Further customization of the "Keep latest artifacts" setting

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

Currently, the "Keep latest artifacts" setting can be configured at a global level, and at project level. However, this is not granular enough for some uses. As the documentation explains, when the setting is enabled, the latest artifact is kept from every unique ref. This will include every branch, and therefore every MR - even if the user is only interested in keeping artifacts from latest tags.

Currently, the user has these options:

  1. Enable the setting. Depending on workflow, artifacts might build up too quickly, bloating up space, and need to be manually pruned, like with our maintenance scripts.
  2. Keep the setting disabled. The responsibility to keep important artifacts now lies in user's hands, who will most likely spawn artifact upload jobs depending on the origin of the pipeline.

I propose for further customization of the "Keep latest artifacts" setting, so that it can stay enabled for more users and better match their workflow. I envision this as more granular selection as to what types of refs are included, for example:

  • Only releases
  • Only tags
  • All branches (current behavior)

This is motivated by a customer ticket.

Edited by 🤖 GitLab Bot 🤖