Repository navigation
ci: backport blobless checkouts for review lanes to 0.12 (#27513, #29347) - #29387
Conversation
…27513) * fix(ci): fetch only what Code Review's jobs read, not every branch Every Code Review job checked out with fetch-depth: 0, which downloads every branch and tag with every blob ever committed (2.87 GiB, 1109 branches). On a slow runner that fetch alone outlasted the job's timeout and the job was cancelled inside actions/checkout. The four jobs now check out the merge commit at depth 2 and run one shared script as their diff-base step. It fetches the commit history of the base tip and the head without trees or blobs, resolves the merge-base, fetches the merge-base's files by running the diffs once, and fails the step if the history is still shallow or any object of the four commits is still missing, so no later step reads the network. A retry after an attempt that completed the history asks for no --unshallow, which git refuses on a complete history. The script runs from the pull request's own commit, so the jobs hand it no token. The repository is public, so every fetch is anonymous: the script turns off any credential helper and the http.extraheader that actions/checkout writes for github.com. A private repository refuses the fetch, and the step fails with an error saying the repository must be public or readable without credentials. PR Hygiene's checker steps now fail when the base tip's copy of their script cannot be read, and run the checkout copy only when the base tip has no such file. Closes #23397 * fix(ci): fetch the history with blob:none, which git 2.56 can deepen On git 2.56 (the CodeBuild runners), deepening a shallow clone with --filter=tree:0 aborts in index-pack. blob:none keeps the commit graph and skips every blob, and passes the suite on git 2.47 and 2.56. (cherry picked from commit 300ee84)
The Security Scope Review jobs and the fork content scan check out with fetch-depth: 0, and on the runner fleet that clone alone now outlasts their 15- and 30-minute budgets: on 2026-11-03 the candidates job and the publish job were cancelled inside actions/checkout after 30 and 15 minutes. Apply the pattern from #29301 to every full-history checkout in security-scope-review.yml, fork-security-scope-review.yml and fork-internal-content-scan.yml: add filter: blob:none (all commits and trees arrive, the checked-out tree is complete, older blobs are fetched on demand) and raise the 15-minute job budgets to 20. The bounded-checkout test now pins the filter and the budget on each job. (cherry picked from commit a073c19) # Conflicts: # test/test_workflow_bounded_checkout.py
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This backports two fixes main already merged. They address cancellations the description reports on PR #29291. The only part with no runtime effect is the fork-workflow copies. Notes
What this change shipsInventory (7 items) — 5 justifiedIntent: let PRs into
[FIRST-PRINCIPLES-REVIEWED] a99ac9c Description read[DESCRIPTION-READ] 31de81127ef2cf2d4fa14b0a1d66abbe228c7d41b31eb5d23235bf7519d87328 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS This backports two fixes main already carries, and each job still reads the same commits and files. Nothing in it blocks. Notes
[DESIGN-REVIEWED] a99ac9c Description read[DESCRIPTION-READ] 26097ff1d229482576561328a234e13c777e5a08dd7255b645dc665a1ad21c6b 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 |
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: |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: This diff changes CI workflows only. Nothing in TIGHTENING: Two workflow-side guards got stricter. (1) The history fetch is now anonymous: ADJUDICATED: 18 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: I wrote posix, windows and any rows. The posix rows ( UNADJUDICATED:
[SCOPE-REVIEWED] a99ac9c |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- .github/workflows/security-scope-review.yml:1414 -- Failed lazy fetch executes PR-controlled code in the privileged publisher
[BLOCK-MERGE] a99ac9c Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (fenced): FLAG. The finding is real, but reaching it takes a combination of conditions the attacker can't arrange.
🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override. The annotate-only pass judged the condition combination each one requires extreme, and pre-drafted the override rationale below. A repository writer must independently verify a rationale before posting it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop.
Replace False positive or not applicable? A repository writer can comment: |
Problem / Motivation
Goal: Pull requests into
release/0.12.0finish their review-lane checkouts inside the job budget instead of being cancelled inactions/checkout.On 2026-11-03, PR #29291 (base
release/0.12.0) hadInclusive Language,Automated Rule Check,PR HygieneandSAST (Semgrep)cancelled inside theirfetch-depth: 0checkout (10 to 30 minutes each), andSecurity Scope Reviewcancelled the same way. On main these lanes were fixed by #27513 (Code Review jobs) and #29347 (Security Scope lanes).release/0.12.0has neither.Why it matters
Every PR into the 0.12 release branch hits the same cancellations, so its required
PR Readinesscannot go green without repeated reruns. That blocks 0.12 backports and patch releases.Not a goal
internal-content-scanand stable gate). fix(release): forward-port #28498 link-preview fix and #29301 checkout budget to 0.12 #29291 already carries it to 0.12.runs-onlines stay as they are on 0.12.What changed (motivation → approach → change)
Two clean cherry-picks from main, each with its
(cherry picked from ...)trailer:fix(ci): fetch only what Code Review's jobs read, not every branch (#27513)300ee84bdcfetch-depth: 2, then.github/scripts/code-review-history.shfetches the commit history without blobs and the merge-base tree.ci: blobless full-history checkout for the security scope lanes (#29347)a073c19453filter: blob:noneon every full-history checkout insecurity-scope-review.yml,fork-security-scope-review.ymlandfork-internal-content-scan.yml; 15-minute job budgets raised to 20.One conflict, in
test/test_workflow_bounded_checkout.py: 0.12 lacks #29301, so the new pin test lists only #29347's eight jobs, notinternal-content-scan.yml/release.yml. #29291 keeps those two in the bounded-checkout allowlist on 0.12 until it lands.The fork workflows run from the default branch on
workflow_run, so their 0.12 copies change nothing at runtime. They are carried so the branch matches main and the pin test holds.Backwards compatibility
Compatible: each job reads the same commits and files; only when objects are downloaded changes.
Removes nothing: the diff changes checkout depth and filters and raises timeouts; no path, key, check or record is taken away.
Tests
CI runs no backend tests on PRs into
release/*, so the related set ran locally: every test file that readscode-review.yml,security-scope-review.yml,fork-internal-content-scan.yml,code-review-history.shor the shared AI-review workflow helpers (58 files), in 3 sequential single-process batches.No failure is caused by the picks. One case,
test_code_review_history_fetch.py::test_a_checker_runs_the_base_tips_copy_and_a_failed_read_fails_the_step[...proof_line_check.py], hangs on a host whose firstpython3onPATHis a version-manager shim: the test setsHOMEto a temp dir and keepsPATH, so the shim finds no tools and spins. It hangs the same way on main. With the real interpreter first onPATH, all 6 cases pass, and batch 2 above was run that way.Proof: not provable -- docs or config only
Manual verification
This PR's own Code Review and Security Scope lanes run on the 0.12 workflows it changes, so their checkout times are the measurement. They are posted in a comment once CI finishes.
Related Issues
Part of #29264. Backports #27513 and #29347 to
release/0.12.0.Sibling sweep
Swept: every
actions/checkoutwithfetch-depth: 0in.github/workflows/onrelease/0.12.0.Sibling: .github/workflows/code-review.yml -- changed here
Sibling: .github/workflows/security-scope-review.yml -- changed here
Sibling: .github/workflows/fork-security-scope-review.yml -- changed here
Sibling: .github/workflows/fork-internal-content-scan.yml -- changed here
Sibling: .github/workflows/internal-content-scan.yml -- tracked in #29291
Sibling: .github/workflows/release.yml -- tracked in #29291
Pattern harvest
Not generalizable: a branch cut before a CI fix needs that fix backported; the ratchet in
test_workflow_bounded_checkout.pyalready covers the pattern.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.