Skip to content
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

Can we express these requirements with the plugin? #89

Open
olivierdagenais opened this issue Sep 6, 2023 · 1 comment
Open

Can we express these requirements with the plugin? #89

olivierdagenais opened this issue Sep 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@olivierdagenais
Copy link
Member

What feature do you want to see added?

Given these requirements:

  • Builds 10 days and younger are always kept, regardless of their position in the build history
  • The 15 most recent builds are always kept, regardless of their age
  • Discard everything else

Is it possible to implement with the build-history-manager plugin?

Here are some examples/test scenarios:

  1. Suppose my job has 1 run a day, for each of 20 days. We should end up with the last 15 runs kept.
  2. Suppose my job has 2 runs a day, for each of 20 days. We should end up with the last 20 runs kept (i.e. 2 runs a day for the last 10 days - runs older than 10 days are gone).
  3. Suppose my job has 2 runs a day, for the first 10 days, then 10 days without runs. We should end up with the last 15 runs kept (i.e. we're only keeping based on "The 15 most recent builds are always kept, no matter their age", because the other runs have been deleted).
  4. Suppose my job has 15 runs a day, for each of 20 days. We should end up with the last 150 runs kept (15 * 10).

It feels like we would need a BuildPosition condition, which compares against a monotonically-increasing counter of runs (assuming the latest run starts at 1), such that we would be able to craft the configuration to have the following rules:

  1. conditions: [BuildPosition(maxBuildPosition: 15)], continueAfterMatch: false
  2. conditions: [BuildAgeRange(maxDaysAge: 10)], continueAfterMatch: false
  3. actions: [DeleteBuild()]

What do you think?

Thanks!

Upstream changes

n/a

@damianszczepanik
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants