Repository navigation
fix(pacquet): resolve versionless workspace packages - #12940
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? |
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughWorkspace package indexing now defaults omitted or null versions to ChangesWorkspace version handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 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 |
Confidence Score: 5/5Safe to merge. The change is a focused three-arm match replacing the previous two-field destructure, with no side effects beyond correctly populating the workspace map for versionless packages. The fix is minimal and surgical. The new behavior (index missing/null versions as No files require special attention. Reviews (4): Last reviewed commit: "chore(pacquet): add changeset for versio..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pnpm/crates/package-manager/src/install.rs (1)
2494-2501: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSimplify the version match by treating null as the default case.
The two
0.0.0arms (NoneandSome(value) if value.is_null()) can be collapsed into a single default arm, reducing duplication.♻️ Suggested refactor
- let version = match project.manifest.value().get("version") { - None => "0.0.0".to_string(), - Some(value) if value.is_null() => "0.0.0".to_string(), - Some(value) => { - let Some(version) = value.as_str() else { continue }; - version.to_string() - } - }; + let version = match project.manifest.value().get("version") { + Some(value) if !value.is_null() => { + let Some(version) = value.as_str() else { continue }; + version.to_string() + } + _ => "0.0.0".to_string(), + };🤖 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/package-manager/src/install.rs` around lines 2494 - 2501, Update the version extraction match in the manifest processing flow to combine the None and null-value cases into one default arm returning "0.0.0". Preserve the existing string conversion for non-null values and continue behavior for non-string versions.pnpm/crates/cli/tests/workspace_install.rs (1)
238-309: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider adding a test for the
nullversion case.The implementation handles
Some(value) if value.is_null() => "0.0.0"(line 2496 ininstall.rs) as a distinct branch from missing version (None). The current tests cover missing version and non-string version, but not an explicit"version": nullinpackage.json. A quick additional fixture or variant would close that gap.🤖 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/workspace_install.rs` around lines 238 - 309, Extend workspace_specs_resolve_a_versionless_private_package to explicitly set "version": null in the private package fixture, or add a focused variant covering that input. Keep the existing assertions for workspace:* and workspace:0.0.0 resolution, ensuring the null-version path resolves to the same expected file dependency.
🤖 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/workspace_install.rs`:
- Around line 238-309: Extend
workspace_specs_resolve_a_versionless_private_package to explicitly set
"version": null in the private package fixture, or add a focused variant
covering that input. Keep the existing assertions for workspace:* and
workspace:0.0.0 resolution, ensuring the null-version path resolves to the same
expected file dependency.
In `@pnpm/crates/package-manager/src/install.rs`:
- Around line 2494-2501: Update the version extraction match in the manifest
processing flow to combine the None and null-value cases into one default arm
returning "0.0.0". Preserve the existing string conversion for non-null values
and continue behavior for non-string versions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ddabf1d0-9920-4f87-81a2-9c02eff4464e
📒 Files selected for processing (2)
pnpm/crates/cli/tests/workspace_install.rspnpm/crates/package-manager/src/install.rs
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.10973275008,
"stddev": 0.1284221516723707,
"median": 4.089070940979999,
"user": 3.9223883799999997,
"system": 3.5713270799999997,
"min": 3.94024339348,
"max": 4.38957875148,
"times": [
4.14962596848,
4.13719698248,
4.07199928648,
4.10614259548,
4.38957875148,
3.94024339348,
3.97228288148,
4.06257415248,
4.22138736548,
4.0462961234799995
]
},
{
"command": "pacquet@main",
"mean": 4.07045333498,
"stddev": 0.09984979469918978,
"median": 4.039401122479999,
"user": 3.87340458,
"system": 3.570415079999999,
"min": 3.96246173048,
"max": 4.29756281448,
"times": [
4.01376299248,
4.08300168848,
3.99045570048,
4.04681606548,
4.03198617948,
4.29756281448,
3.96246173048,
4.07995002048,
4.17966971148,
4.01886644648
]
},
{
"command": "pnpr@HEAD",
"mean": 2.2304006531799994,
"stddev": 0.11375655881452792,
"median": 2.22716711248,
"user": 2.69903198,
"system": 3.0786231799999997,
"min": 2.03637254148,
"max": 2.3815016604799997,
"times": [
2.03637254148,
2.14681722448,
2.34829207648,
2.3516276434799996,
2.18587008448,
2.3815016604799997,
2.28291810148,
2.17961891448,
2.26846414048,
2.12252414448
]
},
{
"command": "pnpr@main",
"mean": 2.19440697298,
"stddev": 0.10954280790397321,
"median": 2.15480688698,
"user": 2.69782788,
"system": 3.07064358,
"min": 2.06432070948,
"max": 2.36050783348,
"times": [
2.36050783348,
2.2716332914799997,
2.16631748948,
2.31383944848,
2.0726797644799997,
2.10607996748,
2.06432070948,
2.31111548148,
2.14329628448,
2.13427945948
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6797985200400001,
"stddev": 0.011199221043502391,
"median": 0.68008740184,
"user": 0.39375263999999993,
"system": 1.37039954,
"min": 0.65751867584,
"max": 0.6928100838400001,
"times": [
0.6899228178400001,
0.6784847498400001,
0.6928100838400001,
0.6809661318400001,
0.67325625984,
0.6873835338400001,
0.6905344358400001,
0.67920867184,
0.65751867584,
0.66789983984
]
},
{
"command": "pacquet@main",
"mean": 0.70399534794,
"stddev": 0.09612257341293248,
"median": 0.67499578234,
"user": 0.41712914,
"system": 1.3612085399999998,
"min": 0.65065124584,
"max": 0.97384341484,
"times": [
0.69147891784,
0.6567449038400001,
0.67468496584,
0.67530659884,
0.65065124584,
0.7002753378400001,
0.67172261984,
0.6867137358400001,
0.65853173884,
0.97384341484
]
},
{
"command": "pnpr@HEAD",
"mean": 0.74256983644,
"stddev": 0.07276937600401122,
"median": 0.7181485053400001,
"user": 0.42040254,
"system": 1.3717475399999999,
"min": 0.6974289168400001,
"max": 0.9433262468400001,
"times": [
0.70776524484,
0.71714794784,
0.7371148858400001,
0.7158673548400001,
0.7216272398400001,
0.70527842484,
0.71914906284,
0.6974289168400001,
0.9433262468400001,
0.76099303984
]
},
{
"command": "pnpr@main",
"mean": 0.7399997866400001,
"stddev": 0.0346105561646211,
"median": 0.7285930683400001,
"user": 0.42297183999999993,
"system": 1.3901311399999998,
"min": 0.6957315538400001,
"max": 0.8183106748400001,
"times": [
0.6957315538400001,
0.77314108784,
0.7295882518400001,
0.7275978848400001,
0.7353237908400001,
0.7267270708400001,
0.8183106748400001,
0.71395260484,
0.7548396968400001,
0.72478524984
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.38893368868,
"stddev": 0.048485509964765056,
"median": 4.38435589218,
"user": 3.9119828399999994,
"system": 3.4724752199999998,
"min": 4.32115453918,
"max": 4.46075489918,
"times": [
4.3712678151799995,
4.41026241018,
4.39744396918,
4.32115453918,
4.42540182118,
4.46075489918,
4.37071191818,
4.44927183018,
4.36115195318,
4.32191573118
]
},
{
"command": "pacquet@main",
"mean": 4.28878262238,
"stddev": 0.05870749517920017,
"median": 4.27479236768,
"user": 3.7760527399999995,
"system": 3.4323676199999995,
"min": 4.23673810118,
"max": 4.44458482118,
"times": [
4.26996927218,
4.29034338118,
4.25430956018,
4.44458482118,
4.31106790118,
4.28496012618,
4.26090988618,
4.27961546318,
4.23673810118,
4.25532771118
]
},
{
"command": "pnpr@HEAD",
"mean": 2.2467001100799995,
"stddev": 0.14353248276366753,
"median": 2.18110439818,
"user": 2.57977694,
"system": 2.97517812,
"min": 2.10201578518,
"max": 2.4657714191799998,
"times": [
2.14448391218,
2.41932471218,
2.1555650861799998,
2.4657714191799998,
2.1404258071799998,
2.10201578518,
2.46338723118,
2.18038593718,
2.18182285918,
2.21381835118
]
},
{
"command": "pnpr@main",
"mean": 2.25789624428,
"stddev": 0.14737354876603412,
"median": 2.2626091321799997,
"user": 2.52469244,
"system": 2.9782043199999997,
"min": 2.0372483941799997,
"max": 2.45258763418,
"times": [
2.03981821918,
2.31639929318,
2.45258763418,
2.27063395518,
2.19204381118,
2.2545843091799997,
2.3831159781799998,
2.44055572518,
2.0372483941799997,
2.1919751231799998
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.39955400606,
"stddev": 0.012601704002875214,
"median": 1.3934365356599998,
"user": 1.3426578,
"system": 1.7408768,
"min": 1.3896122661599999,
"max": 1.42847922416,
"times": [
1.39286255416,
1.39401051716,
1.39152361016,
1.39024835016,
1.40231532216,
1.40119727016,
1.39174381616,
1.3896122661599999,
1.41354713016,
1.42847922416
]
},
{
"command": "pacquet@main",
"mean": 1.43180207196,
"stddev": 0.06251383390793025,
"median": 1.41231525116,
"user": 1.3967096999999997,
"system": 1.7484042,
"min": 1.38774677616,
"max": 1.60695342016,
"times": [
1.38774677616,
1.4103877361600001,
1.60695342016,
1.41135728116,
1.43238343316,
1.41242166916,
1.41381816816,
1.41021322316,
1.41220883316,
1.42053017916
]
},
{
"command": "pnpr@HEAD",
"mean": 0.68053193586,
"stddev": 0.045626473438601815,
"median": 0.66608892516,
"user": 0.3509895,
"system": 1.2905517999999998,
"min": 0.65071980216,
"max": 0.80525349716,
"times": [
0.65558428216,
0.65981107516,
0.66596659416,
0.6932582701600001,
0.68006912616,
0.80525349716,
0.66621125616,
0.6722420691600001,
0.65071980216,
0.6562033861600001
]
},
{
"command": "pnpr@main",
"mean": 0.6997306700599999,
"stddev": 0.08000173092994516,
"median": 0.67097667666,
"user": 0.36283220000000005,
"system": 1.2971238999999999,
"min": 0.66454363116,
"max": 0.92585196116,
"times": [
0.66663902416,
0.6701017111600001,
0.67044648716,
0.67150686616,
0.66454363116,
0.66716840416,
0.6933247731600001,
0.6830026181600001,
0.92585196116,
0.68472122416
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 3.0466021697400003,
"stddev": 0.025041008296342718,
"median": 3.05505085954,
"user": 1.7770822799999997,
"system": 1.98398784,
"min": 3.00408901654,
"max": 3.07894724954,
"times": [
3.06614586154,
3.02837152954,
3.05345909554,
3.05664262354,
3.06928952554,
3.06181076254,
3.03158835454,
3.01567767854,
3.07894724954,
3.00408901654
]
},
{
"command": "pacquet@main",
"mean": 3.0765684390400003,
"stddev": 0.029929695616183586,
"median": 3.07595194854,
"user": 1.81187998,
"system": 2.00748324,
"min": 3.03807266854,
"max": 3.14394658854,
"times": [
3.14394658854,
3.0681683945400002,
3.09922946254,
3.08318522754,
3.07781435154,
3.04478115654,
3.07408954554,
3.07947315354,
3.03807266854,
3.05692384154
]
},
{
"command": "pnpr@HEAD",
"mean": 0.6713576022400001,
"stddev": 0.008024564569384846,
"median": 0.6720368675400001,
"user": 0.33853558,
"system": 1.2965292400000001,
"min": 0.6584870525400001,
"max": 0.6874612935400001,
"times": [
0.6874612935400001,
0.66620335454,
0.66317136054,
0.6705327765400001,
0.67475467454,
0.67529753954,
0.67576990554,
0.6584870525400001,
0.66835710654,
0.6735409585400001
]
},
{
"command": "pnpr@main",
"mean": 0.68521305054,
"stddev": 0.02897051930390544,
"median": 0.6798399510400001,
"user": 0.35562108000000003,
"system": 1.29997084,
"min": 0.65966626354,
"max": 0.7623199685400001,
"times": [
0.6835570145400001,
0.67526941454,
0.66570357654,
0.66712529054,
0.65966626354,
0.6840818325400001,
0.69309894254,
0.67612288754,
0.6851853145400001,
0.7623199685400001
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6757128720000001,
"stddev": 0.013435208016425905,
"median": 0.6773858074000001,
"user": 0.6454428999999999,
"system": 0.1523387,
"min": 0.6592016629,
"max": 0.6995820069,
"times": [
0.6776340309000001,
0.6683046899,
0.6787435359,
0.6610187309000001,
0.6995820069,
0.6778359229,
0.6942053299000001,
0.6634652259,
0.6592016629,
0.6771375839
]
},
{
"command": "pacquet@main",
"mean": 0.6839061035000001,
"stddev": 0.010260275520062156,
"median": 0.6822093359000001,
"user": 0.6495654999999999,
"system": 0.1564232,
"min": 0.6660585179,
"max": 0.7007442839,
"times": [
0.6830128049,
0.6837447889,
0.6778971439,
0.6765449319000001,
0.6660585179,
0.6808274079000001,
0.7007442839,
0.6814058669,
0.6914313819000001,
0.6973939069
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10932115319166667,
"stddev": 0.0017957049137443761,
"median": 0.10850513640000001,
"user": 0.02971335,
"system": 0.019556324999999996,
"min": 0.1072742339,
"max": 0.1122847119,
"times": [
0.1115762909,
0.1119317439,
0.1072742339,
0.1088025589,
0.1080511619,
0.1121613109,
0.1079980939,
0.1080072959,
0.1072804609,
0.1100619519,
0.1114698319,
0.1079072139,
0.1122847119,
0.1080632099,
0.1078231819,
0.1077494959,
0.1088108839,
0.11117717690000001,
0.1114330639,
0.1082077139,
0.1078270189,
0.1073886029,
0.1094079079,
0.1110125599
]
},
{
"command": "pnpr@main",
"mean": 0.10941246510833336,
"stddev": 0.0020400414170334232,
"median": 0.10845424240000001,
"user": 0.027625849999999997,
"system": 0.021175866666666668,
"min": 0.1073647209,
"max": 0.1139782199,
"times": [
0.1139782199,
0.1106511859,
0.1115164289,
0.1094523299,
0.1111883329,
0.1076911819,
0.1080980349,
0.1074567389,
0.1074948109,
0.1099577929,
0.1128664119,
0.1100623179,
0.1079897469,
0.1081631059,
0.1091049159,
0.1128956709,
0.1121422769,
0.1075089199,
0.1084186099,
0.1073647209,
0.1084898749,
0.1077483299,
0.1075011129,
0.1081580909
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 6.952768914960001,
"stddev": 0.08648901120716877,
"median": 6.9455712297600005,
"user": 4.127502,
"system": 3.8388779,
"min": 6.76461602126,
"max": 7.05871306126,
"times": [
6.90464356826,
7.00973048826,
7.05871306126,
6.91862094326,
6.9449875072600005,
7.04053154226,
6.94615495226,
7.02267033226,
6.91702073326,
6.76461602126
]
},
{
"command": "pacquet@main",
"mean": 6.961493303759999,
"stddev": 0.2005588647795507,
"median": 6.92347643776,
"user": 4.0611833,
"system": 3.8318871000000003,
"min": 6.76237863126,
"max": 7.40753995026,
"times": [
6.76237863126,
7.40753995026,
6.78387261826,
6.78543735426,
6.9906498282600005,
6.94472350926,
6.83315506726,
6.90222936626,
7.10189947726,
7.10304723526
]
},
{
"command": "pnpr@HEAD",
"mean": 5.0562675847600005,
"stddev": 0.10363128173547266,
"median": 5.03326270226,
"user": 2.8475995999999997,
"system": 3.2958641999999996,
"min": 4.93138290126,
"max": 5.27922203326,
"times": [
5.01400252826,
5.07880272226,
5.27922203326,
4.93138290126,
4.97535832326,
5.04996101726,
5.14572439726,
5.11346738126,
4.95819015626,
5.01656438726
]
},
{
"command": "pnpr@main",
"mean": 5.130466223060001,
"stddev": 0.07857535353165762,
"median": 5.10769450776,
"user": 2.8083993,
"system": 3.3343291,
"min": 5.03193474826,
"max": 5.2623405532600005,
"times": [
5.07094928726,
5.19122176926,
5.03193474826,
5.23387246726,
5.07114134626,
5.06177915526,
5.16603388826,
5.10859357326,
5.2623405532600005,
5.10679544226
]
}
]
} |
|
| Branch | pr/12940 |
| 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 | 2,246.70 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 671.36 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 680.53 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 109.32 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,230.40 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 5,056.27 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 742.57 ms |
|
CI fixes in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12940 +/- ##
=======================================
Coverage 85.45% 85.45%
=======================================
Files 474 474
Lines 74561 74565 +4
=======================================
+ Hits 63714 63721 +7
+ Misses 10847 10844 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The Windows runner's longer temp path shifts miette's wrap point into the matched substring; flatten the decorated output before matching. The raw string also satisfies dylint's avoidable-string-escapes lint.
2c15d0c to
0a3c047
Compare
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Changeset missing pnpm entry
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| --- | ||
| "pacquet": patch | ||
| --- |
There was a problem hiding this comment.
1. Changeset missing pnpm entry 📘 Rule violation § Compliance
The new changeset front-matter lists only pacquet and does not declare a bump for the pnpm package, which violates the changeset requirement in the compliance checklist. This can lead to incorrect or incomplete release metadata for pnpm when processing changesets.
Agent Prompt
## Issue description
The changeset file does not include a `pnpm` entry in its front-matter, but the compliance checklist requires changesets to explicitly declare `pnpm` with a valid bump type.
## Issue Context
This PR adds `.changeset/pacquet-versionless-workspace-packages.md` with only `"pacquet": patch` in the front-matter.
## Fix Focus Areas
- .changeset/pacquet-versionless-workspace-packages.md[1-3]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 61d435f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Summary
pnpm 12's Rust workspace map currently drops every named workspace project whose
package.jsonhas noversion. A dependency such assa: workspace:*then fails with a misleading "no package named sa" error.pnpm 11 intentionally treats a named, versionless workspace package as version
0.0.0(see #2648 and #2678). This PR restores that behavior in the Rust implementation and covers bothworkspace:*andworkspace:0.0.0whileinjectWorkspacePackagesis enabled. Malformed non-string versions remain excluded instead of being coerced to0.0.0.Squash Commit Body
Verification
[email protected]0.0.0git diff --check: passedChecklist
0.0.0for versionless workspace packages.Summary by CodeRabbit
Bug Fixes
null, are now recognized during installation.Tests