Repository navigation
test(cli): tighten the optional-peer node_modules and failure output - #13378
Conversation
`Path::exists` follows the link, so a dangling `peer-c` link in pkg-a's `node_modules` would have read as "not linked" and passed the check; `symlink_metadata` fails only when nothing is there at all. The importer snapshot moves from an unconditional `dbg!` into the assertion message, so it is printed when a check fails rather than on every run. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe workspace install regression test now reports package details when an optional peer is unexpectedly present and uses symlink metadata to treat dangling symlinks as linked. ChangesOptional peer assertion tightening
Estimated code review effort: 1 (Trivial) | ~3 minutes 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 Qodotest(cli): tighten optional-peer link detection and failure output
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "test(cli): require NotFound from the opt..." | Re-trigger Greptile |
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/cli/tests/workspace_install.rs`:
- Line 279: Update the symlink assertion in the workspace install test to
require that symlink_metadata returns an I/O error whose kind is
ErrorKind::NotFound, rather than accepting any error via is_err(). Preserve the
existing dangling-symlink-safe symlink_metadata check and ensure other failures
do not satisfy the assertion.
🪄 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: 7861c93a-18f4-4399-96d7-bed8ec6a3f99
📒 Files selected for processing (1)
pnpm/crates/cli/tests/workspace_install.rs
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13378 +/- ##
==========================================
+ Coverage 87.22% 87.26% +0.04%
==========================================
Files 536 540 +4
Lines 92059 92644 +585
==========================================
+ Hits 80297 80847 +550
- Misses 11762 11797 +35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.4822043998,
"stddev": 0.10500412350023003,
"median": 2.4932405667,
"user": 1.6748556999999997,
"system": 1.27162716,
"min": 2.3579934257,
"max": 2.7119376527,
"times": [
2.4771597437,
2.4023117237,
2.3579934257,
2.5093213897,
2.5204812907,
2.7119376527,
2.5325691487,
2.3749397807,
2.4046045497,
2.5307252927
]
},
{
"command": "pacquet@main",
"mean": 2.4413234982,
"stddev": 0.13292448841101603,
"median": 2.3891483522000003,
"user": 1.6365439,
"system": 1.2915879600000002,
"min": 2.3358200517000003,
"max": 2.6945171457000003,
"times": [
2.6608905277,
2.3981391027,
2.3557286617,
2.3358200517000003,
2.3801576017,
2.6945171457000003,
2.3443764577,
2.4943767687,
2.3469886467000003,
2.4022400177
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5031202467,
"stddev": 0.14344390366771992,
"median": 1.4917090372000001,
"user": 1.1705877999999998,
"system": 1.13320916,
"min": 1.3508665707,
"max": 1.7840098767,
"times": [
1.3511972267,
1.5640686517,
1.3694125157,
1.4996137667,
1.4838043077,
1.4363045637,
1.7840098767,
1.3508665707,
1.6863589647000001,
1.5055660227
]
},
{
"command": "pnpr@main",
"mean": 1.5636948264000001,
"stddev": 0.12884591942626397,
"median": 1.5497397207,
"user": 1.177514,
"system": 1.14164296,
"min": 1.3479643367,
"max": 1.7852918567000002,
"times": [
1.3479643367,
1.5114035357,
1.5434103787,
1.5560690627000002,
1.5113293257000002,
1.5566724837,
1.4669886597000001,
1.7559491177000002,
1.6018695067,
1.7852918567000002
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25116959256000004,
"stddev": 0.006403258111997361,
"median": 0.24974196676,
"user": 0.20770281999999995,
"system": 0.4944283200000001,
"min": 0.24543631276000002,
"max": 0.26755887776,
"times": [
0.24543631276000002,
0.25226162275999997,
0.25300424575999997,
0.24645527476,
0.24786825776000002,
0.24684870876,
0.25124508176,
0.24823885176000002,
0.26755887776,
0.25277869176
]
},
{
"command": "pacquet@main",
"mean": 0.24771915916,
"stddev": 0.004886451686763972,
"median": 0.24728792526,
"user": 0.18104711999999998,
"system": 0.52190282,
"min": 0.23750352276,
"max": 0.25637162376,
"times": [
0.24800735076000002,
0.23750352276,
0.24618704076,
0.24605262476,
0.24537171676000002,
0.24958681176,
0.24990171676000003,
0.25164068376,
0.25637162376,
0.24656849976
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26372536216,
"stddev": 0.008111797578582536,
"median": 0.26059586926,
"user": 0.19839942,
"system": 0.5221347199999999,
"min": 0.25563531176,
"max": 0.28169186875999996,
"times": [
0.26685922376,
0.25563531176,
0.26030222976,
0.25830725476,
0.27177082776,
0.25828540376,
0.26639014776,
0.25712184476,
0.26088950876,
0.28169186875999996
]
},
{
"command": "pnpr@main",
"mean": 0.26860930886,
"stddev": 0.00370038088733701,
"median": 0.26963617425999997,
"user": 0.19894112,
"system": 0.5180497199999999,
"min": 0.26336605976,
"max": 0.27293047876,
"times": [
0.27293047876,
0.27030926476,
0.26336605976,
0.27199708276,
0.26363892176,
0.26685019676,
0.26936270976,
0.26483221376,
0.27289652176,
0.26990963876
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.75262092644,
"stddev": 0.011074841527399818,
"median": 2.75325266734,
"user": 1.81612242,
"system": 1.3557713999999998,
"min": 2.73182298034,
"max": 2.76759159634,
"times": [
2.76399307034,
2.76187851834,
2.7430227253400004,
2.75929372034,
2.75525946534,
2.73182298034,
2.76759159634,
2.74564834234,
2.74645297634,
2.75124586934
]
},
{
"command": "pacquet@main",
"mean": 2.7488413555399993,
"stddev": 0.020854347917988052,
"median": 2.7497561363400003,
"user": 1.85552822,
"system": 1.2933097,
"min": 2.72201282834,
"max": 2.78337466934,
"times": [
2.77796715834,
2.78337466934,
2.72926017034,
2.75292638234,
2.75854544834,
2.72201282834,
2.74740190234,
2.75211037034,
2.72511660834,
2.7396980173400003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5558922063400003,
"stddev": 0.11019414179038275,
"median": 1.53224072484,
"user": 1.19239952,
"system": 1.1463820999999996,
"min": 1.4380068003400002,
"max": 1.7467339483400002,
"times": [
1.6794653933400001,
1.45799959634,
1.5585484103400002,
1.53899341634,
1.6812513663400002,
1.4427776323400001,
1.4380068003400002,
1.7467339483400002,
1.52548803334,
1.4896574663400002
]
},
{
"command": "pnpr@main",
"mean": 1.56023013864,
"stddev": 0.16077884877692633,
"median": 1.49597784984,
"user": 1.18688832,
"system": 1.1385777999999998,
"min": 1.42449781234,
"max": 1.87298336534,
"times": [
1.87298336534,
1.5231487063400002,
1.43282677934,
1.78727765534,
1.4366100833400002,
1.42449781234,
1.49027575234,
1.67506209434,
1.45793919034,
1.50167994734
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5966116562200001,
"stddev": 0.019096972361655137,
"median": 0.59340892622,
"user": 0.7288176599999999,
"system": 0.6645279399999999,
"min": 0.5722084577200001,
"max": 0.63748932372,
"times": [
0.5783668187200001,
0.59275780572,
0.61014208372,
0.63748932372,
0.59648351472,
0.61230564472,
0.59406004672,
0.58357367072,
0.58872919572,
0.5722084577200001
]
},
{
"command": "pacquet@main",
"mean": 0.5753662610200001,
"stddev": 0.011007717816853765,
"median": 0.5734195497200001,
"user": 0.68156896,
"system": 0.6773440399999999,
"min": 0.56052664072,
"max": 0.59497850472,
"times": [
0.57007552072,
0.58031110972,
0.57296649972,
0.59017098972,
0.57333298272,
0.59497850472,
0.5735061167200001,
0.56124865672,
0.56052664072,
0.5765455887200001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29829060512000005,
"stddev": 0.008065915927601542,
"median": 0.29803085922000006,
"user": 0.19275286,
"system": 0.49190524,
"min": 0.28287156572000005,
"max": 0.31501828472000004,
"times": [
0.29391582372,
0.29753409772,
0.29579247072000003,
0.29857654372000003,
0.29852762072000005,
0.31501828472000004,
0.29936295272,
0.28287156572000005,
0.29680858872000004,
0.30449810272000005
]
},
{
"command": "pnpr@main",
"mean": 0.29436812201999996,
"stddev": 0.00684048947858272,
"median": 0.29264452172000005,
"user": 0.18876695999999998,
"system": 0.50324754,
"min": 0.28564737072,
"max": 0.30873972872000005,
"times": [
0.28564737072,
0.29301533172000005,
0.29227371172000005,
0.29103489072000005,
0.29794947172,
0.28879564772000005,
0.30164067272,
0.29510481172,
0.30873972872000005,
0.28947958272
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9070157563199999,
"stddev": 0.01123809374725703,
"median": 1.90637549852,
"user": 0.9631566199999998,
"system": 0.73668288,
"min": 1.88458833752,
"max": 1.9222384875199998,
"times": [
1.91912060652,
1.90596416352,
1.88458833752,
1.90678683352,
1.9184475105199998,
1.9058602445200001,
1.89963056952,
1.9222384875199998,
1.89893906552,
1.90858174452
]
},
{
"command": "pacquet@main",
"mean": 1.8902944940200002,
"stddev": 0.008263788262738533,
"median": 1.89089645002,
"user": 0.95677122,
"system": 0.7309673799999999,
"min": 1.87629209852,
"max": 1.90735160652,
"times": [
1.8934251655199998,
1.88367564452,
1.8850061005199998,
1.89202939552,
1.89234799252,
1.87629209852,
1.88731501852,
1.88976350452,
1.90735160652,
1.89573841352
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3011774107200001,
"stddev": 0.008880110364171825,
"median": 0.30083999602,
"user": 0.19685581999999996,
"system": 0.5028697799999999,
"min": 0.28898498652000004,
"max": 0.31580821352000005,
"times": [
0.31021467352000004,
0.29852813752000007,
0.30641534752000005,
0.28898498652000004,
0.30687932352,
0.29351129752000005,
0.31580821352000005,
0.28975213552000006,
0.30293989852000003,
0.29874009352
]
},
{
"command": "pnpr@main",
"mean": 0.30056979332000006,
"stddev": 0.006996440565563657,
"median": 0.30141119952000006,
"user": 0.18542602000000002,
"system": 0.51069308,
"min": 0.28780915852000005,
"max": 0.31050265152000006,
"times": [
0.30244717852,
0.30462539052000004,
0.29755992552000005,
0.29543545252000003,
0.30983866752000006,
0.30058199452000006,
0.31050265152000006,
0.29465710952,
0.28780915852000005,
0.30224040452000006
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36258296335999995,
"stddev": 0.00592759595580603,
"median": 0.36190541956,
"user": 0.36441643999999995,
"system": 0.058645079999999995,
"min": 0.35536727956,
"max": 0.37297585656000004,
"times": [
0.37250252256,
0.35658380856,
0.36257424956,
0.36148802756000004,
0.36318887856000004,
0.35928687756,
0.37297585656000004,
0.35953932156,
0.36232281156,
0.35536727956
]
},
{
"command": "pacquet@main",
"mean": 0.36965388206000005,
"stddev": 0.008430537040412849,
"median": 0.36634063306000003,
"user": 0.35622774,
"system": 0.07416078,
"min": 0.35892497856,
"max": 0.38318132956,
"times": [
0.35892497856,
0.36702879056000004,
0.38194208156000004,
0.37009353756,
0.37762489056000004,
0.36523579956,
0.36157328356,
0.36528165356000003,
0.38318132956,
0.36565247556
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08955075678580646,
"stddev": 0.002877720894232919,
"median": 0.08979226156,
"user": 0.018972559354838704,
"system": 0.01362984451612903,
"min": 0.08511382256,
"max": 0.09660563956,
"times": [
0.08991295256,
0.09362487156,
0.08896264856,
0.09102272056,
0.09235655056,
0.08511382256,
0.08670482756,
0.09161041856,
0.08584817556,
0.08696540456,
0.08730729656,
0.08528995656,
0.08892476556000001,
0.08895336156,
0.09375065056,
0.08979226156,
0.09003826056,
0.09049756456000001,
0.08632313256,
0.09075598556,
0.09660563956,
0.08570556756,
0.08739882356,
0.09005581756,
0.09016401656,
0.09183834056,
0.09141206356,
0.08762903156,
0.08879163756,
0.09488998856,
0.08782690556
]
},
{
"command": "pnpr@main",
"mean": 0.09086255023741938,
"stddev": 0.0034337492315872683,
"median": 0.09042222756,
"user": 0.02166678516129032,
"system": 0.011507245806451615,
"min": 0.08499265956,
"max": 0.09871477256,
"times": [
0.08999222556,
0.09047395956,
0.09150598056,
0.09662259056,
0.08997086656,
0.08948694956,
0.09061366856,
0.09504990456,
0.09034744056,
0.09871477256,
0.08962906356,
0.09402417756,
0.09252818956,
0.09074989256,
0.09140976856000001,
0.09316102556,
0.09042222756,
0.08803162656,
0.08552594456,
0.08635002656,
0.08726934856,
0.09779098656,
0.08953285856,
0.09022464256,
0.08537830656,
0.09271614856,
0.09074624356,
0.09022703956,
0.08499265956,
0.09532909856,
0.08792142356
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.50875051342,
"stddev": 0.11852827629462982,
"median": 4.442513609020001,
"user": 1.7986200799999998,
"system": 1.3999281199999998,
"min": 4.419335787520001,
"max": 4.77023260552,
"times": [
4.77023260552,
4.6018681175200005,
4.4314478065200005,
4.50758097052,
4.62148463652,
4.44230230752,
4.42455536152,
4.419335787520001,
4.4259726305200005,
4.44272491052
]
},
{
"command": "pacquet@main",
"mean": 4.47572087342,
"stddev": 0.059945564910812085,
"median": 4.448935730520001,
"user": 1.77943548,
"system": 1.4195167199999998,
"min": 4.420599177520001,
"max": 4.58700287352,
"times": [
4.58700287352,
4.54555936052,
4.43366493252,
4.420599177520001,
4.462940665520001,
4.434930795520001,
4.534939485520001,
4.424601555520001,
4.42832645852,
4.48464342952
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5534453000199995,
"stddev": 0.15953338907394343,
"median": 3.47796071352,
"user": 1.29235438,
"system": 1.21367062,
"min": 3.45036099452,
"max": 3.8635868965199998,
"times": [
3.45036099452,
3.4647151735199997,
3.51629544652,
3.52362879852,
3.46851707652,
3.84121385952,
3.8635868965199998,
3.48740435052,
3.45665579752,
3.46207460652
]
},
{
"command": "pnpr@main",
"mean": 3.5257149865199997,
"stddev": 0.07968821494645477,
"median": 3.48672854552,
"user": 1.2671349799999998,
"system": 1.2425300199999998,
"min": 3.45897122052,
"max": 3.70195592452,
"times": [
3.55471003052,
3.47648331952,
3.57957371852,
3.48736594752,
3.70195592452,
3.48609114352,
3.58967652652,
3.45960105252,
3.45897122052,
3.46272098152
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13378 |
| 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,438.01 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 288.98 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 282.87 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.11 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,350.87 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,450.36 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 255.64 ms |
`is_err()` also accepts a permission or I/O failure on the path, which would read as "the peer is not linked" for the wrong reason. Match `ErrorKind::NotFound` so only a genuinely absent entry passes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit d56d575 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…npm#13378) `Path::exists` follows the link, so a dangling `peer-c` link in pkg-a's `node_modules` would have read as "not linked" and passed the check; `symlink_metadata` fails only when nothing is there at all. The importer snapshot moves from an unconditional `dbg!` into the assertion message, so it is printed when a check fails rather than on every run. Follow-up to pnpm#13372, which merged before this commit landed.
Summary
Follow-up to #13372, which merged while the last review round was still being addressed — this is the commit that missed the merge.
Two test-only refinements to
optional_peer_stays_out_of_the_importer_without_auto_install_peers:Path::existsfollows the link, so a dangling@pnpm.e2e/peer-clink inpkg-a/node_moduleswould have read as "not linked" and passed the check.fs::symlink_metadatafails only when nothing is at that path at all, and still catches a Windows junction.dbg!into the assertion message, so it is printed when a check fails rather than on every run.No behavior change and no changeset: the regression this test guards is already fixed on main by #13372.
Squash Commit Body
Checklist
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit