fix: strict sync fails a profile it cannot check

profile_sync skipped a profile whose repository no longer answers, which carries no pin, or whose declared death the forge contradicts, with empty counts. --strict counted refs to review only, so the CI job meant to stop an unchecked new profile passed a mistyped repository. Such skips now fail a strict run. An unsupported host, a declared takedown and a profile without refs stay accepted.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 02:23:56 +02:00
1 parent 7bfe68b777
commit 392a5d68cc
2 files changed
+39 -2

No files matched your search

+19
View File
@@ -4234,5 +4234,24 @@ class TheUnknownProfileHintCountsTheListing(unittest.TestCase):
self.assertIn(f"lists all {count}.", hint.stderr + hint.stdout)
class StrictRefusesAnUncheckableProfile(unittest.TestCase):
"""A new profile whose repository answered 404, or with no pin at all,
was skipped with empty counts and --strict passed it in CI."""
def test_defects_are_told_from_the_profiles_nature(self):
from profile_sync import ProfileReport
def report(reason):
return ProfileReport(name="p", entries=[], counts={}, skipped=reason)
self.assertTrue(report("no declared repository answers (moved)").uncheckable())
self.assertTrue(report(
"no source_commit and no resolvable profiled_date on any declared repository"
).uncheckable())
self.assertFalse(report("unsupported host: https://example.org").uncheckable())
self.assertFalse(report("upstream gone (declared): taken down").uncheckable())
self.assertFalse(report("no source_ref").uncheckable())
if __name__ == "__main__":
unittest.main()