Repository navigation
Conversation
Synchronize shared-subtree owner context before optional peer hoisting. Preserve scalar libc metadata and omit integrity for commit-addressed git archives. Related to #13305.
|
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:
📝 WalkthroughWalkthroughThis PR updates git-hosted tarball metadata, serializes singleton ChangesGit-hosted lockfile resolution
Libc metadata serialization
Workspace peer resolution
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Workspace
participant ImporterHoistState
participant PeerResolver
participant MissingScope
Workspace->>ImporterHoistState: prepare required round
ImporterHoistState->>PeerResolver: resolve peer requirements
PeerResolver->>MissingScope: apply owner scope to missing issues
Workspace->>ImporterHoistState: complete required rounds
Workspace->>ImporterHoistState: hoist optional peers across importers
Possibly related issues
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 lockfile output to match pnpm 11 for n8n (peers, libc, git deps)
AI Description
Diagram
High-Level Assessment
Files changed (12)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "perf(pacquet): publish peer context befo..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
pnpm/crates/lockfile/src/resolution/tests.rs (1)
721-734: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAssert the complete normalized resolution.
The regression currently checks only the variant and
git_hosted. Compare against a full expectedTarballResolutionso changes to the URL,integrity, orpathcannot pass unnoticed.As per path instructions, lockfile regression tests must prove the exact lockfile shape.
🤖 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/lockfile/src/resolution/tests.rs` around lines 721 - 734, Update the test to construct a complete expected TarballResolution and compare it with the result of to_lockfile_form, covering the normalized tarball URL, integrity, git_hosted, and path fields. Replace the current variant-only extraction and git_hosted assertion while preserving the existing resolution inputs.Source: Path instructions
🤖 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/lockfile/src/package_metadata/tests.rs`:
- Around line 46-53: Update singleton_libc_is_written_as_a_string to serialize
metadata through the production serialize_yaml::to_string path used by the
round-trip test, then assert the exact expected libc: glibc line or field shape
rather than using a substring contains check. Ensure the test rejects additional
or alternate libc representations.
In `@pnpm/crates/lockfile/src/resolution.rs`:
- Around line 355-362: Update the rustdoc contract for to_lockfile_form to
clarify that integrity-less tarballs pass through unchanged except for
recognized git-hosted archives, which may be normalized with git_hosted set to
Some(true). Keep the implementation unchanged.
---
Nitpick comments:
In `@pnpm/crates/lockfile/src/resolution/tests.rs`:
- Around line 721-734: Update the test to construct a complete expected
TarballResolution and compare it with the result of to_lockfile_form, covering
the normalized tarball URL, integrity, git_hosted, and path fields. Replace the
current variant-only extraction and git_hosted assertion while preserving the
existing resolution inputs.
🪄 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: ea11661e-467a-4a03-a52d-ccee44326bd5
📒 Files selected for processing (12)
.changeset/git-hosted-lockfile-resolution.md.changeset/libc-lockfile-scalar.md.changeset/shared-peer-owner-barrier.mdpnpm/crates/lockfile/src/package_metadata.rspnpm/crates/lockfile/src/package_metadata/tests.rspnpm/crates/lockfile/src/resolution.rspnpm/crates/lockfile/src/resolution/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rspnpm/crates/resolving-git-resolver/src/git_resolver.rspnpm/crates/resolving-git-resolver/src/git_resolver/tests.rspnpm/crates/resolving-git-resolver/src/lib.rs
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main pnpm/pnpm#13432 +/- ##
==========================================
+ Coverage 87.60% 87.63% +0.03%
==========================================
Files 545 545
Lines 93698 93849 +151
==========================================
+ Hits 82085 82246 +161
+ Misses 11613 11603 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Follow-up on the four Qodo findings:
The two actionable inline review findings were fixed in 06f7f81, and the full pre-push checks passed. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit 06f7f81 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7644001810000005,
"stddev": 0.22125367159253992,
"median": 2.8032526519000003,
"user": 2.0637020799999997,
"system": 1.6166630599999998,
"min": 2.4082255724,
"max": 3.1424571924,
"times": [
2.4976725144,
2.8754238694000005,
2.5466970634000003,
2.4082255724,
2.9380453624000005,
2.8422014604,
3.1424571924,
2.7932178894,
2.7867734714,
2.8132874144000004
]
},
{
"command": "pacquet@main",
"mean": 2.5880413994,
"stddev": 0.1651332246180289,
"median": 2.5283338169,
"user": 1.8640877799999997,
"system": 1.47108946,
"min": 2.4186320284000002,
"max": 2.8733221964,
"times": [
2.8733221964,
2.5139781094,
2.4864916214000004,
2.8579516944000005,
2.5426895244,
2.5014553244,
2.4186320284000002,
2.5616777314,
2.6945706964000005,
2.4296450674
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5982874268999998,
"stddev": 0.13275813475028297,
"median": 1.5805307444,
"user": 1.2510063800000002,
"system": 1.3032172599999998,
"min": 1.4205303524,
"max": 1.8096020754000002,
"times": [
1.5605308724,
1.4205303524,
1.4586945994,
1.7027973964,
1.8096020754000002,
1.6005306164000002,
1.6657687064,
1.5063326414,
1.4955693794,
1.7625176294
]
},
{
"command": "pnpr@main",
"mean": 1.5510354312,
"stddev": 0.13513515252100308,
"median": 1.5203085004,
"user": 1.2765200799999998,
"system": 1.29368736,
"min": 1.3918552004,
"max": 1.7875996314,
"times": [
1.4746981664,
1.3918552004,
1.7875996314,
1.7217299494,
1.4232276054,
1.6724100464,
1.5475960434,
1.4930209574,
1.5633408764,
1.4348758354
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.3236613346,
"stddev": 0.039462826176523205,
"median": 0.31851688910000003,
"user": 0.26755384,
"system": 0.6437921600000001,
"min": 0.2847235241,
"max": 0.41862984410000004,
"times": [
0.2893506161,
0.3000406111,
0.2847235241,
0.2926338891,
0.34612445810000003,
0.31995444310000004,
0.33573766310000003,
0.41862984410000004,
0.3170793351,
0.3323389621
]
},
{
"command": "pacquet@main",
"mean": 0.289388171,
"stddev": 0.016565471835211742,
"median": 0.2869381756,
"user": 0.25069344,
"system": 0.56845986,
"min": 0.26660170110000003,
"max": 0.3119658711,
"times": [
0.3077030831,
0.3119658711,
0.2743146871,
0.3087771951,
0.2765018851,
0.26660170110000003,
0.2761401181,
0.2930384981,
0.2980008181,
0.28083785310000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30061704720000004,
"stddev": 0.005584667854802415,
"median": 0.2996340786,
"user": 0.25539323999999997,
"system": 0.56445316,
"min": 0.2890107201,
"max": 0.3077722001,
"times": [
0.29767184210000003,
0.29958409410000003,
0.2981285681,
0.29874327910000004,
0.3077623021,
0.30296328910000003,
0.2996840631,
0.3048501141,
0.3077722001,
0.2890107201
]
},
{
"command": "pnpr@main",
"mean": 0.28899472239999996,
"stddev": 0.0070002292171346785,
"median": 0.2903777111,
"user": 0.22589093999999998,
"system": 0.56213046,
"min": 0.2757739511,
"max": 0.2972601701,
"times": [
0.2972601701,
0.2971512061,
0.2891266261,
0.2928127451,
0.2856118301,
0.2943772371,
0.29162879610000003,
0.2831534221,
0.2830512401,
0.2757739511
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.9476770535999997,
"stddev": 0.057185164987543675,
"median": 2.9532285878,
"user": 2.12654204,
"system": 1.6077850599999999,
"min": 2.8200831143,
"max": 3.0566137923,
"times": [
2.9222909063,
2.8200831143,
2.9534573163,
2.9529998592999998,
3.0566137923,
2.9494084143,
2.9550592393,
2.9593893393,
2.9661763323,
2.9412922223
]
},
{
"command": "pacquet@main",
"mean": 2.8561111903000005,
"stddev": 0.07728638466324463,
"median": 2.8353867832999997,
"user": 1.9313627399999997,
"system": 1.4599956600000001,
"min": 2.7779824123,
"max": 3.0268682363,
"times": [
3.0268682363,
2.8109870753,
2.8493189553,
2.9235231573,
2.8731966493,
2.8973083343,
2.7779824123,
2.7908209413000002,
2.7896515303,
2.8214546113
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6017240103,
"stddev": 0.11970632160641569,
"median": 1.5743998817999998,
"user": 1.1811197399999998,
"system": 1.29484156,
"min": 1.4543908373,
"max": 1.8503646702999998,
"times": [
1.5443969303,
1.4915589333,
1.4543908373,
1.5865140712999999,
1.6440383443,
1.6859624062999998,
1.8503646702999998,
1.5005667043,
1.6971615133,
1.5622856923
]
},
{
"command": "pnpr@main",
"mean": 1.5729293624,
"stddev": 0.12316185881030733,
"median": 1.5148229552999999,
"user": 1.0878804399999997,
"system": 1.1918788599999997,
"min": 1.4371141363,
"max": 1.7806408572999999,
"times": [
1.5157599103,
1.6600362572999998,
1.5138860002999999,
1.7806408572999999,
1.4772957883,
1.7340667853,
1.4794190942999998,
1.6567052983,
1.4371141363,
1.4743694963
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6203548406199999,
"stddev": 0.023333975200013075,
"median": 0.60899197602,
"user": 0.74558216,
"system": 0.71063818,
"min": 0.59710047402,
"max": 0.65890841802,
"times": [
0.60535048602,
0.60837383802,
0.64585858602,
0.65890841802,
0.65074152302,
0.62617564102,
0.59710047402,
0.60961011402,
0.59849485502,
0.60293447102
]
},
{
"command": "pacquet@main",
"mean": 0.6035199146200001,
"stddev": 0.013834767592686776,
"median": 0.60447297402,
"user": 0.7564528599999999,
"system": 0.6651374800000001,
"min": 0.58433733102,
"max": 0.63464536602,
"times": [
0.59727315602,
0.60610846502,
0.58850986202,
0.58433733102,
0.60719972702,
0.63464536602,
0.59710328702,
0.60370083902,
0.60524510902,
0.61107600402
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30665270872000006,
"stddev": 0.0045964267662094585,
"median": 0.30629030252,
"user": 0.21133375999999998,
"system": 0.52957438,
"min": 0.29984962502,
"max": 0.31583623302,
"times": [
0.30806126802000006,
0.31583623302,
0.31029165202000003,
0.29984962502,
0.30421466602,
0.30558775702,
0.30261552402,
0.30976215102000004,
0.30699284802000004,
0.30331536302
]
},
{
"command": "pnpr@main",
"mean": 0.30751552302000007,
"stddev": 0.009140824302914486,
"median": 0.31040021602,
"user": 0.21389505999999997,
"system": 0.5257100799999999,
"min": 0.29485402402000005,
"max": 0.31695317302000003,
"times": [
0.29485402402000005,
0.31401274802,
0.29960558902,
0.29942740502000004,
0.31535887802,
0.31654881602,
0.31695317302000003,
0.31536640302,
0.30678768402,
0.29624051002
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.01235644926,
"stddev": 0.08640688919453382,
"median": 1.9807744545600001,
"user": 1.11857706,
"system": 0.8272385800000001,
"min": 1.9237977710599998,
"max": 2.15578064706,
"times": [
2.15578064706,
2.11307554306,
2.13005377706,
1.97447396506,
1.98707494406,
1.93592376006,
1.94833724806,
1.9237977710599998,
1.9644107070599999,
1.99063613006
]
},
{
"command": "pacquet@main",
"mean": 2.06120357416,
"stddev": 0.16336862155531712,
"median": 2.00842663856,
"user": 1.20838556,
"system": 0.9011972799999999,
"min": 1.89629054606,
"max": 2.37023224606,
"times": [
1.89853546006,
1.91469481706,
1.89629054606,
1.97083832706,
2.00306598306,
2.01378729406,
2.09538445906,
2.19988931306,
2.37023224606,
2.24931729606
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30984969426000003,
"stddev": 0.004449589572489868,
"median": 0.30840124556,
"user": 0.20001525999999997,
"system": 0.53933098,
"min": 0.30305218606,
"max": 0.31736397305999997,
"times": [
0.31134550006,
0.30852427606,
0.31429649706,
0.30305218606,
0.31473940706,
0.31736397305999997,
0.30827821505999997,
0.30649053606,
0.30740317606,
0.30700317606
]
},
{
"command": "pnpr@main",
"mean": 0.30207596206,
"stddev": 0.007912946527336416,
"median": 0.30290066305999996,
"user": 0.19761726000000002,
"system": 0.5181232799999999,
"min": 0.28803579006,
"max": 0.31281599406,
"times": [
0.29709542905999997,
0.30475310206,
0.29886648706,
0.28803579006,
0.30104822406,
0.29291300506,
0.30765289306,
0.30991339906,
0.31281599406,
0.30766529706
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.37969806404,
"stddev": 0.019524938561533034,
"median": 0.37715401674000004,
"user": 0.3784701999999999,
"system": 0.05157337999999999,
"min": 0.35902358324,
"max": 0.42955502024000003,
"times": [
0.37017172324000003,
0.37247290424,
0.38256700124,
0.38336996424,
0.35902358324,
0.42955502024000003,
0.36175477924,
0.37810405124,
0.38375763124,
0.37620398224
]
},
{
"command": "pacquet@main",
"mean": 0.3736611204400001,
"stddev": 0.011263747229234644,
"median": 0.37208180074,
"user": 0.36164260000000004,
"system": 0.06165288,
"min": 0.35763447324000003,
"max": 0.40132726724,
"times": [
0.37645051424000003,
0.37136851524000003,
0.37355926924,
0.35763447324000003,
0.36643566624,
0.37246644024000003,
0.37169716124,
0.40132726724,
0.37771848824,
0.36795340924000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08765371308848485,
"stddev": 0.002213285700614575,
"median": 0.08754530724000001,
"user": 0.021326000000000005,
"system": 0.009261841212121215,
"min": 0.08466418124,
"max": 0.09465318024000001,
"times": [
0.08598894124,
0.09014960624,
0.08558326324,
0.08642042024,
0.08785356424,
0.08754530724000001,
0.08833593924000001,
0.08837018224,
0.09049229824,
0.08520103724,
0.09017941924,
0.08552728824,
0.08643500924,
0.08813443024,
0.08864495724,
0.08563275524,
0.08615704724,
0.08770492624000001,
0.09050545324,
0.08470418524000001,
0.08894094024,
0.08797893124,
0.08665965824,
0.08560287924,
0.08748311124000001,
0.09465318024000001,
0.09199237724,
0.08466418124,
0.08668554924,
0.08805268724,
0.08637076724000001,
0.08811079924000001,
0.08581143924000001
]
},
{
"command": "pnpr@main",
"mean": 0.08785223278545451,
"stddev": 0.0015507094118949855,
"median": 0.08753050724,
"user": 0.02228281818181817,
"system": 0.0070546181818181815,
"min": 0.08584120524000001,
"max": 0.09272234524,
"times": [
0.08626072224,
0.08900906824,
0.08584120524000001,
0.08725444424,
0.08735254624000001,
0.08734632424000001,
0.09004469924,
0.08592442124,
0.08843229924,
0.08639742824,
0.08713771324,
0.08810739024,
0.09272234524,
0.08927497724,
0.08792220824000001,
0.08868352424,
0.08680239124,
0.08875503024,
0.08665461524,
0.08768387324,
0.08967476124,
0.08620552424,
0.08584346624,
0.08716845824,
0.08811602224000001,
0.08753050724,
0.08761330124,
0.08689849224,
0.08793805924,
0.08751468624,
0.08846688924,
0.09157414824,
0.08697213924000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.73756142234,
"stddev": 0.1929850283480382,
"median": 4.6705428941400005,
"user": 2.23937374,
"system": 1.7346386799999998,
"min": 4.52903021814,
"max": 5.0064085471399995,
"times": [
4.54165583114,
4.62315107514,
4.95572992914,
4.94212194614,
4.65059426414,
4.69049152414,
4.90258778714,
4.52903021814,
5.0064085471399995,
4.53384310114
]
},
{
"command": "pacquet@main",
"mean": 4.63467860754,
"stddev": 0.1767418491961395,
"median": 4.56510638414,
"user": 1.8864882399999998,
"system": 1.4754593799999998,
"min": 4.46967338914,
"max": 4.94448814414,
"times": [
4.83924169314,
4.47940079014,
4.84815611114,
4.62624588214,
4.59856505214,
4.52218387914,
4.46967338914,
4.48718341814,
4.53164771614,
4.94448814414
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5313403531400005,
"stddev": 0.0725653953299533,
"median": 3.50877904864,
"user": 1.3626206399999998,
"system": 1.36103138,
"min": 3.46877607914,
"max": 3.72367164814,
"times": [
3.5366960921399997,
3.54278854314,
3.72367164814,
3.50489625614,
3.50389621314,
3.54431836814,
3.50542641914,
3.46877607914,
3.51213167814,
3.4708022341399998
]
},
{
"command": "pnpr@main",
"mean": 3.5724676430399995,
"stddev": 0.09624288018702265,
"median": 3.54825490614,
"user": 1.28409314,
"system": 1.3256380799999998,
"min": 3.46052107514,
"max": 3.74610092314,
"times": [
3.67201013114,
3.46052107514,
3.47389663014,
3.74610092314,
3.55921264114,
3.65452787814,
3.51508566614,
3.53729717114,
3.48644465814,
3.61957965614
]
}
]
} |
|
The +43.83% Commit c210f83 skips the barrier unless the workspace has multiple importers. The 31 targeted workspace resolver tests pass, including both owner-context regressions, and the full pre-push checks pass. The pushed commit has triggered a fresh benchmark run. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit c210f83 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Code review by qodo was updated up to the latest commit dbc5cfc |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs (1)
528-537: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate
HoistMissingScopeconstruction — extract a helper.The same 3-field
HoistMissingScope(importer_id, first_importer_by_pkg, first_walk_missing_by_pkg) is built here and again inline incomplete_required_round's fixpoint loop (Lines 594-598). A future field addition/rename toHoistMissingScopethat only updates one site would silently reintroduce inconsistent owner-scoping between the initial round and subsequent rounds.♻️ Suggested extraction
+ fn build_hoist_missing_scope(&self) -> HoistMissingScope { + HoistMissingScope { + importer_id: self.importer_id.clone(), + first_importer_by_pkg: self.ctx.workspace().first_importer_by_pkg(), + first_walk_missing_by_pkg: self.ctx.workspace().first_walk_missing_by_pkg(), + } + } + pub(crate) fn apply_owner_missing_scope(&self, round: &mut RequiredRound) { - apply_hoist_missing_scope( - &mut round.peers_result, - &HoistMissingScope { - importer_id: self.importer_id.clone(), - first_importer_by_pkg: self.ctx.workspace().first_importer_by_pkg(), - first_walk_missing_by_pkg: self.ctx.workspace().first_walk_missing_by_pkg(), - }, - ); + apply_hoist_missing_scope(&mut round.peers_result, &self.build_hoist_missing_scope()); }let RequiredRound { snapshot, original_node_ids, peers_result } = first_round.take().unwrap_or_else(|| { - self.resolve_required_round(Some(Arc::new(HoistMissingScope { - importer_id: self.importer_id.clone(), - first_importer_by_pkg: self.ctx.workspace().first_importer_by_pkg(), - first_walk_missing_by_pkg: self.ctx.workspace().first_walk_missing_by_pkg(), - }))) + self.resolve_required_round(Some(Arc::new(self.build_hoist_missing_scope()))) });Also applies to: 583-599
🤖 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/resolving-deps-resolver/src/resolve_importer.rs` around lines 528 - 537, Extract a shared helper on the surrounding resolver type that constructs and returns HoistMissingScope using importer_id, first_importer_by_pkg, and first_walk_missing_by_pkg. Update apply_owner_missing_scope and the complete_required_round fixpoint loop to call this helper instead of constructing HoistMissingScope inline, preserving identical owner-scoping behavior across both paths.pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the cross-importer barrier invariant behind owner-scope filtering. The correctness of missing-peer suppression depends on every importer's initial required round finishing (and recording into the shared
WorkspaceTreeCtx) beforeapply_owner_missing_scoperuns for any importer; this is currently enforced only by the accidental structure of three separate loops, with no comment stating the precondition at either the enforcing site or the function that relies on it.
pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs#L290-301: add a comment above the three-loop sequence explaining that loop 2 (apply_owner_missing_scope) must run only after loop 1 (prepare_initial_required_round) has finished for every importer, since it depends on the fully-populatedfirst_importer_by_pkg/first_walk_missing_by_pkgmaps.pnpm/crates/resolving-deps-resolver/src/resolve_importer.rs#L528-537: add a doc comment onapply_owner_missing_scopestating its precondition (must be called only after all importers' initial required rounds have completed) so the contract travels with the function, not just its current call site.🤖 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/resolving-deps-resolver/src/resolve_workspace.rs` at line 1, Document the cross-importer ordering contract in the three-loop sequence in resolve_workspace.rs: explain that apply_owner_missing_scope must run only after prepare_initial_required_round has completed for every importer because it relies on fully populated first_importer_by_pkg and first_walk_missing_by_pkg maps. Add a doc comment to apply_owner_missing_scope in resolve_importer.rs stating the same precondition.pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs (1)
368-384: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the single-use, consuming contract of
apply_hoist_missing_scope.
result.missing_ancestor_pkg_ids.remove(peer_name)destructively drains the ancestor-chain map. A second invocation on the sameResolvePeersResultwould find empty ancestor chains for everypeer_name, causingzipto yield zero pairs andretainto silently drop all of that peer's missing issues — a full, hard-to-detect loss of diagnostics rather than a crash. Currently onlyapply_owner_missing_scopecalls this once per round, but nothing documents that this must not be called twice.📝 Suggested doc comment
+/// Consumes (drains) `result.missing_ancestor_pkg_ids` while filtering +/// `result.peer_dependency_issues.missing`. Must be called at most once +/// per `ResolvePeersResult` — a second call would find no recorded +/// ancestor chains and silently drop every remaining missing-peer issue. pub(crate) fn apply_hoist_missing_scope( result: &mut ResolvePeersResult, scope: &HoistMissingScope, ) {🤖 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/resolving-deps-resolver/src/resolve_peers.rs` around lines 368 - 384, Document the single-use, consuming contract on apply_hoist_missing_scope: its removal of entries from result.missing_ancestor_pkg_ids means it must not be invoked more than once for the same ResolvePeersResult, or subsequent calls will discard missing peer issues. Keep the implementation unchanged and make the warning explicit in the function’s documentation.
🤖 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/resolving-deps-resolver/src/resolve_importer.rs`:
- Around line 528-537: Extract a shared helper on the surrounding resolver type
that constructs and returns HoistMissingScope using importer_id,
first_importer_by_pkg, and first_walk_missing_by_pkg. Update
apply_owner_missing_scope and the complete_required_round fixpoint loop to call
this helper instead of constructing HoistMissingScope inline, preserving
identical owner-scoping behavior across both paths.
In `@pnpm/crates/resolving-deps-resolver/src/resolve_peers.rs`:
- Around line 368-384: Document the single-use, consuming contract on
apply_hoist_missing_scope: its removal of entries from
result.missing_ancestor_pkg_ids means it must not be invoked more than once for
the same ResolvePeersResult, or subsequent calls will discard missing peer
issues. Keep the implementation unchanged and make the warning explicit in the
function’s documentation.
In `@pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs`:
- Line 1: Document the cross-importer ordering contract in the three-loop
sequence in resolve_workspace.rs: explain that apply_owner_missing_scope must
run only after prepare_initial_required_round has completed for every importer
because it relies on fully populated first_importer_by_pkg and
first_walk_missing_by_pkg maps. Add a doc comment to apply_owner_missing_scope
in resolve_importer.rs stating the same precondition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6ea526e9-9d9e-46ff-a326-393c65432298
📒 Files selected for processing (4)
pnpm/crates/resolving-deps-resolver/src/resolve_importer.rspnpm/crates/resolving-deps-resolver/src/resolve_peers.rspnpm/crates/resolving-deps-resolver/src/resolve_peers/tests.rspnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs
|
| Project | pnpm's project |
| Branch | pr/13432 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,454.39 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 303.05 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 299.85 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.66 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,420.53 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,468.78 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 289.01 ms |
Restore the integrity hash collected while resolving commit-addressed git-hosted archives. This keeps Rust pnpm aligned with the TypeScript security behavior that pins downloaded archive bytes in the lockfile. Revert only the git integrity portion of #13432; retain its peer resolution and libc serialization changes.
Summary
Aligns Rust pnpm lockfile generation with pnpm 11 for the n8n workspace validation tracked by #13305.
The Rust implementation now:
libcmetadata as a scalar;No TypeScript change is needed: pnpm 11 produced the correct reference shapes in all three cases. Fresh back-to-back resolutions of n8n produced byte-identical lockfiles: 77 importers, 3,795 package entries, and 3,884 snapshots.
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
Bug Fixes
libcmetadata is serialized in pnpm-compatible scalar format.Tests
libcserialization, and shared peer-resolution scenarios.