Skip to content

Comments

feat: Add retention policy for available releases cleanup#37

Merged
LittleChimera merged 8 commits intomainfrom
cleanup-available-releases-with-retention
Jan 3, 2026
Merged

feat: Add retention policy for available releases cleanup#37
LittleChimera merged 8 commits intomainfrom
cleanup-available-releases-with-retention

Conversation

@LittleChimera
Copy link
Contributor

  • Change default history limit from 5 to 10
  • Add cleanup of old available releases when history is full
  • Implement retention policy with three criteria (OR logic):
    1. Keep all releases from the lowest history entry index to the end
    2. Keep all releases created within the last week (7 days)
    3. Keep at least 30 releases minimum
  • Keep the maximum number of releases that satisfies any criterion
  • Add comprehensive tests for retention policy

- Change default history limit from 5 to 10
- Add cleanup of old available releases when history is full
- Implement retention policy with three criteria (OR logic):
  1. Keep all releases from the lowest history entry index to the end
  2. Keep all releases created within the last week (7 days)
  3. Keep at least 30 releases minimum
- Keep the maximum number of releases that satisfies any criterion
- Add comprehensive tests for retention policy
@cursor
Copy link

cursor bot commented Dec 26, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

- Add AvailableReleasesRetentionDays field to RolloutSpec (default: 7 days)
- Add AvailableReleasesMinCount field to RolloutSpec (default: 30 releases)
- Update cleanup function to use configurable values instead of hardcoded constants
- Update function documentation to reflect configurability
- Remove hacky duplicate tag scenario that can't occur in reality
- Rewrite test to verify cleanup keeps releases from lowest history entry index
- Set proper timestamps and minimum retention to allow cleanup to work
- Let controller naturally build AvailableReleases instead of manually setting it
- Add debug logging to controller for troubleshooting (can be removed if needed)
- Initialize AvailableReleases upfront with all versions and timestamps
- Use for loop to deploy versions instead of manual per-version deployment
- Restore timestamps once before final deployment instead of after each one
- Cleaner and more maintainable test code
- Remove manual ImagePolicy 0.1.0 setup from tests that use loops
- Convert manual deployments to loops where appropriate
- Cleaner and more consistent test code
@LittleChimera LittleChimera merged commit 4aa6894 into main Jan 3, 2026
3 of 7 checks passed
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