No unique key for Azure cache with Kubernetes Runner
Summary
When generating a cache using Azure blob storage and Kubernetes executor, no cache key is used. All caches are stored under the same file path in azure blob storage. That cache is pulled and pushed. There is no issue with that functionality. However, if the lock file is different on different branches, no unique cache key is generated all caches are stored under the file name package-lock-default-21-protected
. It seems to use the path to the lock file in the storage path of the cache but does not use the SHA of the lock file
Steps to reproduce
.cache:
cache:
- key:
files:
- ${CI_PROJECT_DIR}/backend/requirements/base.txt
paths:
- ${CI_PROJECT_DIR}/backend/venv/
- key:
files:
- ${CI_PROJECT_DIR}/frontend/package-lock.json
paths:
- ${CI_PROJECT_DIR}/frontend/node_modules
- ${CYPRESS_CACHE_FOLDER}
myjob:
extends:
- .cache
Actual behavior
All files get stored under package-lock-default-21-protected
Expected behavior
The cache file name (or path) should contain some key unique to the SHA of the last several commits to the lock file as documented here: https://docs.gitlab.com/ee/ci/yaml/index.html#cachekeyfiles
Used GitLab Runner version
0.58.1