Repository navigation
feat(rules)!: rename release-age to no-outdated-packages - #190
Merged
Merged
Conversation
Contributor
🦋 Changeset detectedLatest commit: 3a5b691 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Every other rule id names a policy — `no-files`, `require-files`, `max-file-size`, `no-packages`, `require-engine-version`. `release-age` was the only one naming the thing being measured instead. With #187 landing `no-deprecated-packages`, the registry-backed family now reads `no-deprecated-packages` / `no-outdated-packages` as a pair. It also collided with ecosystem vocabulary in the worst direction: `minimumReleaseAge` (Renovate, pnpm) and npm's `--before` all mean "don't install anything younger than N days". This rule is the inverse — don't stay behind an upgrade that has already aged past your threshold — so the old name inverted the polarity for anyone arriving from those tools. `rules['release-age']` still works, in both the base `rules` block and inside `overrides[].rules`, and warns on load. Deprecated keys are migrated in a new `src/config/deprecations.ts` before Zod sees the config, which is what lets `HermexConfigSchema` stay `.strict()` — the schema describes only the current vocabulary and one module knows the old one. Authoring both spellings is an error rather than a silent precedence rule: the two would resolve to one governing entry per package, and quietly picking a winner would hide a policy decision the user never made. Internal field names (`worstLevel`, `UpgradeLevel`, `minCompliant*`) are deliberately untouched — they belong to the layering fix in #189, which will move rather than rename them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Gallevy
force-pushed
the
claude/release-age-rule-naming-f52acc
branch
from
September 13, 2026 16:49
a1fccb2 to
a425977
Compare
Contributor
Output Review1 of 28 case(s) changed · 0 invariant breach(es) · all 28 cases Reference:
Open a case to read its diff, its config and its full output. If this is the change you meant, apply the |
Contributor
Coverage Report
File Coverage
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The migration runs inside `loadConfig` before Zod, so the warning path had no automated coverage — only `migrateDeprecatedConfig` in isolation did. Pins that a legacy `release-age` config resolves onto `no-outdated-packages` and warns exactly once, on stderr. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Gallevy
enabled auto-merge (squash)
September 13, 2026 16:52
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.
Renames the
release-agerule tono-outdated-packages, with the old key still working behind a deprecation warning.Rebased onto
ec7ba75(#187).Why
Every other rule id names a policy —
no-files,require-files,max-file-size,no-packages,require-engine-version,require-codeowners.release-agewas the only one naming the thing being measured instead.#187 sharpened this: it landed
no-deprecated-packagesas the other registry-backed rule. The two read as a pair now —no-deprecated-packages/no-outdated-packages— where before one of them was the odd one out.The stronger reason is that the old name was a false friend.
minimumReleaseAge(Renovate, pnpm 10.16+), Dependabot's "cooldown", and npm's--beforeall mean don't install anything younger than N days — supply-chain safety. This rule is the exact inverse: don't stay behind an upgrade that has already aged past your threshold. Same units, opposite direction. Someone arriving from Renovate readrelease-age: { thresholds: { patch: 30 } }and concluded "don't take patches younger than 30 days" — backwards, with nothing in the name to correct them.Migration
rules: { - 'release-age': [{ severity: 'error', patterns: ['@my-org/*'] }], + 'no-outdated-packages': [{ severity: 'error', patterns: ['@my-org/*'] }], }rules['release-age']still works and behaves identically, in both the baserulesblock and insideoverrides[].rules. It warns on load:Warnings go to stderr, so
--format jsonon stdout stays clean.Authoring both spellings is an error, not a silent precedence rule — the two would resolve to one governing entry per package, and quietly picking a winner would hide a policy decision the user never made.
How
Deprecated keys are migrated in a new
src/config/deprecations.tsbefore Zod sees the config. That's what letsHermexConfigSchemastay.strict(): the schema describes only the current vocabulary, and exactly one module knows the old one. Retiring the alias later is a one-line deletion there, not a schema change.Scope
Renamed:
rules['release-age']→rules['no-outdated-packages'](base + overrides)ruleId— breaking for--jsonconsumersReleaseAgeViolation→NoOutdatedPackagesViolationsrc/rules/release-age.ts→src/rules/no-outdated-packages.ts,evaluateReleaseAge→evaluateOutdatedPackagesDeliberately not renamed:
worstLevel,UpgradeLevel,minCompliant*,installedVersion). These belong to refactor(release-age): separate registry facts, rule verdict, and display state #189, which will move them between layers rather than rename them in place — renaming here would be churn we'd undo.releaseAgeconfig block (authToken/cacheTtlMs/cacheDisabled) and the enricher's internals. That's registry connection/infra shared withno-deprecated-packages, not rule policy.comply-release-age,configs/release-age.config.ts). Test scaffolding; renaming them would make every case look new totest:output's against-main comparison for no reviewer benefit.Docs
The rule's section is retitled, and picks up a disclaimer that the familiar word otherwise invites:
Plus a migration note. Both
docs/examples.mdanddocs-templates/__examples.mdare updated, since which one is the source of truth is currently ambiguous (see plan 034).Verification
pnpm run typecheck/pnpm run lint/pnpm run format— cleanpnpm run test:ci— 1171 passed, 56 files. 7 new: 5 on the migration rules, 2 on theloadConfigseam (the warning path had no coverage otherwise)comply-all-rule-types-json, +2 −2, which is theruleIdstring and nothing else. 0 invariant breaches.Needs the
output:approvedlabel, since the JSONruleIdchange is a real (intended) output change.Follow-up
#189 — the layering fix. This rule is the only one whose verdict is computed in the registry layer and stored on the display object rather than going facts → rule → violations → display. That's what makes fields like
worstLevelandminCompliantVersionhard to name honestly, and it's why this PR leaves them alone.🤖 Generated with Claude Code