Let the index claim decide which document URL is probed
CI / Python 3.13 (push) Successful in 39s
CI / Python 3.12 (push) Successful in 55s
CI / Build and smoke-test image (push) Successful in 17s

This commit is contained in:
omar committed 2026-11-29 11:16:42 +03:00
1 parent 04b31e6bf3
commit 58c20f914c
1 file changed
+8 -2
+8 -2
View File
@@ -403,7 +403,9 @@ def _checks(group: Group, asset: Asset | None = None) -> set[Check]:
planned = _base_checks(group.id, asset)
for alias in group.related_ids:
planned.update(_base_checks(alias))
for claim in group.claims:
rank = {'index': 0, 'live': 1, 'cache': 2}
settled: dict[tuple[str, str], int] = {}
for claim in sorted(group.claims, key=lambda item: rank.get(item.observation.channel, 3)):
doc = claim.observation.doc
if (_CVE.fullmatch(group.id) and claim.observation.channel in {'index', 'cache'}
and redhat_document(doc, claim.issue)):
@@ -419,8 +421,12 @@ def _checks(group: Group, asset: Asset | None = None) -> set[Check]:
# and any earlier URL, which may belong to a stale cached copy.
for candidate in {ident, ident.upper(), ident.lower()}:
planned.discard(Check(doc.source, candidate))
key = (doc.source, ident.upper())
if settled.get(key, 9) < rank.get(claim.observation.channel, 3):
continue
settled[key] = rank.get(claim.observation.channel, 3)
planned = {check for check in planned
if not (check.url and check.source == doc.source and check.native_id == ident)}
if not (check.url and check.source == doc.source and check.native_id.upper() == key[1])}
planned.add(Check(doc.source, ident, doc.url))
return planned