Repository navigation
Commit 6817bf1
ci: prune the build-core, typecheck and pack-smoke Turbo seeds before saving them (#27067)
Fixes #26957
Part of #25452 (step 2 of its directive, rewritten by ruling 6458731814
to "prune, not drop"; step 3, the pool reading after at least 5 merges,
stays open there)
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:把剩下四处 per-sha Turbo 种子(Build Core、Type Check · workspace、两个
pack-smoke 作业)的保存步骤接到现成的 `prune-turbo-cache.mjs`
后面,种子只留本次运行用到的任务条目;不删种子、不加脚本、不加门禁、不抬池子上限。
- 为什么改:裁决 6458731814 选 A「修剪,不删」;#26070 → A 后这些种子是 PR
构建唯一的缓存,但整份保存会把旧种子一路累积进去,挤爆 10 GB 缓存池。
- 风险与回滚:只动 `.github/workflows/` 的四个文件;最坏情况是某次 push 不保存种子(无运行摘要即
`save=false`),下一个 PR 退回上一份种子;回滚 = revert 本 PR。
- 先看:`.github/workflows/lint.yml`(typecheck 两条 turbo 命令加
`--summarize`,否则修剪会丢掉 typecheck
条目);`.github/workflows/publish-smoke.yml`(`actions/cache` 拆成 restore +
save,保存门槛与原 post-step 一致);`.github/workflows/ci.yml` Build Core 尾部。
- 两分钟验证:`node scripts/ci/prune-turbo-cache.mjs --self-test`,预期最后一行
`prune-turbo-cache self-test: OK (25 case(s) across 5 batteries).`
- 需要你做的:作为 GOVERNED_APPROVERS 审批(或亲手合并)这个 Tier H draft PR。
## What changes
Ruling 6458731814, verbatim from #26957: "Letter **A, prune, do not
drop**: the Build Core, Type Check · workspace and pack-smoke per-sha
seeds stay, and each seed-save step is wired behind
`scripts/ci/prune-turbo-cache.mjs --site …` exactly as Test Core, Build
UI Deps, Type Check UI and Lint UI are today, so a seed holds only the
task entries its own run used." and "⛔ The pool limit is not raised
here" stands.
Every save site of the three seed families, derived from the YAML at
`origin/main` `cb8988ee14` (each `actions/cache*` step whose key
resolves to `turbo-build-core-`, `turbo-typecheck-` or
`turbo-pack-smoke-`):
| Site (job) | File | Saves when (unchanged) | Turbo run had
`--summarize`? | Change |
|---|---|---|---|---|
| Build Core (`build-core`) | `ci.yml` | `always() && push` | yes (`pnpm
build --summarize`, summary left in `.turbo/runs/`) | prune step `--site
'Build Core'`; save ANDs `save == 'true'` |
| Type Check · workspace (`typecheck-workspace`), the one designated
typecheck writer | `lint.yml` | `always() && push` | build yes; `turbo
run typecheck` NO | `--summarize` added to both `turbo run typecheck`
lines; prune step `--site 'Type Check · workspace'`; save ANDs `save ==
'true'` |
| Packed-tarball smoke, release candidate (`pack-smoke`) |
`publish-smoke.yml` | every run it runs on (`workflow_run` after
Release, `workflow_dispatch`), job green, exact key missed (the
`actions/cache` post-step) | NO (`pnpm run build`) | `--summarize`
added; `actions/cache` split into `actions/cache/restore` +
`actions/cache/save` behind the prune, same gate: `success() &&
cache-hit != 'true' && save == 'true'` |
| Packed-tarball smoke, opt-in (`pack-smoke`) | `pack-smoke-optin.yml` |
`pull_request` with `needs:pack-smoke`, job green, exact key missed | NO
| same as the row above |
Restore-only sites, untouched: `ci.yml` `ui-published-artifacts`;
`lint.yml` `typecheck-source-gates`, `typecheck-debt`,
`typecheck-consumers`; `test-nightly-tiers.yml` `tiers` (L186 is a
restore, not a save, so no wiring is owed there). The pack-smoke seed is
keyed `${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}`,
which is why a grep for the literal `turbo-pack-smoke` finds nothing.
Wiring notes:
- `--summarize` does not enter a task hash (ci.yml Build Core's ASSERTED
paragraph: 83 of 83 identical with and without, turbo 2.11.5), and none
of the four TURBO_* remote-cache lines is added anywhere, so the PINS in
that comment still hold.
- The pack-smoke save keeps `continue-on-error: true` and keeps the
post-step's semantics: a failed `actions/cache` post-step never failed
the job, and an explicit save step without the flag could have.
- The two pack-smoke prune steps also carry `cache-hit != 'true'`, so an
exact-key hit, which the post-step never saved, does not touch the
restored cache either.
- No `--site` list is pinned anywhere: `git grep -n "prune-turbo-cache"
-- scripts packages .github` hits only the script itself and `ci.yml`
(its CI-filter path and its `--self-test` in Build Core), and the
script's self-test uses the fixture site name only.
## Tests
- `node scripts/ci/prune-turbo-cache.mjs --self-test` (script
unchanged): `prune-turbo-cache self-test: OK (25 case(s) across 5
batteries).`, exit 0.
- End-to-end on a real turbo run, private `--cache-dir` so the shared
cache was untouched: a planted stale entry `deadbeef` plus `pnpm exec
turbo run typecheck --filter=@objectstack/sdui-parser --summarize`, then
the exact prune command of the `lint.yml` site. Output: `kept 1 task
entry named by 1 run summary` / `dropped 3 file(s) the run did not use`,
`save=true`; what is left is the typecheck task's three files only. That
shows the `--summarize` this PR adds is what keeps the typecheck
entries.
- `pnpm run build --summarize --dry=json` echoes `turbo run build
--filter=!@objectstack/docs --filter=!./ui*/apps/site --summarize
--dry=json`, so pnpm forwards the flag to turbo in the two pack-smoke
jobs.
- YAML parsed with PyYAML; every changed step rendered (`if:`, key,
command):
<details><summary>Rendered steps</summary>
```
ci.yml build-core | Prune the Turbo cache to this run's tasks (main only) | id=prune-turbo-cache | if="always() && github.event_name == 'push'" | --site 'Build Core'
ci.yml build-core | Save Turbo cache (main only) | if="always() && github.event_name == 'push' && steps.prune-turbo-cache.outputs.save == 'true'" | key=${{ runner.os }}-turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
lint.yml typecheck-workspace | Type check workspace packages | 'pnpm exec turbo run typecheck "${UNIVERSE[@]}" --summarize', 'pnpm exec turbo run typecheck "${FILTERS[@]}" --summarize'
lint.yml typecheck-workspace | Prune the Turbo cache to this run's tasks (main only) | id=prune-turbo-cache | if="always() && github.event_name == 'push'" | --site 'Type Check · workspace'
lint.yml typecheck-workspace | Save Turbo cache (main only) | if="always() && github.event_name == 'push' && steps.prune-turbo-cache.outputs.save == 'true'" | key=${{ runner.os }}-turbo-typecheck-${{ github.ref_name }}-${{ github.sha }}
publish-smoke.yml pack-smoke | Setup turbo cache | uses=actions/cache/restore@v6 | id=turbo-cache | key=${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
publish-smoke.yml pack-smoke | Build | pnpm run build --summarize
publish-smoke.yml pack-smoke | Prune the Turbo cache to this run's tasks | id=prune-turbo-cache | if="success() && steps.turbo-cache.outputs.cache-hit != 'true'" | --site 'Packed-tarball smoke (release candidate)'
publish-smoke.yml pack-smoke | Save turbo cache | if="success() && steps.turbo-cache.outputs.cache-hit != 'true' && steps.prune-turbo-cache.outputs.save == 'true'" | key=${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
pack-smoke-optin.yml pack-smoke | Setup turbo cache | uses=actions/cache/restore@v6 | id=turbo-cache | key=${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
pack-smoke-optin.yml pack-smoke | Build | pnpm run build --summarize
pack-smoke-optin.yml pack-smoke | Prune the Turbo cache to this run's tasks | id=prune-turbo-cache | if="success() && steps.turbo-cache.outputs.cache-hit != 'true'" | --site 'Packed-tarball smoke (opt-in)'
pack-smoke-optin.yml pack-smoke | Save turbo cache | if="success() && steps.turbo-cache.outputs.cache-hit != 'true' && steps.prune-turbo-cache.outputs.save == 'true'" | key=${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
```
</details>
## Acceptance notes
- Post-prune seed size: **NOT MEASURED: seed size, reason: only a push
run on `main` saves these seeds, so the first reading is the first push
run after this lands.** Read the `prune-turbo-cache: Build Core: …` and
`prune-turbo-cache: Type Check · workspace: …` lines (`kept N task
entries …` / `dropped N file(s) the run did not use: X MB -> Y MB on
disk.`) in that run's Build Core and Type Check · workspace logs. The
pack-smoke lines (`prune-turbo-cache: Packed-tarball smoke (…): …`)
appear on the next Release-triggered Publish Smoke run, or on a PR
carrying `needs:pack-smoke`. The MB-scale figure on the card is an
extrapolation from Test Core, not a measurement.
- Pool reading (#25452 step 3) is not this PR's: it needs at least 5
merges and `actions/cache/*` read access.
- Seen, not changed: both pack-smoke restores keep their bare `${{
runner.os }}-turbo-` restore-key fallback, which can restore any Turbo
seed family. Wiring only; noted, not filed.
## Verification
Derived gates (`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack`), run on `56f9bbce` with each exit code
captured before any pipe; reconciled on `b782ee2d` (the merge of
`origin/main` `3230bdbf`, which touches no workflow; the derived list is
byte-identical on both):
<details><summary>dispatch-gates --ran</summary>
```
Run reconciliation — 56 derived, 52 run, 4 NOT-MEASURED, 0 UNRUN.
NOT-MEASURED · DERIVED (4) — your record carries exit 3 for these
- pnpm check:dts-closure [recorded exit 3 — PREREQUISITE NOT MET]
- pnpm check:dual-build-cjs-loads [recorded exit 3 — PREREQUISITE NOT MET]
- pnpm check:lean-entry-closure [recorded exit 3 — PREREQUISITE NOT MET]
- pnpm check:sourcemap-no-sources-content [recorded exit 3 — PREREQUISITE NOT MET]
✓ dispatch-gates --ran: 56 derived famil(ies) accounted for — 52 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3).
```
</details>
The four NOT-MEASURED gates read a built `dist/`; this diff changes
nothing they read. CI runs them in Build Core. `pnpm
check:pm-dispatch-gates` exited 0 (`1935 cases pass` in the fast tier).
Every other derived family exited 0, among them `check:self-test-wired`,
`check:self-test-workflow-commands`, `check:ci-filter-parity`,
`check:workflow-status-functions`, `check:workflow-step-name-quoting`,
`check:step-collectors`, `check:shard-attestation` and
`check:required-contexts`.
Governed surface: `.github/workflows/**`, Tier H. This lands only
through a GOVERNED_APPROVERS approval or the maintainer's hand.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYooUn7D13pPguPf727)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5193634 commit 6817bf1
4 files changed
Lines changed: 92 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2997 | 2997 | | |
2998 | 2998 | | |
2999 | 2999 | | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
| 3011 | + | |
| 3012 | + | |
3000 | 3013 | | |
3001 | 3014 | | |
3002 | | - | |
| 3015 | + | |
3003 | 3016 | | |
3004 | 3017 | | |
3005 | 3018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5684 | 5684 | | |
5685 | 5685 | | |
5686 | 5686 | | |
5687 | | - | |
| 5687 | + | |
5688 | 5688 | | |
5689 | 5689 | | |
5690 | 5690 | | |
| |||
5700 | 5700 | | |
5701 | 5701 | | |
5702 | 5702 | | |
5703 | | - | |
| 5703 | + | |
5704 | 5704 | | |
5705 | 5705 | | |
5706 | 5706 | | |
| |||
5721 | 5721 | | |
5722 | 5722 | | |
5723 | 5723 | | |
5724 | | - | |
| 5724 | + | |
| 5725 | + | |
| 5726 | + | |
| 5727 | + | |
| 5728 | + | |
| 5729 | + | |
| 5730 | + | |
| 5731 | + | |
5725 | 5732 | | |
| 5733 | + | |
| 5734 | + | |
| 5735 | + | |
| 5736 | + | |
| 5737 | + | |
| 5738 | + | |
5726 | 5739 | | |
5727 | 5740 | | |
5728 | 5741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | | - | |
| 127 | + | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| 138 | + | |
135 | 139 | | |
136 | | - | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
204 | 206 | | |
205 | | - | |
| 207 | + | |
| 208 | + | |
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
212 | 215 | | |
| 216 | + | |
213 | 217 | | |
214 | | - | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
240 | 269 | | |
241 | 270 | | |
242 | 271 | | |
| |||
0 commit comments