Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR adds GVS hoisted-child symlink creation across Rust and JavaScript installation paths, with runtime coverage for transitive dependency resolution. It also changes ChangesGlobal virtual store dependency resolution
CLI deprecate behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant InstallCommand
participant LinkPipeline
participant getHoistedDependencies
participant GVSNodeModules
InstallCommand->>LinkPipeline: pass dependency graph and hoist patterns
LinkPipeline->>getHoistedDependencies: compute hoisted child aliases
getHoistedDependencies-->>LinkPipeline: return alias-to-package mappings
LinkPipeline->>GVSNodeModules: merge mappings and create symlinks
Assessment against linked issues
Out-of-scope changes
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Confidence Score: 5/5
Reviews (24): Last reviewed commit: "style(gvs): collapse long let binding to..." | Re-trigger Greptile |
060bc46 to
a40a213
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pnpm/crates/cli/src/cli_args/dispatch_query.rs (1)
244-245: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove comment that narrates the function body.
The comment "The handler is synchronous, so this resolves to a ready future once the output is printed" restates what the code already makes obvious. The leading fragment "print split" is unclear. Per coding guidelines, comments should only capture non-obvious rationale, not describe what the code does.
♻️ Suggested change
-// print split. The handler is synchronous, so this resolves to a ready future -// once the output is printed. pub(super) fn pack<'a>(ctx: &RunCtx<'a>, args: &PackArgs) -> miette::Result<CommandFuture<'a>> {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/cli_args/dispatch_query.rs` around lines 244 - 245, Remove the adjacent comment above the synchronous handler’s output-printing logic, including the unclear “print split” fragment and the explanation about the ready future; leave the implementation unchanged.Sources: Coding guidelines, Path instructions
pnpm/crates/package-manager/src/create_symlink_layout.rs (1)
45-143: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoffGVS hoisted-children symlink helper looks correct.
Target/dest computation, self-name + direct-dep skip guards, and the pre-create-dirs-then-parallel-symlink ordering are sound.
One optional consideration:
get_hoisted_dependenciesis recomputed per snapshot inside the rayon pass, so total work scales as O(snapshots × graph). It is parallelized, but on very large graphs this could dominate the hoist phase. Worth confirming against a large fixture if not already measured.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/package-manager/src/create_symlink_layout.rs` around lines 45 - 143, Measure create_gvs_hoisted_children_symlinks with a large snapshot/graph fixture to confirm whether per-snapshot get_hoisted_dependencies calls dominate runtime. If confirmed, reduce repeated hoist computation through an appropriate cache or reuse strategy while preserving each snapshot’s dependency-specific results and existing parallel symlink behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/dispatch_query.rs`:
- Around line 244-245: Remove the adjacent comment above the synchronous
handler’s output-printing logic, including the unclear “print split” fragment
and the explanation about the ready future; leave the implementation unchanged.
In `@pnpm/crates/package-manager/src/create_symlink_layout.rs`:
- Around line 45-143: Measure create_gvs_hoisted_children_symlinks with a large
snapshot/graph fixture to confirm whether per-snapshot get_hoisted_dependencies
calls dominate runtime. If confirmed, reduce repeated hoist computation through
an appropriate cache or reuse strategy while preserving each snapshot’s
dependency-specific results and existing parallel symlink behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0883c1b7-db11-4cbc-9ce0-2db7735aca93
📒 Files selected for processing (9)
pnpm/crates/cli/src/cli_args/deprecate.rspnpm/crates/cli/src/cli_args/dispatch_query.rspnpm/crates/cli/tests/deprecate.rspnpm/crates/package-manager/src/create_symlink_layout.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-installer/test/install/globalVirtualStore.tspnpm11/installing/deps-restorer/src/index.ts
💤 Files with no reviewable changes (1)
- pnpm/crates/cli/tests/deprecate.rs
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/src/cli_args/dispatch_query.rs`:
- Around line 246-261: Update pnpm/crates/cli/src/cli_args/dispatch.rs routing
to call dispatch_query::pack(ctx, &args), and remove or replace the
CliCommand::Change|Version|Lane and CliCommand::Star|Unstar|Stars arms that
reference missing handlers. The sites in
pnpm/crates/cli/src/cli_args/dispatch_query.rs at lines 149, 180, and 246-261
require no direct change; use the existing pack function signature and available
handlers as the routing targets.
In `@pnpm11/installing/deps-installer/src/install/link.ts`:
- Around line 604-633: Honor optional-dependency filtering in every GVS hoist
implementation: in pnpm11/installing/deps-installer/src/install/link.ts lines
604-633, pass the optional setting into getGvsHoistedChildrenPaths and exclude
depNode.optionalDependencies when optional dependencies are disabled; in
pnpm/crates/package-manager/src/install_frozen_lockfile.rs lines 1245-1261, pass
whether DependencyGroup::Optional is included; and in
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs lines 1940-1956,
pass the fresh install’s effective optional-inclusion state.
- Around line 448-452: Update the GVS reconciliation flow around
enableGlobalVirtualStore and hoistPattern so hoist-setting or hoist-graph
changes refresh all affected existing slots, not only newPkgs and direct-child
updates. Include removed GVS-hoisted aliases in removedAliases and ensure the
no-change early return is bypassed when the desired GVS children differ.
Preserve existing behavior for unaffected slots.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5cf74f63-8155-4324-bbbb-62920c043596
📒 Files selected for processing (9)
pnpm/crates/cli/src/cli_args/deprecate.rspnpm/crates/cli/src/cli_args/dispatch_query.rspnpm/crates/cli/tests/deprecate.rspnpm/crates/package-manager/src/create_symlink_layout.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-installer/test/install/globalVirtualStore.tspnpm11/installing/deps-restorer/src/index.ts
💤 Files with no reviewable changes (1)
- pnpm/crates/cli/tests/deprecate.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- pnpm11/installing/deps-restorer/src/index.ts
- pnpm/crates/package-manager/src/create_symlink_layout.rs
- pnpm/crates/cli/src/cli_args/deprecate.rs
a40a213 to
9a78d7a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/installing/deps-installer/test/install/globalVirtualStore.ts`:
- Around line 540-573: Extend the test “GVS package runtime can resolve hoisted
transitive dependencies” with a CommonJS probe alongside the existing probe.mjs
ESM check. Write a .cjs file in the same package directory that requires
`@pnpm.e2e/dep-of-pkg-with-1-dep`, then execute it and assert successful
resolution, preserving the existing ESM assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 76c1e625-9fe9-4fa7-9afe-caf1a80371a5
📒 Files selected for processing (6)
pnpm/crates/package-manager/src/create_symlink_layout.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-installer/test/install/globalVirtualStore.tspnpm11/installing/deps-restorer/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs
- pnpm/crates/package-manager/src/create_symlink_layout.rs
- pnpm11/installing/deps-installer/src/install/link.ts
- pnpm11/installing/deps-restorer/src/index.ts
9a78d7a to
3b73241
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/installing/deps-installer/src/install/link.ts`:
- Around line 607-650: Update getGvsHoistedChildrenPaths so direct child aliases
are reserved even when their childDepPath is a workspace/local link absent from
depGraph; reuse the complete aliases emitted by getChildrenPaths, or otherwise
track all entries in depNode.children, before adding hoistedChildren. Ensure
link: aliases cannot be selected or overwritten during the subsequent
Object.assign merge.
- Around line 588-605: Update the symlinkAllModules preparation around
getGvsHoistedChildrenPaths so invariant GVS hoist-pattern merging occurs once
outside the depNodes.map loop, and reuse any available project-level hoist
result instead of traversing depGraph for each depNode. Preserve the existing
children, modules, and name mappings while eliminating repeated graph-wide work.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9915bb9b-1989-4de0-8f2a-8ccc704dc205
📒 Files selected for processing (6)
pnpm/crates/package-manager/src/create_symlink_layout.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-installer/test/install/globalVirtualStore.tspnpm11/installing/deps-restorer/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
- pnpm/crates/package-manager/src/create_symlink_layout.rs
- pnpm11/installing/deps-restorer/src/index.ts
3b73241 to
42e4e5e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/installing/deps-installer/test/install/globalVirtualStore.ts`:
- Around line 605-606: Replace execSync and its shell-interpolated command in
the global virtual store test with execFileSync, passing node and probeFile as
separate arguments while preserving the existing stdio option and no-throw
assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0b98ff49-e038-42d9-a235-152011309f33
📒 Files selected for processing (6)
pnpm/crates/package-manager/src/create_symlink_layout.rspnpm/crates/package-manager/src/install_frozen_lockfile.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm11/installing/deps-installer/src/install/link.tspnpm11/installing/deps-installer/test/install/globalVirtualStore.tspnpm11/installing/deps-restorer/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs
- pnpm11/installing/deps-restorer/src/index.ts
- pnpm/crates/package-manager/src/create_symlink_layout.rs
- pnpm11/installing/deps-installer/src/install/link.ts
03e96ec to
62467da
Compare
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
62467da to
0ffb65e
Compare
0ffb65e to
0a8d42b
Compare
|
@zkochan could you take a look at it? Thanks! |
1266c9a to
5708a10
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Code Review by Qodo
1. Headless installs omit hoisted links
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical optional-dependency, symlink-configuration, and stale-link issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (12)
Honor include_optional when computing GVS hoists · New Honor symlink=false in GVS linking · New Clean stale aliases from shared GVS slots · New Remove stale pattern-dependent GVS aliases · New Avoid quadratic repeated hoist graph traversals · New Reconcile GVS links on all-warm installs · New Avoid per-package quadratic hoist computation · New Filter optional children before GVS hoisting · New Repair GVS links on warm headless installs · New Avoid repeated hoist traversals during relinking · New Exclude optional-only dependencies from GVS hoists · New Add Rust regression coverage for GVS hoisting · New
5708a10 to
b209d50
Compare
|
Code review by qodo was updated up to the latest commit b209d50 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
zkochan
left a comment
There was a problem hiding this comment.
no, we can't accept this solution. The gvs can't have symlinks specific to a project's context as that context may vary in different projects.



Summary
When
enableGlobalVirtualStore: true, packages that execute code from the global links store (e.g. Angular build workers, Nuxt postinstall scripts) fail to resolve transitive dependencies because Node's module resolution cannot reach deps that are only wired into the project's local hoist location. This fix creates symlinks for hoisted transitive dependencies inside each GVS slot'snode_modules/, mirroring the project-level hoist structure so runtime resolution works from the links store.Closes #12437.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit