Feature proposal: pruning job traces and artifacts of deleted branches
Release notes
Problem to solve
One of the housekeeping method available to Gitlab users/admins is to delete branches after they have been integrated. That doesn't however remove the associated jobs or their artifacts (including job traces). Those artifacts can be preserved indefinitely, depending on the global instance policy. That means using up the storage which in some cases can have negative impact on performance (e.g. increases backup time)
It may be desirable in some use cases to keep them, but generally in trunk-based development, such artifacts are usually considered redundant to artifacts from the integration branches (e.g. master
, develop
, main
etc.) and could be removed to preserve space.
Intended users
User experience goal
Proposal
A couple of ways to achieve it that I can think of:
- in MR, an additional option to delete not just the branch but also the job traces
- in project settings, another UI button to remove artifacts from merged branches, similarly to the Delete merged branches feature
- do it automatically for selected projects; that's what I believe Jenkins does in case of multi-branch pipeline; see
- https://www.jenkins.io/doc/book/pipeline-as-code/#:~:text=Orphaned%20Item%20Strategy,they%20are%20no%20longer%20present.
- https://www.jenkins.io/blog/2015/12/03/pipeline-as-code-with-multibranch-workflows-in-jenkins/ (Automatic job pruning/deletion for branches deleted from the repository, according to the settings.)
To put it in short form:
As a Gitlab administrator, I want to define a retention policy for job artifacts of merged branches in specific projects, so I can preserve disk space of the instance.
Documentation
Documentation would reflect the changes in functionality
What does success look like, and how can we measure that?
Admins and Users would be able to opt to delete job logs and artifacts when merging or deleting specific branches.