Repository navigation
perf(pr-pipeline): cut ci-status's GITHUB_TOKEN reads - #9433
Conversation
ci-status read the base commit's .work-item-tracker.json and trusted-actor list through the contents API in up to four places per run. One sparse checkout of those two files at the base SHA now serves every hold step; a 40-hex ref makes actions/checkout fetch over git with no REST request. The broker-pin step leaves the pull request's file pages under RUNNER_TEMP, and the review-lane step's exempt-author branch reuses them instead of reading the list again. What ci-status accepts or rejects is unchanged: a failed checkout is an unreadable config (fail closed, or no clear for the cost hold), and a file missing from a checkout that succeeded is the old 404. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a second-page fixture to the broker-pin test, compares the shared pages slurped, and counts the base-config checkout in ci-status's timeout budget comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
The checkout's continue-on-error lets a failure fall through to the hold steps, which read its outcome through BASE_CONFIG and fail closed or keep the hold, so it is not a gate the aggregator must read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token-calls # Conflicts: # .github/workflows/pr-require-checks.yml
|
claude-security-review reviewed No security issues found in this pull request. critical-findings: 0 What I reviewed. I read all of Trust boundary: held.
Manifest items. The diff touches no Trust-gate paths. The diff doesn't modify Note on the PR description. The description in Not consulted. I did not read |
|
claude-review reviewed Code review: 1 findingThe diff does not match the PR description or the issue it closes. The workflow change itself looks sound. Blocking: the PR closes #9396 but does not implement itThe PR title is
The body says
None of these is met by this diff. Merging would auto-close #9396 with the work undone. Either the body and The PR body's Verification section ("378 passed", What the diff does (read, not executed)
Neither a No embedded instructions were found in the PR context file. No manifest files changed, so there are no |
claude-security-review flagged the same mismatch as a process note. Both lanes found the diff itself sound on |
No related issue: efficiency register E9-E14 (owner directive 2026-10-23)
Summary
ci-statusinpr-require-checks.ymlspent GITHUB_TOKEN requests reading the same data more than once per run. It read the base commit's.work-item-tracker.jsonand trusted-actor list through the contents API in up to four places, and on exempt-author runs it read the PR file list twice. What it accepts and rejects is unchanged.Fix
Check out the base commit's hold config, does a sparse checkout of/.work-item-tracker.jsonand/.github/standards/trusted-actors/trusted-actors.jsonatpull_request.base.sha || merge_group.base_sha, withpersist-credentials: falseandcontinue-on-error: true. The cost-hold, human-gated, hold-lift and merge-group steps read the files fromBASE_CONFIG.BASE_CONFIGis empty and each step treats the config as unreadable, as it did on a failed API read: fail closed, or the cost hold stays.needs-human.scripts/lane-coverage-step-opt-outs.txtwith that reason.3d3c42e5). Its API call sites all return early for a 40-hex ref on a runner with git:git-source-provider.ts:154github-api-helper.ts:137-139ref-helper.ts:226-235, which needs arefs/pull/refpulls/N/filespages in$RUNNER_TEMP/pr-files.json, and each consumer applies its own jq filter. The review-lane step's exempt-author branch reuses that file and falls back to its own read when the file is absent.steps.human_gated.outputs.held == 'false', so the PR never carries the label at that point. "Exit when no hold label" would therefore exit on every run.labeledevent.Calls per ci-status run, counted from the code
Scope: REST requests issued by ci-status's own steps, one page per
--paginateread. The pinned check-contract and aggregate-results composites are excluded and unchanged. The savings apply to contract-only runs (label flips, body edits) too, since these steps run there.Main's #9399 (merged into this branch) added
Fail a lanes App pull request its body or a member holds. That step does onepulls.geton every pull_request and merge_group run, plus three more reads on lanes App pull requests. It is identical before and after this PR, so the table leaves it out: for totals on current main, add 1 to every row. Sharing itspulls.getand file read with the steps here is a follow-up, not done here.By item:
Verification
scripts/ci-*.test.shpasses: broker-pin 25, cost-decision 72, human-gated 38, lifted-by 33, merge-group 22, review-lanes 55, lanes-pr-hold 62, plus ordered-skips, queued-pr, rerun-ci-status and squash-header-lines. Every case for a retried or unreadable contents read became a fixture case: checkout failed, file missing, file invalid. Each run also asserts that no/contents/read happens.scripts/check-affected.sh --testspassed on the merged head.ci-test-node-stop-commands.test.shneeds PyYAML. With the pinned CI requirements installed it passes, insidecheck-affected --tests.ci-hold-merge-group.test.shis its only proof.Related
x-ratelimit-reset. This PR leaves theread_apihelpers and the surviving retry loops untouched.🤖 Generated with Claude Code