Repository navigation
refactor: single staging layer for fast lockfile updates - #13762
Conversation
📝 WalkthroughWalkthroughChangesFast lockfile updates
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
Possibly related PRs
Suggested labels: ✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
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 |
PR Summary by QodoSingle staging layer for fast lockfile updates (fix stale catalogs deletion)
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains, and the previously reported narrating comment has been removed. Reviews (3): Last reviewed commit: "perf: address review findings on the fas..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13762 +/- ##
=======================================
Coverage 88.12% 88.12%
=======================================
Files 622 622
Lines 101217 101260 +43
=======================================
+ Hits 89197 89238 +41
- Misses 12020 12022 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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. 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.6181829964600003,
"stddev": 0.11406929250300374,
"median": 2.64967195766,
"user": 2.1691954,
"system": 1.7401042200000003,
"min": 2.39177369316,
"max": 2.82092692916,
"times": [
2.64859834116,
2.65074557416,
2.39177369316,
2.5395643581600003,
2.55448067516,
2.6674647361600003,
2.6655509591600004,
2.82092692916,
2.68390447716,
2.55882022116
]
},
{
"command": "pacquet@main",
"mean": 2.4657173612600003,
"stddev": 0.10095174772593647,
"median": 2.4364785921600003,
"user": 1.9321908000000003,
"system": 1.5328973199999998,
"min": 2.35133803816,
"max": 2.70317795916,
"times": [
2.4413035301600003,
2.70317795916,
2.4316536541600002,
2.40346050116,
2.4306421131600002,
2.4554299701600004,
2.35133803816,
2.52579530816,
2.53310669816,
2.38126584016
]
},
{
"command": "pnpr@HEAD",
"mean": 1.53411117066,
"stddev": 0.12621875731010843,
"median": 1.54373558116,
"user": 1.3578282000000002,
"system": 1.2609201200000002,
"min": 1.35258294616,
"max": 1.7607557551600002,
"times": [
1.5952401891599999,
1.7607557551600002,
1.35258294616,
1.36283768916,
1.56982549416,
1.47566158416,
1.56078420616,
1.4730180691599999,
1.52668695616,
1.6637188171600001
]
},
{
"command": "pnpr@main",
"mean": 1.5743111093599997,
"stddev": 0.14109761189037728,
"median": 1.60890688666,
"user": 1.3379068999999997,
"system": 1.2770726199999998,
"min": 1.37818408716,
"max": 1.79804368016,
"times": [
1.61014084616,
1.37884783716,
1.6843705711599999,
1.50793462816,
1.69864024316,
1.79804368016,
1.6281564821599999,
1.60767292716,
1.37818408716,
1.45111979116
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26278042372,
"stddev": 0.012309360885763532,
"median": 0.26366037082,
"user": 0.22080218000000001,
"system": 0.51863078,
"min": 0.24650767232,
"max": 0.28783918731999997,
"times": [
0.25354622332,
0.27022855132,
0.25641844731999996,
0.26004295132,
0.24881343132000003,
0.26856880932,
0.24650767232,
0.26856117332,
0.26727779032,
0.28783918731999997
]
},
{
"command": "pacquet@main",
"mean": 0.28331925301999994,
"stddev": 0.016354047467927978,
"median": 0.28477767381999997,
"user": 0.25273028000000003,
"system": 0.58336448,
"min": 0.25389889732,
"max": 0.30642973832,
"times": [
0.30642973832,
0.29862761532,
0.28348335532,
0.28607199231999997,
0.29751427432,
0.29209991232,
0.27454236532,
0.27613097731999997,
0.26439340231999997,
0.25389889732
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28639962342,
"stddev": 0.009079901521962365,
"median": 0.28590859982,
"user": 0.24338308,
"system": 0.54568398,
"min": 0.27405508932,
"max": 0.30119841531999997,
"times": [
0.28288563332,
0.29479706932,
0.30119841531999997,
0.27405508932,
0.28858785232,
0.29601828632,
0.27501780532,
0.28322934732,
0.27961474432,
0.28859199132
]
},
{
"command": "pnpr@main",
"mean": 0.27440417262000005,
"stddev": 0.00920900863556922,
"median": 0.27238018131999997,
"user": 0.23652477999999996,
"system": 0.5442813799999999,
"min": 0.26036629631999997,
"max": 0.29045918032,
"times": [
0.28288365332,
0.27964519532,
0.27145743631999997,
0.26630151132,
0.26614907632,
0.27282488332,
0.28201901432,
0.27193547932,
0.26036629631999997,
0.29045918032
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.61877504406,
"stddev": 0.031820837367437876,
"median": 2.6153892586599996,
"user": 1.8887839199999998,
"system": 1.49064776,
"min": 2.57212900116,
"max": 2.6664924471599996,
"times": [
2.6050696101599997,
2.57212900116,
2.5813658571599998,
2.5937815291599997,
2.6099824521599997,
2.62079606516,
2.6664924471599996,
2.6551375571599998,
2.63904470416,
2.6439512171599997
]
},
{
"command": "pacquet@main",
"mean": 2.6440451934599998,
"stddev": 0.036165046055514787,
"median": 2.6356406881599996,
"user": 2.02742392,
"system": 1.59407556,
"min": 2.5933273981599996,
"max": 2.7205540571599998,
"times": [
2.67132454516,
2.5933273981599996,
2.6117081221599996,
2.63239191116,
2.63450781716,
2.7205540571599998,
2.67473270216,
2.63677355916,
2.6266272001599997,
2.6385046221599997
]
},
{
"command": "pnpr@HEAD",
"mean": 1.59331759416,
"stddev": 0.14500470716544675,
"median": 1.5073360251599999,
"user": 1.45704062,
"system": 1.35143506,
"min": 1.43862663416,
"max": 1.77626862916,
"times": [
1.74663720516,
1.77410253916,
1.50750572416,
1.46638291416,
1.77626862916,
1.50716632616,
1.74224079716,
1.43862663416,
1.48993339516,
1.48431177716
]
},
{
"command": "pnpr@main",
"mean": 1.68230592046,
"stddev": 0.15779009778771305,
"median": 1.6742125941600001,
"user": 1.5043676199999998,
"system": 1.43599376,
"min": 1.49059570116,
"max": 1.92879590416,
"times": [
1.5226609901600001,
1.62226455216,
1.84782554716,
1.61157470816,
1.7261606361600002,
1.4947401851600002,
1.73866061516,
1.92879590416,
1.49059570116,
1.83978036516
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5297104996800002,
"stddev": 0.018345347025572185,
"median": 0.53062681188,
"user": 0.7304970799999999,
"system": 0.8746594799999997,
"min": 0.49040989488000003,
"max": 0.55229107188,
"times": [
0.5241073018800001,
0.5183604418800001,
0.54100650888,
0.55229107188,
0.5520342908800001,
0.52093645588,
0.53670540688,
0.49040989488000003,
0.52511395888,
0.5361396648800001
]
},
{
"command": "pacquet@main",
"mean": 0.53400980828,
"stddev": 0.030413608623959545,
"median": 0.53606044538,
"user": 0.7623892800000001,
"system": 0.85268088,
"min": 0.49099637688000003,
"max": 0.5863954828800001,
"times": [
0.52683090688,
0.49155111288000003,
0.5179683018800001,
0.5638579008800001,
0.54528998388,
0.5863954828800001,
0.5509136118800001,
0.5206274378800001,
0.54566696688,
0.49099637688000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33599162158,
"stddev": 0.011200149414498603,
"median": 0.33732772538,
"user": 0.23890307999999996,
"system": 0.5853920799999999,
"min": 0.32231391988,
"max": 0.35436660088000005,
"times": [
0.33914473888,
0.32924597088000007,
0.35436660088000005,
0.32389515588000006,
0.32258687188000007,
0.34215824788000004,
0.33551071188000003,
0.34316660188000003,
0.34752739588000003,
0.32231391988
]
},
{
"command": "pnpr@main",
"mean": 0.35292952808000005,
"stddev": 0.01793203875452187,
"median": 0.3538606443800001,
"user": 0.26696297999999996,
"system": 0.5986630799999999,
"min": 0.32290393788000005,
"max": 0.38578552988000003,
"times": [
0.32290393788000005,
0.3621359168800001,
0.35358183088000006,
0.35413945788000006,
0.35850953288000004,
0.38578552988000003,
0.35166571688000003,
0.36731821388,
0.34187384088000006,
0.33138130288000006
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.80811321762,
"stddev": 0.06401082328222722,
"median": 1.80026644332,
"user": 1.0100222999999997,
"system": 0.9626024999999998,
"min": 1.73661847982,
"max": 1.9314786108200002,
"times": [
1.7496989278200001,
1.73661847982,
1.74319724582,
1.8779847388200002,
1.8438583238200001,
1.9314786108200002,
1.83383824182,
1.79692330782,
1.80360957882,
1.7639247208200002
]
},
{
"command": "pacquet@main",
"mean": 1.7528279525200001,
"stddev": 0.029427320092820265,
"median": 1.7466092183200002,
"user": 0.8796668999999999,
"system": 0.86776,
"min": 1.7137849558200002,
"max": 1.80845907582,
"times": [
1.75648879082,
1.7137849558200002,
1.72173781182,
1.74467217282,
1.80845907582,
1.74147374382,
1.73210492282,
1.74854626382,
1.77740912382,
1.7836026638200002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33034988682,
"stddev": 0.01924043811603221,
"median": 0.32386342982000005,
"user": 0.236232,
"system": 0.5800546,
"min": 0.30149835282000004,
"max": 0.36974704682000004,
"times": [
0.31960108582,
0.32095581582000005,
0.32677104382,
0.36974704682000004,
0.34494587482,
0.31999967382,
0.30149835282000004,
0.31858583582,
0.34607844682,
0.33531569182000004
]
},
{
"command": "pnpr@main",
"mean": 0.33402572892,
"stddev": 0.027143406535798022,
"median": 0.32433248582000007,
"user": 0.2402405,
"system": 0.5754541999999999,
"min": 0.30248644582,
"max": 0.39209095682,
"times": [
0.34796223482,
0.39209095682,
0.34233084582,
0.31350310382,
0.32455396082000004,
0.32411101082000005,
0.32265844782,
0.36037820982,
0.31018207282000004,
0.30248644582
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2555167979618182,
"stddev": 0.029278030450175456,
"median": 0.24482158078000002,
"user": 0.2252288109090909,
"system": 0.09197062909090911,
"min": 0.21532933678000002,
"max": 0.32046460578,
"times": [
0.24262594778000002,
0.24482158078000002,
0.24154833678,
0.26428794578000003,
0.26695644478,
0.29126115078000003,
0.32046460578,
0.25116544978,
0.23443619778000002,
0.23778778078,
0.21532933678000002
]
},
{
"command": "pacquet@main",
"mean": 0.22384291468909093,
"stddev": 0.019667902003448146,
"median": 0.23028686178000002,
"user": 0.1888509018181818,
"system": 0.06593381090909091,
"min": 0.19516539578,
"max": 0.25303806878,
"times": [
0.24707696678000002,
0.23803615078,
0.20023966178000002,
0.22265099078,
0.23426851078000002,
0.20243848278,
0.23028686178000002,
0.25303806878,
0.19516539578,
0.20839483678,
0.23067613478000001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09343779729612905,
"stddev": 0.0034228562591097893,
"median": 0.09223054278000001,
"user": 0.024191171612903215,
"system": 0.012187908387096774,
"min": 0.08873583578000001,
"max": 0.10378345678,
"times": [
0.09065886978000001,
0.09167856378000001,
0.08969998878,
0.09208097578,
0.09539881078000001,
0.09079718278000001,
0.09077219578000001,
0.09115548078,
0.09027949078000001,
0.09251735178,
0.08968519278,
0.09160335378000001,
0.09175149378000001,
0.09489271278000001,
0.09410765678,
0.09411496478,
0.09159199278,
0.09223054278000001,
0.08873583578000001,
0.09209300178,
0.09517254778,
0.09048228978,
0.09233818178,
0.09719719978000001,
0.09583679378000001,
0.10378345678,
0.09858615478,
0.09870486378000001,
0.09992591978000001,
0.09502684078000001,
0.09367180878
]
},
{
"command": "pnpr@main",
"mean": 0.09391971611333333,
"stddev": 0.003426163264184644,
"median": 0.09411867528000001,
"user": 0.024354386666666665,
"system": 0.01278452,
"min": 0.08843319678,
"max": 0.10533845678,
"times": [
0.09433154078,
0.09117313578000001,
0.08918124278,
0.09202518978,
0.09203170778000001,
0.08843319678,
0.09557902678,
0.09062501278,
0.09610838878000001,
0.09706522678000001,
0.08965310678,
0.09599430178000001,
0.09303569078000001,
0.09278564378000001,
0.09297909178000001,
0.10533845678,
0.08902025578,
0.09085732678000001,
0.09410337978000001,
0.09259974578,
0.09349551278000001,
0.09513127378000001,
0.10004983878000001,
0.09612160278000001,
0.09413397078,
0.09624344078000001,
0.09523509878000001,
0.09515948578000001,
0.09431085078000001,
0.09478973978
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9612426064355556,
"stddev": 0.3377272223416577,
"median": 0.8313479198800001,
"user": 0.911773588888889,
"system": 0.18314351999999998,
"min": 0.62968936088,
"max": 1.61978435388,
"times": [
0.7218366188800001,
0.62968936088,
0.8022342828800001,
0.8313479198800001,
1.24149351888,
1.61978435388,
0.9067817588800001,
1.2552717478800002,
0.6427438958800001
]
},
{
"command": "pacquet@main",
"mean": 0.9707271875466669,
"stddev": 0.17276760996127105,
"median": 1.00896041988,
"user": 0.9364888111111109,
"system": 0.18751418666666664,
"min": 0.6146365718800001,
"max": 1.2107690398800002,
"times": [
0.6146365718800001,
0.8622614788800002,
0.9793022538800001,
1.00896041988,
1.0995829668800001,
1.2107690398800002,
1.03721933988,
1.06162542188,
0.8621871948800001
]
},
{
"command": "pnpm@HEAD",
"mean": 3.558401402213333,
"stddev": 0.2335038777367015,
"median": 3.52962977988,
"user": 5.17971358888889,
"system": 0.36951607555555555,
"min": 3.23072499988,
"max": 3.96806525088,
"times": [
3.72511459888,
3.68561346688,
3.52962977988,
3.27902049388,
3.48595809188,
3.23072499988,
3.43252538588,
3.96806525088,
3.68896055188
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.66212395154,
"stddev": 0.1289417563727637,
"median": 4.60632844424,
"user": 2.7526735600000003,
"system": 2.0204648599999997,
"min": 4.56061217374,
"max": 4.90530790074,
"times": [
4.566796827739999,
4.60449624174,
4.90530790074,
4.60816064674,
4.57238153674,
4.65392064074,
4.89143662474,
4.66052115874,
4.59760576374,
4.56061217374
]
},
{
"command": "pacquet@main",
"mean": 4.67665020524,
"stddev": 0.1764577363368434,
"median": 4.59055521774,
"user": 2.5718423599999998,
"system": 1.9454490599999996,
"min": 4.5233301057399995,
"max": 4.99573586174,
"times": [
4.68389741674,
4.59108131374,
4.564588477739999,
4.56118293374,
4.75445115774,
4.99573586174,
4.5233301057399995,
4.53086929774,
4.59002912174,
4.97133636574
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5621511447400005,
"stddev": 0.14404961714292666,
"median": 3.50449776424,
"user": 1.46748096,
"system": 1.3618903599999999,
"min": 3.45439143174,
"max": 3.93466709174,
"times": [
3.93466709174,
3.65423073074,
3.4832785577400003,
3.50937297374,
3.49962255474,
3.5952177087400004,
3.45439143174,
3.52416702974,
3.48376850574,
3.48279486274
]
},
{
"command": "pnpr@main",
"mean": 3.5743819601399998,
"stddev": 0.06273368268694057,
"median": 3.56934105724,
"user": 1.69875096,
"system": 1.5138014599999998,
"min": 3.4724508857400003,
"max": 3.67417796474,
"times": [
3.55807220774,
3.53463303374,
3.63137150974,
3.67417796474,
3.51697871074,
3.4724508857400003,
3.58327776874,
3.58060990674,
3.54312294574,
3.64912466774
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13762 |
| 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.63 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 301.50 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 322.31 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 88.74 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,352.58 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,454.39 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 274.06 ms |
|
Addressed in b17c360:
Written by an agent (Claude Code, claude-opus-5). |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.changeset/group-moves-fast-update.md (1)
7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse user-visible wording for the release note.
The phrase “updates the lockfile in place instead of re-resolving the whole dependency graph” describes the implementation. State the observable benefit instead: the install reuses existing resolutions during dependency-group moves.
Suggested wording
-`pnpm install` after moving a dependency between `dependencies`, `devDependencies`, and `optionalDependencies` now updates the lockfile in place instead of re-resolving the whole dependency graph [`#13696`](https://github.com/pnpm/pnpm/issues/13696). +`pnpm install` now reuses existing dependency resolutions when a dependency moves between `dependencies`, `devDependencies`, and `optionalDependencies` [`#13696`](https://github.com/pnpm/pnpm/issues/13696).As per path instructions and retrieved learnings, Changeset entries should describe concise user-visible behavior rather than internal implementation rationale.
🤖 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 @.changeset/group-moves-fast-update.md at line 7, Rewrite the changeset entry to describe the user-visible behavior: when moving a dependency between dependencies, devDependencies, and optionalDependencies, pnpm install reuses the existing dependency resolutions. Remove the implementation-focused wording about updating the lockfile in place and re-resolving the graph.Sources: Path instructions, Learnings
pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts (1)
182-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated
trackRequestedPackageshelper across two fast-update test files. Both test files define the same helper, which wrapsstoreController.requestPackageto record requested aliases. A single shared helper prevents the two copies from diverging.
pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts#L182-L190: remove the local helper and import a shared one fromtest/utils.pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts#L174-L182: remove the local helper and import the same shared one.🤖 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 `@pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts` around lines 182 - 190, Remove the duplicated trackRequestedPackages helper from pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts lines 182-190 and pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts lines 174-182, add one shared implementation under test/utils, and import it in both test files while preserving existing usage.
🤖 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 @.changeset/group-moves-fast-update.md:
- Line 7: Rewrite the changeset entry to describe the user-visible behavior:
when moving a dependency between dependencies, devDependencies, and
optionalDependencies, pnpm install reuses the existing dependency resolutions.
Remove the implementation-focused wording about updating the lockfile in place
and re-resolving the graph.
In
`@pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts`:
- Around line 182-190: Remove the duplicated trackRequestedPackages helper from
pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts
lines 182-190 and
pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts lines
174-182, add one shared implementation under test/utils, and import it in both
test files while preserving existing usage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2d254fc2-1027-40e6-bf58-9d171faad576
📒 Files selected for processing (12)
.changeset/fast-update-single-staging.md.changeset/group-moves-fast-update.mdpnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rspnpm/crates/package-manager/src/fast_update_importers.rspnpm/crates/package-manager/src/fast_update_importers/tests.rspnpm/crates/package-manager/src/fast_update_lockfile.rspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.tspnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.tspnpm11/installing/deps-installer/test/install/catalogFastUpdate.tspnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.tspnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts
The fast-update coordinator already stages every rewrite on a clone and discards it unless the candidate passes the freshness gates, so the importers handler staging its own inner clone and copying back was a second, redundant layer; it now mutates the coordinator's candidate directly. The coordinator also commits by replacing the lockfile's keys wholesale instead of Object.assign, which silently kept top-level keys the update had deleted: removing the last referent of a catalog entry through the fast path left the stale catalogs section in the written lockfile. pacquet's importers handler now scans for manifest drift before cloning the lockfile, so installs whose drift lies elsewhere (a settings or patch change) no longer pay a full lockfile clone in the handler; the other pacquet handlers already detected before cloning. The canTryFastUpdateLockfile trigger list is deduplicated into a FAST_UPDATABLE_SETTINGS constant. Related to #13696.
The importers handler's manifest map is now keyed by PkgName, parsed once when the map is built, so the drift pre-scan, the update loop, and the removal filter test membership without per-dependency string conversions. The TypeScript empty-group cleanup only runs for a project whose groups were actually edited. The coordinator's wholesale-replacement check uses Object.hasOwn instead of the prototype-chain-sensitive in operator.
b17c360 to
6a6932f
Compare
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Code review by qodo was updated up to the latest commit 6a6932f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Related to #13696. Builds on the group-moves work from #13761 (merged); rebased onto
main.First stage of consolidating the fast lockfile update paths: one staging layer instead of two, and no lockfile clone before drift is detected.
tryFastUpdateLockfile) already clones the lockfile and discards the candidate unless it passes the freshness gates, yet the importers handler staged its own inner clone and copied back on success. The handler now mutates the coordinator's candidate directly; the discard-on-failure invariant lives in one place and is pinned by coordinator-level tests.Object.assign, which cannot delete top-level keys — removing the last referent of a catalog entry through the fast path left the stalecatalogs:section in the written lockfile (a full resolution drops it). The commit now replaces the lockfile's keys wholesale. Regression-tested at unit and install level; the install-level test failed before the fix.try_fast_update_importerscloned the whole lockfile before checking for drift, so every stale install paid a clone in this handler even when its drift lay elsewhere (a settings or patch change). It now scans for manifest drift on a borrow and clones only when it will act. The other three sync handlers already detected before cloning.canTryFastUpdateLockfiletrigger list is deduplicated into aFAST_UPDATABLE_SETTINGSconstant.No behavior changes apart from the catalog fix; both stacks fall back to the resolver under the same conditions as before. Stage 2 (composing handlers on one candidate instead of the exactly-one-fires rule) is filed separately.
Squash Commit Body
Checklist
already linked to it solves it.
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 (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit