Repository navigation
perf(ci): cut CI Status REST reads on merge_group runs - #17299
Conversation
In the merge queue, the verdict reader read the trusted-actor list, admission rules and pipeline config at main's tip through the contents API on every run, although the job's .base checkout already sits at that tip. BABYSIT_CONFIG_CHECKOUT now lists both checkouts (base-config and .base), the .base sparse list carries those three files, and the reader takes a file from a checkout only when its HEAD is the commit asked. The tip itself is still read live, so a main that moved since reads the API as before. The runner-tail step enforces nothing; it now samples one merge-group run in ten instead of reading the attempt's jobs on every run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
|
claude-security-review reviewed Security review (incremental, blocking only): no findingsThis review covers only what changed since The change is in a test module. When the module is imported, it removes git variables it may have inherited ( This head already has a review, so this one reports blocking findings only. The earlier review's conclusions for the other 6 files still stand, since none of them changed. The change spends nothing new. critical-findings: 0 |
|
claude-review reviewed Code review (incremental, blocking only): perf(ci): cut CI Status REST reads on merge_group runsThis round looks only at the push since New change. When the module loads, it now removes Earlier finding restated. The earlier review raised this as a summary comment with no line anchor, so it is restated each round. The code it points to is unchanged at this head:
PR context: the PR closes no issue, so there are no acceptance criteria to check. The PR text contains no embedded instructions to the lane. Spend (not a finding): this push adds no paid usage. Loosened-check verdict: fail. That is the default, because the prompt had no I ran no tests. The author's verification is author-claimed and unverified. Verifier dropped 0 of 0 candidates. |
…suite The new checkout fixture builds a git repository, so the suite must clear GIT_DIR, GIT_WORK_TREE and GIT_CONFIG before any test spawns git (scripts/check-fixture-git-isolation.sh), as the merge-policy suite does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: the repository's 5,000-call hourly GITHUB_TOKEN pool runs out almost every hour, and
CI Statuson merge_group spends about 4x what a pull_request run does.Summary
Measured over 15:55Z-21:58Z on 2026-11-18 from the job-call records: 99 merge_group
CI Statusruns spent 1,579 calls, minus GraphQL about 16 per run. A pull_request run spends about 4. Each merge group holds one queued pull request (pr-Nin the ref), so nothing reads "every PR in the group". The extra cost is the merge-queue verdict reader, its carried-cache read and the runner-tail step, which run only in the queue:actions/artifacts(named PASS/FAIL lookups)actions/runs/{n}/artifactscompare/{x}(run heads against main)graphql(separate pool)actions/runs/{n}actions/artifacts/{n}/zipactions/workflows/{x}/runspulls/{n}actions/runs/{n}/attempts/{n}/jobs(runner tail)git/ref/heads/mainpulls/{n}/commitspulls/{n}/reviewscontents/4 segments (trusted-actor list, admission rules at main's tip)contents/3 segments (pipeline config)issues/{n}/timelineissues/{n}/comments,pulls/{n}/comments,issues/{n}/labelsFix
babysit_verify_evidence.py) read the trusted-actor list, admission rules and pipeline config at main's tip through the contents API, although the job's.basecheckout already sits at that tip.BABYSIT_CONFIG_CHECKOUTnow takes several checkouts separated byos.pathsep(base-config and.base), the.basesparse list carries those three files, and_raw_fileand_text_filetake a file from a checkout only when its HEAD is the commit asked (merge_policy.checkout_file_at). The tip itself is still read live, so if main moved after the checkout the read goes to the API as before. The file is read from git objects (ls-tree,cat-file), never the work tree, and.baseis main's own code, which this job already runs.Record each job's runner tailenforces nothing and now runs on one merge-group run in ten (endsWith(github.run_id, '0')), which still shows the trend.Reads kept, and why:
verdictHold, quoted in the lanes-hold step's comment).pulls/{n}, reviews, comments, timeline and commits: a veto, approval or push after queueing changes the verdict, and the step reads them live by design.git/ref/heads/main: the reader resolves the live tip so a since-removed trusted actor or policy change is never read from a stale commit (carry_base_tiptakes a passed tip only where an older one can only refuse more).Calls saved per hour, against the 6 h data (calls minus GraphQL): the runner tail drops about 96 of 107 reads (16/h). The contents reads drop up to 100 (up to 17/h): fewer if main moves between the checkout and the read, or if some 3-segment reads are
docs/upstreampage pins, which this change does not cover. Total 16-33 calls per hour, out of about 257/h.Follow-ups not taken here:
_contains(2.45/run) has no local-history path the way_GreenMain.aheaddoes. Adding one needs a history fetch inci-status, and a stale local "no" must fall back to the API, so it is a separate change.Hold paths touched (
pr-require-checks.yml,babysit_verify_evidence.pyand the other babysit scripts), so this needs a trusted approval.Verification
ConfigFromTheBaseCheckout(merge policy) gains two tests: the listed checkout whose HEAD is the commit answers, and a checkout file reads only at its HEAD.FilesAtTheTipFromTheCheckout(verify evidence) shows the trusted list and pipeline config come from the checkout with no API read, and that another commit reads the contents API.scripts/ci-lanes-pr-hold.test.shpins the newBABYSIT_CONFIG_CHECKOUTvalue and the three files in.base's sparse list.scripts/check-affected.sh: 19 passed, 0 skipped.scripts/run-ruff.sh checkis clean on the changed Python.Related
🤖 Generated with Claude Code