WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Can we express these requirements with the plugin? #89

@olivierdagenais

Description

@olivierdagenais

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions