Make "keep latest artifact" an instance-level configuration
Release notes
The previous release introduced a project setting to disable keeping the latest artifact from the most recent successful job. But sometimes you don't need to manage storage consumption at such a granular level and would prefer to opt-out entirely for self-managed installations. Having a one-click option to disable the default behavior is more efficient than changing the setting for each project individually.
Documentation: https://docs.gitlab.com/ee/ci/yaml/#artifactsexpire_in
Problem to solve
The feature to always keep the latest artifacts from a successful job/pipeline was delivered in #16267 (closed) (13.3) and enabled in #229936 (closed) (13.4) but there is no option to disable this feature at an instance-level. Consequently, self-managed instances are unable to opt out of a feature that can result in storing unnecessary data and ultimately increasing storage consumption.
Proposal
Add admin setting to disable keeping latest artifact at the instance-level. Disabling the feature at the instance-level would preclude using this feature at the project-level; so effectively the project-level UI to opt-out of keeping the latest artifact will be disabled but still visible (not hidden) and with some visual cue to explain why the feature is disabled by instance-level config.
Availability & Testing
- Unit test changes - required, please add tests for all new implemented logics
- Integration test changes - required, please add test for UI element rendering, when selected and when unselected.