Repository navigation
fix(config): respect explicit enableGlobalVirtualStore in CI environments - #10836
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts pnpm’s config initialization so CI environments only disable the Global Virtual Store (GVS) when it hasn’t been explicitly configured by the user, unblocking workflows like Nix builds and cache-persisted CI runs.
Changes:
- Make the CI-based
enableGlobalVirtualStoreoverride conditional on the setting being unset. - Add config-level tests to cover CI default behavior vs explicit user configuration.
- Remove
ci: falseworkarounds from pnpm integration tests now that explicit GVS is respected in CI.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
config/config/src/index.ts |
Updates CI override logic to only apply when enableGlobalVirtualStore is not explicitly set. |
config/config/test/index.ts |
Adds tests validating CI default disabling vs respecting explicit config. |
pnpm/test/install/globalVirtualStore.ts |
Removes CI workaround since explicit GVS enablement is now honored. |
pnpm/test/list.ts |
Removes CI workaround since explicit GVS enablement is now honored. |
.changeset/ci-respect-explicit-gvs.md |
Adds changeset documenting the behavior change for @pnpm/config and pnpm. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ents Previously, `ci: true` (auto-detected or configured) unconditionally set `enableGlobalVirtualStore` to `false`, even when the user had explicitly enabled it in `pnpm-workspace.yaml` or via CLI. This forced users to add `ci: false` as a workaround in their workspace config whenever they wanted GVS in CI-like environments (Nix builds, CI systems with persistent caches, Docker multistage builds). Now, the CI override only applies when `enableGlobalVirtualStore` was not explicitly set (i.e., is `null` or `undefined`). This preserves the default behavior for ephemeral CI while respecting explicit user configuration. Also removes the `ci: false` workarounds from existing tests that were documenting this limitation.
335702e to
44dc048
Compare
|
The Also applied the Copilot suggestion to soften "never" → "usually" in the comment. |
|
Note: #10691 addresses the same issue but removes the CI override entirely. This PR takes a more conservative approach — CI still disables GVS by default (preserving current behavior for ephemeral CI), but respects explicit user configuration via |
|
I don't understand. This is completely the same as just removing the override. The other PR has the same result in all scenarios. |
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
pnpm 10.x hard-disables enableGlobalVirtualStore in CI environments (CI=true), breaking identity convergence for cross-repo link: deps. pnpm 11 (pnpm/pnpm#10836) respects explicit enableGlobalVirtualStore even in CI. Changes: - DEFAULT_AGGREGATE_PACKAGE_MANAGER: [email protected] → [email protected] - commonPnpmPolicySettings: add optimisticRepeatInstall: false (pnpm#10393) and verifyDepsBeforeRun: false (known pnpm 11 issues) - package.json packageManager bump Note: pnpm-lock.yaml and Nix hashes intentionally NOT updated here — the Nix build sandbox uses nixpkgs pnpm (10.32.1) which can read the existing v9 lockfile. Lockfile migration happens when nixpkgs ships pnpm 11. Co-authored-by: Johannes Schickling <[email protected]> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Enables pnpm's experimental `enableGlobalVirtualStore` and reuses it through the existing setup-node `cache: 'pnpm'` path so that the full virtual store (`<store-path>/links/`) is restored between runs and `pnpm install --frozen-lockfile` becomes near-instant once warm. - `pnpm-workspace.yaml`: opt into `enableGlobalVirtualStore: true`. The global virtual store lives at `$(pnpm store path)/links/`, which is already inside the directory cached by `actions/setup-node`. - `build-status.yml`: every setup-node step gains a `cache-dependency-path` that hashes both `pnpm-lock.yaml` and `pnpm-workspace.yaml`, so the very edit that turns GVS on rotates the cache key and forces setup-node to save the new `links/` layout. - `build-status.yml`: every `pnpm install --frozen-lockfile` step is run with `env: CI: 'false'`. pnpm 10.33 still unconditionally disables the global virtual store when it detects CI (the PR that allows an explicit user setting to win, pnpm/pnpm#10836, only ships in pnpm 11.0.0-beta.2+). `ci-info` treats an explicit `CI=false` as an opt-out even when `GITHUB_ACTIONS=true`, so scoping the override to just the install steps keeps CI semantics intact for everything else in the job (vitest, codecov, etc.). The `documentation` job's "Generate API reference" step is split in two so the `CI=false` scope stays on the install and does not leak into `docs-ci`.
The root and SDK package.json pin pnpm 12.16.0, and both pnpm-workspace.yaml files set `virtualStoreType: global`: packages link from pnpm's machine-wide store (<storeDir>/links) instead of a per-checkout node_modules/.pnpm. pnpm keeps an explicit setting in CI (pnpm/pnpm#10836), so CI and release installs use it too. The comment above the key says how to revert. @google/adk 2.3.0 imports `uuid` without declaring it (dist/esm/plugins/reflect_retry_model_plugin.js:11, cjs :34). The per-project layout reached it only through the hidden hoist, which the global store does not have, so every ADK test file failed to load. A packageExtensions entry declares it, with the range of the existing uuid override. The lockfile's packageManagerDependencies document moves to 12.16.0, @google/adk gains uuid 11.1.1, a packageExtensionsChecksum is recorded, and [email protected] now lists its optional ajv peer. minimumReleaseAgeExclude stays empty: a frozen install passes the supply-chain check without an entry. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What
When
ci: true(auto-detected viaci-infoor configured), pnpm unconditionally setsenableGlobalVirtualStoretofalse. This change makes the override conditional: CI only disables GVS when the user hasn't explicitly set it.Why
The current behavior prevents valid use cases:
Existing tests already document this as a pain point:
What changed
config/config/src/index.ts: One-line conditional changeconfig/config/test/index.ts: Two new tests — one verifying CI still disables GVS by default, one verifying explicit config is respectedpnpm/test/install/globalVirtualStore.ts: Removedci: falseworkaroundpnpm/test/list.ts: Removedci: falseworkaround.changeset/ci-respect-explicit-gvs.md: Changeset (patch for@pnpm/configandpnpm)Behavior change: None for users who haven't explicitly set
enableGlobalVirtualStore. CI still disables GVS by default. Only users who explicitly opt in viapnpm-workspace.yamlor CLI will see their setting respected.