CI variable expansion in `cache:key:files`
Problem to solve
- Variable substitution doesn't happen in Cache Key Files settings
Intended users
- Parker (Product Manager)
- Delaney (Development Team Lead)
- Sasha (Software Developer)
- Devon (DevOps Engineer)
Further details
- Gitlab caching functionality brings a much needed performance gain to CI/CD jobs where installing 3rd party dependencies takes place (composer, yarn, npm, etc)
- Key Files makes cache invalidation to behave as "tag based" and allow to share cached files as much as possible across the whole project (cache being invalidated only when listed files change, .lock files for instance)
Proposal
- I believe it would be very beneficial to give the ability to use environment variables in Cache Key Files, like so :
cache:
key:
files:
- ${THEME_PATH}/yarn.lock
- Users will be able to use Cache Key Files mode in a lot more cases and make their CI/CD pipelines more performant
Permissions and Security
- TBD
Documentation
Testing
- TBD
What does success look like, and how can we measure that?
- Success metrics :
- Duration of CI/CD jobs execution
- Acceptance criterias :
- CI variables are substituting correctly inside of Cache Key Files settings
What is the type of buyer?
- Core
Links / references
Edited by Manuel Grabowski