You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: ignore the version of a lone project in the dependency-status check - #17561
Bumping only the version of a single-project repository made verifyDepsBeforeRun report "The workspace structure has changed since last install" and spawn an install before the script. In pnpm v12 the install fast path re-resolved too.
The dependency-status check compares each recorded project's name and version with its manifest. A project's version decides only how other workspace projects' dependencies resolve to it, so the version is now compared only when the workspace has more than one project, or when linkWorkspacePackages is deep (a transitive dependency may then resolve to the lone project). The name, the project set, and every other check stay as they were. Multi-project workspaces keep the strict comparison: a dependent's workspace:^1 or a linked range can stop matching after a bump.
Fixed in both stacks:
v12: project_structure_matches in pnpm/crates/package-manager/src/optimistic_repeat_install/settle.rs (shared by the run gate, the install fast path, and the relocation check). It now takes the config to read linkWorkspacePackages.
v11: findWorkspaceStructureIssue in pnpm11/deps/status. v11 reaches this check only when a pnpm-workspace.yaml exists, as in the issue's repro.
The issue's repro on a fixed v12 debug build: the warn run prints no warning, the default run starts no install.
New Rust unit tests: a lone project's bump passes both the install fast path and the run gate (each checked against the original state), and is refused under deep linking and in a two-project workspace. Each gate's assertion and the deep rule were checked by sabotage.
New v11 unit test and e2e test (singleProjectWorkspace.ts). The e2e fails on a bundle patched to always compare versions.
The dependency-status check compared each workspace project's recorded
name and version with its manifest, so bumping the version of a
single-project repository made verifyDepsBeforeRun report drift and
spawn an install, and made the install fast path re-resolve.
A project's version only decides how other projects' dependencies
resolve to it, so it is compared only when the workspace has several
projects, or when linkWorkspacePackages is deep and a transitive
dependency may resolve to the lone project. The name stays compared
everywhere. Fixed in both the v11 and
v12 dependency-status checks.
Closes pnpm/pnpm#17560
Checklist
I checked the referenced issue and verified that none of the PRs
already linked to it solves it.
New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
are implemented in every affected version.
Added a changeset (pnpm changeset) if this PR changes any published
package. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5-5).
Summary by CodeRabbit
Bug Fixes
In a single-project workspace, changing only the project version no longer triggers an out-of-sync dependency warning or requires an install before running a script when workspace linking is not set to deep.
With deep workspace linking enabled, version changes are recognized as workspace structure changes.
Version changes in multi-project workspaces continue to be recognized as workspace structure changes.
The dependency-status check compared each workspace project's recorded
name and version with its manifest, so bumping the version of a
single-project repository made `verifyDepsBeforeRun` report drift and
spawn an install, and made the install fast path re-resolve.
A project's version only decides how other projects' dependencies
resolve to it, so it is compared only when the workspace has several
projects. The name stays compared everywhere.
Fixes#17560
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Files skipped from review as they are similar to previous changes: 1
.changeset/lone-project-version-bump.md
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Walkthrough
The dependency-status and optimistic repeat-install checks now compare project versions only for multi-project workspaces or when linkWorkspacePackages is Deep. Tests cover version changes, project renames, and script execution after a single-project version-only change.
Changes: Single-project version checks
Layer / File(s)
Summary
Dependency status and script verification pnpm11/deps/status/src/findWorkspaceStructureIssue.ts, pnpm11/deps/status/test/findWorkspaceStructureIssue.test.ts, pnpm11/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts, .changeset/lone-project-version-bump.md
The dependency-status check compares versions for multiple projects or when deep linking is enabled. Tests cover single-project and multi-project version changes, a project rename, and script execution after a version-only change. The changeset records patch releases for @pnpm/deps.status, pnpm, and pacquet.
The repeat-install check compares versions for multiple projects or when workspace linking is Deep. Configuration is passed into workspace-state relocation and structure checks. Tests cover single-project version changes under different linking modes and a multi-project version change.
Prevent a version-only change to a single private root project from triggering a dependency-state warning or pre-script install [#17560]
✅
Possibly related issues
pnpm/pnpm#17560 — The change addresses the reported single-project version-only check while retaining version checks for multiple projects and deep workspace linking.
A version-only change to a single-project workspace no longer triggers a spurious outdated-dependencies warning or install. Multi-project workspaces and deep workspace linking keep strict version comparison. No actionable merge-blocking risk remains.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
test now reaches blacksmith.blob.core.windows[.]net test no longer reaches blacksmith.blob.core.windows[.]net test no longer reaches registry.npmjs[.]org
HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.
Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.
Scenario
Engine
Syscall
main calls (max)
HEAD calls (min)
Change
Tolerance
Identical-run spread
Result
isolated-fresh-restore-cold-cache-cold-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-restore-cold-cache-cold-store
pnpr
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-restore-hot-cache-hot-store
pacquet
statx
48340
48345
+0.0%
966
4
Within tolerance
isolated-fresh-restore-hot-cache-hot-store
pnpr
access
11
11
+0.0%
50
0
Within tolerance
isolated-repeat-install-hot-cache-hot-store
pacquet
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-hot-cache-hot-store
pnpr
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-cold-cache-hot-store
pacquet
access
8
8
+0.0%
50
0
Within tolerance
isolated-repeat-install-cold-cache-hot-store
pnpr
access
8
8
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-cold-store
pacquet
access
11
11
+0.0%
50
0
Within tolerance
isolated-fresh-install-cold-cache-cold-store
pacquet
readlink
16893
15564
-7.9%
337
934
Unstable (identical runs differ by 934, not gated)
Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.
The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.
Scenario: Isolated linker: fresh restore, cold cache + cold store
Scenario: GVS linker: fresh restore, hot cache + hot store
Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
Scenario: Store only: unlocked direct deps, cold cache + hot store
Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.
Scenario: Cargo: repeat install, hot cache + hot store
Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Ignore lone-project version bumps in dependency-status checks
🐞 Bug fix🧪 Tests🕐 20-40 Minutes
AI Description
• Ignore a lone project's version bump when checking workspace structure in pnpm v11 and v12.
• Preserve project-name and membership checks, and version checks for multi-project workspaces.
• Add regression tests and patch changesets for affected packages.
Diagram
graph TD
A["v12 callers"] --> C["Compare project set"] --> D{"Multiple projects?"} -->|No| E["Compare names"] -->|Match| G["Other checks"]
B["v11 status"] --> C
D -->|Yes| F["Compare names versions"] -->|Match| G
E -->|Mismatch| H["Structure drift"]
F -->|Mismatch| H
Loading
High-Level Assessment
The following are alternative approaches to this PR:
1. Compare only referenced workspace-project versions
➕ Could avoid rejecting version bumps in multi-project workspaces with no affected dependents.
➖ Requires dependency-resolution analysis in a structure check and increases the risk of missing linked or range-based relationships.
Recommendation: Keep the project-count rule. It fixes the lone-project case while preserving the conservative multi-project safeguard without adding dependency-graph analysis.
Files changed (6) +137 / -3
Bug fix (2) +13 / -3
settle.rsSkip lone-project version comparisons in v12+8/-2
Skip lone-project version comparisons in v12
• The shared workspace-structure check now compares versions only when there is more than one project. Project count, directory keys, and names remain required to match.
findWorkspaceStructureIssue.tsSkip lone-project version comparisons in v11+5/-1
Skip lone-project version comparisons in v11
• The workspace-structure check now ignores version differences for a single project while retaining project-set and name comparisons and strict version checks for larger workspaces.
workspace.rsCover v12 install and run decisions after version bumps+48/-0
Cover v12 install and run decisions after version bumps
• Adds tests showing that a lone-project version bump passes both the optimistic install check and run dependency-status check, while a bump in a two-project workspace remains rejected.
singleProjectWorkspace.tsTest script execution after a lone-project version bump+21/-0
Test script execution after a lone-project version bump
• Adds an end-to-end case that installs a single-project workspace, bumps its version, and confirms its script runs with verifyDepsBeforeRun set to error.
1. The release note combines two user-visible outcomes✓ Resolved
Description
The changeset sentence says verifyDepsBeforeRun both stops reporting a lone-project version change
as drift and stops installing before scripts run. These are separate observable effects that should
be stated as separate sentences so each release-note entry describes one logical change.
+`verifyDepsBeforeRun` no longer reports dependencies as out of sync, or installs before running a script, when only the `version` field of a single-project repository changed [#17560](https://github.com/pnpm/pnpm/issues/17560).
Evidence
The added changeset sentence joins two separate observable effects with or, which matches the
checklist's compound-sentence failure criterion.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The changeset entry combines two distinct user-visible outcomes in one sentence: the dependency-status warning is suppressed, and an unnecessary install is avoided.
## Fix Focus Areas
- .changeset/lone-project-version-bump.md[7-7]
## Recommended Fix
Rewrite the release note as two sentences, with one sentence stating that `verifyDepsBeforeRun` no longer reports a lone project's version-only change as out of sync, and a second sentence stating that it no longer installs before running a script for that change.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Context sources
⚠️ Tickets: not configured — No jira, linear integration is connected for the linked tickets
1. The release note combines two user-visible outcomes✓ Resolved
Description
The changeset sentence says verifyDepsBeforeRun both stops reporting a lone-project version change
as drift and stops installing before scripts run. These are separate observable effects that should
be stated as separate sentences so each release-note entry describes one logical change.
+`verifyDepsBeforeRun` no longer reports dependencies as out of sync, or installs before running a script, when only the `version` field of a single-project repository changed [#17560](https://github.com/pnpm/pnpm/issues/17560).
Evidence
The added changeset sentence joins two separate observable effects with or, which matches the
checklist's compound-sentence failure criterion.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The changeset entry combines two distinct user-visible outcomes in one sentence: the dependency-status warning is suppressed, and an unnecessary install is avoided.
## Fix Focus Areas
- .changeset/lone-project-version-bump.md[7-7]
## Recommended Fix
Rewrite the release note as two sentences, with one sentence stating that `verifyDepsBeforeRun` no longer reports a lone project's version-only change as out of sync, and a second sentence stating that it no longer installs before running a script for that change.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
With `linkWorkspacePackages: deep` a transitive dependency may resolve
to the lone project by its version, so its version stays compared there.
The Rust test now restores the recorded state between the install and
run gates, so each gate is checked against the original state, and
validates the bumped manifest so only the structure check can fire.
The changeset states its two effects in separate sentences.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
…ething can resolve to it (#17579)
Bumping the version of a workspace project that nothing depends on made
both dependency-status checks report "The workspace structure has
changed since last install", so verifyDepsBeforeRun reinstalled before
every script and the install fast path re-resolved, though a full
install changed nothing.
A version decides only how dependencies resolve to the project, so it
is now compared only when:
- a dependency group of any project or a catalog entry names the
project, directly or through an npm: or workspace: alias;
- an override, a package extension, or a patched dependency mentions
its name (a substring match, which can refuse more than needed but
never misses);
- a pnpmfile is loaded in a workspace of several projects, since a
readPackage hook may add a dependency on any project;
- a dependency or a catalog entry is a local path, such as
workspace:../lib or file:../lib, which names a project by directory
under any alias;
- linkWorkspacePackages is deep.
A lone project keeps the rule from #17561. The repeat-install
oracle now requires both gates to accept such a version bump.
Closespnpm/tasks#246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumping only the
versionof a single-project repository madeverifyDepsBeforeRunreport "The workspace structure has changed since last install" and spawn an install before the script. In pnpm v12 the install fast path re-resolved too.The dependency-status check compares each recorded project's name and version with its manifest. A project's version decides only how other workspace projects' dependencies resolve to it, so the version is now compared only when the workspace has more than one project, or when
linkWorkspacePackagesisdeep(a transitive dependency may then resolve to the lone project). The name, the project set, and every other check stay as they were. Multi-project workspaces keep the strict comparison: a dependent'sworkspace:^1or a linked range can stop matching after a bump.Fixed in both stacks:
project_structure_matchesinpnpm/crates/package-manager/src/optimistic_repeat_install/settle.rs(shared by the run gate, the install fast path, and the relocation check). It now takes the config to readlinkWorkspacePackages.findWorkspaceStructureIssueinpnpm11/deps/status. v11 reaches this check only when apnpm-workspace.yamlexists, as in the issue's repro.Closes #17560
Verification
warnrun prints no warning, the default run starts no install.singleProjectWorkspace.ts). The e2e fails on a bundle patched to always compare versions.pnpm-package-manageroptimistic-repeat-install tests (213),pnpm-cliverify_deps_before_run(49),@pnpm/deps.status(188), v11verifyDepsBeforeRune2e (37): all pass.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
🤖 Generated with Claude Code
Written by an agent (Claude Code, claude-opus-5-5).
Summary by CodeRabbit
deep.deepworkspace linking enabled, version changes are recognized as workspace structure changes.