Repository navigation
fix(verify-deps): compare dedupePeers in the pre-run lockfile check - #17328
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure freshness checks pnpm11/deps/status/src/types.ts, pnpm11/deps/status/src/assertWantedLockfileUpToDate.ts, pnpm/crates/package-manager/src/optimistic_repeat_install/deps_status.rs |
The status options include dedupePeers. The TypeScript lockfile check and Rust pre-run freshness check use the configured value. |
Verify repeated-run behavior pnpm11/deps/status/test/checkDepsStatus.test.ts, pnpm/crates/cli/tests/suite/verify_deps_before_run.rs, .changeset/verify-deps-before-run-dedupe-peers.md |
Tests cover matching dedupePeers settings and confirm that a script runs without an additional install after a lockfile rewrite. The changeset records patch releases. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Stop repeated pre-run installs when dedupePeers is true and a lockfile changes [#17322] |
✅ |
Possibly related PRs
- pnpm/pnpm#17259: Both PRs change lockfile conditions used in freshness decisions.
- pnpm/pnpm#17264: Both PRs modify settings used by pre-run freshness checks.
Suggested labels: product: pnpm@11, product: pacquet
Merge Risk: 
Minimal · up to e6253
-
The freshness checks now use the configured setting, with no identified issue requiring a fix before merge.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 ESLint
-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.
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 @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17328 +/- ##
=======================================
Coverage 92.59% 92.59%
=======================================
Files 1882 1882
Lines 243454 243451 -3
=======================================
+ Hits 225416 225420 +4
+ Misses 18038 18031 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.48464155112,
"stddev": 0.12953231021814454,
"median": 2.45692996442,
"user": 2.4272288800000004,
"system": 1.9090999,
"min": 2.34428687542,
"max": 2.67556304442
},
{
"command": "pacquet@main",
"mean": 2.61144580512,
"stddev": 0.15846026052477993,
"median": 2.60683210942,
"user": 2.45506058,
"system": 2.005364,
"min": 2.38583643942,
"max": 2.82201803242
},
{
"command": "pnpr@HEAD",
"mean": 1.5535053854200003,
"stddev": 0.10622762331217805,
"median": 1.54563884442,
"user": 2.31432148,
"system": 1.8080496999999998,
"min": 1.3962173314200002,
"max": 1.7248797584200002
},
{
"command": "pnpr@main",
"mean": 1.6492872387200002,
"stddev": 0.11362868411013681,
"median": 1.6575425794200003,
"user": 2.45582028,
"system": 2.0444044000000003,
"min": 1.4726768014200002,
"max": 1.8093567224200002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22249643958000004,
"stddev": 0.01841473528530664,
"median": 0.21673917898,
"user": 0.24811158,
"system": 0.5278852399999999,
"min": 0.20825124498,
"max": 0.26904943398000003
},
{
"command": "pacquet@main",
"mean": 0.23889412727999998,
"stddev": 0.01817376393922544,
"median": 0.23796758548000002,
"user": 0.26704188,
"system": 0.57036094,
"min": 0.21669995998000002,
"max": 0.27918143598000006
},
{
"command": "pnpr@HEAD",
"mean": 0.24578829257999998,
"stddev": 0.014063549936473655,
"median": 0.24221073348,
"user": 0.27263028,
"system": 0.55030164,
"min": 0.22314003498,
"max": 0.26775453898000007
},
{
"command": "pnpr@main",
"mean": 0.24908348188,
"stddev": 0.014591194621536397,
"median": 0.24477670648000002,
"user": 0.24796487999999997,
"system": 0.56693404,
"min": 0.23199683298,
"max": 0.27349884398
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.012034614907859923,
"stddev": 0.0018012229134412479,
"median": 0.01175907676,
"user": 0.006835823501945525,
"system": 0.00621882178988327,
"min": 0.00855067976,
"max": 0.018893108760000003
},
{
"command": "pacquet@main",
"mean": 0.012461794002009129,
"stddev": 0.0018624028252659274,
"median": 0.01219761076,
"user": 0.007304122739726026,
"system": 0.006243480365296806,
"min": 0.00882261176,
"max": 0.01997703476
},
{
"command": "pnpr@HEAD",
"mean": 0.011702592991617647,
"stddev": 0.0011732218218673497,
"median": 0.011598037759999999,
"user": 0.006745369264705877,
"system": 0.005994438970588232,
"min": 0.00918320776,
"max": 0.014614998760000001
},
{
"command": "pnpr@main",
"mean": 0.011139750323981049,
"stddev": 0.0010941408008041872,
"median": 0.01106416776,
"user": 0.006496652701421801,
"system": 0.005672715639810427,
"min": 0.00875924576,
"max": 0.01491436176
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008011193327539268,
"stddev": 0.0008079055725281095,
"median": 0.00789404916,
"user": 0.004887634869109949,
"system": 0.003812051937172773,
"min": 0.00699157316,
"max": 0.014388068160000001
},
{
"command": "pacquet@main",
"mean": 0.007773671034576272,
"stddev": 0.00039524573994764695,
"median": 0.0077393791600000005,
"user": 0.004688632881355931,
"system": 0.0037485597288135623,
"min": 0.007125635160000001,
"max": 0.01058312016
},
{
"command": "pnpr@HEAD",
"mean": 0.007849131306258509,
"stddev": 0.0004334293622686988,
"median": 0.00779108166,
"user": 0.004444560680272113,
"system": 0.004054808095238095,
"min": 0.007130605160000001,
"max": 0.01025706516
},
{
"command": "pnpr@main",
"mean": 0.007709222362166062,
"stddev": 0.00029968212989858636,
"median": 0.007706016160000001,
"user": 0.004588961083032493,
"system": 0.0037618390613718402,
"min": 0.00712035416,
"max": 0.00917174416
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4669934325200003,
"stddev": 0.03148827364689721,
"median": 2.4578838215200003,
"user": 2.24549904,
"system": 1.45776606,
"min": 2.42656338802,
"max": 2.51400764202
},
{
"command": "pacquet@main",
"mean": 2.46506413242,
"stddev": 0.02208247834686893,
"median": 2.46435169852,
"user": 2.3002831399999994,
"system": 1.43315006,
"min": 2.44154808702,
"max": 2.50859700802
},
{
"command": "pnpr@HEAD",
"mean": 1.5996354094199998,
"stddev": 0.13163665695738286,
"median": 1.6542274020199998,
"user": 1.7590526399999997,
"system": 1.26320506,
"min": 1.37927183502,
"max": 1.73882287802
},
{
"command": "pnpr@main",
"mean": 1.5225285816199996,
"stddev": 0.12093825084104669,
"median": 1.4978582665199998,
"user": 1.76487774,
"system": 1.2549442599999998,
"min": 1.3799763050199998,
"max": 1.74670910302
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6264533417000001,
"stddev": 0.029404946168618426,
"median": 0.6245776361,
"user": 0.8878539599999999,
"system": 0.9462595400000001,
"min": 0.5864003211000001,
"max": 0.6772400861000001
},
{
"command": "pacquet@main",
"mean": 0.6265333110000001,
"stddev": 0.07940441290417505,
"median": 0.6044820156,
"user": 0.8987642599999999,
"system": 0.9665666399999999,
"min": 0.5741353701,
"max": 0.8450527221
},
{
"command": "pnpr@HEAD",
"mean": 0.4310403378000001,
"stddev": 0.03604146562400511,
"median": 0.4325773746,
"user": 0.41567856000000003,
"system": 0.7964099399999999,
"min": 0.38397342510000004,
"max": 0.48857563410000004
},
{
"command": "pnpr@main",
"mean": 0.4431821813,
"stddev": 0.0648037124154457,
"median": 0.4462304561,
"user": 0.41996686000000005,
"system": 0.7787173399999999,
"min": 0.34765558710000005,
"max": 0.5373058051
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.60204220484,
"stddev": 0.01103700094651709,
"median": 1.59948900234,
"user": 0.83030038,
"system": 0.8005119,
"min": 1.5895858758399999,
"max": 1.62054150184
},
{
"command": "pacquet@main",
"mean": 1.61417485004,
"stddev": 0.015124105029375823,
"median": 1.61405526734,
"user": 0.8366515799999998,
"system": 0.7764287000000001,
"min": 1.59340456984,
"max": 1.64592948584
},
{
"command": "pnpr@HEAD",
"mean": 0.2672349151400001,
"stddev": 0.005245043120881657,
"median": 0.26781112434,
"user": 0.23469968,
"system": 0.5025701,
"min": 0.25671649384,
"max": 0.27506168784
},
{
"command": "pnpr@main",
"mean": 0.27319927714000003,
"stddev": 0.012939910379132618,
"median": 0.26975674834,
"user": 0.24696928,
"system": 0.5013452,
"min": 0.25893170884000005,
"max": 0.29736774984000003
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2178847610418182,
"stddev": 0.016301245587329455,
"median": 0.21747670286,
"user": 0.19456470363636366,
"system": 0.07142263454545456,
"min": 0.19796062786000002,
"max": 0.25310582986
},
{
"command": "pacquet@main",
"mean": 0.22058789501384618,
"stddev": 0.011667998263789735,
"median": 0.21889404486,
"user": 0.1919394169230769,
"system": 0.07342133384615383,
"min": 0.20688694286,
"max": 0.25010567486
},
{
"command": "pnpr@HEAD",
"mean": 0.0887100830475,
"stddev": 0.001962577489483474,
"median": 0.08799892436000001,
"user": 0.031764683749999995,
"system": 0.011736538125000001,
"min": 0.08662942286,
"max": 0.09603958986
},
{
"command": "pnpr@main",
"mean": 0.08832240248499999,
"stddev": 0.0016738124238212307,
"median": 0.08785974636,
"user": 0.028256871249999992,
"system": 0.014322179999999999,
"min": 0.08643613786,
"max": 0.09357533486
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21482196681333335,
"stddev": 0.012969140031723747,
"median": 0.21894870948,
"user": 0.21158759111111108,
"system": 0.04595932444444444,
"min": 0.19644923048000001,
"max": 0.23367638748
},
{
"command": "pacquet@main",
"mean": 0.21383485192444449,
"stddev": 0.013432391829997219,
"median": 0.20898589748000002,
"user": 0.21156914666666662,
"system": 0.046321546666666664,
"min": 0.20120856448,
"max": 0.24084806648
},
{
"command": "pnpm@HEAD",
"mean": 3.1714693958133333,
"stddev": 0.04854444165703852,
"median": 3.19046995148,
"user": 4.685671368888887,
"system": 0.3388075466666667,
"min": 3.08781238448,
"max": 3.22535189248
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.08962297975212122,
"stddev": 0.00327159084218408,
"median": 0.08932076854000001,
"user": 0.07659053757575758,
"system": 0.04889998787878786,
"min": 0.08515296254,
"max": 0.10049621754000002
},
{
"command": "pacquet@main",
"mean": 0.09009965654000002,
"stddev": 0.004771937147697826,
"median": 0.08899994504,
"user": 0.07762868624999998,
"system": 0.047918012499999996,
"min": 0.08501034854,
"max": 0.10454218154000001
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.11469647908000001,
"stddev": 0.011262965471612811,
"median": 0.11448384172,
"user": 0.0465999,
"system": 0.07669621999999998,
"min": 0.10090409272,
"max": 0.14097532072000002
},
{
"command": "pacquet@main",
"mean": 0.10327086803034483,
"stddev": 0.005114051510459256,
"median": 0.10262317072,
"user": 0.04199359517241377,
"system": 0.06912398965517243,
"min": 0.09645057572,
"max": 0.11713570672000001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.4781814432800005,
"stddev": 0.1684094401691245,
"median": 4.41107087568,
"user": 1.8996446800000002,
"system": 1.40746606,
"min": 4.318089559680001,
"max": 4.837635785680001
},
{
"command": "pacquet@main",
"mean": 4.46891638628,
"stddev": 0.20936250043952967,
"median": 4.36929850768,
"user": 1.8482878799999996,
"system": 1.4230499599999997,
"min": 4.31810003968,
"max": 4.87890990368
},
{
"command": "pnpr@HEAD",
"mean": 3.50100813138,
"stddev": 0.12236383242624223,
"median": 3.4593257606799996,
"user": 1.81900628,
"system": 1.36730356,
"min": 3.4003351986799997,
"max": 3.81217830768
},
{
"command": "pnpr@main",
"mean": 3.51822066488,
"stddev": 0.15759356454083814,
"median": 3.4787471966799997,
"user": 1.9470184799999999,
"system": 1.4721024600000001,
"min": 3.3936028826799998,
"max": 3.92495106968
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19381661673714284,
"stddev": 0.010419797487941062,
"median": 0.19161062538,
"user": 0.24040160571428568,
"system": 0.17527628285714286,
"min": 0.18096212288,
"max": 0.21191128488
},
{
"command": "pacquet@main",
"mean": 0.18718876680857144,
"stddev": 0.01442862311163269,
"median": 0.18637263188,
"user": 0.22678646285714285,
"system": 0.16664642571428573,
"min": 0.16499957788,
"max": 0.22533058888
},
{
"command": "pnpr@HEAD",
"mean": 0.19052981841846156,
"stddev": 0.008814834575846331,
"median": 0.19208599188,
"user": 0.22647558923076927,
"system": 0.15853606307692306,
"min": 0.17533465088,
"max": 0.20344355088
},
{
"command": "pnpr@main",
"mean": 0.1950260682646154,
"stddev": 0.01363913864474017,
"median": 0.19223900088,
"user": 0.21978228153846155,
"system": 0.17064106307692306,
"min": 0.17661256188,
"max": 0.23011904288
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.2661681802199998,
"stddev": 0.03394621481735659,
"median": 1.25145804332,
"user": 0.6532588999999999,
"system": 0.27379951999999996,
"min": 1.22320331282,
"max": 1.31928887182
},
{
"command": "pacquet@main",
"mean": 1.2626635093199998,
"stddev": 0.022207469943424006,
"median": 1.25653685832,
"user": 0.6497852,
"system": 0.23965322000000003,
"min": 1.2368225848199998,
"max": 1.3055055708199998
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.03820938228231882,
"stddev": 0.004662282671656418,
"median": 0.03714839292,
"user": 0.027996487536231886,
"system": 0.019805573623188404,
"min": 0.03129166792,
"max": 0.05287949292
},
{
"command": "pacquet@main",
"mean": 0.03537278366074074,
"stddev": 0.0037328758746894663,
"median": 0.03410897192,
"user": 0.02414242419753086,
"system": 0.019745999259259267,
"min": 0.03078525692,
"max": 0.05029126692
}
]
} |
|
Execution Profiles recorded for 1 job, triggered by
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
a32abc0 to
e625340
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Code Review by Qodo
1. Peer deduplication can cause repeat installs
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Rebased onto Review of the change
Qodo finding declined ( Status: all 71 checks pass on e625340, CodeRabbit approved it with no actionable comments, and nothing remains within the PR's scope. Written by an agent (Claude Code, claude-fable-5-1). |
…the repeat-install fast path (#17383) A contract test reads the fields of `Config` from its source and requires each to be classified: recorded in the workspace state, ruling the fast path out, reaching it through another input, not an install input, or a known gap. A recorded field is proven by changing it and asserting the install gate reports its setting key, and a blocking field by asserting the fast path is ruled out. A new `Config` field fails the test until it is classified. The gaps the classification found were checked with the CLI: changing `virtualStoreDirMaxLength`, `globalVirtualStoreDir`, or turning on `dangerouslyAllowAllBuilds`, or turning off `skipRuntimes` leaves the fast path reporting the tree up to date while a full install changes it. Also drop the `dedupe_peers` value every freshness caller passed through from the config (`GatePolicy`, `CheckLockfileSettingsDriftOptions` and the content checks). The checks now read it from the config, so no gate can compare the lockfile against a hard-coded value again, the bug fixed by #17328. Part of pnpm/tasks#219.
Summary
Closes #17322.
The
verifyDepsBeforeRunlockfile check compared the lockfile'sdedupePeersagainstfalseinstead of the configured value, so withdedupePeers: trueany lockfile change made the check fail. In pnpm v12 with a pnpmfile active this turned into an install before everypnpm run/pnpm exec, since the install that followed found nothing to do and the gate never recorded the tree as proven. pnpm v11 has the same gap (assertLockfileSettingsUpToDatenever passeddedupePeers): it reportssettings.dedupePeersas outdated after a lockfile change and runs one extra install.Both now pass the configured
dedupePeers. With the fix, the issue's repro runs the script directly on every run, and switchingdedupePeersoff still triggers an install. The existing v12 e2e test pinned the old behavior (a frozen verifier install after a relaid lockfile), so it now expects the script to run without an install.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 (Claude Code, claude-opus-5-5).
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
pnpm runandpnpm execincorrectly reporting dependencies as outdated after a lockfile change when peer dependency deduplication is enabled.