Repository navigation
fix(ci): keep Renovate from rewriting peer OR ranges - #2063
Conversation
Security updates force update-lockfile, then bump ranges that have no lockfile entry. That joins || alternatives with spaces. Use auto so peers widen and an in-range peer range stays intact. Co-authored-by: Yam Borodetsky <[email protected]>
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Renovate vulnerability range strategy —
.github/renovate.jsonsetsvulnerabilityAlerts.rangeStrategy: "auto"(previously the implicitupdate-lockfile), with comments explaining the||-range corruption from #2033. - Regression guard —
scripts/sync-lib/renovate.test.jsadds a string-presence test asserting thevulnerabilityAlertsblock keeps"enabled": trueand"rangeStrategy": "auto".
The fix is behaviorally correct. Under the old default, a vulnerability update on a range with no lockedVersion (peers normally) escalates update-lockfile → bump, and npm's bump replaces each || alternative and space-joins them, producing exactly the ^8.0.16 ^8.0.16 … corruption in #2033. auto makes npm resolve peers to widen, so the escalation never fires and an in-range fix leaves the range untouched, while pinned devDependencies still move to the fixed version. The peerDependencies: enabled: false packageRule remains correct for regular updates because the vulnerability rule re-enables peers via its force, and it does not override rangeStrategy.
The added test is a literal string check — consistent with the other tests in the same file — and can't validate Renovate's runtime behavior, but it does pin the regression line. No blocking or minor issues.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Security updates were still rewriting peer ranges even though
peerDependenciesare disabled.#2033turned@arkenv/vite-plugin's Vite peer range from^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0into^8.0.16 ^8.0.16 ^8.0.16 ^8.0.16 ^8.0.16. Vulnerability alerts forcerangeStrategy: update-lockfile, and Renovate then switches that tobumpwhen the range has no lockfile entry.bumprewrites each||alternative and joins them with spaces.vulnerabilityAlerts.rangeStrategyis nowauto. npm widens peers, so an in-range peer range stays as written, and a pinned devDependency still moves to the fixed version. Regular (non-security) updates still skippeerDependencies.