Repository navigation
Commit 4cb162b
ci(docs-deploy): print what each docs deploy uploads, by part, before the upload (#38297)
repo:objectstack#3 · os-tesla · session_01L9qibzZRa3nLMmeQvLoDWE
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao9y3zpvwyjTXecpSHhuy4Ag)_
Fixes #36192
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户无感:文档站部署每次在上传前多打印一张表,列出这次要传多少、各部分各占多少,写在部署日志和运行摘要里。
- 为什么做:文档站部署产物瘦身专题的第二步(第一步已合并,合并后第一次线上部署从 954.6 MB 降到 742.8 MB,少传约
22%),以后每次部署都有体积读数,变大能马上看见。
- 出错会怎样:这一步只读不写;它自己坏了只出一条警告,部署照常发布。撤回本 PR 即还原。
- 要你做的:这是部署流程文件的改动,需要你批准后才能合并。
## What changes
- `.github/workflows/docs-deploy.yml`: one new step, `Measure what this
deploy uploads`, between the build assertion and the upload. It runs
`node apps/docs/scripts/measure-deploy-output.mjs` (landed in #38264),
prints the per-part table to the log and appends it to the run summary.
- It runs before the upload so the reading exists for the runs that need
it most: the ones whose upload aborts.
- `continue-on-error: true`, the only step in this workflow with it: the
step publishes nothing, so a broken measurement must not stop the docs
from publishing. A failure still leaves a `::warning::` annotation. The
workflow's header rule (a run that cannot deploy goes red) is about the
publish, and it is unchanged.
- `timeout-minutes: 5` on the same step: `continue-on-error` does not
absorb a hang, so without it only the job's 30-minute clock would end
the step, with no deploy. A step that hits its own timeout counts as
failed, which `continue-on-error` lets through. The script is
synchronous local reads and takes seconds.
- The reading is written to `$RUNNER_TEMP`, outside the tree `vercel
deploy --prebuilt` reads.
- `skip-changeset`: a workflow file, nothing publishes.
## Tests
- The step's `run:` block, extracted from the YAML and run locally with
`RUNNER_TEMP` and `GITHUB_STEP_SUMMARY` set, against the offline `vercel
build` output: exit 0; log and summary both carry the table (`Deployment
files: 13039 … Distinct contents: 7847 files, 631.7 MiB`).
- Same block with `.vercel/output` moved away: the script refuses (no
`config.json`), the step prints the warning and exits 1, which
`continue-on-error` turns into a warning on a green run.
- The step's keys parsed from the YAML at `cd1513fc`: `name`,
`continue-on-error: true`, `timeout-minutes: 5`, `run`. No check-run
executes the step (Docs Deploy runs from `main` only); its first run is
the first deploy after merge.
## Acceptance notes
- What #36192 measured, for the card: production run 46118151955
uploaded 954.6 MB / 13,039 files before #38264. Offline,
content-deduplicated: 742.8 MiB before, 631.7 MiB after #38264 (−15.0%).
The first scheduled deploy after #38264 (run 46146191991) uploaded 742.8
MB / 13,039 files by the CLI's own lines (−22.2%), read on the card in
7239573592; the two scales are not reconciled. The claim (7237738388)
replaced the card's "well under half" target with the measured
reduction; the reader-visible remainder (function code 188.5 MiB, the
compiled collection twice; the trimmed tree still ~48 KB per page) goes
to the maintainer as a decision.
## Verification
Read first: the new step in `.github/workflows/docs-deploy.yml`, above
`Deploy the prebuilt output to production`.
Two-minute check: after merge, the next Docs Deploy run (scheduled, or
"Run workflow" on `main`) shows a `Docs deploy output` table in its
summary and the deploy still reaches `Deployed:`.
<details><summary>Gates at cd1513f</summary>
- `node scripts/pm/dispatch-gates.mjs --commands`: 36 derived families,
each run with its exit captured before any pipe, all exit 0 (one sweep
under the verify lock, 896 s; list in the card's project files as
`gates-ran-pr2-cd1513fc.list`); `--ran`: 36 derived, 36 run, 0
NOT-MEASURED, 0 UNRUN (a derived zero).
- `node scripts/pm/overlap-check.mjs`: VERDICT clean, merges cleanly
into origin/main.
- `dispatch-gates.mjs --tier .github/workflows/docs-deploy.yml`: no
path-derived mandate. The path is a governed surface (Tier H): landing
needs the maintainer's approval.
- Every family CI runs: the PR's check-runs.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 333e6f3 commit 4cb162b
1 file changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
191 | 225 | | |
192 | 226 | | |
193 | 227 | | |
| |||
0 commit comments