From a8520f6dfb477b00d7603b6555eb7efbdb20adfa Mon Sep 17 00:00:00 2001 From: donghyeon-ka Date: Sun, 27 Sep 2026 13:20:12 +0900 Subject: [PATCH] fix(fixtures): keep pnpm in a linked fixture from installing (F-4) pnpm verifies the install before a script, and a fixture running it with CI=true against an install made without CI saw other settings and installed through the linked .pnpm and .bin, rewriting the shared lock.yaml and shims. Every fixture pnpm run now turns that check off; a test pins it for all. Co-Authored-By: Claude Opus 5.5 --- .../check-supply-chain-provider-fixtures.ts | 6 +- scripts/lib/fixture-node-modules.ts | 14 ++ scripts/lib/removal-fixture.ts | 9 +- .../security-followup-archive.test.ts | 6 +- .../ci-runner/ci-artifact-contract.test.ts | 6 +- tests/unit/fixture-node-modules.test.ts | 145 +++++++++++++++++- 6 files changed, 177 insertions(+), 9 deletions(-) diff --git a/scripts/check-supply-chain-provider-fixtures.ts b/scripts/check-supply-chain-provider-fixtures.ts index 21646494..80f702d9 100644 --- a/scripts/check-supply-chain-provider-fixtures.ts +++ b/scripts/check-supply-chain-provider-fixtures.ts @@ -41,7 +41,10 @@ import { releaseCandidateManifestSchema, } from "./lib/release-candidate.ts"; import { writeValidatedJsonArtifact } from "./lib/validated-json-artifact.ts"; -import { linkFixtureNodeModules } from "./lib/fixture-node-modules.ts"; +import { + FIXTURE_PNPM_ENVIRONMENT, + linkFixtureNodeModules, +} from "./lib/fixture-node-modules.ts"; const repositoryRoot = process.cwd(); const fixtureRoot = await mkdtemp(path.join(tmpdir(), "provider-exact-five-fixture-")); @@ -74,6 +77,7 @@ try { maxBuffer: 32 * 1024 * 1024, env: { ...process.env, + ...FIXTURE_PNPM_ENVIRONMENT, CI: "true", VITE_BUILD_ID: "provider-exact-five-fixture", VITE_COMMIT_SHA: revision, diff --git a/scripts/lib/fixture-node-modules.ts b/scripts/lib/fixture-node-modules.ts index 85bb7ce2..26e3e7b5 100644 --- a/scripts/lib/fixture-node-modules.ts +++ b/scripts/lib/fixture-node-modules.ts @@ -27,6 +27,20 @@ import path from "node:path"; * the linked directories. It is rewritten to name the fixture root instead: * the packages are the repository's own, already validated. */ +/** + * F-4. The environment for every `pnpm` a linked fixture runs. pnpm verifies + * the install before a script and, when the fixture's copied state disagrees + * with its own settings (for example `CI=true` against an install made + * without it), installs. `.pnpm` and `.bin` are links into the repository's + * node_modules, so that install rewrote the shared `.pnpm/lock.yaml` and bin + * shims. A fixture started through `pnpm