Skip to content

feat: never target a release younger than the repository's release-age policy - #101

Merged
lucasbraum merged 2 commits into
mainfrom
lucasbraum/upt-7-release-age
Oct 13, 2026
Merged

lucasbraum merged 2 commits into
mainfrom
lucasbraum/upt-7-release-age

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Closes UPT-7.

What

list, check, fix, plan and the Action never pick a target version younger than the repository's release-age policy.

Manager Setting Unit Exempt
npm min-release-age in .npmrc (env > project > user > global) days —
pnpm minimumReleaseAge in pnpm-workspace.yaml minutes minimumReleaseAgeExclude (names, @org/*, [email protected] || 1.2.4)
Yarn npmMinimalAgeGate in .yarnrc.yml duration (3d, 1w), bare number = minutes npmPreapprovedPackages

I checked the key names and units against the npm config docs, pnpm's dependency-resolution settings and Yarn's plugin-npm source (DurationUnit.MINUTES).

  • One place: loadRegistryConfig attaches the policy, and both fetchers (npm and discovery) apply it. resolve(name, 'latest') returns the newest release old enough, never a prerelease in place of a stable release. versions and manifests leave out younger releases, so companions and re-resolved peers follow the policy too.
  • Network: publish dates come from the full package document, once per package. That document is fetched only when a policy is set and the abbreviated document's modified falls inside the window. Packages with no recent change cost no extra request. Nothing is fetched per version.
  • Output: a package whose newest release is held back says why, e.g. 4.6.7 is 2 days old; your policy is 7 days (min-release-age in .npmrc); targeting 4.6.5.
    • list shows this under a RELEASE AGE section, in both the terminal and the HTML report, and the JSON has a new releaseAge field.
    • check prints the line under its table and labels the target release-age policy.
    • fix prints it in the summary and adds targetSource: release-age policy.
  • Nothing qualifies: the package is skipped with the reason. In check this is skipReason: RELEASE_AGE, which is not a failure and does not change the exit code. In uptide.run/v1 it is status: skipped with the reason.
  • Explicit targets: fix pkg@x with a version the policy refuses stops before any work and names the newest release old enough. When nothing is old enough, fix never falls back to the pack's tested target.
  • Built-in defaults: when the repository sets nothing, the default of the package manager version it pins applies, labelled in the reason (your policy is 1 day (pnpm 11 default)). An explicit 0 turns it off.
    • pnpm 11 and 12: minimumReleaseAge 1440 minutes, together with any minimumReleaseAgeExclude. Sources: the v11.0.0 release notes (pnpm#11158), config/reader/src/index.ts#L175 at v11.0.0 ('minimum-release-age': 24 * 60), and the v12.11.2 settings reference ("Default: 1440 (since v11)").
      • This default is not strict (minimumReleaseAgeStrict: false): pnpm falls back to a younger release rather than fail. Here it keeps Uptide on the release pnpm prefers; it doesn't prevent an install failure.
    • Yarn 4.15.0 and later 4.x: npmMinimalAgeGate 1d, together with any npmPreapprovedPackages. Sources: yarnpkg/berry#7135 (commit b11eb6d, plugin-npm/sources/index.ts), listed in the 4.15.0 release and absent from 4.14.1. Upgrading Yarn writes the old value into existing projects' .yarnrc.yml, and Uptide reads that as an explicit setting.
    • Finding the version: the version comes from packageManager, from devEngines.packageManager when its range stays inside one of those rows, or from Yarn's yarnPath.
      • Lockfiles can't tell: pnpm 9 to 12 all write lockfileVersion: '9.0', and every Yarn 4 writes __metadata.version: 8.
      • An unpinned version, a range that crosses a boundary (>=10), or a version not verified (pnpm 13, Yarn 5) gets no default.
  • uptide.yml: a new optional minReleaseAgeDays field. It's camelCase like the other fields, and the unit is in the name because pnpm counts minutes.
    • It applies when the repository sets no policy itself. A package manager's default doesn't count as one, so both apply then.
    • The CLI passes it to the engine and its workers through UPTIDE_MIN_RELEASE_AGE_DAYS, so --config, the Action and plan (which now takes --config) are covered.
  • Docs: docs/config.md#release-age, SECURITY.md (Release age) and docs/privacy.md (the extra registry request). They include the npx uptide@latest note from the issue.

Decisions to review

  • When several policies are set, a version must pass all of them. A version with no publish date is allowed, matching pnpm's default.
  • npm before, Yarn per-scope npmScopes.*.npmMinimalAgeGate and pnpm settings in .npmrc are not read. pnpm 11 reads only auth and registry settings from .npmrc.
  • check and the fix workers now load the registry config from the repository (--cwd) instead of the process cwd. This also fixes private registries when --cwd points elsewhere.

Tests

  • fixtures/repos/release-age/{npm,pnpm,yarn,pnpm-11-default,yarn-default,none} are synthetic. fetch/release-age.test.ts (17 tests) covers each manager's units, the built-in defaults (pinned through packageManager, devEngines and yarnPath, with every no-default case including explicit 0 and unknown versions), npm layer precedence, the fallback, the exclude lists, the npm and discovery fetchers including the no-full-document fast path, list end to end, resolveTarget and the run report.
  • action/run.test.ts has one more test for the skipped rows, and html/list.test.ts one for the HTML and terminal sections.
  • pnpm test, pnpm lint, pnpm typecheck, pnpm docs:links and pnpm public:check all pass.

🤖 Generated with Claude Code

lucasbraum and others added 2 commits October 12, 2026 21:48
…e policy

list, check, fix and the Action read npm min-release-age (.npmrc layers, days),
pnpm minimumReleaseAge and minimumReleaseAgeExclude (pnpm-workspace.yaml,
minutes) and Yarn npmMinimalAgeGate and npmPreapprovedPackages (.yarnrc.yml,
durations). The registry configuration carries the policy, so both fetchers
apply it: `latest` becomes the newest release old enough, and versions and
manifests leave out younger ones, so companions and peers follow it too.

Publish dates come from the full package document, fetched once per package
and only when the abbreviated one says something changed inside the window.

When the newest release is too young the output says why and what it targets;
when nothing newer than the installed version qualifies the package is
skipped with that reason (status skipped in uptide.run/v1). fix refuses an
explicit target the policy refuses. uptide.yml gains min-release-age (days),
used only when the repository sets no policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…nd plan

- uptide.yml's field is minReleaseAgeDays: camelCase like the rest of the
  file, with the unit in the name since pnpm counts minutes.
- When the repository sets no release-age policy, the default of the package
  manager version it pins applies, labelled in the reason: pnpm 11 and 12
  (minimumReleaseAge 1440, pnpm/pnpm#11158) and Yarn 4.15+ (npmMinimalAgeGate
  1d, yarnpkg/berry#7135). The version comes from packageManager,
  devEngines.packageManager or yarnPath; lockfiles cannot tell, and an unknown
  version gets no default. minReleaseAgeDays still applies next to a default.
- The HTML list report shows the release-age section; plan reads uptide.yml
  (--config) so its targets follow minReleaseAgeDays too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum merged commit 8452329 into main Oct 13, 2026
10 checks passed
@lucasbraum
lucasbraum deleted the lucasbraum/upt-7-release-age branch October 13, 2026 05:37
@uptide-release uptide-release Bot mentioned this pull request Oct 13, 2026
lucasbraum pushed a commit that referenced this pull request Oct 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#108](#108)
[`38dcd4b`](38dcd4b)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Uptide Action
now requires the Anthropic API key. Without `anthropic-api-key` (or with
it
empty), in any mode, it stops before doing anything: the job summary
says to add the
repository secret `ANTHROPIC_API_KEY` (Settings → Secrets and variables
→ Actions), the run
report has no upgrades and an error starting with `LLM_KEY_MISSING`, and
the job fails.
`uptide.run/v1` gains `llmKey` (`present` or `missing`; never the key).
`uptide init` no longer
writes `llm.enabled`, and refuses an existing `uptide.yml` that sets it
to `false`, which the
  Action rejects. The CLI on your own machine still runs without a key.

- [#101](#101)
[`8452329`](8452329)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `list`, `check`,
`fix`, `plan` and the Action never target a release younger than the
repository's release-age policy: npm `min-release-age` (`.npmrc`), pnpm
`minimumReleaseAge`
with `minimumReleaseAgeExclude` (`pnpm-workspace.yaml`), or Yarn
`npmMinimalAgeGate` with
`npmPreapprovedPackages` (`.yarnrc.yml`). When none is set, the default
of the pinned package
manager version applies (pnpm 11 and 12, Yarn 4.15 and later: one day),
labelled as such.
When the newest release is too young, the newest one old enough is the
target and the output
says why (`4.6.7 is 2 days old; your policy is 7 days (min-release-age
in .npmrc); targeting
4.6.5`). When nothing newer than the installed version qualifies, the
package is skipped with
that reason, shown as `status: skipped` in `uptide.run/v1` and in the
HTML list report.
Companions and peers follow the same policy. `minReleaseAgeDays` in
`uptide.yml` applies when
the repository sets no policy itself. See `docs/config.md#release-age`.

### Patch Changes

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Action's
commits are authored by the Uptide App's own bot account,
`<app slug>[bot] <<bot user id>+<app
slug>[bot]@users.noreply.github.com>`, resolved with the
installation token, so GitHub links them to the App. When it cannot be
resolved they keep
  `uptide[bot] <[email protected]>` and the job log warns.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide.run/v1`
gains `verification.baselineHealth`: the repository before the upgrade
in
counts only (type errors, failing test runs, and missing-module errors
under its own paths and
in packages), so the dashboard can tell a run that could only compare
from one that proved.
No module or alias name leaves the fix report. Optional; absent in older
reports.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `check` analyzes
a package's companions at the versions its upgrade moves them to, even
when
nothing imports them or they only carry types: `check react` in a Next
app used to report
`react-dom` and `@types/react` on their own at their installed versions,
while `react` moved
to 19. They are now members of `react`'s group, linked into the compile
at 19, and the
  Action's job summary shows each one moving with `react`.

- [#102](#102)
[`78f1f7a`](78f1f7a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide init`
writes a workflow that runs the released Uptide Action,
`uptide-dev/uptide@2045c7d # v0.9.0`,
and no longer notes that the action is not released yet.

- [#100](#100)
[`53f9f7d`](53f9f7d)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` reads pnpm
lockfiles that install a package once per version of the upgraded one
(`x@1([email protected])` next to `x@1([email protected])`) instead of failing with
"Map keys must be unique". Variants that differ only by that version are
compared as one entry; variants that differ in anything else are still
checked one by one.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - When Uptide
refuses to publish a migration that did not verify, it words the reason
as the
run's verdict does: `1 type error introduced by the upgrade, 2
pre-existing` instead of
`1 new type error`, and a test run that was already failing before the
upgrade is named as
  such instead of as a failure of the migration.

- [#104](#104)
[`8fd120e`](8fd120e)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Reports no longer
show a breaking count of 0 for a package without a migration pack: the
terminal, the HTML report and the Action's job summary say `not
analyzed: no pack yet`
instead, and `uptide.run/v1` gains `analysis` (`pack` or `none`, absent
when nothing was
analyzed). A companion that `check` reports at its installed version
(`react-dom` or
`@types/react` with `react`) shows the versions it moves to and `moves
with react`, carried as
`movesWith`, instead of `up to date`; no upgrade kind is printed when
nothing moves. The job
summary lists breaking sites per package by path and line, and has no
breaking-sites section
when there are none. The generated workflow runs on `ubuntu-24.04`
instead of `ubuntu-latest`.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Reports say what
the upgrade broke and what the migration left. `uptide.run/v1` gains
`verification.typecheck.afterUpgrade`, the type errors right after the
version bump and before
any fix, next to `before` and `after` (optional; absent in older
reports). The job summary
prints `types 0 → 4 with the upgrade → 0 after Uptide`, and the pull
request body and the
  terminal say `the upgrade broke 4 · Uptide left 0`.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
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