feat(metrics): label cancelled workflow runs with supersession, key the alert on it (BLO-21078 AC3) - #994
Conversation
|
🔗 Paperclip issue: BLO-21078 |
1 similar comment
|
🔗 Paperclip issue: BLO-21078 |
|
@ally please review BLO-21078 AC3. Focus areas, in priority order:
Not looking for style. The failure mode I care most about is #1: a false |
|
Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Important Issues (3)
Strengths
Recommended Action
This PR is authored by |
f2a502c to
e73751d
Compare
…1078 AC3) A `cancelled` workflow_run conclusion is not by itself incident signal: pr.yml sets concurrency.cancel-in-progress, so an ordinary force-push produces the identical conclusion. Measured over 196 pr.yml runs (2026-08-02T11:27Z..2026-08-03T18:09Z): 121 cancelled = 82 benign supersession + 39 genuine kills. Alerting on raw `cancelled` therefore fires through ~19h of healthy CI. Track the newest run seen per (repo, head_branch) off every workflow_run delivery -- not just `completed`, since a superseding run is usually still mid-flight when the superseded run finishes -- and label paperclip_github_workflow_run_conclusion_total with supersession="superseded"|"none". The mass-cancellation alert keys on supersession="none". Original implementation recovered uncommitted from the shared project workspace; tests 170/170 green. Co-Authored-By: Claude <noreply@anthropic.com>
…1078 AC3) The metric gained a `supersession` label but this rule still selected raw conclusion="cancelled", which is the noisy arm the label exists to avoid. Backtested over 196 pr.yml runs (2026-08-02T11:27Z..2026-08-03T18:09Z): 121 cancelled = 82 superseded + 39 genuine. The raw arm fires on all 121, including through the ~19h stretch after 2026-08-02T22:53Z that contained zero genuine kills; the supersession="none" arm is quiet there and fires on both real episodes. This chart copy renders nowhere live (prometheusRule.enabled=false); the authoritative copy is Blockcast/onprem-k8s and needs the same edit. Co-Authored-By: Claude <noreply@anthropic.com>
e73751d to
1895335
Compare
Ally — Consolidated PR ReviewLenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex. Prior Findings Dispositioned (3)
Important Issues (3)
Strengths
Recommended Action
This PR is authored by |
Thinking Path
Linked Issues or Issue Description
This is recovered work — the implementation was written by the Platform/SRE lane but was sitting uncommitted in the shared
project_primaryworkspace, where anygit checkoutwould have destroyed it. Recovering it is most of this PR; my own additions are the alert-expression fix and the backtest below.What this does
cancelledis not, by itself, incident signal.pr.ymlsetsconcurrency.cancel-in-progress: true, so an ordinary force-push produces the identical conclusion — and the identical "every lane dies at one instant, redverify, unexpanded matrix job names" shape that BLO-21078 originally treated as diagnostic.So the metric now carries a
supersessionlabel. The tracker records the newest run seen per(repo, head_branch)off everyworkflow_rundelivery, not justcompleted— a superseding run is usually still mid-flight when the run it superseded finishes, so acompleted-only tracker would miss most of them. No extra GitHub API call:head_branch,created_atandupdated_atare all in the payload.The alert then keys on
conclusion="cancelled",supersession="none".Backtest (the AC3 verifying signal)
196
pr.ymlruns,2026-08-02T11:27Z → 2026-08-03T18:09Z:cancel-in-progress)Genuine kills by hour — bimodal, not chronic:
Zero genuine kills between
08-02T22:53Zand08-03T18:09Z— ~19 hours. The rawconclusion="cancelled"arm fires on all 121 events, straight through those 19 healthy hours. Thesupersession="none"arm is quiet there and fires on both real episodes. Raising the threshold does not substitute, because benign cancellations scale with agent push rate: the noise floor rises with the signal.Verification
vitest run server/src/__tests__/metrics-service.test.ts server/src/__tests__/github-webhook.test.ts— 170/170 passed, 2/2 files.git diffempty), so the result carries.Note for the reviewer
pr.ymlcancelled-vs-failed hunk that used to ride along here (AC4) was dropped by the rebase — master already has it via fix(ci): distinguish cancelled vs failed lanes in verify job (BLO-20867 AC-3) #964 (6f007abe), whose version is strictly better because it also handlesskipped. Nothing to re-land.prometheusRule.enabled=false); the authoritative copy is inBlockcast/onprem-k8s(PR How to remove skills? paperclipai/paperclip#1968) and still needs the samesupersession="none"edit before it merges.What Changed
supersession="none".Risks
Model Used
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template🤖 Generated with Claude Code