Skip to content

[core] Add custom tag expiration strategy #5655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

askwang
Copy link
Contributor

@askwang askwang commented May 23, 2025

Purpose

Currently, there are some problems in tag expiration mechanism:

  1. Normally, the expiration in the commit phase is based only on the tag retention time, and those tags without retention time are not processed, which needs to be expired separately.
  2. When setting tag.automatic-creation=batch, it will first expire once in the commit phase, and then call its own separate expiration logic, which deletes only based on tag number, which will force the deletion of tags that have not expired, it is not reasonable.

so, we add the tag expiration strategy, it support three strategies:

  • retain-time: expire only based on tag retain time.
  • retain-number: expire only base on tag retain number even if the tag retain time is not reached. This strategy need set conf tag.num-retained-max.
  • hybrid: first expire based the tag retain time, then consider retain number if conf tag.num-retained-max is set.

If we does not set tag.num-retained-max, the hybrid strategy is equivalent to retain-time strategy.

Tests

API and Format

Documentation

@askwang askwang closed this May 23, 2025
@askwang askwang reopened this May 23, 2025
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