Fallback cache keys
What does this MR do?
Add support for specifying multiple fallback keys on the cache
block in the GitLab CI with the new field cache:fallback_keys
Runner implementation: gitlab-runner!3875 (merged)
How to set up and validate locally
In the default
section:
cache: &global_cache
key: gems-$CI_COMMIT_REF_SLUG
paths:
- vendor/
fallback_keys:
- gems
jobx:
script: ls
cache:
# inherit all global cache settings
<<: *global_cache
Using fallback_keys
per job cache:
multiple_fallback_caches:
script:
- echo
cache:
key: bin-"$CI_COMMIT_REF_SLUG"
paths:
- binaries/
fallback_keys:
- bin
Related issues
Fix #22213 (closed) and #361235 (closed)
Checklist
Pre-merge
Consider the effect of the changes in this merge request on the following:
-
Different pipeline types - Non-canonical projects:
-
gitlab-foss
-
security
-
dev
-
personal forks
-
-
Pipeline performance
No effect
If new jobs are added:
-
Change-related rules (e.g. frontend/backend/database file changes): _____ -
Frequency they are running (MRs, main branch, nightly, bi-hourly): _____ -
Add a duration chart to https://app.periscopedata.com/app/gitlab/652085/Engineering-Productivity---Pipeline-Build-Durations if there are new jobs added to merge request pipelines
This will help keep track of expected cost increases to the GitLab project average pipeline cost per merge request RPI
No jobs added
Post-merge
-
Consider communicating these changes to the broader team following the communication guideline for pipeline changes
Edited by Pedro Pombeiro