feat: advance profiles that cite no source

_needs_review held every skipped report, so a profile with no source_ref
never moved: anarch sat behind a CI-only commit through every bulk advance.
Its source pin now moves; its upstream pin does not, since nothing was
compared there.
This commit is contained in:
Abdessamad Derraz committed 2026-10-27 04:26:28 +01:00
1 parent e96d1326a3
commit 951bd070bf
2 files changed
+31 -2

No files matched your search

+21
View File
@@ -3122,6 +3122,27 @@ class TestBumpCommit(unittest.TestCase):
self.assertEqual(profile_sync.pending_recale(report), 1)
self.assertFalse(bump_commit(self.path, report))
def test_a_profile_citing_nothing_advances(self):
# anarch's pin sat behind HEAD through every bulk advance: the
# report skips a profile with no source_ref, and the skip blocked it.
report = ProfileReport(
name="p", repo="o/n", pin="pin", head="newhead", entries=[], counts={},
skipped=profile_sync.NO_SOURCE_REF,
)
report.upstream_head, report.upstream_pin = "uphead", "uppin"
self.assertTrue(bump_commit(self.path, report))
text = self.path.read_text(encoding="utf-8")
self.assertIn("newhead", text)
# Nothing was compared upstream, so its pin is not written.
self.assertNotIn("uphead", text)
def test_any_other_skip_still_holds_the_pin(self):
report = ProfileReport(
name="p", repo="o/n", pin="pin", head="newhead", entries=[], counts={},
skipped="rate limited: gitlab.com",
)
self.assertFalse(bump_commit(self.path, report))
def test_accepted_when_nothing_had_to_move(self):
part = PartResult(
RefPart("a.c", 10, 12, "a.c:10-12"), "ANCHORED", None, 10, 12, []