INNER CODE UNIT · Python
merged_results
wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:197
def merged_results(run_id, attempt):
"""Attempt 2 only reran the failed shards, so merge it OVER attempt 1."""
# The ref MUST be in the key: nightly runs each example once per wolfSSL ref,
# so keying on (id, target) alone collapses master and stable into one row and
# a pass on one ref silently overwrites a failure on the other.
def key(r):
return (r["id"], r.get("ref", ""), r.get("target", ""))
first = {key(r): r for r in fetch_results(run_id, 1)}
if attempt >= 2:
for r in fetch_results(run_id, attempt):
first[key(r)] = r
return list(first.values())
def classify(run_id, attempt, retry_note):
"""Fold per-target results into a per-dir observation."""
a1 = defaultdict(list)