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:
📝 WalkthroughWalkthroughThreads explicit parent-node and parent-package context through resolve_peers, centralizes realized-vs-pending graph-child insertion, strengthens cache/parent matching (including optional peers and version-only compatibility), refactors parent-ref overwrite/version logic, adds tests for alias/diamond scenarios, and updates a CI workflow action. ChangesPeer Resolution Core Refactor and Tests
Sequence Diagram(s)sequenceDiagram
participant CLI_Test
participant Walker
participant resolve_node
participant add_graph_child_or_pending
participant Lockfile
CLI_Test->>Walker: start walk (seed parent refs)
Walker->>resolve_node: resolve_node(parent_node_ids, parent_pkg_ids_chain)
resolve_node->>add_graph_child_or_pending: insert child/peer or defer to pending_peer_edges
add_graph_child_or_pending->>Lockfile: record realized edges / pending edges
resolve_node->>Walker: return resolved node + ParentRefs
Walker->>Lockfile: finalize pending edges and write pnpm-lock.yaml
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
1.
|
Code Review by Qodo
Context used 1. Aliased child peers over-bubble
|
|
Code review by qodo was updated up to the latest commit 6703bbf |
|
Code review by qodo was updated up to the latest commit 185b70a |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12273 +/- ##
==========================================
+ Coverage 87.38% 87.52% +0.13%
==========================================
Files 278 280 +2
Lines 32506 33428 +922
==========================================
+ Hits 28406 29258 +852
- Misses 4100 4170 +70 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code review by qodo was updated up to the latest commit e021c38 |
|
Code review by qodo was updated up to the latest commit 4baed62 |
|
Addressed Qodo’s Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit d682d8e |
|
Addressed Qodo’s Verification:
Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit 6cb8034 |
|
Addressed Qodo’s Verification:
Written by an agent (Codex, GPT-5). |
Integrated-Benchmark Report (Linux)Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 9.96498368688,
"stddev": 0.09442034696101408,
"median": 9.936733990079999,
"user": 3.1659704999999994,
"system": 3.2708764599999993,
"min": 9.86640831858,
"max": 10.18248369358,
"times": [
10.18248369358,
10.01064769658,
9.895579377579999,
9.912326689579999,
9.89602512758,
9.86640831858,
9.905495606579999,
10.03437047558,
9.985358592579999,
9.961141290579999
]
},
{
"command": "pacquet@main",
"mean": 9.954153732879998,
"stddev": 0.127020992347452,
"median": 9.921254166579999,
"user": 3.1563049999999997,
"system": 3.25501196,
"min": 9.85229180058,
"max": 10.28682649158,
"times": [
9.85229180058,
10.28682649158,
9.87505845458,
9.973148450579998,
10.01240101458,
9.940172262579999,
9.908293516579999,
9.934214816579999,
9.892396568579999,
9.866733952579999
]
},
{
"command": "pnpr@HEAD",
"mean": 5.37440098418,
"stddev": 0.11229110234310656,
"median": 5.343192414080001,
"user": 2.5686077,
"system": 2.9290221599999997,
"min": 5.25382981758,
"max": 5.58419732858,
"times": [
5.35334493758,
5.29555773458,
5.33303989058,
5.3683616045800004,
5.58419732858,
5.25382981758,
5.3725801975800005,
5.56797045358,
5.29988125358,
5.31524662358
]
},
{
"command": "pnpr@main",
"mean": 5.4353086706800005,
"stddev": 0.10703705141182497,
"median": 5.4261475490799995,
"user": 2.5760514000000003,
"system": 2.91699866,
"min": 5.31556498758,
"max": 5.59433370058,
"times": [
5.31556498758,
5.45727788858,
5.34184067058,
5.54056840058,
5.39501720958,
5.4858767555800005,
5.33231085458,
5.59433370058,
5.32639706358,
5.5638991755800005
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.66799756696,
"stddev": 0.016044897932155057,
"median": 0.67595531356,
"user": 0.38266290000000003,
"system": 1.33117272,
"min": 0.6437733040600001,
"max": 0.6835120640600001,
"times": [
0.6817976410600001,
0.6748963780600001,
0.6789637960600001,
0.6598654270600001,
0.6835120640600001,
0.6437733040600001,
0.65108027306,
0.6828877280600001,
0.6770142490600001,
0.6461848090600001
]
},
{
"command": "pacquet@main",
"mean": 0.68988544296,
"stddev": 0.06281213447515538,
"median": 0.6635806240600001,
"user": 0.39628450000000004,
"system": 1.34035852,
"min": 0.65871891406,
"max": 0.8649313720600001,
"times": [
0.6614231450600001,
0.66380677606,
0.66284222006,
0.6875972060600001,
0.6613909570600001,
0.8649313720600001,
0.6790029850600001,
0.6957863820600001,
0.6633544720600001,
0.65871891406
]
},
{
"command": "pnpr@HEAD",
"mean": 0.8014552614600001,
"stddev": 0.06308520591484462,
"median": 0.7859624655600002,
"user": 0.4056162,
"system": 1.3467674200000002,
"min": 0.7492533990600001,
"max": 0.9631821790600001,
"times": [
0.8062557570600001,
0.7897613720600001,
0.7504820220600001,
0.7492533990600001,
0.78090016506,
0.9631821790600001,
0.84078266306,
0.7921656350600002,
0.7821635590600001,
0.7596058630600001
]
},
{
"command": "pnpr@main",
"mean": 0.78397074766,
"stddev": 0.012181992706302344,
"median": 0.7772556720600001,
"user": 0.41656630000000006,
"system": 1.34163392,
"min": 0.7705875780600001,
"max": 0.8047884880600001,
"times": [
0.8047884880600001,
0.77536322706,
0.7705875780600001,
0.79347805806,
0.8016168310600001,
0.7763595080600001,
0.7772337540600001,
0.78809458206,
0.7749078600600001,
0.7772775900600001
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 9.331798343420001,
"stddev": 0.03660474738625822,
"median": 9.327309165920001,
"user": 3.8006289800000004,
"system": 3.3224377599999997,
"min": 9.28626545042,
"max": 9.409005505420001,
"times": [
9.318366496420001,
9.29156254842,
9.28626545042,
9.34103869442,
9.36785957442,
9.33625183542,
9.31573852942,
9.409005505420001,
9.34165773242,
9.310237067420001
]
},
{
"command": "pacquet@main",
"mean": 9.29067998852,
"stddev": 0.052265325167259576,
"median": 9.276342360420001,
"user": 3.72971308,
"system": 3.3457407599999995,
"min": 9.228822044420001,
"max": 9.40500780242,
"times": [
9.339530658420001,
9.317843512420001,
9.241413210420001,
9.268362423420001,
9.284322297420001,
9.29594288742,
9.26023035042,
9.40500780242,
9.228822044420001,
9.26532469842
]
},
{
"command": "pnpr@HEAD",
"mean": 5.0830578083199995,
"stddev": 0.04543835609711767,
"median": 5.08954784542,
"user": 2.4225156799999996,
"system": 2.8377803599999996,
"min": 5.020522532419999,
"max": 5.15454772942,
"times": [
5.12231896542,
5.020522532419999,
5.07874348842,
5.15454772942,
5.0307805844199995,
5.05720590042,
5.12300506342,
5.03662699242,
5.10647462442,
5.10035220242
]
},
{
"command": "pnpr@main",
"mean": 5.121674553419999,
"stddev": 0.06885521272892708,
"median": 5.10682162242,
"user": 2.4213716799999996,
"system": 2.84178076,
"min": 5.03823921142,
"max": 5.24270494842,
"times": [
5.22105608442,
5.10733377742,
5.06565665642,
5.0978401374199995,
5.16873765242,
5.11642091142,
5.03823921142,
5.10630946742,
5.05244668742,
5.24270494842
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.51436899068,
"stddev": 0.047602886114390265,
"median": 1.51774994808,
"user": 1.6245906599999997,
"system": 1.8627569999999998,
"min": 1.45786651908,
"max": 1.61857636208,
"times": [
1.45786651908,
1.47260214208,
1.55131088408,
1.61857636208,
1.52332559308,
1.46353584408,
1.49538510308,
1.51226822408,
1.52323167208,
1.52558756308
]
},
{
"command": "pacquet@main",
"mean": 1.4926442256799999,
"stddev": 0.04573369300188756,
"median": 1.4808710285800002,
"user": 1.63204116,
"system": 1.8801020000000002,
"min": 1.45889250408,
"max": 1.61430209808,
"times": [
1.61430209808,
1.5142985310800001,
1.48344940308,
1.47125389408,
1.46746343808,
1.45889250408,
1.49233103608,
1.46151187508,
1.47829265408,
1.48464682308
]
},
{
"command": "pnpr@HEAD",
"mean": 0.67035424418,
"stddev": 0.012411180258385062,
"median": 0.66797772408,
"user": 0.33479256,
"system": 1.2728153,
"min": 0.65284358708,
"max": 0.69302688808,
"times": [
0.69302688808,
0.65284358708,
0.6664994900800001,
0.6799292800800001,
0.67635679908,
0.66300743108,
0.66938457608,
0.6665708720800001,
0.6548771160800001,
0.68104640208
]
},
{
"command": "pnpr@main",
"mean": 0.7191640084800001,
"stddev": 0.04190614941979869,
"median": 0.6967990260800001,
"user": 0.36495866,
"system": 1.296557,
"min": 0.68523895308,
"max": 0.8000534720800001,
"times": [
0.7604865420800001,
0.69864653608,
0.8000534720800001,
0.77221194908,
0.6876933630800001,
0.6899641750800001,
0.69495151608,
0.6943560090800001,
0.70803756908,
0.68523895308
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.0834757676999995,
"stddev": 0.043223050025307665,
"median": 5.073019542199999,
"user": 1.7836535599999999,
"system": 1.9926053400000001,
"min": 5.021619074699999,
"max": 5.1444084747,
"times": [
5.021619074699999,
5.1444084747,
5.1183940387,
5.0643242577,
5.142850409699999,
5.0637281017,
5.028026050699999,
5.073742203699999,
5.0722968807,
5.1053681847
]
},
{
"command": "pacquet@main",
"mean": 5.0402602455,
"stddev": 0.04818832815484789,
"median": 5.0260545332,
"user": 1.7819669599999997,
"system": 1.97926194,
"min": 4.9926543317,
"max": 5.1573902207,
"times": [
5.0403019567,
5.019054918699999,
5.0166711427,
5.000783160699999,
5.0826651537,
5.1573902207,
5.0330541477,
4.9926543317,
5.0180003857,
5.0420270366999995
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6835624411000001,
"stddev": 0.016850416718823875,
"median": 0.6766562597000001,
"user": 0.33916756,
"system": 1.27173094,
"min": 0.6673123487,
"max": 0.7151254237,
"times": [
0.7151254237,
0.6914615997,
0.6721879977,
0.6716680107,
0.7077957547,
0.6776290997000001,
0.6889549897,
0.6756834197,
0.6673123487,
0.6678057667
]
},
{
"command": "pnpr@main",
"mean": 0.7067162583000001,
"stddev": 0.054709913881469,
"median": 0.6812867967,
"user": 0.34993415999999994,
"system": 1.29395444,
"min": 0.6726911837,
"max": 0.8527297147,
"times": [
0.7213157907000001,
0.6815405057,
0.6794690707000001,
0.8527297147,
0.7278668097000001,
0.6931235637000001,
0.6810330877,
0.6726911837,
0.6808883067,
0.6765045497000001
]
}
]
} |
Summary
Fixes #12272.
Verification
cargo clippy --locked --workspace --all-targets -- -D warningsRUSTFLAGS="-D warnings" cargo dylint --all -- --all-targets --workspacecargo test --locked -p pacquet-resolving-deps-resolvercargo test --locked -p pacquet-resolving-deps-resolver resolve_peers::tests::own_peer_is_resolved_from_aliased_child_real_name -- --nocapturecargo test --locked -p pacquet-resolving-deps-resolver importer_parent_refs_skip_direct_deps_irrelevant_by_alias_and_real_name -- --nocapturecargo test --locked -p pacquet-cli --test install peer_dependenc -- --nocapturecargo test --locked -p pacquet-cli --test install -- --nocapturecargo test --locked -p pacquet-cli --test install peer_shared_through_a_diamond_is_resolved_consistently -- --nocapturepnpm --filter @pnpm/installing.deps-installer test test/install/peerDependencies.ts -t "in a subdependency, when there are several aliased dependencies of the same package"cargo build --locked --bin pacquetjest@30.4.2,@babel/core@7.29.7, andautoInstallPeers: true;diff -ubetween pnpm and pacquet lockfiles exited 0Written by an agent (Codex, GPT-5).
Summary by CodeRabbit
Bug Fixes
Tests
Chores
Refactor