Add an ability of erasing job artifacts but keeping build logs (traces)
Problem to solve
Problem that there is no ability to erase artifacts but keep build logs (traces).
In ideal world with unlimited storage capacity I would prefer to never expire build artifacts. But reality forces us to use some artifacts retention policy. At the moment GitLab is not flexible enough in terms of handling artifacts. In production we had to set Default artifacts expiration option to 0 (unlimited).
To prevent a storage from overflowing a special script is run each day, this script erases old jobs in accordance with some policy using erase GitLab API call. Problem that "erase" erases everything including build logs (traces). Developers do not happy with that, they want to have build logs even for those jobs which were cleaned up.
At the moment I see no way to erase artifacts only.
I see 2 options:
- Add an ability to modify expiration date (changing it from "never" to some real date) of job artifacts using API.
- Add a new API entry point which can be used for erasing only artifacts but keeping traces, it can be
POST /projects/:id/jobs/:job_id/erase_artifacts, for example.
What does success look like, and how can we measure that?
Links / references
I am aware of only one feature proposal which could partially help: https://gitlab.com/gitlab-org/gitlab-ce/issues/23777