gem cache poisoning breaks auto-deploy pipelines
We have a problem with the current auto-deploy branch
scripts/gitaly-test-spawn
fails because of missing gems
The following gems are missing
* tzinfo (1.2.7)
* activesupport (6.0.3)
* loofah (2.5.0)
* actionview (6.0.3)
* actionpack (6.0.3)
* gitlab-labkit (0.12.0)
Install missing gems with `bundle install`
bundle check failed
https://gitlab.com/gitlab-org/gitlab/-/jobs/558277101
According to our visibility on the changes, it started here: 1ec86a77
We have a global gem cache, and every pipeline outside of auto-deploy branch is competing with our builds.
What happens is that when frontend-fixtures
job starts on auto-deploy, its cache is already poisoned by another pipeline.
Because this is a cache, we should ensure that each job verifies the dependencies updating them if needed.
Another option could be having a separate cache key on auto-deploy branches.