Skip to content

Commit de1cb8d

Browse files
claude[bot]claude
andauthored
ci: census pnpm acquisition by need, not by mechanism spelling (#11779)
A grep for `corepack enable` across .github/workflows/ is on its way to 0 as those sites move onto .github/actions/setup-pnpm. That zero is a true answer about Corepack that reads as a complete answer about pnpm acquisition, and it is not one: showcase-smoke.yml acquires pnpm through pnpm/action-setup, which contains no Corepack string and is invisible to that key. A metric that reaches zero while its subject survives is worse than no metric. check-pnpm-acquisition keys the population on the NEED -- every job that RUNS pnpm -- rather than on any one mechanism spelling, so a mechanism nobody has taught it cannot become a silent zero: it surfaces as a job running pnpm with no recognised acquisition, a loud failure. The full census prints on SUCCESS, every mechanism keeping a row including the ones at 0. It also pins the ordering that killed two jobs here with "Unable to locate executable file: pnpm": a setup-node asking for the pnpm store cache shells out to pnpm, so pnpm must be acquired strictly earlier. That is what makes showcase-smoke.yml's inverted order safe to leave in place, and what catches the naive conversion of it. Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx Co-authored-by: Claude <noreply@anthropic.com>
1 parent 705d321 commit de1cb8d

4 files changed

Lines changed: 615 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,30 @@ jobs:
16711671
- name: Node-version drift guard
16721672
run: pnpm check:node-version
16731673

1674+
# pnpm-acquisition census. Sibling of the guard above, and here for the
1675+
# failure the guard above cannot have: a census that reaches ZERO while
1676+
# the thing it measures is still there. The `corepack enable` sites are
1677+
# moving onto .github/actions/setup-pnpm, and when that finishes a grep
1678+
# for `corepack enable` returns 0 — a true answer about Corepack that
1679+
# reads as a complete answer about pnpm acquisition. It is not one:
1680+
# showcase-smoke.yml acquires pnpm through `pnpm/action-setup`, which
1681+
# contains no Corepack string and is invisible to that key. A metric that
1682+
# hits zero while its subject survives is worse than no metric, because it
1683+
# retires the attention.
1684+
#
1685+
# So this gate is keyed on the NEED, not the mechanism: the population is
1686+
# every job that RUNS pnpm. A mechanism nobody has taught it cannot become
1687+
# a silent zero — it surfaces as a job running pnpm with no recognised
1688+
# acquisition, which fails loudly. It prints the full census on SUCCESS
1689+
# (every mechanism keeps a row, including the ones at 0), so the answer to
1690+
# "how does CI get pnpm" is one job log rather than a grep nobody thinks
1691+
# to re-derive. It also pins the ordering that killed two jobs in this
1692+
# repo with "Unable to locate executable file: pnpm": a setup-node asking
1693+
# for the pnpm store cache shells out to pnpm, so pnpm must be acquired
1694+
# strictly earlier. Runs its own --self-test first.
1695+
- name: pnpm-acquisition census
1696+
run: pnpm check:pnpm-acquisition
1697+
16741698
# Workflow status-function guard (#5343, from #4900 and #4928). GitHub
16751699
# wraps any `if:` that names no status function in an IMPLICIT success().
16761700
# So a job-level condition written to read an upstream job's OUTPUT VALUE

.github/workflows/showcase-smoke.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@ jobs:
1919
timeout-minutes: 45
2020
steps:
2121
- uses: actions/checkout@v7
22+
# ⚠️ This is the ONLY job in the repo that acquires pnpm through
23+
# `pnpm/action-setup`, and the only one using setup-node's `cache: pnpm`.
24+
# Those are the same fact, and the order below is load-bearing — read this
25+
# before "tidying" it onto `.github/actions/setup-pnpm` like every other
26+
# caller.
27+
#
28+
# `cache: pnpm` makes setup-node shell out to pnpm to locate the store, so
29+
# pnpm must already be on PATH when setup-node runs. That is the OPPOSITE
30+
# ordering from every setup-pnpm caller here (setup-node first, then the
31+
# composite). Getting it backwards does not degrade, it kills the job in
32+
# the setup step with "Unable to locate executable file: pnpm" — the
33+
# failure `partof-closing-keyword-guard.yml` and `single-claim-path-guard.yml`
34+
# both carry receipts for. `pnpm check:pnpm-acquisition` fails on that
35+
# inversion, so the naive conversion is caught rather than shipped.
36+
#
37+
# Converting is therefore not a swap: it means DROPPING `cache: pnpm` and
38+
# adding the house pair (`pnpm store path` → actions/cache, as ci.yml does
39+
# seven times over). Deliberately not done here. This job is nightly and
40+
# non-blocking, its one uncached pnpm download is a single fetch rather
41+
# than the per-queue-build multiplier the composite was built to remove,
42+
# and the restructure trades that for re-plumbing the dependency cache of
43+
# a green job nothing gates on. The site is not hidden by staying: it is
44+
# counted and printed by `pnpm check:pnpm-acquisition`, which is keyed on
45+
# jobs that RUN pnpm rather than on any one spelling — precisely so this
46+
# path cannot vanish from a `corepack enable`-shaped census again.
2247
- uses: pnpm/action-setup@v6
2348
- uses: actions/setup-node@v7
2449
with:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"check:release-page-status": "node scripts/check-release-page-status.mjs --self-test && node scripts/check-release-page-status.mjs",
106106
"check:release-body": "node scripts/release-github-releases.mjs --self-test",
107107
"check:node-version": "node scripts/check-node-version.mjs",
108+
"check:pnpm-acquisition": "node scripts/check-pnpm-acquisition.mjs --self-test && node scripts/check-pnpm-acquisition.mjs",
108109
"check:workflow-status-functions": "node scripts/check-workflow-status-functions.mjs --self-test && node scripts/check-workflow-status-functions.mjs",
109110
"check:shard-attestation": "node scripts/check-shard-attestation.mjs --self-test && node scripts/check-shard-attestation.mjs",
110111
"check:required-contexts": "node scripts/check-required-contexts.mjs --self-test && node scripts/check-required-contexts.mjs",

0 commit comments

Comments
 (0)