Repository navigation
Retention: start prerelease_superseded_for_days at the later of release and prerelease publication - #842
Open
schmitch wants to merge 2 commits into
Open
Retention: start prerelease_superseded_for_days at the later of release and prerelease publication#842schmitch wants to merge 2 commits into
schmitch wants to merge 2 commits into
Conversation
…ation prerelease_superseded_for_days started its clock at the superseding release's publication only, so a prerelease published after its release (a lagging CI version bump, a maintenance line's rc after a newer major) was hard-deleted on the next run. The clock now starts at max(release.created_at, prerelease.created_at): a prerelease always has its N days. docs/retention.md says so; a unit test and the worker test cover a prerelease published after its release. Fixes #757 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJbobLATLgHyeaU5Gqa
The preview test meant its CI builds to come before 1.0.0, but it left them at now(), after the release. Since #757 such a build keeps its 14 days, so the test now backdates them as its comment says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012e6DJbobLATLgHyeaU5Gqa
This branch has not been deployed
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.
Fixes #757
Problem
prerelease_superseded_for_dayscounted only from the superseding release's publication. If a prerelease was published after that release (a lagging CI version bump such as2.3.0-ci.500a month after2.3.0, or a maintenance line's1.9.1-rc.1after2.0.0), the next run hard-deleted it, sometimes minutes after it was published.Change
crates/core/src/retention/evaluate.rs: intriggers_match, the clock now starts atmax(release.created_at, prerelease.created_at), so a prerelease always gets its N days. The module docs say the same. Which release supersedes a prerelease (superseding_releases,superseded_by) is unchanged.docs/retention.md: the criteria table now gives the new starting point.docs/changes/2.2.0/757.fixed.md: changelog fragment.Tests
a_prerelease_published_after_its_release_has_its_days_too. It covers prereleases published before and after2.3.0, plus a maintenance-line rc, at both 14 and 25 days.crates/core/tests/retention_worker.rs::unlisted_and_superseded_versions_go_after_their_daysnow also seeds2.0.0-ci.2, published 2 days ago, after2.0.0. It is kept.crates/server/tests/admin_retention.rs::preview_shows_the_new_triggers_decisions_and_the_next_runs: its comment said the CI builds come before1.0.0, but the fixture left them atnow(), which is after the release. Under the old behaviour they were deleted anyway. With this fix they keep their 14 days, so the test now backdates them 30 days to match its comment. No assertion changed.cargo test -p forge-core --lib retention: 115 passed.cargo test -p forge-core --test retention_worker: 22 passed.cargo test -p forge-server --test admin_retention: 17 passed.cargo clippy -p forge-core --all-targets -- -D warnings,cargo clippy -p forge-server --tests -- -D warnings,cargo fmt --all --checkandcargo xtask changelog --checkall pass.No admin API or web UI change.
🤖 Generated with Claude Code
https://claude.ai/code/session_012e6DJbobLATLgHyeaU5Gqa