Cleanup of artifacts on old job after disable of Keep artifacts from most recent successful jobs

Hello,

Last week, I disabled Keep artifacts from most recent successful jobs setting on my GitLab project.

I did it because I noticed that my Artifacts storage is around 130 GiB which is weird for me because:

  • expiry is explicity set in .gitlab-ci.yml for all artifacts to 1 day
  • artifacts generated by one job is less than 200 MiB

With that change, the current behavior seems to be:

  • artifacts generated on job after that change are removed based on expiry value
  • artifacts generated on job before that change are not removed

For example, if I look at jobs which run 2 weeks ago, I’m still able to download old artifacts:

In this screenshot, I can download artifacts on all pipelines.
On successful pipelines before 653247319 (in my screenshot), I can see that artifacts are not downloadable. Certainly because only latest artifacts on a successful job are kept.

I expect this behavior

  • artifacts generated on job after that change are removed based on expiry value
  • artifacts generated on job before that change are removed based on expiry value

I was not able to find clear answer on that topic in GitLab’s documentation or on this forum.

I know there is a significant change on GitLab regarding storage for Free tier on the 2022-10-19 and I would like to be sure my storage quota is accurate.

Thanks in advance.

3 Likes

Job logs also contribute to the storage quota. As far as I could tell there is no way to remove them from the UI so you need to call the erase job endpoint. It will delete all the artifacts as well as the log.

I found this endpoint after I decided to export and reimport a project to clear out the artifacts, so I don’t know for sure if it will reduce the storage usage. It seems promising though.