Repository navigation
ci(pr-pipeline): accept review verdicts from workflow_run lane runs - #17584
kyle-sexton wants to merge 10 commits into
Conversation
Every reader of the hosted review lanes' verdicts now accepts a run of the caller's workflow_run lane (pr-review-hosted-lane.yml, pr-review-security-hosted-lane.yml) as well as the caller's own pull_request run. A lane run is found through the index check run named for its workflow on the head (external_id = run id) and bound only on its own record: path, event workflow_run, head branch main, both repositories, and the run-name `<name> #<pull request> <head sha>`. At a head with a bound lane run, that run is read, not the pull_request run that started it. No lane run exists yet, so every reader decides as before; each now makes one index read per head and lane. Refs: #17537 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
…ne run rerun-ci-status holds no checks: read, so a pull_request run's completion reads no index check runs and costs what it did before. Drop the clauses of comments that named only the pull_request run, answer the index read in enable-auto-merge's fake, and point the read-floor wait comment at WAIT_BUDGET_SECONDS.mergeGroup, which replaced ciStatusVerify. Refs: #17537 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
Refs: #17537 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b8f3809b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| read_api index "the $name check runs on $HEAD_SHA" \ | ||
| "repos/$GITHUB_REPOSITORY/commits/$HEAD_SHA/check-runs?check_name=${name// /%20}&filter=all&per_page=100" |
There was a problem hiding this comment.
Grant checks read permission for the new lane-index lookup
When a workflow_run lane completion reaches this reader, newest_review calls the Checks API using github.token, but rerun-ci-status still grants only contents: read, actions: write, and pull-requests: read (lines 730–733). The missing checks: read permission causes this request to be refused, and read_api eventually exits before rerunning CI Status. Although phase A does not yet produce these lane completions, the newly added reader will fail when phase B enables them. Add checks: read to this job alongside the lookup.
Useful? React with 👍 / 👎.
|
claude-security-review reviewed Security review: no security issues foundThis review covered blocking only findings. The lane already reviewed earlier heads, the last being What I checked The PR adds a second source of review-lane verdicts to each reader: a
I checked whether this new source lets through anything the base stopped:
Token scopes, the trusted-actor list, the kill switch and the actions under Spend note: each verdict reader makes one or more extra GitHub API reads per head and lane (the index check-run page plus each run it names). This uses API rate limit only and starts no charge. critical-findings: 0 |
| read_api index "the $name check runs on $HEAD_SHA" \ | ||
| "repos/$GITHUB_REPOSITORY/commits/$HEAD_SHA/check-runs?check_name=${name// /%20}&filter=all&per_page=100" |
There was a problem hiding this comment.
rerun-ci-status reads the check-runs index without checks: read.
This job's permissions block (L730-L733) grants only contents: read, actions: write and pull-requests: read, so the job token's checks scope is none. The comment above newest_review says so ("the job holds no checks: read"), and so does the shell test ("as the job holds no checks: read"). Yet when a lane run's completion starts the job, this line calls GET commits/$HEAD_SHA/check-runs with that token. The check-runs list endpoint needs the Checks read permission for an installation token, unless the repository is public.
How it fails: phase B adds the lane workflows to on.workflow_run.workflows. The first lane-run completion then gets a refused read here, and read_api stops the step, so ci-status is never re-run for that head. The "readers-first" step is supposed to make that change safe, and this reader breaks it. scripts/ci-rerun-ci-status.test.sh stubs gh, so no test exercises the token's scope.
Fix: add checks: read # find a review caller's lane run through its index check run to this job's permissions now, alongside the reader. If the change relies on the repository being public, say so in the comment instead.
claude-lane: claude-review
| } | ||
|
|
||
|
|
||
| class LaneRunTests(unittest.TestCase): |
There was a problem hiding this comment.
The new test class is defined after if __name__ == "__main__": unittest.main().
unittest.main() calls sys.exit once the classes defined above it have run. So running python test_babysit_lane_binding.py reports success without ever defining LaneRunTests (or MAIN_TIP, LANE_PATH, lane_record, REFUSED). LaneRunGateTests in test_babysit_gh_lane_run_carry.py#L530 has the same problem, appended after that file's unittest.main() at L523-L524.
CI's pytest still collects both classes, but running either file directly quietly skips every new lane-run test. Move the if __name__ == "__main__": block back to the end of each file.
claude-lane: claude-review
|
claude-review reviewed CI code review: PR #17584, lane-run verdict readers (phase A of #17537), blocking onlyThis lane has already reviewed earlier heads of this PR (the last was No new blocking findings on this head. The new head merges Prior findings
What I checked on this head
Notes
Verifier dropped 0 of 0 candidates. |
pr-dispatch-feedback.yml named pr-review-hosted-lane.yml and pr-review-security-hosted-lane.yml, which do not exist yet, so scripts/workflow-self-paths.test.sh failed. The job cannot start on a lane run until its workflow_run trigger list names the lane workflows, which phase B adds with the lane files, so the handling moves there. Refs: #17537 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
…atch A shipped copy of a shared library changed, so sync-shared-copies.sh --check-bump needs a fragment whose bump is not none in each carrier. Refs: #17537 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj
|
Superseded: the owner backed out the claude-lanes environment move (hub Q242, 2026-11-20). The 16 Claude org secrets stay the single source, so the review lanes no longer need to move to workflow_run for secret access. #17537 closes with this. |
Refs: #17537
Summary
Phase A of #17537 (owner decision Q8): the readers-first change. Every reader of the hosted review lanes' verdicts now accepts a verdict from either the caller's own
pull_requestrun or a futureworkflow_runlane run (pr-review-hosted-lane.yml,pr-review-security-hosted-lane.yml). No lane run exists today, so every verdict is unchanged; phase B can move the lanes without a flag day.Fix
A lane run is found through the index check run named for its workflow on the head (
external_id= run id). It is bound only on its own record: path, eventworkflow_run, head branchmain, both repositories, and the run-name<name> #<pull request> <head sha>. When a head has a bound lane run, readers read that run and not thepull_requestrun that started it. An index page that is not whole fails closed.Readers changed:
pr-require-checks.yml):lane_runin the review-lanes step, and the cost-hold step's notice reader.collect_lane_runs(each bound lane run stood on its head, with that head's tree),bind/_lane_runs,_noticed_headinbabysit_merge_policy.py, and the lane-comment checker inbabysit_lane_binding.py.lane-binding.mjs(laneRunTarget,boundLaneRun,laneRunsAt, comment checker; copies regenerated),merge-holds.mjsnoticedHead,clear-escalations.mjsreviewLanesCleanandlaneReview,feedback-dispatch.mjs(reviewedHead,reviewRunAt, the unsent sweep's triggers), and the reconciler's pending check.test_floor_paths.pyandtest_merge_holds_sync.pynow take the hold-paths callers fromsync-hold-floor.pyBLOCKSinstead of naming the two files.Not changed:
pr-review-hosted.yml,pr-review-security-hosted.yml,PENDING_REMOTEand the secrets check (all owned by #17516).pr-dispatch-feedback.ymlis unchanged: itsrerun-ci-statusjob can start on a lane run only once itson.workflow_run.workflowslist names the lane workflows, andscripts/workflow-self-paths.test.shfails any workflow naming a-lane.ymlfile before it exists, so the job's lane handling moves to phase B with the trigger list and the lane files.Verification
Each reader has tests for: a bound lane run is accepted; a lane run whose PR number, head SHA, branch, event or path does not match is refused; the existing
pull_requesttests still pass. Run locally after mergingorigin/main:scripts/ci-review-lanes.test.sh,scripts/ci-hold-cost-decision.test.sh,scripts/ci-rerun-ci-status.test.sh(unchanged),scripts/workflow-self-paths.test.shlane-binding,pr-merge/*,pr-unblock/*,maintenance-reconcile-lost-runs/*,resolve-config/*babysit-prsPython suite (pytest), includingtest_merge_holds_sync.py, which checks that the JS and Python cost-decision readers agree on the lane-run casesRelated
🤖 Generated with Claude Code
https://claude.ai/code/session_01KeBVgbERyakZ33T4AetfRj