Repository navigation
Conversation
Collect required peers from the resolved dependency graph before auto-installing them. Shared child-resolution results can omit peers supplied by another importer, and deeper occurrences cannot safely await the owner promise. Keep optional-peer discovery unchanged and filter providers at each dependency level. Closes #14840.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe resolver now discovers missing transitive peers from resolved dependency graphs during auto-installation. Tests cover cycles, deep dependency chains, workspace dependency depths, importer order, peer validation, and frozen-lockfile reproducibility. A changeset declares patch releases. ChangesTransitive peer resolution
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant WorkspaceInstall
participant resolveRootDependencies
participant collectMissingRequiredPeers
participant Lockfile
WorkspaceInstall->>resolveRootDependencies: resolve importers with autoInstallPeers
resolveRootDependencies->>collectMissingRequiredPeers: inspect resolved dependency roots
collectMissingRequiredPeers-->>resolveRootDependencies: return transitive missing peers
resolveRootDependencies->>Lockfile: resolve complete peer contexts
Lockfile-->>WorkspaceInstall: support frozen-lockfile installation
Assessment against linked issues
Suggested labels: Suggested reviewers: Merge Risk: ⚪ Minimal · up to The peer-resolution change preserves dependency-level provider handling and is covered by workspace and lockfile regression tests. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/installing/deps-resolver/src/resolveDependencies.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. pnpm11/installing/deps-resolver/test/collectMissingRequiredPeers.test.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 |
PR Summary by QodoFix transitive peer auto-installation across workspace depths
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Visit each package once per required peer name and stop at provider subtrees. Use iterative traversal to avoid stack overflow in deep graphs. Cover dense cycles, a 20,000-package chain, and provider visibility across shared subtrees.
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Avoid rescanning the graph for each distinct absent peer. Collect their constraints directly, and reserve provider-aware traversal for names with a possible provider. Add a deterministic regression covering 500 distinct peers along a dependency chain.
|
Code review by qodo was updated up to the latest commit 3cb2efb |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…hs (pnpm#14841) Shared child-resolution results can omit peers supplied by the owning importer's ancestors. A deeper occurrence also cannot safely await the shallower owner's promise because that can deadlock on dependency cycles. Before auto-installing peers, collect missing required peers from the resolved dependency graph and filter providers at each dependency level. Collect peers with no possible provider directly in one graph pass. For peers with possible providers, visit each package at most once per name and stop at subtrees with a provider. Use iterative traversal to handle deep graphs and dense dependency cycles without enumerating paths. Keep optional-peer collection and the child-resolution ownership rules unchanged. Cover two workspace projects sharing a local package at different depths, both importer orders, strict peer checks, one complete child snapshot, and a frozen-lockfile reinstall. Closes pnpm#14840.
…hs (pnpm#14841) Shared child-resolution results can omit peers supplied by the owning importer's ancestors. A deeper occurrence also cannot safely await the shallower owner's promise because that can deadlock on dependency cycles. Before auto-installing peers, collect missing required peers from the resolved dependency graph and filter providers at each dependency level. Collect peers with no possible provider directly in one graph pass. For peers with possible providers, visit each package at most once per name and stop at subtrees with a provider. Use iterative traversal to handle deep graphs and dense dependency cycles without enumerating paths. Keep optional-peer collection and the child-resolution ownership rules unchanged. Cover two workspace projects sharing a local package at different depths, both importer orders, strict peer checks, one complete child snapshot, and a frozen-lockfile reinstall. Closes pnpm#14840.
Summary
Fixes missing transitive peers when workspace projects share a dependency at different depths. A peer supplied by one project no longer prevents
autoInstallPeersfrom installing it for another project, and the lockfile contains one complete peer context.Closes #14840.
This is a pnpm v11 bug fix. The original reproduction passes on pnpm v12, so no Rust changes are needed.
Validation:
pnpm peers checkreports no issues.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 (Codex, GPT-6).
Summary by CodeRabbit
pnpm installnow automatically installs missing transitive peer dependencies when workspace projects share dependencies at different levels.