Skip to content

Commit 44fecec

Browse files
committed
ci: census pnpm acquisition by need, not by mechanism spelling
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. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
1 parent 5cb62d8 commit 44fecec

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
@@ -1654,6 +1654,30 @@ jobs:
16541654
- name: Node-version drift guard
16551655
run: pnpm check:node-version
16561656

1657+
# pnpm-acquisition census. Sibling of the guard above, and here for the
1658+
# failure the guard above cannot have: a census that reaches ZERO while
1659+
# the thing it measures is still there. The `corepack enable` sites are
1660+
# moving onto .github/actions/setup-pnpm, and when that finishes a grep
1661+
# for `corepack enable` returns 0 — a true answer about Corepack that
1662+
# reads as a complete answer about pnpm acquisition. It is not one:
1663+
# showcase-smoke.yml acquires pnpm through `pnpm/action-setup`, which
1664+
# contains no Corepack string and is invisible to that key. A metric that
1665+
# hits zero while its subject survives is worse than no metric, because it
1666+
# retires the attention.
1667+
#
1668+
# So this gate is keyed on the NEED, not the mechanism: the population is
1669+
# every job that RUNS pnpm. A mechanism nobody has taught it cannot become
1670+
# a silent zero — it surfaces as a job running pnpm with no recognised
1671+
# acquisition, which fails loudly. It prints the full census on SUCCESS
1672+
# (every mechanism keeps a row, including the ones at 0), so the answer to
1673+
# "how does CI get pnpm" is one job log rather than a grep nobody thinks
1674+
# to re-derive. It also pins the ordering that killed two jobs in this
1675+
# repo with "Unable to locate executable file: pnpm": a setup-node asking
1676+
# for the pnpm store cache shells out to pnpm, so pnpm must be acquired
1677+
# strictly earlier. Runs its own --self-test first.
1678+
- name: pnpm-acquisition census
1679+
run: pnpm check:pnpm-acquisition
1680+
16571681
# Workflow status-function guard (#5343, from #4900 and #4928). GitHub
16581682
# wraps any `if:` that names no status function in an IMPLICIT success().
16591683
# 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
@@ -104,6 +104,7 @@
104104
"check:release-page-status": "node scripts/check-release-page-status.mjs --self-test && node scripts/check-release-page-status.mjs",
105105
"check:release-body": "node scripts/release-github-releases.mjs --self-test",
106106
"check:node-version": "node scripts/check-node-version.mjs",
107+
"check:pnpm-acquisition": "node scripts/check-pnpm-acquisition.mjs --self-test && node scripts/check-pnpm-acquisition.mjs",
107108
"check:workflow-status-functions": "node scripts/check-workflow-status-functions.mjs --self-test && node scripts/check-workflow-status-functions.mjs",
108109
"check:shard-attestation": "node scripts/check-shard-attestation.mjs --self-test && node scripts/check-shard-attestation.mjs",
109110
"check:required-contexts": "node scripts/check-required-contexts.mjs --self-test && node scripts/check-required-contexts.mjs",

0 commit comments

Comments
 (0)