Skip to content

Add a Ruby version-specific cache key

Stan Hu requested to merge sh-add-ruby-version-cache-key into master

What does this MR do?

When we started adding Ruby 3.0 builds for gitlab-org/gitlab#385509 (closed) (most likely in !1278 (merged)), I noticed the gitlab-rails-{ce,ee} runner caches contained gems for both Ruby 2.7 and 3.0.

To ensure the images only contain the gem versions needed for the installed Ruby interpreter, add a cache key based on the minor version of Ruby.

Related issues

gitlab-org/gitlab#385509 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated
Edited by Stan Hu

Merge request reports