Follow-up: Introduce Parameters to bulk delete API endpoint
Note: Follow up to issue #223793 (closed)
Problem to Solve
As indicated in the initial MR for artifact expiration:
As a developer, I like this implementation [referring to the
expire_in
tag in.gitlab-ci.yml
], because it keeps all of the configuration in the project YAML files. As a GitLab administrator, I worry about having to track down projects that haven't yet added the expiration directives to their YAML files, as well as cleaning up old artifacts that are never going to expire). It would be nice if there were some admin tools for cleaning up build artifacts (like "expire all artifacts > 30 days old that are not git tags").
The problem to solve here is that administrators need a way to efficiently clean up old, non-essential artifacts.
Proposal
Issue #16267 (closed), allows for keeping the latest artifacts for important jobs, which can be used with an overall aggressive expire_in
policy to ensure that you always have the latest important artifacts, but all others are quickly discarded. That's insufficient, though, because some projects may not be setting an aggressive expire_in
policy.
In issue #223793 (closed) - we introduce a bulk delete endpoint for artifacts per project.
The scope of work here is to add parameters that allow for doing more general cleanups efficiently:
-
delete_tags
: delete artifacts also for tags, -
keep_n
: keep N last artifacts for succesful pipelines on each branch, -
delete_orphaned
: delete all orphaned branch and tags (no longer present in git repo), -
older_than
: delete older than
Future Improvements
In the future, you could imagine a cleanup button in the project settings page, accessible only to Maintainers, that allows for the same operation as the API endpoint.
Workaround
In the meantime, I've released a tool called gitlab-artifact-cleanup
which accomplishes this via the API: https://gitlab.com/JonathonReinhart/gitlab-artifact-cleanup
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.