Repository navigation
fix(npm-resolver): align the stable-range shortcuts with pnpm v12 - #17072
Conversation
The stable-range mirror shortcuts (the dominant lockfile version and the fresh ETag-less mirror) now hold the same conditions as v12's `range_pick_is_stable`: - `minimumReleaseAge` rules them out only for a package it applies to. A package in `minimumReleaseAgeExclude` keeps them, so its range resolves from the mirror when the lockfile version dominates, instead of asking the registry. - An offline or prefer-offline pick never tries them. Such a pick reads the mirror first, and the shortcuts only re-read the mirror that read could not pick from. `decideMirrorShortcuts` reports the release-age answer it computed, and `mirrorWrittenAfter` takes it, so a pick asks the exclusion policy at most once. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoAlign pnpm v11 stable-range mirror shortcuts with v12
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1. Resolver speedup lacks measurements
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Qodo findings:
Written by an agent (Claude Code, claude-opus-5-5). |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Your distinction is valid: finding 1 concerns missing numeric benchmark evidence, not an incorrect claim that the exclusion policy is evaluated twice. The implementation and test support the claim that the policy lookup remains at one evaluation per applicable range pick, but the PR still provides no before/after performance measurements. The finding therefore remains open unless explicitly dismissed. finding 2 is marked implemented. The documentation fix in |
|
Code review by qodo was updated up to the latest commit 537203a |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
v11 only. This aligns v11's stable-range mirror shortcuts with v12's
range_pick_is_stable. #17064 left the last two v11/v12 route differences as they were, and this PR closes them. Follow-up to pnpm/tasks#146.The shortcuts are the dominant lockfile version and the fresh mirror without an ETag.
Packages excluded from
minimumReleaseAge. This is a user-visible change. v11 ruled the shortcuts out wheneverminimumReleaseAgewas set, so a package inminimumReleaseAgeExcludealways asked the registry. v12 rules them out only where the release age applies. Now v11 does too.Offline and prefer-offline picks. These picks read the mirror first. When that read could not pick, v11 went on to try these shortcuts on the same mirror. v12 does not. Now v11 doesn't either. No result changes, because the shortcuts only re-read a mirror that already gave no pick.
Hot path. The exclusion check is a policy lookup, so it runs last, and only when every cheap condition passes.
decideMirrorShortcutsreports the answer it computed (releaseAgeApplies), andmirrorWrittenAftertakes that answer. So a pick asks the policy at most once. v12 asks twice in the same case.Tests.
metaCache.test.tshas a new test: a package excluded fromminimumReleaseAge, with a dominant lockfile version, resolves from a backdated mirror without a registry request. It failed before the change.route.test.tsadds table rows for the excluded package, another package excluded, offline, prefer-offline, the reportedreleaseAgeApplies, andmirrorWrittenAftertaking the given answer without asking again.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit