fix(npm): use packageName for pnpm overrides with range selectors in minimumReleaseAgeExclude#42164
Open
oikarinen wants to merge 1 commit intorenovatebot:mainfrom
Open
Conversation
…minimumReleaseAgeExclude For pnpm.overrides entries with version range selectors (e.g. "pkg@<=1.0.0"), depName contains the full override key including the selector, which is needed to correctly update package.json. However this caused invalid entries in minimumReleaseAgeExclude like "fast-xml-parser@<=5.3.5@5.5.7" instead of "fast-xml-parser@5.5.7", breaking pnpm install with ERR_PNPM_INVALID_MINIMUM_RELEASE_AGE_EXCLUDE. Fix by using packageName (bare npm package name parsed by @pnpm/parse-overrides) instead of depName when constructing minimumReleaseAgeExclude entries. Falls back to depName for dependency types where packageName is not set. Made-with: Cursor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
When a
pnpm.overridesentry uses a version range selector (e.g."fast-xml-parser@<=5.3.5": "5.5.7"), Renovate was generating an invalidminimumReleaseAgeExcludeentry likefast-xml-parser@<=5.3.5@5.5.7instead offast-xml-parser@5.5.7, causingpnpm installto fail withERR_PNPM_INVALID_MINIMUM_RELEASE_AGE_EXCLUDE.The root cause:
depNamefor pnpm overrides with range selectors contains the full override key (needed for correctly updatingpackage.json), butminimumReleaseAgeExcluderequires exact package name + version pairs.Fix by using
upgrade.packageName ?? upgrade.depNamewhen constructingminimumReleaseAgeExcludeentries.packageNameholds the bare npm package name (fast-xml-parser) as parsed by@pnpm/parse-overrides, whiledepNameretains the full key. Falls back todepNamefor all other dependency types wherepackageNameis not set, preserving existing behaviour.Context
AI assistance disclosure
Made with Cursor (claude-4.6-sonnet). AI was used for root cause analysis, implementation, tests, and documentation.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: