Repository navigation
fix(resolver): bound minimumReleaseAge latest fallback - #13044
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 (1)
📝 WalkthroughWalkthroughPublish-age metadata filtering now bounds ChangesLatest dist-tag fallback
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Possibly related issues
Possibly related PRs
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/5The change is safe to merge: it narrows an existing fallback scan rather than widening any search path, and the two implementations (TypeScript and Rust) are symmetric. Both implementations correctly bound the latest fallback to versions at or below the original tag target, handle the no-safe-fallback case by omitting the tag entirely, and leave generic filter_pkg_metadata_versions behaviour unchanged. New tests in both suites cover the main scenario and the edge case. Files Needing Attention: No files require special attention. Reviews (4): Last reviewed commit: "docs(changeset): link pnpm/pnpm#13034 in..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/resolving-npm-resolver/src/pick_package_from_meta.rs (1)
361-363: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCorrect the misleading doc comment.
The phrase
for non-latest tags, no newer than the original latest targetcontradicts the implemented behavior. The code specifically enforces the "no newer than the original target" bound for thelatesttag (viatag == "latest"), while non-latest tags are unconstrained by the original tag's version magnitude.Please adjust the wording to correctly reflect that the boundary applies to the
latesttag.💡 Suggested adjustment
-/// for non-`latest` tags, no newer than the original `latest` target, -/// same prerelease/release status, and preferring non-deprecated +/// (no newer than the original target for the `latest` tag, same +/// prerelease/release status, and preferring non-deprecated🤖 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/resolving-npm-resolver/src/pick_package_from_meta.rs` around lines 361 - 363, Update the documentation comment near the tag-selection logic to state that the “no newer than the original latest target” constraint applies to the latest tag, not non-latest tags. Preserve the existing descriptions of prerelease/release matching and deprecated-version preference.
🤖 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/resolving-npm-resolver/src/pick_package_from_meta.rs`:
- Around line 361-363: Update the documentation comment near the tag-selection
logic to state that the “no newer than the original latest target” constraint
applies to the latest tag, not non-latest tags. Preserve the existing
descriptions of prerelease/release matching and deprecated-version preference.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d9ef2aba-7c86-4237-b358-eb2d3fae88d5
📒 Files selected for processing (5)
.changeset/minimum-release-age-latest-bound.mdpnpm/crates/resolving-npm-resolver/src/pick_package_from_meta.rspnpm/crates/resolving-npm-resolver/src/pick_package_from_meta/tests.rspnpm11/resolving/registry/pkg-metadata-filter/src/index.tspnpm11/resolving/registry/pkg-metadata-filter/test/index.ts
|
Clarified the Rust doc comment so each fallback constraint names the tag it applies to in Written by an agent (OpenAI Codex, GPT-5.5). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13044 +/- ##
=======================================
Coverage 87.87% 87.88%
=======================================
Files 549 549
Lines 96192 96205 +13
=======================================
+ Hits 84532 84545 +13
Misses 11660 11660 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. 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.5552898273799998,
"stddev": 0.17727585648778857,
"median": 2.59228510348,
"user": 1.53336202,
"system": 1.2973190999999997,
"min": 2.34910387348,
"max": 2.76742787348,
"times": [
2.49393705448,
2.35144914948,
2.76742787348,
2.69063315248,
2.36716347948,
2.74070932948,
2.69416701948,
2.69502736848,
2.40327997348,
2.34910387348
]
},
{
"command": "pacquet@main",
"mean": 2.4546011204799996,
"stddev": 0.11613122844792612,
"median": 2.40772094048,
"user": 1.7138022200000003,
"system": 1.3743393,
"min": 2.36550811548,
"max": 2.75807015548,
"times": [
2.40893507548,
2.36550811548,
2.4400563054799997,
2.38303853248,
2.48949408948,
2.40650680548,
2.75807015548,
2.39606167948,
2.5079603584799997,
2.39038008748
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5721924288799998,
"stddev": 0.1738702829958862,
"median": 1.62817288398,
"user": 1.07930922,
"system": 1.1562956,
"min": 1.35243658248,
"max": 1.80544999048,
"times": [
1.4510183854799998,
1.63081597748,
1.35243658248,
1.67483102048,
1.62552979048,
1.6805086354799998,
1.3662380054799999,
1.80544999048,
1.36299482248,
1.77210107848
]
},
{
"command": "pnpr@main",
"mean": 1.49008898288,
"stddev": 0.13039455378307105,
"median": 1.49544581398,
"user": 1.09396182,
"system": 1.1693236999999996,
"min": 1.34718377048,
"max": 1.76138784448,
"times": [
1.50822838748,
1.36301867748,
1.3761311274799999,
1.54193970548,
1.5958555094799998,
1.48266324048,
1.54607439748,
1.37840716848,
1.34718377048,
1.76138784448
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.26758065782,
"stddev": 0.006848693896313029,
"median": 0.26788758242,
"user": 0.22466413999999996,
"system": 0.5279822799999999,
"min": 0.25626501492000003,
"max": 0.27849207992,
"times": [
0.26409197292000003,
0.26998497592000004,
0.25944282492000004,
0.27063645892000004,
0.27162431092,
0.26579018892,
0.27487004892,
0.25626501492000003,
0.26460870192,
0.27849207992
]
},
{
"command": "pacquet@main",
"mean": 0.26225578392000004,
"stddev": 0.00698581860820397,
"median": 0.26336458442,
"user": 0.21313053999999995,
"system": 0.53874898,
"min": 0.24823517392000002,
"max": 0.27430832492,
"times": [
0.25640267692,
0.25893314992000005,
0.27430832492,
0.26651613392,
0.24823517392000002,
0.26467023792000005,
0.26018445992,
0.26657851292,
0.26221142992,
0.26451773892
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29095387352,
"stddev": 0.017994238906244617,
"median": 0.28541859642,
"user": 0.23392594000000005,
"system": 0.5599803799999999,
"min": 0.27438928792,
"max": 0.33607250392000004,
"times": [
0.30444665592000003,
0.29438001592,
0.28826207692,
0.27438928792,
0.33607250392000004,
0.28532254992,
0.28241222692,
0.28551464292,
0.27894476792,
0.27979400692
]
},
{
"command": "pnpr@main",
"mean": 0.27634308202,
"stddev": 0.011443599486682856,
"median": 0.27558729692000006,
"user": 0.22070163999999998,
"system": 0.52726808,
"min": 0.26084657092,
"max": 0.29070644792,
"times": [
0.28518743192,
0.28864367992,
0.28833815192,
0.29070644792,
0.26201443492000004,
0.27129166792000003,
0.26522784092,
0.26084657092,
0.27431671992,
0.27685787392000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.64862177398,
"stddev": 0.023792587767725696,
"median": 2.6395278313799997,
"user": 1.5977954999999997,
"system": 1.33779446,
"min": 2.62625591888,
"max": 2.69503218888,
"times": [
2.64481001788,
2.65534973388,
2.69503218888,
2.63238604488,
2.62839573288,
2.62959423288,
2.6805386808800002,
2.63424564488,
2.62625591888,
2.65960954388
]
},
{
"command": "pacquet@main",
"mean": 2.6429754194799995,
"stddev": 0.016496965310508815,
"median": 2.64662966588,
"user": 1.6070995999999997,
"system": 1.34506336,
"min": 2.61911719588,
"max": 2.67462352588,
"times": [
2.63510056388,
2.67462352588,
2.65084602188,
2.61911719588,
2.62358069188,
2.64753862788,
2.65445725288,
2.62957564788,
2.64919396288,
2.64572070388
]
},
{
"command": "pnpr@HEAD",
"mean": 1.62193382078,
"stddev": 0.12932605626083407,
"median": 1.65949987888,
"user": 1.0524336,
"system": 1.15062976,
"min": 1.43503049188,
"max": 1.77881179888,
"times": [
1.6428800588799999,
1.77881179888,
1.72097441088,
1.67611969888,
1.46969939788,
1.60539725388,
1.43503049188,
1.69762731388,
1.44258526288,
1.7502125198799998
]
},
{
"command": "pnpr@main",
"mean": 1.6159949052800002,
"stddev": 0.16267903781421958,
"median": 1.59294843088,
"user": 1.0959538,
"system": 1.2125351599999998,
"min": 1.41781356688,
"max": 1.8679143628800001,
"times": [
1.41781356688,
1.85324973288,
1.46791958588,
1.53524046788,
1.8679143628800001,
1.76014279188,
1.5911822038799999,
1.59471465788,
1.62538857588,
1.44638310688
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.44995910756000007,
"stddev": 0.02499925270435607,
"median": 0.44234951926000005,
"user": 0.59351464,
"system": 0.6886586,
"min": 0.43002531776,
"max": 0.51729432576,
"times": [
0.43801591576000004,
0.44995504176000006,
0.43957219376000006,
0.51729432576,
0.44978745376,
0.44495393776000003,
0.45666482276000003,
0.43002531776,
0.43357696576000004,
0.43974510076000006
]
},
{
"command": "pacquet@main",
"mean": 0.45441725636,
"stddev": 0.021993845622404837,
"median": 0.44692462676000005,
"user": 0.5854508399999999,
"system": 0.7109354,
"min": 0.42925352676000006,
"max": 0.49162513976000005,
"times": [
0.43776616176000005,
0.43546376976000006,
0.45200541676000006,
0.49162513976000005,
0.43911920576,
0.44184383676000005,
0.42925352676000006,
0.47008789176000004,
0.48629696676000006,
0.46071064776000004
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33090275956000004,
"stddev": 0.010586794223276354,
"median": 0.33338749776000004,
"user": 0.22588353999999997,
"system": 0.5529777,
"min": 0.31123516776000004,
"max": 0.34584024176000006,
"times": [
0.31744414976,
0.31123516776000004,
0.32521559276,
0.33164129476000004,
0.33843733876000004,
0.32801129776000004,
0.33799062276,
0.33807818876,
0.34584024176000006,
0.33513370076000004
]
},
{
"command": "pnpr@main",
"mean": 0.32903885756000006,
"stddev": 0.011851035352969986,
"median": 0.33187620926000005,
"user": 0.22813274000000003,
"system": 0.5270969000000001,
"min": 0.30839723176000006,
"max": 0.34397272476,
"times": [
0.34099800976000005,
0.32895466476,
0.33629841676000005,
0.34397272476,
0.32028691576,
0.30839723176000006,
0.31278749876,
0.32817898576000004,
0.33571637376,
0.33479775376000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7976019532400003,
"stddev": 0.023911723659561727,
"median": 1.7941438394400002,
"user": 0.8233941,
"system": 0.7751395000000001,
"min": 1.7695042889400001,
"max": 1.8552628049400002,
"times": [
1.80665567594,
1.79618982994,
1.8021760899400001,
1.77030748994,
1.8035934149400001,
1.79144595394,
1.8552628049400002,
1.7695042889400001,
1.78878613494,
1.7920978489400001
]
},
{
"command": "pacquet@main",
"mean": 1.82060797044,
"stddev": 0.019622082390552676,
"median": 1.81790704444,
"user": 0.8770592,
"system": 0.776071,
"min": 1.7856216099400002,
"max": 1.85785361294,
"times": [
1.8169373929400001,
1.8188766959400002,
1.85785361294,
1.8415118859400001,
1.8284575959400002,
1.82433670094,
1.7856216099400002,
1.80711545694,
1.80973709294,
1.8156316599400002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.33330252654,
"stddev": 0.015604680326120567,
"median": 0.33506254444000005,
"user": 0.22674540000000004,
"system": 0.5648516,
"min": 0.30271427594,
"max": 0.35791451494000004,
"times": [
0.35791451494000004,
0.34543281994,
0.33473831994000003,
0.30271427594,
0.31919859294,
0.33539778994,
0.34710100894,
0.33188303094,
0.32325814294,
0.33538676894
]
},
{
"command": "pnpr@main",
"mean": 0.34024094903999996,
"stddev": 0.013742437996051585,
"median": 0.34031809044000005,
"user": 0.22726990000000002,
"system": 0.5755739,
"min": 0.31581901994,
"max": 0.36467343694000004,
"times": [
0.35286257394000003,
0.33414471594,
0.33849929494000003,
0.32507648794,
0.31581901994,
0.34580127694,
0.33733364694,
0.34213688594,
0.34606215094000004,
0.36467343694000004
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2821254440818182,
"stddev": 0.028569265925602005,
"median": 0.27553292690000003,
"user": 0.2826905418181818,
"system": 0.08071779272727274,
"min": 0.24788504190000002,
"max": 0.33179349290000004,
"times": [
0.24788504190000002,
0.2481314879,
0.2496583909,
0.28609565690000005,
0.2718721819,
0.30748084690000005,
0.29196010590000004,
0.33179349290000004,
0.3188081139,
0.27553292690000003,
0.27416163890000006
]
},
{
"command": "pacquet@main",
"mean": 0.27844720070000006,
"stddev": 0.0201191458381807,
"median": 0.2734528009,
"user": 0.28624686,
"system": 0.06477382000000001,
"min": 0.2474115539,
"max": 0.3168355479,
"times": [
0.29372137090000006,
0.2605454039,
0.2474115539,
0.26896886090000005,
0.3168355479,
0.29920824590000006,
0.27052948790000003,
0.2803459339,
0.27068461190000004,
0.27622098990000005
]
},
{
"command": "pnpr@HEAD",
"mean": 0.0972926043,
"stddev": 0.003918382941315389,
"median": 0.09684981590000001,
"user": 0.026521193333333335,
"system": 0.011868486666666667,
"min": 0.08995949290000001,
"max": 0.10465170690000002,
"times": [
0.09276353490000001,
0.0943813309,
0.10417063490000002,
0.1015679839,
0.09866678890000001,
0.09455051090000001,
0.09461224790000002,
0.1013045659,
0.09700249490000001,
0.09348832890000001,
0.09786194290000001,
0.09729611190000001,
0.0950202009,
0.09669713690000001,
0.09724045690000001,
0.10276586390000002,
0.10102928390000002,
0.09647779190000001,
0.09873264390000001,
0.09446690290000001,
0.09575632490000001,
0.10102356290000002,
0.10360047490000002,
0.0933618679,
0.10465170690000002,
0.09190456890000001,
0.09983800690000001,
0.09205743790000001,
0.08995949290000001,
0.0965279269
]
},
{
"command": "pnpr@main",
"mean": 0.09960794986551724,
"stddev": 0.0047602209925066315,
"median": 0.09757892790000001,
"user": 0.026260015172413796,
"system": 0.01375417517241379,
"min": 0.09315065890000002,
"max": 0.11034129290000001,
"times": [
0.09615132290000002,
0.09472572290000002,
0.11034129290000001,
0.10341796890000002,
0.09903650890000001,
0.10261192190000001,
0.09738767590000001,
0.09495017790000002,
0.09748708390000001,
0.09757892790000001,
0.10535732290000001,
0.10785098690000001,
0.10256856990000002,
0.09979286190000002,
0.0956650819,
0.09609823190000001,
0.09426638190000002,
0.09650683690000002,
0.10234201990000001,
0.10839365390000001,
0.10590200490000001,
0.10022201390000002,
0.09637714990000001,
0.0960029019,
0.1010726259,
0.09412838190000002,
0.09597505890000001,
0.10326919790000001,
0.09315065890000002
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.69877732688,
"stddev": 0.1715931206001448,
"median": 4.663484651379999,
"user": 2.1978263799999995,
"system": 1.6216939400000001,
"min": 4.47727806088,
"max": 5.04546152288,
"times": [
5.04546152288,
4.62331812288,
4.70196963588,
4.59365490888,
4.65486857088,
4.5336199618799995,
4.78103544488,
4.67210073188,
4.90446630788,
4.47727806088
]
},
{
"command": "pacquet@main",
"mean": 4.56727505478,
"stddev": 0.09799252526387933,
"median": 4.52355478538,
"user": 2.01937338,
"system": 1.57930034,
"min": 4.48003214688,
"max": 4.76645313188,
"times": [
4.544038748879999,
4.48003214688,
4.4893789138799995,
4.50425700688,
4.76645313188,
4.68848638488,
4.5266912358799996,
4.5204183348799996,
4.64669592988,
4.50629871388
]
},
{
"command": "pnpr@HEAD",
"mean": 3.61654320468,
"stddev": 0.12355738524796518,
"median": 3.60281068038,
"user": 1.2339070799999996,
"system": 1.28818654,
"min": 3.48076231288,
"max": 3.8530243248800002,
"times": [
3.5870080148800003,
3.48076231288,
3.6186133458800005,
3.7895350958800003,
3.62678039788,
3.5832780108800004,
3.48481562088,
3.8530243248800002,
3.6396849718800004,
3.50192995088
]
},
{
"command": "pnpr@main",
"mean": 3.5598110490800003,
"stddev": 0.07011362362866375,
"median": 3.54409016088,
"user": 1.2982474800000001,
"system": 1.25528684,
"min": 3.4732959788800004,
"max": 3.70085483788,
"times": [
3.49425703588,
3.70085483788,
3.52725954388,
3.5081987958800003,
3.6202174348800003,
3.61821148488,
3.52026438288,
3.4732959788800004,
3.5746302178800002,
3.5609207778800003
]
}
]
} |
|
| Branch | pr/13044 |
| Testbed | pacquet |
🚨 1 Alert
| Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Upper Boundary (Limit %) |
|---|---|---|---|---|
| isolated-linker.fresh-resolve.hot-cache.offline | Latency milliseconds (ms) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 733.91 ms(+20.56%)Baseline: 608.74 ms | 730.49 ms (100.47%) |
Click to view all benchmark results
Constraint: Keep TypeScript and pacquet resolver behavior in parity. Rejected: Global Rust helper bound | it also drives package-version guards. Confidence: high Scope-risk: narrow Directive: Keep age-fallback policy aligned across both resolver implementations. Tested: Red-green parity regressions and complete affected test suites. Tested: TypeScript compile, lint, spellcheck, metadata, and changeset gates. Tested: Strict changed-crate Clippy, rustdoc, and rustfmt. Not-tested: Full Rust workspace gate due the temporary filesystem limit.
Constraint: Keep the publish-date filter contract unambiguous. Confidence: high Scope-risk: narrow Tested: Resolver tests, strict Clippy, rustdoc, and rustfmt.
1d0e4d5 to
7da4caf
Compare
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. Previous review resultsReview updated until commit a5783c2 Results up to commit 7da4caf
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit a5783c2 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
| Project | pnpm's project |
| Branch | pr/13044 |
| 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,435.03 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 302.71 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 311.24 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 89.96 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,352.44 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,480.76 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 274.39 ms |
Summary
Closes #13034.
latesttag at or below the registry's original tag target whenminimumReleaseAgefilters that targetSquash Commit Body
Checklist
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 (OpenAI Codex, GPT-5.5).
Summary by CodeRabbit
latestdist-tag never resolves to a version newer than the registry’s originally targetedlatest, even when cutoff or trusted-version rules exclude it.latestdist-tag repopulation so fallback respects the original bound.latesttarget.minimumReleaseAgewon’t overridelatestwith a newer SemVer than the registry tag target (see#13034).