feat(npm): write min-release-age-exclude entries for security updates
#45177
Unanswered
MorrisonCole
asked this question in
Request Help
Replies: 1 comment 4 replies
|
Could you also post how the work that needs to be done for it i.e. in which files we should add the exclusion settings/fields. For example, in pnpm's case we could just add the |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How are you running Renovate?
A Mend.io-hosted app
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
44.12.0
Please tell us more about your question or problem
This discussion originally covered both npm and Yarn. The Yarn half is split out into #45279 which is actionable today; this one is now npm-only, where the upstream setting can't yet properly express what's needed. I've raised https://github.com/orgs/community/discussions/204502 upstream where discussion needs to happen first.
When
min-release-ageis set in a project, Renovate security updates that resolve to a version younger than the gate should record that version as approved by adding an entry tomin-release-age-excludein.npmrc, the same way Renovate already does for pnpm'sminimumReleaseAgeExclude(#39168):min-release-age=7 min-release-age-exclude[]=axios // note this does *NOT support version scoping*, we need to advocate for / get https://github.com/orgs/community/discussions/204502 solved first!Why it's needed
npm applies the gate when it resolves a package, not when it installs from the lockfile.
npm ciis fine after a security update merges - the problem is the next thing that re-resolves. Verified on npm 12.0.2, with a security fix already locked:npm ci, cold cachenpm install <pkg>, range permits an older versionnpm install <pkg>, range pins the fixETARGETSo after a security fix lands, a developer running
npm install <pkg>either hits a hard error or silently reverts the fix.Why npm is blocked, and pnpm/Yarn aren't
min-release-age-excludematches package names andminimatchglobs only - there's nopkg@versionform. The most Renovate could write today is the bare package name, which would exempt that package from the gate permanently rather than approving the one audited version. An entry that does carry a version isn't rejected either: it parses fine and matches nothing, so it silently exempts nothing.That makes automatic writes riskier than they're worth for npm right now. I've raised the missing version-scoped form upstream in https://github.com/orgs/community/discussions/204502 - if npm gains it, this becomes the same change as the pnpm and Yarn ones.
Logs (if relevant)
No response
All reactions