Repository navigation
fix: read an empty run listing through check-runs in three readers - #33367
Conversation
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change copies #32383's tested fallback (empty listing read through check-runs) into three more readers, only adds a read scope, and takes nothing away. Notes
[DESIGN-REVIEWED] 53df3b7 Description read[DESCRIPTION-READ] 6086ae1aa8f7b6c05c0f14fdffefbf78e0565e31306af526d6d84300e42c2e6e 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 This fixes linked issue #32348, and tests fail on the empty listing without it. Nothing blocks. The one concern is a sixth copy of a check-runs read the repository already has in three places. Notes
What this change shipsInventory (5 items) — 5 justifiedIntent: when GitHub's run search wrongly comes back empty, a PR Size approval, a Sensitive Change Review comment and a merge-queue group still find their runs and clear. FIX.
[FIRST-PRINCIPLES-REVIEWED] 53df3b7 Description read[DESCRIPTION-READ] 36a2c31709d7e95a8fb4927bfc4e25fb0f550e1f7da516f5538836a4ca4eb6ca 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: |
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: |
115cbd1 to
b5f84e3
Compare
|
Rebased: main moved in docs/ci/ci-and-reviews.md and test/test_ci_fleet_routing_expression_parity.py since this head's CI ran (2caa69b -> 4a0cb55); CI re-running. The new base carries #33377, which re-pins the dashboard server's lazy-import count. That stale pin was main's red: it failed The same push makes the Sensitive Change Review comment test's decoy a newer |
buluoray
left a comment
There was a problem hiding this comment.
Approving. Three CI readers now read an empty actions/runs head_sha listing through the head's check-runs instead of concluding "no run" (.github/workflows/pr-size-override.yml:165-201, sensitive-change-review-comment.yml:83-106, merge-queue-readiness.yml:197-236). Non-empty listings take the old path, a failed fallback read keeps each reader's existing read-failure path, and the only scope added is checks: read. GPT's block is a test-skip ratchet rule, and Sensitive Change Review still needs the author's template.
|
Suggestion for the Merged or closed PR. GitHub fills a workflow run's Either of these would cover it:
Second mode, PR still open. The wait loop gives an in-progress run 150 s (30 x 5 s). When Sensitive Change Review is still running past that, the step fails with "run ... did not finish in time". Seen on #29609 and #33818. Re-running the helper after Sensitive Change Review finishes clears it, so this may only need a note, not a code change. |
|
|
[operator: bolichen97] Thanks, both modes check out. #33882 merged at 20:14:57Z, and its approval helper failed one second earlier with "No Sensitive Change Review run found": the listing answered the run, and the Rebutted for this PR: out of its goal. This PR is about an EMPTY listing read as "no run". In the merged case the listing is not empty, and the clause that drops the run is unchanged from main, which is the "A listing that answers some runs but not all" line under Not a goal. The fallback added here runs only on an empty listing, so it neither causes the merged case nor makes it worse. A merged or closed PR's check no longer gates anything, so the cost is a red helper run, not a stuck PR. Both modes and your two options are in #34113, so they can land as their own fix. |
The actions/runs head_sha listing is a filtered search that can answer no runs for a head whose runs exist. #32383 made PR Readiness, the AI review override handler and the withheld-verdict republisher read that empty answer through the head's check-runs. Three readers still took it as "no run": a PR Size approval was recorded but PR Policy was not re-run, a Sensitive Change Review author comment failed with "No Sensitive Change Review run found", and the merge-queue poll would fail a green group once its five-minute appear window passed. Each now reads an empty listing through the head's check-runs (every row, filter=all), fetches the runs their Actions job links name, and keeps those of its own workflow and event on that exact head. A named run that cannot be read is a read failure, never an absent run. The four workflows involved gain checks: read for that read.
b5f84e3 to
53df3b7
Compare
|
Rebased: main moved in docs/ci/ci-and-reviews.md since this head's CI ran (4a0cb55 -> fd5d9ef); CI re-running. The new base carries #33695, which re-pins the owner-marked pid reader count to 9. That stale pin was main's red: it failed |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 53df3b7. Rebase only: git range-diff of the previously approved b5f84e3 against 53df3b7 is 1: b5f84e35d77 = 1: 53df3b7c291, so the patch is byte-identical. Three CI readers (.github/workflows/pr-size-override.yml:165-201, sensitive-change-review-comment.yml:83-106, merge-queue-readiness.yml:200) fall back to the head check-runs when the actions/runs head_sha listing is empty; the only scope added is checks: read. All AI lanes on this head report no findings. Still needs the owner: Sensitive Change Review for the .github/workflows changes.
Problem / Motivation
Goal: A PR Size approval, a Sensitive Change Review author comment and a merge-queue group no longer stall or fail when GitHub's run listing for a head comes back empty although the head's runs exist.
GitHub's
actions/runs?head_sha=listing is a filtered search, and it has answered no runs for a head whose own check-runs named 30 of them (#23245). #32383 taught PR Readiness, the AI review override handler andrepublish_withheld_verdict.pyto read that empty answer through the head's check-runs. Three more readers still take it as "no run" (#32348):pr-size-override.ymlrecords the approval, then prints "PR Policy has not run" and never re-runs PR Policy, soPR Sizestays red.sensitive-change-review-comment.ymlfails with "No Sensitive Change Review run found", so the author's filled template never clears the check.merge-queue-readiness.ymlsees no run for any lane and, once its five-minute appear window passes, fails a group whose lanes ran.Why it matters
Each reader turns a GitHub search glitch into a red check a person has to clear by hand, and its message points at the wrong cause ("has not run", "push to start one"). The size approval and the Sensitive Change Review comment are the documented ways to clear those checks, so when the glitch hits they silently do nothing. Once the merge queue is switched on, the same glitch would eject a green group and hold the groups behind it for a rebuild.
Not a goal
await-fast-gate.sh,issue-gate-retrigger.yml,fix_loop_metrics.py): tracked in Three more readers take an empty head_sha run listing as no run #33264.What changed (motivation → approach → change)
When one of these readers gets an empty run listing, it now asks the head's check-runs instead of concluding there is no run. Every Actions job's check-run links to its run, so the reader collects those run ids (every row,
filter=all), fetches each run, and keeps only runs of its own workflow and event on that exact head. A run the check-runs name but that cannot be fetched is a failed read, never a missing run. A non-empty listing takes the same path as before.pr-size-override.ymlsensitive-change-review-comment.ymlmerge-queue-readiness.ymlA failed fallback read keeps each reader's existing read-failure path: the size handler posts its "could not be read" notice, the comment workflow stops on the failed
ghcall, and the merge-queue poll marks the lanes errored and retries on the next tick. The check-runs read needschecks: read, sopr-size-override.yml,sensitive-change-review-comment.yml, its callersensitive-change-review-approval.yml(a called workflow gets no scope its caller lacks) and the merge-queue job gain that one read scope.docs/ci/ci-and-reviews.mdnames the three readers beside #32383's and the merge-queue job's added scope.Backwards compatibility
Compatible: the fallback runs only when the listing is empty, so every head whose listing answers takes the same path as before;
checks: readadds a read scope and removes none.Removes nothing: no reader, message or check is taken away; the old "no run" outcomes remain for a head whose check-runs name no run of that workflow either.
Tests
test/test_empty_run_listing_readers.pyruns the realpr-size-override.ymlandsensitive-change-review-comment.ymlsteps against a stubbedghwhose listings answer no runs: each re-runs the run the check-runs name (the size handler picks the head's newest PR Policy run, skipping another workflow's run and another head's; the comment workflow skips a newerpull_request_targetrun of another workflow), and a named run that cannot be read is a read failure, not "no run".test/test_ci_fleet_routing_expression_parity.pyruns the merge-queue poll with a listing that answers no runs every tick: the group is cleared from the check-runs, and an unreadable named run is logged as a read error, not a missing lane.test_pr_size.py,test_sensitive_change_review.pyand the merge-queue test includechecks: read;test_workflow_token_scopes.pyderives that scope from the new call.Proof: PROVEN test/test_ci_fleet_routing_expression_parity.py::test_merge_queue_readiness_reads_runs_and_never_reruns_them, test/test_ci_fleet_routing_expression_parity.py::test_an_empty_listing_is_read_through_the_commits_check_runs, test/test_ci_fleet_routing_expression_parity.py::test_a_named_run_that_cannot_be_read_is_an_api_error_not_a_missing_run, test/test_empty_run_listing_readers.py::TestPrSizeOverride::test_an_empty_listing_re_runs_the_pr_policy_run_the_check_runs_name, test/test_empty_run_listing_readers.py::TestPrSizeOverride::test_a_named_run_that_cannot_be_read_is_a_read_failure (head 53df3b7)
Manual verification
Checked live that the fallback finds what it needs: on #32383's head,
commits/<head>/check-runs?filter=alllists theSensitive Change Review(apull_request_targetrun) andPR Policyjob rows, and eachdetails_urlnames a run whoseevent,head_shaandpathmatch what the readers filter on. The empty listing itself cannot be produced on demand, so the stubbed tests above stand in for it.Screenshots / video
N/A: CI workflows and docs only; nothing a user sees in the app changes.
Related Issues
Closes #32348
Sibling sweep
Swept: git grep -nE 'head_sha[=" ]' -- .github/workflows .github/scripts scripts
Sibling: .github/workflows/pr-size-override.yml -- changed here
Sibling: .github/workflows/sensitive-change-review-comment.yml -- changed here
Sibling: .github/workflows/merge-queue-readiness.yml -- changed here
Sibling: .github/scripts/await-fast-gate.sh -- tracked in #33264
Sibling: .github/workflows/issue-gate-retrigger.yml -- tracked in #33264
Sibling: .github/scripts/fix_loop_metrics.py -- tracked in #33264
Sibling: .github/workflows/pr-readiness.yml -- not affected -- reads through gh_head_runs since #32383
Sibling: .github/workflows/ai-review-human-override.yml -- not affected -- reads through head_runs_from_check_runs since #32383
Sibling: .github/scripts/republish_withheld_verdict.py -- not affected -- applies the same fallback since #32383
Pattern harvest
Rule candidate: review-prompt
Pattern: a workflow reads an
actions/runshead_shalisting and treats an empty answer as "no run" without reading the head's check-runsChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)