Skip to content

fix(config): respect explicit enableGlobalVirtualStore in CI environments - #10836

Merged
zkochan merged 2 commits into
pnpm:mainfrom
vsumner:fix/ci-respect-explicit-gvs
Mar 3, 2026
Merged

zkochan merged 2 commits into
pnpm:mainfrom
vsumner:fix/ci-respect-explicit-gvs

Conversation

@vsumner

@vsumner vsumner commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

What

When ci: true (auto-detected via ci-info or configured), pnpm unconditionally sets enableGlobalVirtualStore to false. This change makes the override conditional: CI only disables GVS when the user hasn't explicitly set it.

// Before
if (pnpmConfig.ci) {
  pnpmConfig.enableGlobalVirtualStore = false
}

// After
if (pnpmConfig.ci && pnpmConfig.enableGlobalVirtualStore == null) {
  pnpmConfig.enableGlobalVirtualStore = false
}

Why

The current behavior prevents valid use cases:

  • Nix builds that construct the GVS (not consume it) — Nix runs in a CI-like environment but needs GVS enabled
  • CI systems with persistent caches between runs (e.g., GitHub Actions with cache keys)
  • Docker multistage builds that pre-build the store in one layer

Existing tests already document this as a pain point:

// pnpm/test/install/globalVirtualStore.ts
ci: false, // We force CI=false because enableGlobalVirtualStore is always disabled in CI

What changed

  • config/config/src/index.ts: One-line conditional change
  • config/config/test/index.ts: Two new tests — one verifying CI still disables GVS by default, one verifying explicit config is respected
  • pnpm/test/install/globalVirtualStore.ts: Removed ci: false workaround
  • pnpm/test/list.ts: Removed ci: false workaround
  • .changeset/ci-respect-explicit-gvs.md: Changeset (patch for @pnpm/config and pnpm)

Behavior change: None for users who haven't explicitly set enableGlobalVirtualStore. CI still disables GVS by default. Only users who explicitly opt in via pnpm-workspace.yaml or CLI will see their setting respected.

@vsumner
vsumner requested a review from zkochan as a code owner March 2, 2026 17:54
Copilot AI review requested due to automatic review settings March 2, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 enableGlobalVirtualStore override conditional on the setting being unset.
  • Add config-level tests to cover CI default behavior vs explicit user configuration.
  • Remove ci: false workarounds 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.

Comment thread config/config/src/index.ts Resolved
…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.
@vsumner
vsumner force-pushed the fix/ci-respect-explicit-gvs branch from 335702e to 44dc048 Compare March 2, 2026 18:07
@vsumner

vsumner commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

The Compile & Lint CI failure is pre-existing on main — the latest main CI run (#22584602094) fails with the same global/commands/package.json is not up-to-date meta-updater error. This was introduced by recent commits on main (likely related to global/commands being a new package without a test/ directory). Happy to rebase once main CI is green.

Also applied the Copilot suggestion to soften "never" → "usually" in the comment.

@vsumner

vsumner commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

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 enableGlobalVirtualStore: true in pnpm-workspace.yaml or CLI. This avoids surprising behavior changes for users who haven't opted in.

@zkochan

zkochan commented Mar 2, 2026

Copy link
Copy Markdown
Member

I don't understand. This is completely the same as just removing the override. The other PR has the same result in all scenarios.

@zkochan
zkochan merged commit 9f5c0e3 into pnpm:main Mar 3, 2026
10 checks passed
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
schickling added a commit to overengineeringstudio/effect-utils that referenced this pull request Mar 23, 2026
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]>
dubzzz pushed a commit to dubzzz/fast-check that referenced this pull request Apr 11, 2026
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`.
gustavoignis pushed a commit to silverprotocol/typescript-sdk that referenced this pull request Nov 9, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants