Repository navigation
ci(repo-gates): restore the build's turbo cache, save and prune on push only - #13360
Conversation
…sh only (objectui#13348) Repo Gates cold-built `./packages/*` on every pull request, push and queue build: the one build-carrying job with no `.turbo/cache` restore. Add the `performance-budget.yml` shape (objectui#12276): one restore key under this job's own `turbo-<os>-repo-gates-` prefix, TURBO_RUN_SUMMARY on the build step, then the replay report, the push-only prune and the push-only bounded save as bookkeeping after the last gate. The build's filter set is unchanged. The two in-tree pins that read this workflow move with it: the action-ref convention test's list of repo-gates.yml refs, and the CI/CD pipeline page's Repo Gates section, which must name `scripts/report-turbo-cache.mjs`. Refs objectui#13348 Claude-Session: https://claude.ai/code/session_01WJozybDmRH8z2c5SD7vJkj Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Inputs: card #13348 (body and all three comments, the surface revision 6364367391 included), PR #13360 body and file list, the net diff ① Derived judgmentsBehaviour changes the diff implies, each judged:
Check-runs on the head (the gate verdicts), all 33 completed: ② Semver levelNo release level. The diff touches a workflow, a test under ③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
维护者速读
席位核对Seat: domain:ui#1 · Clause-②: no · head
|
Closes #13348
Clause-②: no
Governed surface
.github/workflows/**is on objectui's governed surface (node scripts/check-governed-queue-guard.mjs --test .github/workflows/repo-gates.yml→ GOVERNED). This PR stays draft until an approval from a governed approver (os-zhuang/hotlong) is on record.What changed (3 files)
.github/workflows/repo-gates.yml: the build step now has a Turbo cache, set up the same way asperformance-budget.yml'sbundle-analysiscache (objectui#12276):actions/cache/restore@v6on.turbo/cache, with the keyturbo-${{ runner.os }}-repo-gates-${{ github.sha }}and one restore key,turbo-${{ runner.os }}-repo-gates-. It runs on the same condition as the build:!cancelled() && steps.install.outcome == 'success'.TURBO_RUN_SUMMARY: 'true'. The build command and its filter set are unchanged, and it is still never an unfilteredturbo run build(header,repo-gates.yml:55).continue-on-error:!cancelled()).cache-hit != 'true', with a 5 min bound. The existing save of the pinned@objectstackbuild stays the last step.scripts/__tests__/check-action-ref-convention.test.ts: this test pins the exact list ofuses:refs inrepo-gates.yml. The new restore and save add two refs, so the list now has them, in file order.content/docs/guide/ci-cd-pipeline.md: the Repo Gates section now names the cache andscripts/report-turbo-cache.mjs.ci-cd-pipeline-doc.test.tsrequires the page to name every first-party command a workflow runs, and it has no exception list.$SKILL_FILTER/$SNIPPET_FILTEROn this PR's base, the two derived filters add no tasks to the build. Checked with
turbo run build --dry=json:--filter='./packages/*'alone gives 40 tasks, and adding both derived filters gives the same 40. That is also the task setbundle-analysisbuilds. The filters are derived on every run, so they could change it later. If one ever names a package outsidepackages/, that run gets fewer cache hits. It does not break the cache.How acceptance will be measured
mainpush run, 39921589107: the build step took 247 s and the job took 419 s.main's entry, and norepo-gates-entry exists yet. The ≤90 s build step can only show up after a push tomainhas saved an entry. To read it:::noticethat "Report what the turbo cache replayed" writes on the first PR run after that push;cancel-in-progress: true, so a merge can cancel the previous merge's run before it saves. Of the 20 newestmainpush runs, 18 succeeded and 2 were cancelled, so the save should land on most merges.Judgment calls
bundle-analysis's restore has noif:, and the turbo cache policy test does not constrain this.bundle-analysis's 1 s save (objectui#7048's arithmetic), and the comment says to re-derive it from this step's own runs. Including the pinned build's 2 min save, this job's save bounds total 7 of its 30 minutes.Checks run
scripts/__tests__/*.test.tsfiles that read workflows,repo-gatesor the CI/CD page pass. This includesreport-turbo-cache.test.ts(each job has its own prefix and only one restore key, only push saves, the prune runs before the save, the report reads the summary) andworkflow-cache-save-bound.test.ts(saves use the split form, run after the last command and stay within the job ceiling). Before the 2 pin updates, those 2 tests failed.check-governed-queue-guard --test→ GOVERNED.repo-gates.ymlparses with theyamlpackage.check-action-ref-convention,check-pre-install-import-graph,check-control-bytes,check-doc-links,check-new-cross-file-line-citations(0 new) andcheck-changeset-presence(no changeset owed: no released package source changed).Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01WJozybDmRH8z2c5SD7vJkj