GitLab CI's extends overwrites cache lists 0 ▲ Mike Street's Blog 1 hour ago · Tech · hide · 0 comments Our Composer vendor cache is keyed on the composer.lock file, which means every time a dependency changes, the cache gets thrown away and Composer downloads every package from scratch. With Renovate opening merge requests all day, that's a lot of downloading. To speed things up, I wanted to add a second cache for Composer's download cache to our shared GitLab CI config - but no matter what I did, one of the caches kept vanishing. It took me far longer than I'd like to admit to work out why - extends doesn't merge lists. THE SETUP GitLab lets a job have up to four caches, so our shared config had a hidden job for Composer with both caches in it: .composer: variables: COMPOSER_CACHE_DIR: $CI_PROJECT_DIR/.composer-cache cache: - key: composer-download paths: - .composer-cache/ - key: files: - composer.lock paths: - vendor/ The idea was individual jobs could extend .composer and add any caches of their own - for example, a build job which also needs node_modules: build: extends: .composer… No comments yet. Log in to reply on the Fediverse. Comments will appear here.