Skip to content
  • georg's avatar
    CI: Fix cache key: Use project path slug, remove branch name · af19cd23
    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.
    af19cd23
Validating GitLab CI configuration… Learn more