INNER CODE UNIT · Python
classify_jobs
wolfSSL/wolfssl-examples · .github/scripts/ci_triage.py:300
def classify_jobs(run_id, attempt, retry_note):
def by_unit(jobs):
out = defaultdict(list)
for j in jobs:
t, ref = job_unit(j.get("name", ""))
if t:
out[t].append((j.get("conclusion"), ref))
return out
a1 = by_unit(all_jobs(run_id, attempt=1))
final = by_unit(all_jobs(run_id)) if attempt >= 2 else a1
obs, refs, targets = {}, defaultdict(set), {}
for t in set(a1) | set(final):
failed_now = any(c == "failure" for c, _ in final.get(t, []))
failed_before = any(c == "failure" for c, _ in a1.get(t, []))
if failed_now:
obs[t] = store.UNCONFIRMED if retry_note else store.REAL