Repository navigation
Conversation
…#6483) When a workspace package version carries SemVer build metadata, exact version specifiers (e.g. `workspace:0.5.6-next.3+f60facc` or `workspace:0.5.6-next.3`) failed to resolve because version-selector-type and Version normalization strip build metadata before matching keys in the workspace packages map. Fall back to SemVer range resolution for Version specifiers in both pnpm v11 (TypeScript) and v12 (Rust) to honor SemVer precedence rules (spec item 10) where build metadata is ignored. Closes #6483
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughWorkspace dependency resolution now matches packages whose versions include SemVer build metadata. The Rust and TypeScript resolvers apply workspace matching, and installer tests cover linking these packages. Changesets declare patch releases. ChangesWorkspace dependency resolution
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Low Sequence Diagram(s)sequenceDiagram
participant Installer
participant WantedDepIsLocallyAvailable
participant NpmResolver
participant WorkspacePackages
Installer->>WantedDepIsLocallyAvailable: Check local dependency availability
WantedDepIsLocallyAvailable->>NpmResolver: Match non-tag spec against workspace versions
NpmResolver->>WorkspacePackages: Read versions for the package
WorkspacePackages-->>NpmResolver: Return available versions
NpmResolver-->>WantedDepIsLocallyAvailable: Return matching local version
WantedDepIsLocallyAvailable-->>Installer: Return availability result
Assessment against linked issues
Out-of-scope changes
Suggested labels: Merge Risk: ⚪ Minimal · up to Workspace dependencies with SemVer build metadata can now resolve locally. No material merge blocker was identified. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/installing/deps-resolver/src/wantedDepIsLocallyAvailable.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. pnpm11/installing/deps-resolver/test/wantedDepIsLocallyAvailable.test.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency). pnpm11/resolving/npm-resolver/src/index.tsESLint skipped: the matched ESLint configuration already failed (missing-dependency).
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 |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15340 +/- ##
==========================================
- Coverage 91.56% 91.55% -0.01%
==========================================
Files 1388 1390 +2
Lines 186810 187448 +638
==========================================
+ Hits 171045 171625 +580
- Misses 15765 15823 +58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4697112620400006,
"stddev": 0.14627318698367622,
"median": 2.43003558274,
"user": 1.36830122,
"system": 1.5228391000000001,
"min": 2.31171292474,
"max": 2.7213371627400003
},
{
"command": "pacquet@main",
"mean": 2.3961075001400003,
"stddev": 0.12954206363557758,
"median": 2.37524707724,
"user": 1.3997533199999999,
"system": 1.5359551,
"min": 2.26156342874,
"max": 2.60534662374
},
{
"command": "pnpr@HEAD",
"mean": 1.4802299522400002,
"stddev": 0.1204881531591283,
"median": 1.43516948674,
"user": 1.30548152,
"system": 1.4205046,
"min": 1.34178877874,
"max": 1.66500401274
},
{
"command": "pnpr@main",
"mean": 1.4404572575399999,
"stddev": 0.09912498437114792,
"median": 1.41807580124,
"user": 1.32853072,
"system": 1.4117957,
"min": 1.3387986707400001,
"max": 1.65405678074
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26516083762,
"stddev": 0.023476921749892667,
"median": 0.25533496072,
"user": 0.30266454000000004,
"system": 0.6097913399999999,
"min": 0.24068598372000002,
"max": 0.29843837872
},
{
"command": "pacquet@main",
"mean": 0.27117540402000007,
"stddev": 0.05322594546632942,
"median": 0.25160321872,
"user": 0.30688604,
"system": 0.63218184,
"min": 0.22099488272000004,
"max": 0.39993535772
},
{
"command": "pnpr@HEAD",
"mean": 0.29482222502,
"stddev": 0.017938309755430107,
"median": 0.30039572721999996,
"user": 0.31155224000000004,
"system": 0.62749024,
"min": 0.26526005772,
"max": 0.31261571172
},
{
"command": "pnpr@main",
"mean": 0.33069236782,
"stddev": 0.02908570559110972,
"median": 0.32345599822000004,
"user": 0.34762674000000005,
"system": 0.7006436399999999,
"min": 0.29326560272,
"max": 0.38543763372
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.006944996419761899,
"stddev": 0.0007137393936552559,
"median": 0.006678221640000001,
"user": 0.004396456666666663,
"system": 0.0029508830952380957,
"min": 0.005804756140000001,
"max": 0.01047218014
},
{
"command": "pacquet@main",
"mean": 0.007677693283283578,
"stddev": 0.0012322638099557775,
"median": 0.00731372514,
"user": 0.004657565373134329,
"system": 0.0035127601194029846,
"min": 0.0060159281400000006,
"max": 0.01318108114
},
{
"command": "pnpr@HEAD",
"mean": 0.008445788144115226,
"stddev": 0.0013169896538081363,
"median": 0.00822141814,
"user": 0.004593788971193418,
"system": 0.004311207407407407,
"min": 0.006216240140000001,
"max": 0.012313641140000001
},
{
"command": "pnpr@main",
"mean": 0.006832776000215055,
"stddev": 0.0005871985986980109,
"median": 0.006689977640000001,
"user": 0.004169593763440862,
"system": 0.0030765353763440853,
"min": 0.005953876140000001,
"max": 0.010104976140000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009229782383846155,
"stddev": 0.0017520479075288334,
"median": 0.009058482980000001,
"user": 0.005652040961538461,
"system": 0.004202902980769233,
"min": 0.006435818980000001,
"max": 0.01405971198
},
{
"command": "pacquet@main",
"mean": 0.008149974853015874,
"stddev": 0.0012424002208466403,
"median": 0.0078031459800000005,
"user": 0.005013395555555557,
"system": 0.003664998285714286,
"min": 0.00619311998,
"max": 0.01396568198
},
{
"command": "pnpr@HEAD",
"mean": 0.00867738212122138,
"stddev": 0.0009198613426756746,
"median": 0.00850706398,
"user": 0.00494064992366412,
"system": 0.004345976412213742,
"min": 0.006903267980000001,
"max": 0.01357110198
},
{
"command": "pnpr@main",
"mean": 0.008647363030387595,
"stddev": 0.0010767814833847187,
"median": 0.00853374948,
"user": 0.004908771627906977,
"system": 0.004325744186046514,
"min": 0.00656922798,
"max": 0.012161205980000001
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.63761193688,
"stddev": 0.09713662793871412,
"median": 2.6067503518799997,
"user": 2.2483080399999995,
"system": 1.91908856,
"min": 2.5243846843799997,
"max": 2.79420468438
},
{
"command": "pacquet@main",
"mean": 2.67918384448,
"stddev": 0.0487882401198489,
"median": 2.6875892728799995,
"user": 2.32582764,
"system": 1.9357136599999998,
"min": 2.60815480538,
"max": 2.7386365953799996
},
{
"command": "pnpr@HEAD",
"mean": 1.58084671398,
"stddev": 0.15072938657201057,
"median": 1.52677482288,
"user": 1.4525958399999999,
"system": 1.6206998599999998,
"min": 1.4266916813800001,
"max": 1.83302155538
},
{
"command": "pnpr@main",
"mean": 1.57794757268,
"stddev": 0.0900538708696577,
"median": 1.56557824788,
"user": 1.5352737399999998,
"system": 1.72963616,
"min": 1.4539722433800002,
"max": 1.70854428338
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5082554912000001,
"stddev": 0.03821447774374093,
"median": 0.50571747,
"user": 0.7331801600000001,
"system": 0.8927503399999999,
"min": 0.46762280100000003,
"max": 0.582382046
},
{
"command": "pacquet@main",
"mean": 0.569022351,
"stddev": 0.07368146869948135,
"median": 0.5665933065,
"user": 0.8361345599999999,
"system": 0.9773157399999999,
"min": 0.4687307680000001,
"max": 0.710803731
},
{
"command": "pnpr@HEAD",
"mean": 0.2972497886,
"stddev": 0.022156718778874047,
"median": 0.29747674700000004,
"user": 0.22303156,
"system": 0.53273734,
"min": 0.267685989,
"max": 0.34684382900000005
},
{
"command": "pnpr@main",
"mean": 0.3084886132000001,
"stddev": 0.023936638077180362,
"median": 0.3096859005,
"user": 0.2690925599999999,
"system": 0.5491124399999999,
"min": 0.26580514400000005,
"max": 0.346523261
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.6201588712799997,
"stddev": 0.060498514022725075,
"median": 1.6010489236799998,
"user": 0.8287259599999999,
"system": 0.9289205199999999,
"min": 1.56978348368,
"max": 1.74103928168
},
{
"command": "pacquet@main",
"mean": 1.5954918951800001,
"stddev": 0.03247169285165982,
"median": 1.58497461918,
"user": 0.7810643599999998,
"system": 0.8522460199999999,
"min": 1.57382124468,
"max": 1.6827339956799998
},
{
"command": "pnpr@HEAD",
"mean": 0.28959059838000006,
"stddev": 0.03857896610586124,
"median": 0.27001564768,
"user": 0.23857526,
"system": 0.5392542199999999,
"min": 0.25142894968,
"max": 0.35679320968
},
{
"command": "pnpr@main",
"mean": 0.26737621978000004,
"stddev": 0.0037079189097757943,
"median": 0.26675145118,
"user": 0.21272686,
"system": 0.51663112,
"min": 0.26260536168000004,
"max": 0.27502266968
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23147625272,
"stddev": 0.030067725600462305,
"median": 0.22378282622,
"user": 0.24820475999999997,
"system": 0.06835838,
"min": 0.18792159822,
"max": 0.29786463322
},
{
"command": "pacquet@main",
"mean": 0.2246457924507692,
"stddev": 0.013886344263039984,
"median": 0.22525396022,
"user": 0.24111976000000002,
"system": 0.07417958769230769,
"min": 0.20509527622,
"max": 0.25158577922
},
{
"command": "pnpr@HEAD",
"mean": 0.0939779841533333,
"stddev": 0.0031119798457997206,
"median": 0.09322439772,
"user": 0.03399202666666667,
"system": 0.016446394666666666,
"min": 0.08962625122,
"max": 0.09975639922
},
{
"command": "pnpr@main",
"mean": 0.09355551428666664,
"stddev": 0.0023468068622683872,
"median": 0.09324733322,
"user": 0.036746393333333335,
"system": 0.012940937333333331,
"min": 0.08924464522,
"max": 0.09767421822
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.9559392187688888,
"stddev": 0.18137555153616994,
"median": 0.92131145788,
"user": 1.0067972311111109,
"system": 0.23221080222222223,
"min": 0.62272871588,
"max": 1.20063100088
},
{
"command": "pacquet@main",
"mean": 0.9993395402133335,
"stddev": 0.09742299544344879,
"median": 0.9839082368800001,
"user": 1.0610167866666664,
"system": 0.21637613555555552,
"min": 0.83480834288,
"max": 1.1420449488800002
},
{
"command": "pnpm@HEAD",
"mean": 3.7245784863244444,
"stddev": 0.42177254615302257,
"median": 3.64341101588,
"user": 5.952338008888888,
"system": 0.2601849133333334,
"min": 3.11000001188,
"max": 4.2395899548800005
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1918326463066667,
"stddev": 0.010784096763731137,
"median": 0.19179384524,
"user": 0.14578876666666662,
"system": 0.09058312666666665,
"min": 0.18053581924,
"max": 0.22535237624
},
{
"command": "pacquet@main",
"mean": 0.188002841115,
"stddev": 0.006503562536043529,
"median": 0.18695447924,
"user": 0.13831859999999999,
"system": 0.08874614750000001,
"min": 0.17893310224,
"max": 0.20269833724
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.5304649361000005,
"stddev": 0.16414296038371348,
"median": 4.4757845505,
"user": 1.5233108599999998,
"system": 1.7837313,
"min": 4.368641037000001,
"max": 4.773780394
},
{
"command": "pacquet@main",
"mean": 4.4990571949,
"stddev": 0.14598358277482604,
"median": 4.4548568635,
"user": 1.52508256,
"system": 1.7558762999999995,
"min": 4.335837712,
"max": 4.8222061940000005
},
{
"command": "pnpr@HEAD",
"mean": 3.4641378614000002,
"stddev": 0.0874758842144931,
"median": 3.4247605855,
"user": 1.4836825599999997,
"system": 1.5560076,
"min": 3.39007047,
"max": 3.644430355
},
{
"command": "pnpr@main",
"mean": 3.8219076058999994,
"stddev": 1.051987631686741,
"median": 3.4629939404999996,
"user": 1.4257433599999998,
"system": 1.5461332999999997,
"min": 3.402919929,
"max": 6.803955569
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.20154809931684214,
"stddev": 0.030814524020259717,
"median": 0.19939851058,
"user": 0.2432220757894737,
"system": 0.19030631684210525,
"min": 0.12498430258000001,
"max": 0.24960260858000002
},
{
"command": "pacquet@main",
"mean": 0.1642636762723077,
"stddev": 0.03293118509543026,
"median": 0.15019415958000001,
"user": 0.18961722153846153,
"system": 0.16861634923076918,
"min": 0.13144574858,
"max": 0.25353281358
},
{
"command": "pnpr@HEAD",
"mean": 0.1494853738925,
"stddev": 0.02759811064995542,
"median": 0.14586174808000002,
"user": 0.1718084475,
"system": 0.14162582999999998,
"min": 0.11994182258,
"max": 0.21318437258
},
{
"command": "pnpr@main",
"mean": 0.14187187146235294,
"stddev": 0.006568173829609753,
"median": 0.13955853458,
"user": 0.17264676,
"system": 0.13788140352941178,
"min": 0.13282699958,
"max": 0.15200421258
}
]
} |
PR Summary by QodoSupport SemVer build metadata in workspace dependency resolution
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1.
|
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…6483) Use deterministic ordinal comparison in `@pnpm/resolving.npm-resolver` for available versions hint, matching Rust's ordering. Preserve stable-only behavior for tag selectors in `wantedDepIsLocallyAvailable` within `@pnpm/installing.deps-resolver`. Add regression tests for both behaviors in TypeScript and Rust.
|
Code review by qodo was updated up to the latest commit 6c397fb |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary of Changes & Status
Written by an agent (Gemini). |
…pnpm#6483) (pnpm#15340) When a workspace package version carries SemVer build metadata, exact version specifiers (e.g. `workspace:0.5.6-next.3+f60facc` or `workspace:0.5.6-next.3`) failed to resolve because version-selector-type and Version normalization strip build metadata before matching keys in the workspace packages map. Fall back to SemVer range resolution for Version specifiers in both pnpm v11 (TypeScript) and v12 (Rust) to honor SemVer precedence rules (spec item 10) where build metadata is ignored. Closes pnpm#6483
Summary
When a workspace package version carries SemVer build metadata (e.g.
0.5.6-next.3+f60facc), exact version specifiers (such asworkspace:0.5.6-next.3+f60faccorworkspace:0.5.6-next.3) failed withERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE.This occurred because
version-selector-type(in TypeScript) andVersionparsing (in Rust) normalize exact version specifiers by stripping build metadata intofetchSpec. When checking the workspace packages map, direct string key lookups failed because the version stored in the workspace map retains its original build metadata frompackage.json.According to SemVer spec item 10, build metadata MUST be ignored when determining version precedence. This PR updates
pickMatchingLocalVersionOrNullin both pnpm v11 (TypeScript) and v12 (Rust) to fall back to SemVer range resolution when exact key lookup fails. In addition,@pnpm/installing.deps-resolverreuses the exportedpickMatchingLocalVersionOrNullhelper.Closes #6483
Squash Commit Body
Checklist
pnpm changeset) if this PR changes any published package. Keep it short and written for pnpm users — it becomes a release note.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit