Skip to content

fix(npm): use packageName for pnpm overrides with range selectors in minimumReleaseAgeExclude#42164

Open
oikarinen wants to merge 1 commit intorenovatebot:mainfrom
oikarinen:fix/pnpm-overrides-minimumReleaseAgeExclude
Open

fix(npm): use packageName for pnpm overrides with range selectors in minimumReleaseAgeExclude#42164
oikarinen wants to merge 1 commit intorenovatebot:mainfrom
oikarinen:fix/pnpm-overrides-minimumReleaseAgeExclude

Conversation

@oikarinen
Copy link

@oikarinen oikarinen commented Mar 26, 2026

Changes

When a pnpm.overrides entry uses a version range selector (e.g. "fast-xml-parser@<=5.3.5": "5.5.7"), Renovate was generating an invalid minimumReleaseAgeExclude entry like fast-xml-parser@<=5.3.5@5.5.7 instead of fast-xml-parser@5.5.7, causing pnpm install to fail with ERR_PNPM_INVALID_MINIMUM_RELEASE_AGE_EXCLUDE.

The root cause: depName for pnpm overrides with range selectors contains the full override key (needed for correctly updating package.json), but minimumReleaseAgeExclude requires exact package name + version pairs.

Fix by using upgrade.packageName ?? upgrade.depName when constructing minimumReleaseAgeExclude entries. packageName holds the bare npm package name (fast-xml-parser) as parsed by @pnpm/parse-overrides, while depName retains the full key. Falls back to depName for all other dependency types where packageName is not set, preserving existing behaviour.

Context

  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

  • Yes — substantive assistance (AI-generated non-trivial portions of code, tests, or documentation).

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])

  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Newly added/modified unit tests

…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
@github-actions github-actions bot requested a review from viceice March 26, 2026 19:17
@cla-assistant
Copy link

cla-assistant bot commented Mar 26, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant