Repository navigation
fix(catalogs): honor a wanted version the catalog entry already resolves past (pacquet) - #13853
Conversation
…ves past #13841 fixed this for the TypeScript CLI; this is the pacquet side. A version named on the command line reached the lockfile only through the specifier written to the manifest. A cataloged dependency writes `catalog:` there and keeps its version in the catalog entry, so when that entry was a range covering the wanted version but resolved to another one, the request was dropped in silence — `add <pkg>@<version>` wrote nothing at all, and `update <pkg>@<version>` re-resolved to the highest version in range rather than to the one asked for. Install grows a preferred-versions overlay, layered onto the seed built from the lockfile and manifests. `add` and `update` put a version named on the command line there, weighted above the lockfile's own pin so the re-resolve lands on it. `add` also withholds that package's pin and skips the frozen shortcut, which would otherwise hold: its manifest specifier doesn't change when the version behind a `catalog:` reference does, so nothing looked stale enough to resolve. Every other install passes no overlay and is unaffected. Related to #13715. 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)
📝 WalkthroughWalkthroughTargeted catalog ChangesCatalog resolution updates
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Command as Add or Update command
participant Catalog as Catalog request preparation
participant Install as Install pipeline
participant Resolver as Fresh-lockfile resolver
Command->>Catalog: Collect requested catalog versions
Catalog->>Install: Pass preferred versions and pin changes
Install->>Resolver: Forward preferred_versions_override
Resolver->>Resolver: Merge overrides into resolution seeds
Resolver-->>Command: Resolve requested catalog version
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 catalogs: honor CLI-requested versions via preferred-versions override
AI Description
Diagram
High-Level Assessment
Files changed (21)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "style(catalogs): close a multi-line macr..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
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.65595778788,
"stddev": 0.15336545925857675,
"median": 2.63103881188,
"user": 2.23872936,
"system": 1.70684852,
"min": 2.44661170438,
"max": 2.86485708938,
"times": [
2.49666267238,
2.86485708938,
2.51367605838,
2.44661170438,
2.85145712838,
2.5772266833799997,
2.81515431338,
2.73185460538,
2.60070235438,
2.66137526938
]
},
{
"command": "pacquet@main",
"mean": 2.5454561152799995,
"stddev": 0.10943554816418599,
"median": 2.48989511938,
"user": 2.33950656,
"system": 1.74127592,
"min": 2.39882044338,
"max": 2.6842361923799998,
"times": [
2.47126570538,
2.67168602338,
2.49168638738,
2.48810385138,
2.67293642438,
2.46071822238,
2.6460982773799997,
2.39882044338,
2.6842361923799998,
2.46900962538
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6049799651799996,
"stddev": 0.14530389153372983,
"median": 1.64918068238,
"user": 1.59051406,
"system": 1.45960942,
"min": 1.42487231938,
"max": 1.75891065138,
"times": [
1.6996857193800001,
1.71678513638,
1.49192981538,
1.7350280253800001,
1.7581033693800001,
1.42487231938,
1.75891065138,
1.4357936113799998,
1.59867564538,
1.43001535838
]
},
{
"command": "pnpr@main",
"mean": 1.6374082902800002,
"stddev": 0.15096063045785618,
"median": 1.6177883418799999,
"user": 1.6579181600000001,
"system": 1.4293188199999998,
"min": 1.4032686323799999,
"max": 1.8749444843799998,
"times": [
1.64222808338,
1.52167111938,
1.59334860038,
1.4785571443799999,
1.77564615138,
1.70040596738,
1.58195272138,
1.8749444843799998,
1.4032686323799999,
1.8020599983799999
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.29123232618000006,
"stddev": 0.028453783402447315,
"median": 0.30452540728,
"user": 0.24090894000000002,
"system": 0.5863966399999999,
"min": 0.23979126978,
"max": 0.32138513778000005,
"times": [
0.31145248178,
0.32138513778000005,
0.30870027478,
0.31763221978,
0.25318247178000003,
0.23979126978,
0.30203529978000004,
0.30701551478,
0.27836326178000004,
0.27276532978
]
},
{
"command": "pacquet@main",
"mean": 0.27358022568000007,
"stddev": 0.009057775388702215,
"median": 0.27277375378,
"user": 0.23674493999999996,
"system": 0.55229394,
"min": 0.25945715978,
"max": 0.29133341378000005,
"times": [
0.29133341378000005,
0.28380511578,
0.27122511178,
0.26857213878,
0.27432239578,
0.26946533478,
0.27649139778000004,
0.27527874478000003,
0.26585144378000003,
0.25945715978
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30870308228000004,
"stddev": 0.012906715655253432,
"median": 0.31086332778000003,
"user": 0.2722058399999999,
"system": 0.5686615399999999,
"min": 0.28106786278,
"max": 0.32618456878,
"times": [
0.31146719878,
0.31462922178,
0.30089011378,
0.30128574678000003,
0.32372934978,
0.31025945678000005,
0.30412691078000004,
0.31339039278,
0.32618456878,
0.28106786278
]
},
{
"command": "pnpr@main",
"mean": 0.30118588058000006,
"stddev": 0.025873736907569608,
"median": 0.30353426878,
"user": 0.24039634,
"system": 0.5786516399999998,
"min": 0.26172436178,
"max": 0.35252399178000005,
"times": [
0.30754925778000003,
0.30452413478,
0.27792917778000004,
0.26172436178,
0.35252399178000005,
0.30254440278,
0.27966232078000003,
0.32668208478000005,
0.30703715978,
0.29168191378
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.8341234952,
"stddev": 0.05450784040336379,
"median": 2.845504665,
"user": 2.20485354,
"system": 1.7367457000000002,
"min": 2.7545588629999997,
"max": 2.90709783,
"times": [
2.845396605,
2.897577271,
2.764841051,
2.796608489,
2.88837909,
2.90709783,
2.795275212,
2.7545588629999997,
2.845887816,
2.845612725
]
},
{
"command": "pacquet@main",
"mean": 2.7632717391999995,
"stddev": 0.056843822647809655,
"median": 2.7440134325,
"user": 2.02466564,
"system": 1.6247719,
"min": 2.6936447739999996,
"max": 2.8642117419999997,
"times": [
2.7729839849999998,
2.8642117419999997,
2.844574428,
2.800649398,
2.73230396,
2.718526533,
2.726209345,
2.723890322,
2.755722905,
2.6936447739999996
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6406147692000002,
"stddev": 0.13894935977432707,
"median": 1.6759346985,
"user": 1.4077706399999999,
"system": 1.3863075,
"min": 1.41573945,
"max": 1.844406422,
"times": [
1.6814514720000002,
1.41573945,
1.724961033,
1.5073976900000001,
1.671179337,
1.773010701,
1.653508189,
1.68069006,
1.844406422,
1.453803338
]
},
{
"command": "pnpr@main",
"mean": 1.6241325404000002,
"stddev": 0.1522169919395789,
"median": 1.65175072,
"user": 1.2992068399999999,
"system": 1.2782902999999999,
"min": 1.4383477470000001,
"max": 1.8595752150000002,
"times": [
1.691980979,
1.8595752150000002,
1.698737498,
1.49257184,
1.805577369,
1.711700491,
1.457755929,
1.473557875,
1.611520461,
1.4383477470000001
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.46261246612000007,
"stddev": 0.02756209618830837,
"median": 0.46325042392000004,
"user": 0.5717246599999999,
"system": 0.72671738,
"min": 0.41735897392000004,
"max": 0.50270823492,
"times": [
0.48182367292,
0.46051659692,
0.50045518792,
0.46393829092,
0.46290344092,
0.41735897392000004,
0.50270823492,
0.46359740692,
0.43614973592,
0.43667311992
]
},
{
"command": "pacquet@main",
"mean": 0.43987447592000006,
"stddev": 0.0311102126261991,
"median": 0.43880803092,
"user": 0.51997366,
"system": 0.70577558,
"min": 0.40044186692,
"max": 0.5029788189200001,
"times": [
0.42997108792,
0.45403381892,
0.44764497392,
0.40044186692,
0.40846921492,
0.45238026592,
0.5029788189200001,
0.46550922992000004,
0.42622242792000004,
0.41109305392
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30804050091999996,
"stddev": 0.015886733810856674,
"median": 0.30351645592,
"user": 0.21059055999999998,
"system": 0.5271669800000001,
"min": 0.28714714792,
"max": 0.33446582292,
"times": [
0.33446582292,
0.32447351592,
0.30588517392000003,
0.31924702692,
0.32112413992,
0.29575578792,
0.29027736192000003,
0.30088129392,
0.30114773792,
0.28714714792
]
},
{
"command": "pnpr@main",
"mean": 0.30108147702000004,
"stddev": 0.012168794929066392,
"median": 0.29804459692,
"user": 0.20570125999999997,
"system": 0.51583468,
"min": 0.28667414392,
"max": 0.32542427092000004,
"times": [
0.30838891992,
0.32542427092000004,
0.29672924592,
0.30681502892,
0.29763295192,
0.29845624192000003,
0.31202706692,
0.28667414392,
0.28680989992,
0.29185699992
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8827372793200001,
"stddev": 0.02127779833345945,
"median": 1.8910519484200001,
"user": 0.8099082599999999,
"system": 0.79894206,
"min": 1.84303186792,
"max": 1.91331223192,
"times": [
1.89476879792,
1.91331223192,
1.86337542792,
1.8764611079200002,
1.89593697492,
1.8948321859200001,
1.89700705492,
1.86131204492,
1.8873350989200002,
1.84303186792
]
},
{
"command": "pacquet@main",
"mean": 1.86170559992,
"stddev": 0.02618111381954016,
"median": 1.86262246642,
"user": 0.8131576599999999,
"system": 0.7992709600000001,
"min": 1.82671816192,
"max": 1.89756131092,
"times": [
1.88863370892,
1.85761687492,
1.83396625692,
1.86762805792,
1.89756131092,
1.86879564192,
1.82671816192,
1.89531542692,
1.84401900192,
1.83680155692
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29339649232000004,
"stddev": 0.005074352854904954,
"median": 0.29356675342,
"user": 0.21450205999999997,
"system": 0.48679046000000004,
"min": 0.28619537292,
"max": 0.30092243992,
"times": [
0.28640914592,
0.28619537292,
0.29734731792,
0.30011450692,
0.30092243992,
0.29393805892,
0.29352047692,
0.29178232192000003,
0.29012225192,
0.29361302992
]
},
{
"command": "pnpr@main",
"mean": 0.29485259452000007,
"stddev": 0.008370737646005606,
"median": 0.29649192192,
"user": 0.19746085999999996,
"system": 0.50772266,
"min": 0.28315633392,
"max": 0.31123823492,
"times": [
0.31123823492,
0.28478788692,
0.28937793192,
0.29548071292,
0.29750313092,
0.28940890992,
0.28315633392,
0.29886521692,
0.29979251092000003,
0.29891507592
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.22662648839000002,
"stddev": 0.028385949670368886,
"median": 0.22475328164000002,
"user": 0.1727433266666667,
"system": 0.07007464000000001,
"min": 0.19016247914,
"max": 0.29438116514,
"times": [
0.23613185814,
0.23247814414,
0.29438116514,
0.25053717414,
0.19016247914,
0.21999270514000002,
0.19799028414,
0.22951385814,
0.21338118814,
0.19694184914,
0.24138209614,
0.21662505914000002
]
},
{
"command": "pacquet@main",
"mean": 0.21713233597333337,
"stddev": 0.011117484940629859,
"median": 0.21546596064,
"user": 0.17148774333333336,
"system": 0.060191473333333335,
"min": 0.20307133514,
"max": 0.24399033114000002,
"times": [
0.24399033114000002,
0.22612918314000002,
0.22123258314000002,
0.21334547214000002,
0.21954728314000002,
0.20533832614,
0.21648283514,
0.21444908614000002,
0.22281479214000002,
0.20307133514,
0.21346058714000002,
0.20572621714
]
},
{
"command": "pnpr@HEAD",
"mean": 0.09041848930129032,
"stddev": 0.003022287602970595,
"median": 0.08992667414,
"user": 0.02061407935483871,
"system": 0.012699285161290324,
"min": 0.08530534014,
"max": 0.09705332514000001,
"times": [
0.08947322014,
0.09377798914,
0.09140917614,
0.09426676814,
0.09204983114,
0.08976036514,
0.09052245614,
0.09528299114000001,
0.09299006414000001,
0.09588045214,
0.08977985214,
0.08564469914,
0.09705332514000001,
0.08719886114,
0.08806609014,
0.08907221214,
0.09186063514000001,
0.08785607714,
0.08933198014,
0.08617014114,
0.08608732514,
0.08657270214,
0.09149474814,
0.08969130314,
0.08984650614,
0.08992667414,
0.09194822614,
0.09046694914,
0.09183235014,
0.08530534014,
0.09235385714
]
},
{
"command": "pnpr@main",
"mean": 0.0892585383521212,
"stddev": 0.0032361564331979125,
"median": 0.08870357114,
"user": 0.02016241757575758,
"system": 0.012372499393939395,
"min": 0.08452699214,
"max": 0.09693234514,
"times": [
0.08505133414,
0.08643616914,
0.08579207614,
0.09306247214,
0.08862369014,
0.09067733914000001,
0.08452699214,
0.08779161114,
0.09181413714,
0.08932303914,
0.09100069614,
0.09115694814,
0.09080336014,
0.09412556014000001,
0.08760435614,
0.08720904514,
0.09618816014,
0.08649281914,
0.08974708014,
0.08797330614,
0.09008232314,
0.08607431914000001,
0.08586820314,
0.08719692114000001,
0.08612054914,
0.08870357114,
0.08887806414,
0.09693234514,
0.09197927014,
0.09345149314000001,
0.09242495514,
0.08500044414,
0.08741911514
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5179963432044444,
"stddev": 0.11846332350728864,
"median": 0.46725572676,
"user": 0.48087900666666666,
"system": 0.13004951777777776,
"min": 0.39888526476,
"max": 0.7707097357600001,
"times": [
0.6433134057600001,
0.44588072376,
0.7707097357600001,
0.5477722417600001,
0.46660484276,
0.44259957976000003,
0.46725572676,
0.47894556776,
0.39888526476
]
},
{
"command": "pacquet@main",
"mean": 0.5060022679822223,
"stddev": 0.08791038059484453,
"median": 0.52173123576,
"user": 0.46438533999999987,
"system": 0.11572118444444444,
"min": 0.39178746076,
"max": 0.63325681576,
"times": [
0.52173123576,
0.39178746076,
0.5993376907600001,
0.41170380576,
0.41274566976,
0.63325681576,
0.56352906276,
0.47323209276,
0.54669657776
]
},
{
"command": "pnpm@HEAD",
"mean": 2.941402729537777,
"stddev": 0.10790547706247829,
"median": 2.90275671776,
"user": 4.224596451111111,
"system": 0.2907176288888889,
"min": 2.8712797017600002,
"max": 3.2190484177600003,
"times": [
2.90275671776,
2.87133479076,
3.2190484177600003,
2.92585081976,
2.9323114027600004,
2.90106254876,
2.8712797017600002,
2.8911927947600002,
2.95778737176
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.59381443706,
"stddev": 0.16955269416349908,
"median": 4.50539482036,
"user": 1.9680573399999997,
"system": 1.43680384,
"min": 4.42606064036,
"max": 4.814254908360001,
"times": [
4.43101726536,
4.814254908360001,
4.76611010536,
4.45498701936,
4.468453208360001,
4.79679222736,
4.42606064036,
4.54233643236,
4.46791202036,
4.770220543360001
]
},
{
"command": "pacquet@main",
"mean": 4.54866512476,
"stddev": 0.16803292111271426,
"median": 4.48087158986,
"user": 1.95853294,
"system": 1.50077284,
"min": 4.4134459693600006,
"max": 4.94940007836,
"times": [
4.69223089936,
4.44740712536,
4.44457510036,
4.54301776536,
4.94940007836,
4.618359942360001,
4.51433605436,
4.42130562036,
4.442572692360001,
4.4134459693600006
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5487670664600004,
"stddev": 0.10606112831145567,
"median": 3.5116216408600005,
"user": 1.34033254,
"system": 1.24865674,
"min": 3.4461049473600003,
"max": 3.8073836353600004,
"times": [
3.4932057283600004,
3.4461049473600003,
3.8073836353600004,
3.6131864573600003,
3.4733573623600003,
3.4798038953600003,
3.4879112573600004,
3.56538166136,
3.53003755336,
3.59129816636
]
},
{
"command": "pnpr@main",
"mean": 3.5113285963600007,
"stddev": 0.09057316474302597,
"median": 3.47972223636,
"user": 1.3369917399999998,
"system": 1.2656162400000002,
"min": 3.45643971436,
"max": 3.75931342236,
"times": [
3.4819080333600003,
3.4679666323600005,
3.47753643936,
3.47241557136,
3.53662894036,
3.5127973953600002,
3.75931342236,
3.45813997836,
3.45643971436,
3.49013983636
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13853 |
| 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,415.74 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 286.20 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 287.15 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.31 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,424.87 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,446.10 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 281.07 ms |
…hange The first cut withheld the lockfile pin and skipped the frozen shortcut for any `add <pkg>@<version>`, which defeated the resolution reuse added in #13807: adding a version the lockfile already holds resolved the graph again instead of reporting the lockfile up to date. The trigger is now the case that needs it — the dependency resolves through a catalog entry that covers the wanted version but is recorded at a different one. An add that isn't cataloged, whose entry already resolves to the wanted version, or whose entry excludes it, keeps every pin and the frozen shortcut. The predicates behind that decision are the ones the catalog-mode gate already uses, so the two agree by construction. The withheld pin is also bounded to direct dependencies now: a catalog entry governs those, and transitive occurrences of the same package have no reason to lose their resolutions. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 7da1fd8 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13853 +/- ##
==========================================
+ Coverage 88.25% 88.26% +0.01%
==========================================
Files 627 627
Lines 103341 103550 +209
==========================================
+ Hits 91203 91402 +199
- Misses 12138 12148 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The seed policy was workspace-wide, so a project the command never named lost the pin for that package and re-resolved: a sibling declaring the same package directly was rewritten as a side effect. It is now a per-importer policy covering only the projects being added to, matching how a filtered update scopes its own seed, and the preferred version rides along with those importers instead of being layered onto the workspace seed. The regression test adds an untargeted project that declares the package directly and asserts its resolution survives. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 6ec7dd2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/suite/catalog.rs (1)
481-570: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftAdd matching TypeScript CLI regression tests for catalog resolution.
Existing TypeScript tests cover catalog helpers and manifest writing, but not CLI
add, CLIupdate, or filtered-importer isolation. Add equivalent scenarios before merge.🤖 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/cli/tests/suite/catalog.rs` around lines 481 - 570, Add equivalent TypeScript CLI regression tests for the Rust scenarios in add_moves_a_catalog_locked_on_another_version, update_moves_a_catalog_to_an_older_in_range_version, and add_moving_a_catalog_leaves_an_untargeted_project_alone. Cover catalog resolution changes through CLI add and update, preserve the catalog: dependency spec, and verify a filtered add changes only the targeted importer while the untargeted project retains its resolution.Sources: Coding guidelines, Path instructions, Learnings
🤖 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/cli/tests/suite/catalog.rs`:
- Around line 481-570: Add equivalent TypeScript CLI regression tests for the
Rust scenarios in add_moves_a_catalog_locked_on_another_version,
update_moves_a_catalog_to_an_older_in_range_version, and
add_moving_a_catalog_leaves_an_untargeted_project_alone. Cover catalog
resolution changes through CLI add and update, preserve the catalog: dependency
spec, and verify a filtered add changes only the targeted importer while the
untargeted project retains its resolution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c0b997de-75c6-4026-9734-70edfcc4fcda
📒 Files selected for processing (3)
pnpm/crates/cli/tests/suite/catalog.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
- pnpm/crates/package-manager/src/add.rs
Importer ids are relative to the directory the lockfile sits in, which is the workspace root only while one lockfile is shared. The policy keyed against the workspace root regardless, so under `sharedWorkspaceLockfile: false` it named no importer and did nothing at all: the pin stayed, the entry kept its recorded resolution, and the wanted version was dropped again — the very bug this branch fixes, in the configuration it missed. The root is now derived the way the install derives it, in both add paths, and a test covers a project that keeps its own lockfile. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 7962e4a |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…comma Caught by the dylint gate in CI, not locally: a stale lint library meant the run here reported the crate clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit 6ba0191 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
The pacquet side of #13841, which fixed this for the TypeScript CLI. Both stacks had the
same hole, in slightly different shapes:
pacquet add @pnpm.e2e/[email protected]wrote nothing at all — the manifest specifier stayscatalog:, so nothing looked stale and the install never reached the resolver.pacquet update @pnpm.e2e/[email protected]against an entry resolved to a newer in-range versionre-resolved to the highest version the range allows, not to the one asked for.
DropOnlywithholds the pin, but nothing steered the pick.
A version named on the command line only reached the lockfile through the specifier written to
the manifest. A cataloged dependency keeps its version in the catalog entry instead, so the
request had nowhere to land.
Installnow takes an optional preferred-versions overlay, layered onto the seed built from thelockfile and manifests in
preferred_versions_seeds.addandupdateput a version named onthe command line there, weighted one above
EXISTING_VERSION_SELECTOR_WEIGHTso it outranks thelockfile's own pin.
addadditionally withholds that package's pin (DropOnly) and skips thefrozen shortcut, which would otherwise hold. Every other install passes
Noneand resolvesexactly as before.
Related to #13715.
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.
Two end-to-end tests cover the paths above;
pacquet-package-manager(580) and the clicatalog::/add::/update::suites (110) pass, along withcargo fmt, workspace clippy,and dylint.
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
Bug Fixes
Tests