Give each tracked package its own PR, and let a fresh branch tip fall back
The branch tracker stalled omarchy-dev and omarchy-settings-dev twice in a week: - All ~50 auto_merge packages rode one PR, so omasnap-git's failing smoke suite kept the quattro pins unmerged from Oct 4 to Oct 8 (#788). Each package now gets its own PR on auto/track-branches-<package>; packages pinned from the same branch share one, since they move in lockstep. A run closes tracker PRs that master has moved past, and the old single PR. - A branch tip younger than min_release_age held the whole branch, so a run that landed shortly after a quattro commit pinned nothing. The watch now falls back along first-parent history to the newest commit that has cleared the window, measured from clone time so siblings agree. - The every-2-hours schedule fired every 6 to 9 hours in practice; run it hourly.
This commit is contained in:
1 parent
1cef67f336
commit
a7f730d1e6
7 files changed
+187
-50
No files matched your search
@@ -333,6 +333,7 @@ test('only same-repository sync branches queue behind an in-flight build', () =>
|
||||
assert.equal(cancels('omacom/omarchy-pkgs', 'auto/sync-upstream'), false);
|
||||
assert.equal(cancels('omacom/omarchy-pkgs', 'auto/sync-upstream-ttfx'), false);
|
||||
assert.equal(cancels('omacom/omarchy-pkgs', 'auto/sync-rebuilds'), false);
|
||||
assert.equal(cancels('omacom/omarchy-pkgs', 'auto/track-branches-omarchy-dev-omarchy-settings-dev'), false);
|
||||
assert.equal(cancels('omacom/omarchy-pkgs', 'ttfx/fix'), true);
|
||||
assert.equal(cancels('someone/omarchy-pkgs', 'auto/sync-upstream'), true);
|
||||
assert.equal(cancels(undefined, ''), true); // workflow_dispatch
|
||||
|
||||
+28
-1
@@ -250,14 +250,41 @@ b2sums=('old' 'local-b2')
|
||||
with self.redirect_clone(repo), self.assertRaisesRegex(ValueError, 'no tag'):
|
||||
w.git_branch_tip('https://example.test/tool.git', 'main', r'release-(?P<version>[0-9.]+)', self.root / 'other-cache')
|
||||
|
||||
def test_git_branch_min_age_holds_the_tip_instead_of_selecting_history(self):
|
||||
def test_git_branch_min_age_falls_back_to_the_newest_old_enough_tip(self):
|
||||
repo, shas = self.branch_fixture(fresh_tip=True)
|
||||
watch = {'git_branch': 'https://example.test/tool.git', 'branch': 'main'}
|
||||
with self.redirect_clone(repo):
|
||||
releases = w.discover(watch, self.fetch)
|
||||
held = w.discover(watch, self.fetch, min_age=3600)
|
||||
self.assertEqual(w.select_release(releases)['values']['commit'], shas[-1])
|
||||
# The backstop still refuses the fresh tip itself...
|
||||
self.assertIsNone(w.select_release(releases, min_age=3600))
|
||||
self.assertEqual(w.select_release(releases, min_age=3600, bypass=True)['values']['commit'], shas[-1])
|
||||
# ...and the watch offers the commit before it instead of nothing.
|
||||
self.assertEqual(w.select_release(held, min_age=3600)['values']['commit'], shas[-2])
|
||||
self.assertEqual(held[0]['values']['count'], str(len(shas) - 1))
|
||||
|
||||
def test_git_branch_min_age_never_falls_back_into_a_merged_side_branch(self):
|
||||
repo, shas = self.branch_fixture()
|
||||
git = ['git', '-C', str(repo), '-c', 'user.name=Test', '-c', 'user.email=test@example.test']
|
||||
old = {**os.environ, 'GIT_COMMITTER_DATE': '2020-01-02T00:00:00+00:00', 'GIT_AUTHOR_DATE': '2020-01-02T00:00:00+00:00'}
|
||||
subprocess.run([*git, 'checkout', '-q', '-b', 'side'], check=True)
|
||||
(repo / 'side').write_text('x')
|
||||
subprocess.run([*git, 'add', '.'], check=True)
|
||||
subprocess.run([*git, 'commit', '-qm', 'side'], env=old, check=True)
|
||||
subprocess.run([*git, 'checkout', '-q', 'main'], check=True)
|
||||
subprocess.run([*git, 'merge', '-q', '--no-ff', '-m', 'merge side', 'side'], check=True)
|
||||
watch = {'git_branch': 'https://example.test/tool.git', 'branch': 'main'}
|
||||
with self.redirect_clone(repo):
|
||||
held = w.discover(watch, self.fetch, min_age=3600)
|
||||
self.assertEqual(w.select_release(held, min_age=3600)['values']['commit'], shas[-1])
|
||||
|
||||
def test_git_branch_min_age_holds_when_nothing_is_old_enough(self):
|
||||
repo, shas = self.branch_fixture(fresh_tip=True)
|
||||
watch = {'git_branch': 'https://example.test/tool.git', 'branch': 'main'}
|
||||
with self.redirect_clone(repo):
|
||||
held = w.discover(watch, self.fetch, min_age=10 ** 10)
|
||||
self.assertIsNone(w.select_release(held, min_age=10 ** 10))
|
||||
|
||||
def branch_sync_fixture(self):
|
||||
repo, shas = self.branch_fixture()
|
||||
|
||||
Reference in new issue
Block a user