Skip to content

Respect package managers' native minimum release age#144

Open
bircni wants to merge 2 commits into
silverwind:masterfrom
bircni:native-cooldown
Open

Respect package managers' native minimum release age#144
bircni wants to merge 2 commits into
silverwind:masterfrom
bircni:native-cooldown

Conversation

@bircni

@bircni bircni commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The npm ecosystem now ships built-in supply-chain "cooldown" settings — a minimum age a published version must reach before a package manager will install it. updates already has its own cooldown option, but ignored these native settings. This PR makes the npm mode automatically honor them, so updates never proposes a version the package manager itself would refuse to install.

The nearest config file above each manifest is read and normalized to days:

Package manager File Setting (unit) Exclude list
npm .npmrc min-release-age (days) min-release-age-exclude
pnpm pnpm-workspace.yaml or .npmrc minimumReleaseAge / minimum-release-age (minutes) minimumReleaseAgeExclude / minimum-release-age-exclude
bun bunfig.toml [install] minimumReleaseAge (seconds) minimumReleaseAgeExcludes

When several are present, the most conservative age and the union of exclude lists apply.

Precedence

An explicit updates cooldown always wins; the native value is only a fallback when updates has none:

  1. Per-package overrides cooldown
  2. Global/per-dir cooldown (incl. --cooldown) — an explicit 0 disables the native fallback
  3. Native package-manager setting (with its exclude list, which supports globs like @myorg/*)

This is on by default for the npm mode. Other modes (pypi, go, cargo, docker, make, actions) are unaffected. uv/pypi is intentionally left out for now — its pyproject.toml exclude-newer is an absolute timestamp rather than a relative age and needs a separate mechanism.

The npm ecosystem now exposes minimum-release-age supply-chain settings
(npm min-release-age, pnpm minimumReleaseAge, bun minimumReleaseAge). Honor
them automatically for the npm mode so updates never proposes a version the
package manager would itself refuse to install.

The nearest .npmrc / pnpm-workspace.yaml / bunfig.toml above each manifest is
read and normalized to days; the most conservative age and the union of
exclude lists apply. An explicit updates cooldown (global, per-dir, or
override, including an explicit 0) takes precedence; the native value is only
a fallback. Native exclude lists support globs and are matched with the shared
pattern matcher.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bircni

bircni commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

adding yarn support, too

Yarn 4.10+ exposes npmMinimalAgeGate in .yarnrc.yml (minutes as a number, or
a duration string like "7d") plus npmPreapprovedPackages to exempt packages.
Read it alongside the npm/pnpm/bun settings.

The pnpm/yarn YAML extraction is unified behind generic yamlScalar/yamlList
helpers instead of a pnpm-specific parser.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@silverwind

silverwind commented Jun 8, 2026

Copy link
Copy Markdown
Owner

I already added a parser for renovate's setting but it's not enabled by default specifically because I want -C or updates.config.ts to be the only source of that option.

Building a complex config inheritance system from dozens of other tools is not what I want to maintain and it would be too confusing to users.

So for this reason I think I will reject and probably also drop the renovate inheritance.

Users should configure this tool via -C or updates.config.ts only and personally I prefer to keep the default cooldown of 0 (I need this specifically to quickly cascade updates in libraries etc).

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.

2 participants