Skip to content

feat(retention): delete prereleases of majors older than the latest stable major - #27

Merged
letreset merged 1 commit into
mainfrom
feature/retention-older-major-prereleases
Oct 1, 2026
Merged

letreset merged 1 commit into
mainfrom
feature/retention-older-major-prereleases

Conversation

@letreset

@letreset letreset commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Delete prereleases of majors older than the latest stable major

  • New Retention:DeletePrereleasesOfOlderMajors (default false, so nothing changes by default). When on, every prerelease whose major is below the package's latest stable major is deleted, e.g. 2.1.0-beta.1 once 3.0.0 exists, while 3.1.0-beta.1 and 4.0.0-alpha.1 are kept. A package without a stable version keeps all its prereleases.
  • The rule runs on its own (no Max* limit needed) and only adds deletions when combined with the limits. The version being indexed is still never deleted by its own run.
  • Per-feed override Feed.RetentionDeletePrereleasesOfOlderMajors (null uses the global value): migration for Sqlite, SqlServer, PostgreSql and MySql (one nullable column), merged in FeedSettingsResolver, a switch with "Use global default" on the admin feed settings page, and the field in FeedResponse.
  • Tests: PackageDeletionServiceTests (on, off, no stable version, indexed old prerelease kept, combined with MaxPrereleaseVersions), an end-to-end case in PackageIndexingServiceInMemoryTests, FeedSettingsResolverTests and FeedSettingsMirrorTests (save and clear the override).
  • Docs: retention section of configuration.md, the settings table in feeds.md, and UI checklist row FS8.

UI checked in testenv with the dev image: FS1, FS2a and FS8 pass. In FS3 the browser's own min="0" validation stops the form before it is posted, so the server-side message isn't shown; the stored value stays unchanged. That behavior predates this change.

Addresses #25

…table major

Retention could cap versions per level, but prereleases made obsolete by
a newer stable major stayed until a count limit happened to catch them.

- New Retention:DeletePrereleasesOfOlderMajors (default false). When on,
  every prerelease whose major is below the package's latest stable major
  is deleted; a package without a stable version keeps its prereleases,
  and the version being indexed is still never deleted by its own run.
- The rule runs on its own, without any Max* limit, and only ever deletes
  more versions when combined with them.
- Per-feed override: Feed.RetentionDeletePrereleasesOfOlderMajors
  (null uses the global value), with a migration for all four providers,
  a switch on the admin feed settings page and the field in FeedResponse.
- Docs (configuration, feeds) and UI checklist row FS8.

Fixes #25
@letreset
letreset merged commit e6eb854 into main Oct 1, 2026
10 checks passed
@letreset
letreset deleted the feature/retention-older-major-prereleases branch October 1, 2026 07:57
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