Repository navigation
perf(pr-pipeline): drop ci-status reads the run already has - #11851
Conversation
Cut GITHUB_TOKEN REST reads in ci-status with identical decisions: - merge_group: a new queued_author step reads the queued pull request through pr_read with the args the pr-unblock and lanes-hold steps use, so their reads become cache hits. The two carry steps (pr-merge's carried verdict reads and the run cache) now skip a pull request the step proves is not the lanes App's; an unread author keeps them. - pull_request: the lanes-hold step tests the payload author first and exits before reading the pull for a well-formed non-App author; any other payload falls through to the live read and its test. - lanes App pull requests: the lanes-hold step takes the changed files from the broker step's saved pages on a pull_request event, falling back to the live read when they are missing or do not parse; the changed_files count check still applies. The issue-comments read stays live: the job's rule is that comments are read live so a veto is never missed, and reusing the hold-lift step's earlier read would widen that window. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lanes-hold step now takes the broker step's file pages only while the live pull's head equals the event's head, so a push between the two steps cannot pair an old file list with a new head; otherwise it reads the files live as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis 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. |
|
claude-security-review reviewed Security review: no findingscritical-findings: 0 I read all three changed files in full: 1. Payload author short-circuit in the lanes-hold step (L6256-L6263)
2. Reusing the broker step's file pages (L6327-L6337)
3. Merge-queue
Other checks
|
|
claude-review reviewed Code review: perf(pr-pipeline): drop ci-status reads the run already hasResult: no findings. I read every hunk in all 3 changed files: What I checked:
Other checks
|
No related issue: GITHUB_TOKEN counter-A cut assigned by GitHub Support
Summary
ci-statusinpr-require-checks.ymlmakes REST reads whose answers the run already has or never uses. This PR removes them, so counter A (pulls, issues, commits, repo, git refs, compare), the one that trips the hourly breaker, takes fewer calls per run. Every hold decision stays the same.Fix
queued_author("Read whether the queued pull request is the lanes App's"), reads the queued pull request throughpr_read, using the same args the pr-unblock and lanes-hold steps already use. Those two later reads now come from the cache, so the job makes no extra REST call.verdict_reads_restoreandverdict_reads_carrynow skip whenever that step proves the author is not the lanes App. The test is the lanes-hold step's own:.user.id == LANES_APP_ID and .user.type == "Bot". Their only consumer is the lanes-hold step, which exits at that same author check for every other author. If the author cannot be read,lanesstays unset and both steps run as before. The new step hascontinue-on-errorand has its opt-out inscripts/lane-coverage-step-opt-outs.txt.pull_request, pull requests not opened by the lanes App. The lanes-hold step now tests the author from the payload first (github.event.pull_request.user.id/.type), and exits before reading the pull when it is well formed and not the lanes App. A pull request's author never changes, so the payload is as good as a live read here. A malformed or missing payload author falls through to the live read and its existing fail-closed test. The merge queue path is unchanged, since a merge group names no author.pull_request, the lanes-hold step buildsfiles.jsonlfrom the broker step'spr-files.json. That file holds every page of the samepulls/<n>/filesendpoint, read live earlier in the same job. The review-lane step already reuses it. The fields (filename,previous_filename,status) are the same, andmerge-holds.mjsparses each line withJSON.parse. The pages are used only while the live pull's head still equals the event's head (PR_HEAD_SHA), so a push between the two steps cannot pair an old file list with a new head. Thechanged_filescompleteness check still runs. A missing or unparsable file, a moved head, or amerge_groupevent takes the live read.Not changed: the issue-comments read in the lanes-hold step. The job's documented rule (the
pr_readcomment) says comments are read live so that a member's veto is never missed. The hold-lift step's earlier read has the same fields and pagination, but reusing it would let a veto posted between the two steps go unseen, and a comment does not re-runci-status. Also unchanged: the three contents reads at the base commit, draft handling, the api-calls emit position, and ci-workflows.Verification
Per-run REST delta, by event class:
pull_request, not the lanes Apppr_readof the pull now misses and reads itpull_request, lanes Appmerge_group, not the lanes Appgh run downloadcalls. These per-run figures come from the cut's assignment, not from a measurement in this changemerge_group, lanes AppExpected hourly effect at the 2026-11-01 01:58-03:58Z rates. Run counts come from the token-spend report's
runs.json:work-resolve-issue/) 10, plugin release 2.5, other 36.Per class:
That totals about -82 A/h and -28 B/h. The earlier estimate was -96 A/h. It assumed -2 A per lanes App pull request and the full -1 A for exempt authors; the dropped comments reuse and the exempt-author case take that out.
Re-measure: use the same method as the 01:58Z report (fetch.py + analyze.py over pr-require-checks/ci-status), over 2 h starting at merge + 30 min. Compare A calls/h for ci-status (385 A/h in the after-window) with the counter-A window peaks.
Tests:
scripts/ci-lanes-pr-hold.test.sh: PASS=291 FAIL=0. On origin/main's workflow, 19 of the new and updated cases fail. They cover:lanesoutput (true, false, and unset on an unreadable author, ref or id)lanes != 'false'scripts/ci-hold-pr-unblock-status.test.sh32/0,scripts/ci-broker-pin.test.sh25/0,scripts/ci-hold-lifted-by.test.sh64/0,scripts/ci-hold-cost-decision.test.sh172/0.scripts/check-lane-coverage.sh --check: all 79 gate steps fed, 5 opted out.node --testoverreconcile.test.mjs,resolve-pr.test.mjsandmerge-job.test.mjs: 366/0.actionlinton the workflow: clean.shellcheckon the test: clean.Related
🤖 Generated with Claude Code