Repository navigation
fix(pacquet): preserve locked peers during dedupe - #13459
Conversation
|
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 resolver derives peer providers from workspace lockfile peer suffixes, threads them through required-peer hoisting, and prevents matching missing-peer scopes from being suppressed. Tests cover plain, hashed, and workspace-hoisting cases, and a patch changeset documents the behavior. ChangesLocked peer provider handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant WorkspaceWantedLockfile
participant ImporterHoistState
participant HoistMissingScope
WorkspaceWantedLockfile->>ImporterHoistState: provide snapshot suffixes and package metadata
ImporterHoistState->>ImporterHoistState: derive locked_peer_names
ImporterHoistState->>HoistMissingScope: pass locked_peer_names during hoisting
HoistMissingScope->>HoistMissingScope: bypass suppression for locked peers
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR Summary by QodoFix pacquet dedupe to preserve lockfile-encoded optional peer providers
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Confidence Score: 3/5The PR is not yet safe to merge because the global name-only exemption can auto-hoist a genuinely missing peer into an unrelated importer. A peer name locked by any snapshot is shared with every importer, and suppresses bypasses cross-importer suppression solely by that name, so an unrelated missing peer can be retained and hoisted into a lockfile context that was not previously present. Files Needing Attention: pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs; pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs Reviews (5): Last reviewed commit: "fix(pacquet): filter hashed peer provide..." | Re-trigger Greptile |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Repeated lockfile scan
|
Micro-Benchmark ResultsLinux |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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 `@pnpm/crates/resolving-deps-resolver/src/resolve_importer/tests.rs`:
- Around line 20-54: Add a resolver-level regression test, alongside
only_peer_suffix_versions_are_treated_as_locked_peer_providers, that reproduces
the cross-importer optional-peer scenario and exercises the resolver decision
path through HoistMissingScope::suppresses. Assert the optional peer remains
unsuppressed because it is present in locked_peer_names, so the test fails when
the production guard is removed rather than only validating locked-peer
extraction.
🪄 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: 50cb8297-35e9-4923-a86a-66470b577952
📒 Files selected for processing (4)
.changeset/pacquet-dedupe-locked-peers.mdpnpm/crates/resolving-deps-resolver/src/resolve_importer.rspnpm/crates/resolving-deps-resolver/src/resolve_importer/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_peers.rs
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Addressed the performance finding in 78c69b6: peer names are now extracted from each suffix in one pass, including scoped and nested provider paths, cached once on The other two findings do not apply:
Written by an agent (Codex, GPT-5). |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
During
pnpm dedupe --checkon the n8n workspace, pacquet suppressed importer-local optional peer hoisting when another importer had already traversed the same package. That removed optional peer providers already represented in the wanted lockfile's peer suffixes, producing manybufferutilandutf-8-validatepeer-context differences from the TypeScript CLI.Keep preferred versions that occur in wanted-lockfile peer suffixes eligible for importer-local hoisting. This brings the affected jsdom and vitest peer contexts in n8n in line with the TypeScript CLI.
The n8n comparison still exposes two independent parity gaps outside this fix: applying the
@browserbasehq/stagehandoverride during dedupe, and adding integrity for the git-hostedwa-sqlitetarball.Related to #13305.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.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-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
pacquetpatch update.