Let a successful probe cover a failed one for the same identifier
This commit is contained in:
1 parent
ec5fc289c4
commit
41ed142923
1 file changed
+9
-2
@@ -580,12 +580,19 @@ def _trusted_refs(doc: Doc, issue: Issue) -> Iterable[dict[str, Any]]:
|
||||
def _claim_coverage(group: Group, checked: dict[Check, ProviderPage], index: dict[str, Status], asset: Asset | None = None) -> list[Status]:
|
||||
statuses = []
|
||||
planned = _checks(group, asset)
|
||||
answers = {(check.source, check.native_id.upper()): checked[check].status
|
||||
for check in planned if check in checked}
|
||||
for check in planned:
|
||||
actual = checked.get(check)
|
||||
if actual is None and check.url is not None:
|
||||
actual = checked.get(Check(check.source, check.native_id)) if check.source in {'siemens', 'industrial'} else None
|
||||
if actual is not None:
|
||||
statuses.append(actual.status)
|
||||
if actual is None:
|
||||
continue
|
||||
# Two probes of one identifier: a success covers a failure of the other form.
|
||||
sibling = answers.get((check.source, check.native_id.upper()))
|
||||
if actual.status.status != 'ok' and sibling is not None and sibling.status == 'ok':
|
||||
continue
|
||||
statuses.append(actual.status)
|
||||
for claim in group.claims:
|
||||
observation = claim.observation
|
||||
source = observation.doc.source
|
||||
|
||||
Reference in new issue
Block a user