Repository navigation
fix(ci): stop unmonitored check-runs holding the readiness re-fire - #38425
Conversation
The readiness sweep waits to re-fire a pending or failure verdict while another check-run on the head is still queued or running, so the last lane's completion recomputes it once. The scan counted every check-run, including workflows readiness never reads. A queued `macOS Tests (on demand)` run held PR #37795's re-fire for two ticks after every monitored lane had finished, and it also blocked the re-check hold rescue, which needs no check-run left running. The scan now reads each check-run's workflow name and counts a running one only when that workflow is in pr-readiness.yml's workflow_run list (MONITORED_WORKFLOWS, pinned to that list by a test) or the check-run has no workflow run (another app's check). Completions of every check-run stay evidence, so a stale verdict is still re-fired. Part of #37840
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This is a scoped fix with a reproduction from replayed live data. The one cost it adds is a second copy of readiness's lane list, and a test keeps that copy equal to the original. Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: let
[FIRST-PRINCIPLES-REVIEWED] dfd2d6a Description read[DESCRIPTION-READ] 175e6f7374315ced84d6c42ad152d45f85a99b4495d045c2f6ab6cc88b5406b1 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: completions still count as evidence, so the verdict still lands on the final state. The worst case is extra recomputes, and a revert undoes them. Notes
[DESIGN-REVIEWED] dfd2d6a Description read[DESCRIPTION-READ] 095c03d796459e904384b0133ef5ca4a8ebb38f3fd9626c39382228d4369b52f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head dfd2d6a and the related sweep tests pass on it. The narrower running count only decides whether the sweep sends a pending or failed verdict back for another recompute. The sweep never writes a passing status itself, and the green path never reads this count, so the worst a misclassified check-run can cause is an extra recompute. A check-run with no readable workflow name is still counted as running, and a test keeps the monitored list identical to the readiness trigger list. Nothing blocks.
Problem / Motivation
Goal: A pending or failed
PR Readinessverdict is re-fired once every lane readiness evaluates has finished, without waiting for workflows readiness never reads.The readiness sweep holds a "check completed later" re-fire while a check-run on the head is still queued or running, so the last lane's completion recomputes the verdict once. It counts every check-run, whatever workflow it belongs to. A queued
macOS Tests (on demand)run, which readiness does not evaluate, therefore keepsPR Readinesspending after every monitored lane is done: PR #37795's 05:00 and 05:16 ticks were held that way (#37840). The same count blocks the re-check-hold rescue from #37841, which needs no check-run left running.Why it matters
PR Readinessis the one required status, so a held re-fire leaves a finished PR showing pending until the next tick that lets it through, a push, or a manualgh workflow run pr-readiness.yml. AmacOS Tests (on demand)run can sit in its queue for hours, and for that whole time a frozen re-check hold on the same head cannot be rescued.Not a goal
What changed (motivation → approach → change)
A queued run of a workflow readiness never reads, such as
macOS Tests (on demand), no longer keeps a finished PR'sPR Readinesspending: the sweep now waits only for check-runs of the lanes readiness waits on, the workflows inpr-readiness.yml'son.workflow_run.workflows. Before,.github/scripts/readiness_sweep_scan.pycounted every non-completed check-run on the head as a lane still running.The scan now asks GraphQL for each check-run's workflow name (
checkSuite { workflowRun { workflow { name } } }, in both rollup queries) and counts a running check-run only when its workflow is inMONITORED_WORKFLOWS, the same 15 names as that trigger list. A check-run with no workflow run (another app's check) is still counted. A test pins the two lists equal. Completions are read as before: a finished check-run of any workflow can still re-fire a recompute, which at worst re-derives the same verdict. The sweep's comments, its re-check-hold log line anddocs/ci/ci-and-reviews.mddescribe the new count.The nested field adds no rate-limit points (single objects, not connections). Measured on live 25-PR pages of about 1,930 check-runs, it added no time: 8.7 s before and 8.4 s after, then 7.3 s and 7.3 s.
Backwards compatibility
Compatible: the scan's output keys and the sweep's arms are unchanged; a queued check-run of a workflow readiness does not evaluate just stops holding a re-fire.
Removes nothing: no key, path, record or validator is taken away; only the running count is narrower.
Tests
test_only_a_monitored_or_non_actions_check_run_counts_as_running: a queuedmacOS Tests (on demand)check-run is not counted, a queuedCIone and one with no workflow run are, a finished unmonitored check-run is still the newest evidence, and both queries ask for the workflow name.test_the_monitored_workflows_are_readinesss_workflow_run_list:MONITORED_WORKFLOWSequalspr-readiness.yml'son.workflow_run.workflows.test_a_hold_on_a_head_with_every_check_completed_is_refired: follows the reworded log line.Proof: PROVEN test/test_pr_readiness_sweep_recheck_hold.py::test_a_hold_on_a_head_with_every_check_completed_is_refired, test/test_readiness_sweep_scan.py::test_only_a_monitored_or_non_actions_check_run_counts_as_running[CI-1], test/test_readiness_sweep_scan.py::test_only_a_monitored_or_non_actions_check_run_counts_as_running[macOS Tests (on demand)-0], test/test_readiness_sweep_scan.py::test_only_a_monitored_or_non_actions_check_run_counts_as_running[None-1] (head dfd2d6a)
Manual verification
Reproduced and smoke-tested on Linux (Ubuntu 24.04). The sweep's own
run:block and scanner replayed a live GraphQL scan of 50 open pull requests, recorded from this repository at 2026-11-17T10:17Z, withghanswered from the recording and the clock pinned to 10:20Z. PR #37459 was on a re-check hold from 09:23:42Z, had a monitored lane complete at 10:17:03Z, and nothing else running except twomacOS Tests (on demand)check-runs.Base (
75051817195), held, nothing dispatched:This branch, re-fired:
A head whose monitored lane is still running stays held: PR #38303, with 17
CIcheck-runs in progress, reads... has later check evidence, but 20 check(s) are still runningon this branch (21 on the base, one of themSensitive Change Review). Across all 50 recorded pull requests onlyrunning_checkschanged; every head's newest completion and readiness state were identical before and after.Screenshots / video
N/A — CI scripts, a workflow comment and docs only; no user-visible frontend surface.
Related Issues
Part of #37840
Sibling sweep
Swept: git grep -nE 'running_checks|status.*!= *"COMPLETED"|select(.status *!= *"completed")' -- .github/ src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/
Sibling: .github/workflows/pr-readiness.yml -- not affected -- each count there runs over one lane's runs or check-runs, already chosen by the lane list
Sibling: .github/scripts/await-fast-gate.sh -- not affected -- counts the jobs of one Fast Gate run only
Sibling: src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/pr_status_verdict.py -- not affected -- the author's status poll reports every check on purpose, since a red macOS Tests (on demand) run is a concern the author answers
Pattern harvest
Not generalizable: one counter in one scan decided which check-runs were lanes; that rule now lives in one constant pinned to readiness's trigger list.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)