Repository navigation
Add npm release cooldown (.npmrc: min-release-age=7) - #219
Merged
Merged
Conversation
npm only installs versions published at least 7 days ago; save-exact and package-lock make exact saves and the lockfile explicit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
muodov
approved these changes
Nov 18, 2026
Contributor
Author
|
If this looks good to you @muodov , could you merge? |
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.
Adds an
.npmrcthat turns on npm's release cooldown and two related settings:min-release-age=7: npm only installs versions published at least 7 days ago, so a compromised release is usually caught and pulled before it reaches us. Needs npm >= 11.10;.nvmrcis 24.20.0, which bundles npm 11.19.0.save-exact=true:npm install <pkg>records an exact version instead of a^range. Existing entries inpackage.jsonare unchanged.package-lock=true: npm's default, made explicit so a user or CI setting can't turn the lockfile off.Steps to test
A
.npmrcline can be silently ignored (npm below 11.10, an environment override), so the real test is asking npm for a too-new version and checking it refuses. Run either option from the repo root on this branch:A single
npm pack --dry-runcommand. Pick a version of a frequently released package published 5 to 7 days ago (e.g. a recentelectron-to-chromium, which releases several times a week;caniuse-litesometimes goes more than a week without one) and run:Expect
npm error code ETARGET ... with a date before <date>. If it printsnpm notice filename: ..., the cooldown isn't working. It downloads nothing and changes no files.If you prefer a script:
canary.shfrom our internalnode-upgraderepo (cooldown/directory) runs the same check and picks the version for you:Expect
PASS: cooldown in force, ~7.00 days >= 7.Please test this wherever this repo gets installed — you know that best (CI, Docker builds, VMs, developer laptops…). At a minimum, run one of the checks in CI, e.g. a temporary step after
npm ciin.github/workflows/node.js.ymlon a throwaway draft PR you close afterwards.I tested locally with Node 24.20.0 / npm 11.19.0, using this branch's
package.json,package-lock.jsonand.npmrc:npm cisucceeds (including the git dependency@duckduckgo/eslint-config) and leaves the lockfile unchanged, andcanary.shpasses. I also rannpm cion npm 11.11.0 (Node 24.14.1), the one npm where the cooldown plus a git dependency can breaknpm ci; it passes here too.When you've tested, please share your results (where you tested, and what npm printed) on the internal Asana task for this change, which is assigned to you.
After reviewing/testing, I'd love for you to merge this change.
Impact and risks
npm ciand versions already inpackage-lock.jsonare unaffected.@duckduckgo/eslint-configinstalls as before. The cooldown doesn't apply to git dependencies, so this change doesn't protect them.ETARGET. To bypass it once:npm install <pkg>@<version> --min-release-age=0.tracker-radar-internal's Jenkins jobs clone this repo and runnpm ciin it (on npm 11.19.0), so the cooldown applies there too; installs from the lockfile are unaffected. This PR adds noengine-strict, so it can't fail an older npm..npmrc.🤖 Generated with Claude Code