|
| 1 | +--- |
| 2 | +--- |
| 3 | + |
| 4 | +ci: validate on the runtime we publish from — pin every workflow to Node 22 (#3825) |
| 5 | + |
| 6 | +CI ran two Node versions at once, and nobody had decided that. All 12 PR gates — |
| 7 | +Build Core, Test Core, TypeScript Type Check, Dogfood, ESLint, spec liveness, |
| 8 | +dep validation — were on **Node 20**, which reached EOL on **2026-04-30**, while |
| 9 | +`release.yml`, `publish-smoke.yml`, `scaffold-e2e.yml` and `showcase-smoke.yml` |
| 10 | +were on **22**. So code was verified on one runtime and shipped from another, |
| 11 | +and the runtime guarding every merge no longer received security patches. |
| 12 | + |
| 13 | +The split was drift, not policy. `release.yml` carried the receipt in a comment |
| 14 | +— *"22 (not 20 like the other workflows)"* — because a downstream clone pinned |
| 15 | +`engines.node >=22` and pnpm aborted on 20. One workflow got bumped to clear one |
| 16 | +error; the other twelve stayed behind, and nothing in CI could see the gap. |
| 17 | + |
| 18 | +It surfaced only by accident in #3812: a test imported `better-sqlite3@13`, |
| 19 | +whose `engines` say `>=22`. `engines` is a declaration, not enforcement, so it |
| 20 | +loaded on Node 20 and then killed the vitest worker with a **process-level |
| 21 | +abort** — no JS error, so the suite reported `Test Files 22 passed (23)` while |
| 22 | +**17 cases silently never ran**. A green check that had quietly stopped running |
| 23 | +the tests. |
| 24 | + |
| 25 | +All 18 `setup-node` steps now run Node 22, matching what release already used. |
| 26 | + |
| 27 | +**`.nvmrc` is now the single source of truth.** It pins contributors' local |
| 28 | +runtime via `nvm use` — previously there was no pin at all, so a contributor on |
| 29 | +Node 24 could not reproduce a Node 20 gate failure — and `check:node-version` |
| 30 | +(new, wired into the unfiltered, always-required `lint` job) holds every |
| 31 | +workflow to it. A version pin is otherwise 18 independent string literals, which |
| 32 | +is why this drifted invisibly for so long; bumping Node is now a one-line edit |
| 33 | +to `.nvmrc` plus whatever the guard reports. The guard also fails a `setup-node` |
| 34 | +step that pins *nothing*, which would silently inherit the runner default. |
| 35 | + |
| 36 | +Nothing about the published packages changes: `engines.node` stays `>=18.0.0` |
| 37 | +across all 49 of them. That is a promise to users about what ships, independent |
| 38 | +of what CI validates on, and tightening it is a breaking change — left for its |
| 39 | +own decision rather than folded in here. |
0 commit comments