Skip to content

feat(core): add ignoreLockfileSettingsChecks option - #11259

Merged
zkochan merged 1 commit into
v10from
zoltan/ignore-lockfile-settings-checks
Apr 14, 2026
Merged

zkochan merged 1 commit into
v10from
zoltan/ignore-lockfile-settings-checks

Conversation

@zkochan

@zkochan zkochan commented Apr 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds ignoreLockfileSettingsChecks option to @pnpm/core install options
  • When enabled, skips the lockfile settings validation during frozen and preferFrozenLockfile installs, allowing pnpm to proceed as if settings are up to date
  • Prevents LOCKFILE_CONFIG_MISMATCH errors when settings in pnpm-lock.yaml don't match current configuration

Test plan

  • Added test: frozen install succeeds with mismatched autoInstallPeers when ignoreLockfileSettingsChecks: true
  • All existing frozen lockfile tests still pass (13/13)
  • Compiles and lints cleanly

Allow skipping the lockfile settings validation during frozen and
preferFrozenLockfile installs. When enabled, pnpm proceeds as if the
lockfile settings are up to date.
@zkochan
zkochan requested review from gluxon and weyert as code owners April 13, 2026 20:35
Copilot AI review requested due to automatic review settings April 13, 2026 20:35

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@zkochan
zkochan changed the base branch from main to v10 April 13, 2026 20:43
@zkochan
zkochan requested a review from Copilot April 13, 2026 20:44

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

pkg-manager/core/src/install/index.ts:433

  • ignoreLockfileSettingsChecks disables getOutdatedLockfileSetting() entirely, which also affects the preferFrozenLockfile fast-path by keeping needsFullResolution false. There’s a new test for frozenLockfile, but no coverage that preferFrozenLockfile installs with mismatched lockfile settings still proceed (and/or skip resolution) when this flag is enabled. Consider adding a test that exercises the preferFrozenLockfile branch with a settings mismatch and ignoreLockfileSettingsChecks: true to prevent regressions.
    if (!opts.ignorePackageManifest && !opts.ignoreLockfileSettingsChecks) {
      const outdatedLockfileSettingName = getOutdatedLockfileSetting(ctx.wantedLockfile, {
        autoInstallPeers: opts.autoInstallPeers,
        catalogs: opts.catalogs,
        dedupePeers: opts.dedupePeers || undefined,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan
zkochan merged commit 83832f7 into v10 Apr 14, 2026
11 of 15 checks passed
@zkochan
zkochan deleted the zoltan/ignore-lockfile-settings-checks branch April 14, 2026 07:56
zkochan added a commit that referenced this pull request Nov 19, 2026
Port the ignoreLockfileSettingsChecks install option from pnpm v10
(#11259). When enabled, the settings recorded in the lockfile are
not compared with the current configuration, so a mismatch neither fails a
frozen install nor forces a re-resolution.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zkochan added a commit that referenced this pull request Nov 20, 2026
## Summary
Adds the `ignoreLockfileSettingsChecks` install option, which pnpm v10
has (#11259), to the programmatic APIs of both stacks. When it
is enabled, the `settings` recorded in `pnpm-lock.yaml` are not compared
with the current configuration. A mismatch no longer fails a frozen
install with `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH` and no longer makes the
install resolve again. It is not a CLI setting. As in pnpm v10, the
current `overrides` still apply to the project manifests, so a changed
override still makes the lockfile outdated.

**pnpm v11** (`@pnpm/installing.deps-installer`)
- `detectOutdatedLockfileSettings` skips the comparison when the option
is set.
- A frozen install through a pnpr server also honors the option. That
path checks the pnpmfile checksum separately.

**pnpm v12** (`@pnpm/napi`)
- New `ignoreLockfileSettingsChecks` install option, mapped to a new
`InstallLockfilePolicy::ignore_settings_check`.
- The freshness gate (`check_settings`) and the frozen pre-hook
validation (`check_pre_hook_settings_drift`) skip the comparison when it
is set. The other ~100 `InstallLockfilePolicy` / `FreshnessScope`
literals only gain `ignore_settings_check: false`.

## Test plan
- [x] v11: a frozen install succeeds with a mismatched
`autoInstallPeers`, and a prefer-frozen install skips resolution and
keeps the lockfile settings
- [x] v11: a frozen pnpr install accepts a changed pnpmfile checksum
with the option and rejects it without the option
- [x] v12 napi: a frozen install rejects a mismatched
`autoInstallPeers`, accepts it with the option, and a non-frozen install
with the option leaves the lockfile unchanged
- [x] v12 package-manager: a frozen `run` and `validate_frozen` accept a
drifted pnpmfile checksum with `ignore_settings_check`
- [x] Each new test fails when its gate is disabled
- [x] `pnpm-package-manager` + `pnpm-napi` (1429 tests), the smoke
profile, clippy, and the v11 `frozenLockfile.ts` /
`pnprWorkspaceMetadata.ts` suites pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added the `ignoreLockfileSettingsChecks` option for programmatic
installs. It is disabled by default; when enabled, lockfile setting and
pnpmfile checksum mismatches do not fail frozen installs or trigger
dependency resolution.
* **Bug Fixes**
* Frozen and preferred-frozen installs can proceed while retaining the
settings recorded in the lockfile. Current overrides still apply to
project manifests and may make them outdated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

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.

2 participants