Repository navigation
fix(deps.graph-builder): relink a global virtual store slot the current lockfile records - #16663
Conversation
…nt lockfile records A project's current lockfile vouches only for slots that project alone writes. A global virtual store slot is shared, so another project's interrupted install may have re-created it without its child links. Such a slot now stays in the dependency graph as reusable instead of up to date, so the linker restores its children. skipGvsInternalLinking (#11073) still skips linking when the install fetches nothing, because reusable nodes do not count as added. This matches pnpm v12 after #16649. Related to #16642 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughWhen the global virtual store is enabled, unchanged packages remain in the graph. A regression test checks that a frozen-lockfile reinstall restores a dependency link removed from an installed package slot. ChangesGlobal virtual-store relinking
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested labels: Merge Risk: ⚪ Minimal · up to No merge-blocking issue is established. Proceed with normal validation; installs that fetch nothing are not expected to relink incomplete slots. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/deps/graph-builder/src/buildGraphFromPackages.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. pnpm11/installing/deps-installer/test/install/globalVirtualStore.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). 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 |
|
@coderabbitai review |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoRelink reusable global virtual store slots during pnpm v11 installs
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Missing store slots are checked twice
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Summary
The pnpm v11 half of #16649, which fixed pnpm v12 only.
With
enableGlobalVirtualStore,checkPkgDirReusein@pnpm/deps.graph-builderreturnedup-to-datefor any slot the project's current lockfile records, and that slot was dropped from the graph. A global virtual store slot is shared, so another project's interrupted install may re-create it without its dependency links after the record was written. An install that rebuiltnode_modulesthen kept the incomplete slot.Under the global virtual store, such a slot is now
reusable. It stays in the graph without a fetch, so the linker restores its children.#16649 said a v11 fix would have to undo
skipGvsInternalLinking(#11073). That was wrong. The skip applies only whendepGraph.added === 0, andaddedcounts fetched nodes. Reusable nodes don't count, so an install that fetches nothing still skips linking, the same as v12's no-op path. An install that fetches something, like the issue's field case where slots in a new store were missing, now repairs the incomplete slots too.Related to #16642. Once this lands, both versions behave the same. What remains is the no-op install that never checks the store, which is by design.
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.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests