Skip to content

[JENKINS-48715] Retain last N builds #82

@jenkins-infra-bot

Description

@jenkins-infra-bot

I would like the discard old build feature to have an option to always retain the last N builds, regardless of their age. It looks like "Max # of builds to keep" will keep the last N builds, but this is NOT what is does: the "Max 1 of builds to keep" does exactly what it says: once the max number of builds us reached, the oldest builds are deleted, so as to not exceed the max. But the "Max # of builds to keep" is overwritten by the "Days to keep builds". So if you need to keep the last N builds regardless of their age, it is not possible.


Originally reported by deepchip, imported from: Retain last N builds
  • assignee: nkns165
  • status: Open
  • priority: Minor
  • component(s): discard-old-build-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 20251216-182730
Raw content of original issue

I would like the discard old build feature to have an option to always retain the last N builds, regardless of their age. It looks like "Max # of builds to keep" will keep the last N builds, but this is NOT what is does: the "Max 1 of builds to keep" does exactly what it says: once the max number of builds us reached, the oldest builds are deleted, so as to not exceed the max. But the "Max # of builds to keep" is overwritten by the "Days to keep builds". So if you need to keep the last N builds regardless of their age, it is not possible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions