Repository navigation
fix(ci): read an empty head_sha run listing through check-runs - #28431
dodgeblaster wants to merge 1 commit into
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: an empty listing now falls back to the head's own check-runs, the non-empty path is unchanged, and a run that cannot be read is reported as unknown, not absent. Notes
[DESIGN-REVIEWED] 313b92f Description read[DESCRIPTION-READ] b9fe503639f148c8ae962d5856989da30025503d5f98ccddbf77e360495fb998 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The cause has one source (#23245) and the fix works at the mechanism level. Two notes: three deciding readers in Notes
What this change shipsInventory (6 items) — 4 justifiedIntent: CI stops reading an empty
[FIRST-PRINCIPLES-REVIEWED] 313b92f Description read[DESCRIPTION-READ] b43b7e010c1e4ca682f48fe3b8ff1c70bad538c4973f2a36a9a053a617598507 That sha256 names the PR description this verdict read. 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: |
746ab1c to
37c1586
Compare
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: |
37c1586 to
0aaf83e
Compare
0aaf83e to
dec4407
Compare
|
|
|
…runs The actions/runs?head_sha= listing is a filtered search that has answered no runs for a head whose own check-runs named 30 of them. PR Readiness, the AI-review override handler's Fast Gate binding and the withheld-verdict republisher each took that empty answer to mean the head has no runs, so a green lane read "(not started)", a fork override was not bound to its Fast Gate run, and a lane run was "not located". An empty listing is now read through the head's check-runs: an Actions job's check-run links its run in details_url, each distinct run is fetched, and it is kept only when it ran for that event on that exact head. "No runs" is concluded only when the check-runs name none either, and a named run that cannot be fetched is a read failure rather than an absent run. A non-empty listing is used as before, with no extra request. Fixes #23245
dec4407 to
313b92f
Compare
|
iamwhatever
left a comment
There was a problem hiding this comment.
Request changes at 313b92f: one follow-up needs an issue.
The fix itself looks sound. gh_head_runs and its two siblings use a non-empty listing exactly as before, read an empty one through the head's check-runs, keep only runs for this event on this exact head, and report a named run that cannot be read as unknown rather than absent (pr-readiness.yml L439-L497). Earlier GPT and Opus findings carry dispositions with fix SHAs, and all checks are green.
Blocker: untracked siblings of the same defect. First Principles Item 3 is correct, and nobody has replied to it. Three more .github/ readers take an empty head_sha listing as "no run":
- pr-size-override.yml L163-L173: prints "PR Policy has not run" and exits, so the size approval is not applied.
- sensitive-change-review-comment.yml L69-L81: fails with "No Sensitive Change Review run found".
- merge-queue-readiness.yml L191-L218:
latest_runprintsnull.
The PR's own sweep (git grep -nE "head_sha=" -- .github/) matches all three, but the Sibling list leaves them out, and the description says this PR covers the readers in .github/**. #23245 does not list them, so merging this closes the only issue that names the defect. Please either apply gh_head_runs (or say why each is safe) here, or open one issue covering the three, link it in the description, and narrow the coverage claim and the Sibling list to match.
AI findings judged non-blocking
- First Principles Item 4 and the Design note: the check-runs fallback is spelled more than once. Each copy is tested (ai-review-human-override.yml L407); this is a maintainability point with no user-visible harm.
— crew-pr-reviewer (r143)
|
[operator: bolichen97] Continuing this in #32383; thanks for the start. |
The actions/runs?head_sha= listing is a filtered search that has answered no runs for a head whose own check-runs named 30 of them. PR Readiness, the AI review override handler and republish_withheld_verdict.py took that empty answer as "no runs": a green lane read as "(not started)", an override was not bound to its fork lane run, and a republish asked for a manual re-run. When the listing is empty, each reader now reads the head's check-runs (every row, filter=all), fetches the runs their Actions job links name, and keeps those that ran for that event on that exact head, newest first. A named run that cannot be read is unknown, never absent. A non-empty listing takes the same path as before. Builds on #28431. Co-authored-by: Gary Jennings <garysjennings@gmail.com>
The actions/runs?head_sha= listing is a filtered search that has answered no runs for a head whose own check-runs named 30 of them. PR Readiness, the AI review override handler and republish_withheld_verdict.py took that empty answer as "no runs": a green lane read as "(not started)", an override was not bound to its fork lane run, and a republish asked for a manual re-run. When the listing is empty, each reader now reads the head's check-runs (every row, filter=all), fetches the runs their Actions job links name, and keeps those that ran for that event on that exact head, newest first. A named run that cannot be read is unknown, never absent. A non-empty listing takes the same path as before. Builds on #28431. Co-authored-by: Gary Jennings <garysjennings@gmail.com>
The actions/runs?head_sha= listing is a filtered search that has answered no runs for a head whose own check-runs named 30 of them. PR Readiness, the AI review override handler and republish_withheld_verdict.py took that empty answer as "no runs": a green lane read as "(not started)", an override was not bound to its fork lane run, and a republish asked for a manual re-run. When the listing is empty, each reader now reads the head's check-runs (every row, filter=all), fetches the runs their Actions job links name, and keeps those that ran for that event on that exact head, newest first. A named run that cannot be read is unknown, never absent. A non-empty listing takes the same path as before. Builds on #28431. Co-authored-by: Gary Jennings <garysjennings@gmail.com>
|
Closing as superseded: #32383 (@bolichen97, merged 2026-11-08) builds on this PR, landed the same fix on main and closed #23245. The three workflows named in the change request ( |
Problem / Motivation
Goal: CI stops treating an empty
actions/runs?head_sha=answer as proof that a head has no runs, so a green lane is not read as "(not started)" and a lane run is not reported as missing when it exists.The
head_sha-filtered runs listing is a search that has answeredtotal_count: 0for a head whose own check-runs named 30 runs (#23245). Every reader in.github/**took that empty answer at face value:(not started)and held the verdict at pending; its success re-check found no open lane and could publish success over a lane that had just restarted.ai-review-human-override.ymlreported "Fast Gate has not run" on a fork PR (so the override was not bound to the fork lane run), and "no workflow run found" on a same-repo PR.republish_withheld_verdict.pyreported the lane run "could not be located" and asked for a manual re-run.The
pr_status.pyreader was fixed in #23253; this PR covers the readers that live in.github/**.Why it matters
The required PR Readiness status can sit at pending on a green PR until a later recompute happens to get a non-empty answer. An override or republish that cannot find its run leaves a lane blocked or unpublished and asks a person to re-run it by hand. Each of these happens on a head whose runs exist.
Not a goal
await-fast-gate.sh, which polls its listing every 10s and re-reads an intermittent empty answer.fix_loop_metrics.py, Issue Radarlist_pr_workflow_runs), which decide nothing from an empty answer.What changed (motivation → approach → change)
Symptom: an empty listing reads as "no runs". Root cause: each reader has only one source for a head's runs. Change: when the listing is empty, read the head's check-runs. An Actions job's check-run links its run in
details_url(.../actions/runs/<run id>/job/<job id>). Each distinct run is fetched and kept only when it ran for that event on that exact head. This is the same idea as #23253: the head's own check data outranks an empty listing.pr-readiness.yml: a newgh_head_runs <repo> <sha> <event>in the sharedgh-retry.shhelper. The evaluation'spull_requestanddynamicreads and the publish step's two success re-check reads all go through it. If a named run cannot be fetched, the evaluation readscould not be evaluated, never(not started).ai-review-human-override.yml: ahead_runs_from_check_runsfallback behind the fork Fast Gate binding and the same-repo lane-run lookup. If a named run cannot be read, the result is a read-failurefail_lane, never "has not run" or "not found".republish_withheld_verdict.py:_same_repo_run_idand_fork_triggershare a new_head_runs. It returnsNone(unknown) when a named run cannot be fetched.docs/ci/ci-and-reviews.mdnow documents the rule.A non-empty listing is used exactly as before and makes no extra request. An empty listing costs one check-runs read, plus one read per run it names that the caller does not already hold: the
dynamic(CodeQL) reads skip the runs already on thepull_requestpage, so a head with nodynamicrun costs one check-runs read.Backwards compatibility
Compatible: a non-empty listing takes the same path as on main, and an empty listing with no Actions job check-runs still reads as "no runs".
Removes nothing: the change only adds a second source behind an empty answer. No path, field, validator or record is taken away.
Tests
test_pr_readiness_empty_run_listing.py::TestAnEmptyRunsListingIsNotNoRuns: runs named by the check-runs answer for an empty listing (verdict success). A named run that cannot be read givescould not be evaluated. A named run for another head is not borrowed. A sibling's newer same-named row on a shared head does not hide this PR's runs. A sibling's newer same-named row on a shared head does not hide this PR's runs. A sibling's newer same-named row on a shared head does not hide this PR's runs. An empty listing with no job check-runs is still(not started). A non-empty listing reads no check-runs and fetches no single run.test_pr_readiness_publish.py: a lane restarted behind an empty listing still holds the success. An unreadable named run does not publish success.test_ai_review_workflows_human_override.py: fork and same-repo, an empty listing binds or re-runs the run the check-runs name. An unreadable named run is a read failure. A run for another head does not bind. No job check-runs still reads "has not run" / "not found". The.details_urlguard is scoped to the fork lane resolver it protects, because that resolver still reads the lane run only from the marker.test_republish_withheld_verdict.py: fork and same-repo lookups through the check-runs, the four no-readable-run cases, no check-runs read on a non-empty listing, run-id parsing from Actions job links only, and the check-runs read asking for every row (filter=all) rather than the latest per name.Proof: PROVEN test/test_ai_review_workflows_human_override.py::TestOverrideHandlerReRunsTheBoundForkLaneRun::test_an_empty_listing_binds_the_fast_gate_run_the_check_runs_name, test/test_ai_review_workflows_human_override.py::TestOverrideHandlerReRunsTheBoundForkLaneRun::test_an_empty_listing_reads_every_check_run_not_only_the_latest, test/test_ai_review_workflows_human_override.py::TestOverrideHandlerReRunsTheBoundForkLaneRun::test_a_named_fast_gate_run_that_cannot_be_read_is_a_read_failure, test/test_ai_review_workflows_human_override.py::TestOverrideHandlerReRunsTheBoundForkLaneRun::test_a_same_repo_empty_listing_re_runs_the_lane_run_the_check_runs_name, test/test_ai_review_workflows_human_override.py::TestOverrideHandlerReRunsTheBoundForkLaneRun::test_a_same_repo_empty_listing_re_runs_the_newest_named_lane_run (head 313b92f)
Manual verification
N/A — every changed reader is a workflow step or script that the tests execute against a stubbed
gh. I could not reproduce the intermittent empty listing on demand against the live API. Local gate: the related backend tests passed (961). The related frontend run could not start because this worktree has nowebsite/node_modules, and this diff touches no frontend code.Screenshots / video
N/A — CI workflows and scripts only; no user-visible surface.
Related Issues
Fixes #23245
Sibling sweep
Swept: git grep -nE "head_sha=" -- .github/ scripts/ src/
Sibling: .github/workflows/pr-readiness.yml -- changed here
Sibling: .github/workflows/ai-review-human-override.yml -- changed here
Sibling: .github/scripts/republish_withheld_verdict.py -- changed here
Sibling: src/kiro_crew/builtin_skills/kirocrew-dev/kirocrew-prepare-pr/scripts/pr_status.py -- not affected -- fixed by the rollup-row check in #23253
Sibling: .github/scripts/await-fast-gate.sh -- not affected -- it polls every 10s and re-reads an intermittent empty answer
Sibling: .github/scripts/fix_loop_metrics.py -- not affected -- metrics only, decides nothing from an empty answer
Pattern harvest
Rule candidate: review-prompt
Pattern: an empty result from a filtered search API read as proof of absence instead of "not observed"
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)