Repository navigation
fix: allow updating cataloged deps to versions satisfying catalog ran… - #13723
Ayush442842q wants to merge 4 commits into
Conversation
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? |
|
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 (6)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughStrict catalog matching now accepts concrete dependency versions that satisfy catalog ranges. Rust and TypeScript implementations apply the behavior. Tests cover in-range acceptance, out-of-range rejection, lockfile output, and patch release metadata. ChangesStrict catalog matching
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PnpmUpdate
participant installSome
participant CatalogRange
participant Lockfile
PnpmUpdate->>installSome: request concrete dependency version
installSome->>CatalogRange: check version against catalog range
CatalogRange-->>installSome: version satisfies range
installSome->>Lockfile: retain catalog reference and resolved version
Assessment against linked issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 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 |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "refactor(pacquet): remove redundant rust..." | Re-trigger Greptile |
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.4600982327000005,
"stddev": 0.11921273862728454,
"median": 2.4073280813,
"user": 1.7774305799999996,
"system": 1.46204002,
"min": 2.3583735418,
"max": 2.7087073008,
"times": [
2.7087073008,
2.6201894718,
2.3743427228000002,
2.3726856538,
2.4254284768,
2.5138945208,
2.4554028468,
2.3892276858,
2.3827301058,
2.3583735418
]
},
{
"command": "pacquet@main",
"mean": 2.4827238777000007,
"stddev": 0.15709350851982207,
"median": 2.3951918628,
"user": 1.5677587799999997,
"system": 1.28334762,
"min": 2.3428795088000003,
"max": 2.7407188548,
"times": [
2.3428795088000003,
2.4001360928,
2.3902476328,
2.7219496928,
2.6460119568000002,
2.3622302038000003,
2.3760304858,
2.7407188548,
2.4671624478,
2.3798719008
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5016335435000001,
"stddev": 0.10737957515910918,
"median": 1.5039581118,
"user": 1.03513138,
"system": 1.12794342,
"min": 1.3389536628,
"max": 1.6759693568,
"times": [
1.5564334598,
1.5193760218,
1.4388381848,
1.6317885858,
1.3603147638,
1.4885402018,
1.5388915528,
1.4672296448000002,
1.3389536628,
1.6759693568
]
},
{
"command": "pnpr@main",
"mean": 1.4492750091,
"stddev": 0.11701169694485512,
"median": 1.3820311993,
"user": 1.0748906799999998,
"system": 1.1499199199999999,
"min": 1.3639260978,
"max": 1.7029993088,
"times": [
1.3677596678000001,
1.5857424858,
1.3639260978,
1.3891952378,
1.7029993088,
1.3748671608,
1.5083665728,
1.3639620448,
1.3709535518,
1.4649779628000001
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25593288926,
"stddev": 0.006159484107220228,
"median": 0.25784736396,
"user": 0.21316774,
"system": 0.5031108000000001,
"min": 0.24644392246000002,
"max": 0.26421551846,
"times": [
0.25823627646,
0.26421551846,
0.24644392246000002,
0.25020477546000003,
0.25946413246,
0.25236348246,
0.26098807246,
0.24827734046000002,
0.25745845146,
0.26167692046
]
},
{
"command": "pacquet@main",
"mean": 0.26147026145999996,
"stddev": 0.007346557965527105,
"median": 0.25845026646,
"user": 0.20810763999999998,
"system": 0.5250353999999999,
"min": 0.25259832146,
"max": 0.27633012646,
"times": [
0.25868447446000004,
0.25694367846,
0.25259832146,
0.26059233246,
0.25739926046,
0.25821605846,
0.25657568046,
0.26766157346,
0.27633012646,
0.26970110846
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27929181246,
"stddev": 0.004351447053776881,
"median": 0.28010684846,
"user": 0.22702824000000002,
"system": 0.5452071000000001,
"min": 0.27044376746000004,
"max": 0.28511176946,
"times": [
0.27432776046,
0.28511176946,
0.27044376746000004,
0.27901676946000004,
0.27822588146,
0.28308933746000003,
0.28119692746,
0.28167754546,
0.27792857446,
0.28189979146
]
},
{
"command": "pnpr@main",
"mean": 0.3013220790600001,
"stddev": 0.05537853268265364,
"median": 0.27801324346,
"user": 0.23790214,
"system": 0.5930568999999999,
"min": 0.27283406646,
"max": 0.44656416146000005,
"times": [
0.27732488646000003,
0.28196062546,
0.27671054746,
0.28202231046000004,
0.34546369146,
0.44656416146000005,
0.27283406646,
0.27729114246000003,
0.27870160046000003,
0.27434775846000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6047706393200003,
"stddev": 0.012125894760829429,
"median": 2.60561670472,
"user": 1.5041113400000001,
"system": 1.3790957,
"min": 2.5848821202199996,
"max": 2.6253291172199997,
"times": [
2.5996931602199997,
2.60350609122,
2.60639402222,
2.5848821202199996,
2.61289088322,
2.6253291172199997,
2.6145605762199997,
2.6048393872199997,
2.58740588622,
2.60820514922
]
},
{
"command": "pacquet@main",
"mean": 2.6145093200199994,
"stddev": 0.018352987030063644,
"median": 2.61503031172,
"user": 1.5476625400000001,
"system": 1.3362547,
"min": 2.58842062122,
"max": 2.63876750722,
"times": [
2.63876750722,
2.6318197452199996,
2.6240945712199997,
2.6011086182199996,
2.6263858552199997,
2.6017298422199997,
2.5932571082199996,
2.58842062122,
2.63354327922,
2.60596605222
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6190845922200001,
"stddev": 0.15634745127521743,
"median": 1.61501018972,
"user": 1.0287429399999999,
"system": 1.1612123999999997,
"min": 1.42786047522,
"max": 1.86564529622,
"times": [
1.76136976922,
1.59667847022,
1.86564529622,
1.54522367422,
1.46235958522,
1.8197261202200001,
1.44264652422,
1.42786047522,
1.63599409822,
1.63334190922
]
},
{
"command": "pnpr@main",
"mean": 1.59182722912,
"stddev": 0.15931914172799458,
"median": 1.5640987662199999,
"user": 1.0010851400000003,
"system": 1.1975187999999999,
"min": 1.44772513922,
"max": 1.8803115162200001,
"times": [
1.44772513922,
1.45030910122,
1.45221165822,
1.62555974722,
1.8803115162200001,
1.50263778522,
1.63919477322,
1.8288488012200002,
1.6268868282200002,
1.46458694122
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.42268591044,
"stddev": 0.01162876542789239,
"median": 0.42157476914,
"user": 0.5367660599999999,
"system": 0.68436374,
"min": 0.40371600364,
"max": 0.43917950064,
"times": [
0.42189827464,
0.43112836464,
0.41682244364,
0.43227391664000003,
0.42125126364,
0.43478772764,
0.40371600364,
0.41774556964,
0.40805603964,
0.43917950064
]
},
{
"command": "pacquet@main",
"mean": 0.40939775693999997,
"stddev": 0.012193420553548492,
"median": 0.40749013214,
"user": 0.5413516599999999,
"system": 0.65626764,
"min": 0.39464443064,
"max": 0.43078093464,
"times": [
0.39464443064,
0.39482598064,
0.40207204064,
0.42482300364000003,
0.43078093464,
0.41172607364,
0.41269801964,
0.40325419064,
0.41682743164,
0.40232546364
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31240619784,
"stddev": 0.007075851969559332,
"median": 0.31359040614,
"user": 0.21330776,
"system": 0.53000314,
"min": 0.29606406764,
"max": 0.32076802264,
"times": [
0.31641456164,
0.31116910264,
0.31899315564,
0.31659882664,
0.31409197964,
0.31308883264,
0.32076802264,
0.29606406764,
0.30878227064,
0.30809115864
]
},
{
"command": "pnpr@main",
"mean": 0.30322407444,
"stddev": 0.009346556998817656,
"median": 0.30347839564,
"user": 0.19152845999999998,
"system": 0.52481584,
"min": 0.29102668664,
"max": 0.31744047063999997,
"times": [
0.29519198664,
0.31644770364,
0.29227781864,
0.30371010764,
0.30469579164,
0.30324668364,
0.31744047063999997,
0.31011000564,
0.29809348964,
0.29102668664
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.73001663878,
"stddev": 0.005038983894912326,
"median": 1.73068852908,
"user": 0.7609709199999999,
"system": 0.76577728,
"min": 1.72148174008,
"max": 1.73573374708,
"times": [
1.73258882708,
1.72882320608,
1.73030543808,
1.7258138700799999,
1.73515116708,
1.72148174008,
1.73548816808,
1.72370860408,
1.73107162008,
1.73573374708
]
},
{
"command": "pacquet@main",
"mean": 1.7271986239800001,
"stddev": 0.011894640678559635,
"median": 1.7241371400799999,
"user": 0.74522952,
"system": 0.7616293799999998,
"min": 1.71510884608,
"max": 1.7563385490799999,
"times": [
1.72117521708,
1.72290813708,
1.7563385490799999,
1.72694343208,
1.73720164108,
1.71701461908,
1.71510884608,
1.7270215180800002,
1.7247447810799998,
1.7235294990799999
]
},
{
"command": "pnpr@HEAD",
"mean": 0.31285588787999996,
"stddev": 0.006573605411361705,
"median": 0.31225867158000004,
"user": 0.21464502,
"system": 0.5362638799999999,
"min": 0.30136134208000004,
"max": 0.32682082208,
"times": [
0.31720421308,
0.31207129608000006,
0.32682082208,
0.31594613008000005,
0.30825531108000004,
0.31337208708000003,
0.31010800608000005,
0.31097362408,
0.31244604708,
0.30136134208000004
]
},
{
"command": "pnpr@main",
"mean": 0.31226615578000005,
"stddev": 0.008574366687832428,
"median": 0.31374883508000007,
"user": 0.22298592,
"system": 0.51777838,
"min": 0.29957864208,
"max": 0.32496482708,
"times": [
0.32496482708,
0.32226164008,
0.31473093108000005,
0.31276673908,
0.31657683108,
0.31766338308000003,
0.30166029308000003,
0.30597845708000004,
0.30647981408,
0.29957864208
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2335675241466667,
"stddev": 0.018039378294218818,
"median": 0.23659172148000002,
"user": 0.1628272766666667,
"system": 0.07326145333333334,
"min": 0.19353324248,
"max": 0.26511559448,
"times": [
0.24555712748,
0.23054510048000001,
0.24270352248000002,
0.24499383448,
0.23181756048000002,
0.21878372148,
0.26511559448,
0.24307836348,
0.24136588248000002,
0.22402785548,
0.22128848448,
0.19353324248
]
},
{
"command": "pacquet@main",
"mean": 0.22868802389666665,
"stddev": 0.01145706114624162,
"median": 0.22752498948,
"user": 0.17060344333333335,
"system": 0.07335603666666667,
"min": 0.20751885048000002,
"max": 0.24843078048,
"times": [
0.23136113648,
0.22789428548000001,
0.21984995448,
0.23732574848000001,
0.22715569348,
0.20751885048000002,
0.22264123348,
0.22204500948,
0.24843078048,
0.24605900648,
0.22174698148,
0.23222760648000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08823245806064517,
"stddev": 0.00208887429095432,
"median": 0.08790900748000001,
"user": 0.022645472903225806,
"system": 0.008129793548387098,
"min": 0.08511226948000002,
"max": 0.09238511748000001,
"times": [
0.09238511748000001,
0.09149455148,
0.08594876348000001,
0.08612077548000001,
0.08722959748,
0.08872907148,
0.08576299648,
0.08730083148000001,
0.08790900748000001,
0.08638424748000001,
0.09126768648000001,
0.08620597348000002,
0.08887684648000001,
0.09173197548,
0.08781758748000001,
0.09050522148000001,
0.08914744248,
0.08733096648000001,
0.09079050448,
0.08624678048000001,
0.08818191848000001,
0.08800677048000001,
0.08787653748000002,
0.08511226948000002,
0.08916158048000002,
0.08682122348000001,
0.08604936148000002,
0.09136896648000001,
0.08830090948000001,
0.08979430148,
0.08534641648
]
},
{
"command": "pnpr@main",
"mean": 0.08757247005575759,
"stddev": 0.0012900593830669689,
"median": 0.08724715048000001,
"user": 0.02159058727272727,
"system": 0.009389870303030307,
"min": 0.08540447548,
"max": 0.09046920448000001,
"times": [
0.08675100148,
0.08793985548000001,
0.08845640148000002,
0.08540447548,
0.09040061648000002,
0.09045358548000001,
0.08639739248000002,
0.08712509248000001,
0.08742538248000001,
0.08900386448000001,
0.08701511648000002,
0.08583698348000002,
0.08691130148000001,
0.08721277648,
0.08793568748000001,
0.08683936748000001,
0.08870757048000001,
0.08861589948000001,
0.09046920448000001,
0.08822367648000001,
0.08696385048000001,
0.08656562648,
0.08800945648000001,
0.08561781348000001,
0.08810387248000001,
0.08606984948000002,
0.08868992748000001,
0.08711092548,
0.08763559648000001,
0.08746732248000001,
0.08655671848000002,
0.08724715048000001,
0.08672815048000002
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.8258481600866667,
"stddev": 0.18243353430855277,
"median": 0.7904729674200001,
"user": 0.7713069666666665,
"system": 0.15310925555555555,
"min": 0.63359099842,
"max": 1.1839464554199999,
"times": [
0.7904729674200001,
0.80496563342,
0.6749338554200001,
1.03390688742,
0.8950230824200001,
1.1839464554199999,
0.6892222144200001,
0.7265713464200001,
0.63359099842
]
},
{
"command": "pacquet@main",
"mean": 0.7173192836422222,
"stddev": 0.1370872889244683,
"median": 0.6971639524200001,
"user": 0.6627811888888888,
"system": 0.11433314444444445,
"min": 0.54954163042,
"max": 0.9629862934200001,
"times": [
0.54954163042,
0.7679698894200001,
0.61617389442,
0.71231939842,
0.6179671464200001,
0.6971639524200001,
0.9629862934200001,
0.89631411642,
0.6354372314200001
]
},
{
"command": "pnpm@HEAD",
"mean": 2.9702163335311114,
"stddev": 0.0729954795719571,
"median": 2.9677167634200003,
"user": 4.594811966666667,
"system": 0.2697913666666667,
"min": 2.83627521542,
"max": 3.06535809442,
"times": [
2.9347062524200003,
2.83627521542,
3.06535809442,
2.93870627142,
2.9677167634200003,
3.04099394142,
3.0472632824200003,
2.92175469842,
2.97917248242
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.53805702686,
"stddev": 0.1279900004407611,
"median": 4.49992069156,
"user": 1.7391469999999998,
"system": 1.4478313999999997,
"min": 4.42236463756,
"max": 4.7442644755600005,
"times": [
4.67715805256,
4.5416439115600005,
4.43246477256,
4.45819747156,
4.70914728056,
4.54425703956,
4.7442644755600005,
4.42390072056,
4.42717190656,
4.42236463756
]
},
{
"command": "pacquet@main",
"mean": 4.5254573879599995,
"stddev": 0.10480497091144793,
"median": 4.48488475756,
"user": 1.7693864999999995,
"system": 1.3619215999999998,
"min": 4.43492393756,
"max": 4.75875502356,
"times": [
4.45169217956,
4.6273966495600005,
4.47711612156,
4.75875502356,
4.44140433556,
4.43492393756,
4.52464597956,
4.45260482556,
4.49265339356,
4.59338143356
]
},
{
"command": "pnpr@HEAD",
"mean": 3.53868210826,
"stddev": 0.1158506229418957,
"median": 3.4747871660600005,
"user": 1.2092388,
"system": 1.2085301999999998,
"min": 3.44214626356,
"max": 3.74244640656,
"times": [
3.4792628695600003,
3.74244640656,
3.68543769056,
3.6807627585600002,
3.46048134256,
3.44214626356,
3.45693409856,
3.45845591356,
3.4703114625600002,
3.51058227656
]
},
{
"command": "pnpr@main",
"mean": 3.49185436686,
"stddev": 0.0485110730007086,
"median": 3.4809239085600003,
"user": 1.1673644,
"system": 1.2626368999999997,
"min": 3.43745800356,
"max": 3.58665170656,
"times": [
3.48146738956,
3.48038042756,
3.4536604795600003,
3.45246999256,
3.5203088735600003,
3.43745800356,
3.58665170656,
3.48342507956,
3.55796159356,
3.46476012256
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13723 |
| 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,427.86 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 301.36 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 296.06 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.11 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,338.95 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,442.15 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 270.44 ms |
…ge under strict mode This resolves a bug in strict catalog mode where updating a cataloged dependency to a concrete version satisfying a range specifier defined in the catalog was rejected. Fixes pnpm#13715
…ut-of-range version
849dcea to
4273f98
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13723 +/- ##
=======================================
Coverage 88.22% 88.23%
=======================================
Files 616 616
Lines 100163 100173 +10
=======================================
+ Hits 88373 88384 +11
+ Misses 11790 11789 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing as a duplicate: pnpm/pnpm#13716 was opened first and fixes the same issue in both stacks, so we are going with that one. For the record, the two implementations were not equivalent. Relaxing the That turns a loud Thanks for the contribution and for the thorough write-up on the original issue. Written by an agent (Claude Code, claude-opus-5). |
Summary
This PR fixes a bug in strict catalog mode (
catalogMode: strict) where targeted package installations or updates (pnpm update <pkg>@<version>/pnpm add <pkg>@<version>) to a concrete version satisfying a range defined in the catalog were rejected with aERR_PNPM_CATALOG_VERSION_MISMATCHerror.Instead of requiring exact string/version equality, strict mode now resolves the check using
semver.satisfieswhen the catalog specifier is a valid range. This enables automated workflows (such as Renovate or lockfile-only updates) to bump lockfile resolutions within catalog-defined ranges.Fixes #13715
Squash Commit Body
This PR resolves a strict catalog mode verification issue where updating a cataloged dependency to a concrete version satisfying a range specifier defined in the catalog was rejected.
Problem
Previously, targeted updates or installations (e.g.
pnpm update pkg@version) in strict catalog mode were verified by ensuring the wanted version (wantedDep.bareSpecifier) is string-equal or exact-value equal to the catalog specifier (catalogDepSpecifier). Sincesemver.valid()rejects range strings, range-pinned catalog entries could never pass this check when adding or updating to a concrete version, causing strict mode validation to incorrectly fail.Solution
@pnpm/installing.deps-installer, added a range satisfaction check: if the catalog specifier is a valid range, we check if the wanted version satisfies the range viasemver.satisfies.pacquetPort: Inpackage-manager/src/catalog_mode.rs, updated theversions_equallogic to parse the right-hand specifier as aRangeif it is not an exactVersion, and performRange::satisfies.Closes #13715
Checklist
pnpm/port.pnpm changeset) if this PR changes any published package.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Bug Fixes
Tests