Skip to content

Introduce admin controls for managing artifact expiration

As I 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").

This issue is a to start a discussion / feature request for admin tools to deal with artifacts.

I have two (non-exclusive) ideas in mind:

Global, admin-controlled artifact expiration time override

I imagine a site-global admin setting that sets an upper bound on the amount of time artifacts are allowed to persist. As an admin, this prevents users from forgetting to set the expiration time on artifacts, or setting unnecessarily large values, and prevents the disk from getting full (which the admin is ultimately responsible for).

However, I see builds for Git tags as being important, so this setting should be able to exclude those builds from this limit, allowing them to never expire. (See gitlab-org/gitlab-ce#24692)

Artifact cleanup button

I imagine a cleanup button in the project settings page, accessible only Masters, that allows for manual cleanup of artifacts (like "expire all artifacts > 30 days old that are not git tags"). This feature, coupled with #18352 (moved) would help to manually prune down "big" projects.

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