-
georg authored
Before, we were using the project path, containing '/', which is not allowed in GitLab CI cache keys. Fix this via using the project path slug, which replaces special chars with '-'. Additionally, we were using a cache key consisting of project path, CI job name and branch name. However, this lead to a inconsistent cache behavior: Force pushing a branch, which is quite common during development, would somehow reset the cache, making it empty / non existent in fact, leading to longer CI job runtimes. It seems GitLab takes the commit SHA into account while checking for the cache, if using this pattern. To overcome this, don't explicitly set the branch name in the cache key, but instead rely only on the project path and job name. This also works if force pushing a branch, as some tests confirmed.
Validating GitLab CI configuration…
Learn more