Commit e2f8775e authored by Stan Hu's avatar Stan Hu
Browse files

Upgrade to Ruby v2.7.2 in CI

Since Ruby 2.7.2 comes with bundler v2.1.4 by default, we need to
upgrade the Gemfile.lock and bump the CI cache keys. We also need to
install bundler v1.17.3 to ensure a smooth transition for other
dependencies, like Gitaly.

Exclude development gems from QA bundle install since debaser doesn't
compile on Ruby 2.7.
parent 68ff9957
...@@ -17,7 +17,7 @@ stages: ...@@ -17,7 +17,7 @@ stages:
# in cases where jobs require Docker-in-Docker, the job # in cases where jobs require Docker-in-Docker, the job
# definition must be extended with `.use-docker-in-docker` # definition must be extended with `.use-docker-in-docker`
default: default:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
tags: tags:
- gitlab-org - gitlab-org
# All jobs are interruptible by default # All jobs are interruptible by default
......
cloud-native-image: cloud-native-image:
extends: .cng:rules extends: .cng:rules
image: ruby:2.6-alpine image: ruby:2.7-alpine
dependencies: [] dependencies: []
stage: post-test stage: post-test
variables: variables:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
extends: extends:
- .default-retry - .default-retry
- .docs:rules:review-docs - .docs:rules:review-docs
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: review stage: review
needs: [] needs: []
variables: variables:
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
extends: extends:
- .frontend-base - .frontend-base
- .assets-compile-cache - .assets-compile-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.28-lfs-2.9-node-12.18-yarn-1.22-graphicsmagick-1.3.34 image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-git-2.28-lfs-2.9-node-12.18-yarn-1.22-graphicsmagick-1.3.34
variables: variables:
WEBPACK_VENDOR_DLL: "true" WEBPACK_VENDOR_DLL: "true"
stage: prepare stage: prepare
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
   
.rails-cache: .rails-cache:
cache: cache:
key: "rails-v2" key: "rails-v3"
paths: paths:
- vendor/ruby/ - vendor/ruby/
- vendor/gitaly-ruby/ - vendor/gitaly-ruby/
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
   
.static-analysis-cache: .static-analysis-cache:
cache: cache:
key: "static-analysis-v1" key: "static-analysis-v2"
paths: paths:
- vendor/ruby/ - vendor/ruby/
- node_modules/ - node_modules/
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
   
.qa-cache: .qa-cache:
cache: cache:
key: "qa-v1" key: "qa-v2"
paths: paths:
- qa/vendor/ruby/ - qa/vendor/ruby/
policy: pull policy: pull
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
policy: pull policy: pull
   
.use-pg11: .use-pg11:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
services: services:
- name: postgres:11.6 - name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
   
.use-pg12: .use-pg12:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
services: services:
- name: postgres:12 - name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
   
.use-pg11-ee: .use-pg11-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
services: services:
- name: postgres:11.6 - name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
   
.use-pg12-ee: .use-pg12-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
services: services:
- name: postgres:12 - name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
before_script: before_script:
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb' - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
- cd qa/ - cd qa/
- bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet - gem install bundler -v 1.17.3
- bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --without=development --quiet
- bundle check - bundle check
   
qa:internal: qa:internal:
...@@ -47,7 +48,7 @@ update-qa-cache: ...@@ -47,7 +48,7 @@ update-qa-cache:
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
   
.package-and-qa-base: .package-and-qa-base:
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: qa stage: qa
retry: 0 retry: 0
script: script:
......
...@@ -181,6 +181,7 @@ update-coverage-cache: ...@@ -181,6 +181,7 @@ update-coverage-cache:
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- run_timed_command "gem install bundler -v 1.17.3"
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
cache: cache:
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
...@@ -358,6 +359,7 @@ rspec:coverage: ...@@ -358,6 +359,7 @@ rspec:coverage:
- memory-static - memory-static
- memory-on-boot - memory-on-boot
script: script:
- run_timed_command "gem install bundler -v 1.17.3"
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
- run_timed_command "bundle exec scripts/merge-simplecov" - run_timed_command "bundle exec scripts/merge-simplecov"
- run_timed_command "bundle exec scripts/gather-test-memory-data" - run_timed_command "bundle exec scripts/gather-test-memory-data"
......
...@@ -25,7 +25,7 @@ review-build-cng: ...@@ -25,7 +25,7 @@ review-build-cng:
extends: extends:
- .default-retry - .default-retry
- .review:rules:review-build-cng - .review:rules:review-build-cng
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: review-prepare stage: review-prepare
before_script: before_script:
- source ./scripts/utils.sh - source ./scripts/utils.sh
...@@ -122,7 +122,7 @@ review-stop: ...@@ -122,7 +122,7 @@ review-stop:
extends: extends:
- .default-retry - .default-retry
- .use-docker-in-docker - .use-docker-in-docker
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6 image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7
stage: qa stage: qa
# This is needed so that manual jobs with needs don't block the pipeline. # This is needed so that manual jobs with needs don't block the pipeline.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979. # See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
...@@ -199,7 +199,7 @@ review-performance: ...@@ -199,7 +199,7 @@ review-performance:
parallel-spec-reports: parallel-spec-reports:
extends: extends:
- .review:rules:mr-only-manual - .review:rules:mr-only-manual
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: post-qa stage: post-qa
dependencies: ["review-qa-all"] dependencies: ["review-qa-all"]
variables: variables:
......
...@@ -52,7 +52,7 @@ no_ee_check: ...@@ -52,7 +52,7 @@ no_ee_check:
verify-tests-yml: verify-tests-yml:
extends: extends:
- .setup:rules:verify-tests-yml - .setup:rules:verify-tests-yml
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: test stage: test
needs: [] needs: []
script: script:
...@@ -61,7 +61,7 @@ verify-tests-yml: ...@@ -61,7 +61,7 @@ verify-tests-yml:
- scripts/verify-tff-mapping - scripts/verify-tff-mapping
   
.detect-test-base: .detect-test-base:
image: ruby:2.6-alpine image: ruby:2.7-alpine
needs: [] needs: []
stage: prepare stage: prepare
script: script:
......
...@@ -79,7 +79,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the ...@@ -79,7 +79,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the
GitLab is a Ruby on Rails application that runs on the following software: GitLab is a Ruby on Rails application that runs on the following software:
   
- Ubuntu/Debian/CentOS/RHEL/OpenSUSE - Ubuntu/Debian/CentOS/RHEL/OpenSUSE
- Ruby (MRI) 2.6.6 - Ruby (MRI) 2.7.2
- Git 2.24+ - Git 2.24+
- Redis 4.0+ - Redis 4.0+
- PostgreSQL 11+ - PostgreSQL 11+
......
---
title: Update to Ruby v2.7.2
merge_request: 44223
author:
type: other
...@@ -243,9 +243,9 @@ Download Ruby and compile it: ...@@ -243,9 +243,9 @@ Download Ruby and compile it:
   
```shell ```shell
mkdir /tmp/ruby && cd /tmp/ruby mkdir /tmp/ruby && cd /tmp/ruby
curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
echo '2d78048e293817f38d4ede4ebc7873013e97bb0b ruby-2.6.6.tar.gz' | shasum -c - && tar xzf ruby-2.6.6.tar.gz echo 'cb9731a17487e0ad84037490a6baf8bfa31a09e8 ruby-2.7.2.tar.gz' | shasum -c - && tar xzf ruby-2.7.2.tar.gz
cd ruby-2.6.6 cd ruby-2.7.2
   
./configure --disable-install-rdoc ./configure --disable-install-rdoc
make make
......
...@@ -775,11 +775,11 @@ or using the appropriate [`ASDF_<tool>_VERSION`](https://asdf-vm.com/#/core-conf ...@@ -775,11 +775,11 @@ or using the appropriate [`ASDF_<tool>_VERSION`](https://asdf-vm.com/#/core-conf
activate the appropriate version. activate the appropriate version.
   
For example, the following `.tool-versions` file will activate version `12.16.3` of [Node.js](https://nodejs.org/) For example, the following `.tool-versions` file will activate version `12.16.3` of [Node.js](https://nodejs.org/)
and version `2.6.6` of [Ruby](https://www.ruby-lang.org/). and version `2.7.2` of [Ruby](https://www.ruby-lang.org/).
   
```plaintext ```plaintext
nodejs 12.16.3 nodejs 12.16.3
ruby 2.6.6 ruby 2.7.2
``` ```
   
The next example shows how to activate the same versions of the tools mentioned above by using environment variables defined in your The next example shows how to activate the same versions of the tools mentioned above by using environment variables defined in your
...@@ -792,7 +792,7 @@ include: ...@@ -792,7 +792,7 @@ include:
license_scanning: license_scanning:
variables: variables:
ASDF_NODEJS_VERSION: '12.16.3' ASDF_NODEJS_VERSION: '12.16.3'
ASDF_RUBY_VERSION: '2.6.6' ASDF_RUBY_VERSION: '2.7.2'
``` ```
   
A full list of variables can be found in [environment variables](#available-variables). A full list of variables can be found in [environment variables](#available-variables).
......
...@@ -229,7 +229,7 @@ def update_merge_request(opts) ...@@ -229,7 +229,7 @@ def update_merge_request(opts)
context 'when reassigned' do context 'when reassigned' do
it 'schedules for analytics metric update' do it 'schedules for analytics metric update' do
expect(Analytics::CodeReviewMetricsWorker) expect(Analytics::CodeReviewMetricsWorker)
.to receive(:perform_async).with('Analytics::RefreshReassignData', merge_request.id, {}) .to receive(:perform_async).with('Analytics::RefreshReassignData', merge_request.id)
   
update_merge_request({ assignee_ids: [user2.id] }) update_merge_request({ assignee_ids: [user2.id] })
end end
......
FROM ruby:2.6-stretch FROM ruby:2.7-buster
LABEL maintainer="GitLab Quality Department <quality@gitlab.com>" LABEL maintainer="GitLab Quality Department <quality@gitlab.com>"
   
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"
...@@ -65,7 +65,7 @@ COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/ ...@@ -65,7 +65,7 @@ COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/
COPY ./lib/gitlab.rb /home/gitlab/lib/ COPY ./lib/gitlab.rb /home/gitlab/lib/
COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/ COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/
COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/ COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/
RUN cd /home/gitlab/qa/ && bundle install --jobs=$(nproc) --retry=3 --quiet RUN cd /home/gitlab/qa/ && gem install bundler:1.17.3 && bundle install --jobs=$(nproc) --retry=3 --without=development --quiet
COPY ./qa /home/gitlab/qa COPY ./qa /home/gitlab/qa
   
ENTRYPOINT ["bin/test"] ENTRYPOINT ["bin/test"]
...@@ -29,7 +29,7 @@ def executor ...@@ -29,7 +29,7 @@ def executor
end end
   
def executor_image def executor_image
@executor_image || 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6' @executor_image || 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7'
end end
   
def fabricate_via_api! def fabricate_via_api!
......
...@@ -21,7 +21,7 @@ def initialize(name) ...@@ -21,7 +21,7 @@ def initialize(name)
@name = name || "qa-runner-#{SecureRandom.hex(4)}" @name = name || "qa-runner-#{SecureRandom.hex(4)}"
@run_untagged = true @run_untagged = true
@executor = :shell @executor = :shell
@executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6' @executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7'
   
super() super()
end end
......
...@@ -5,6 +5,8 @@ export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true} ...@@ -5,6 +5,8 @@ export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true}
export BUNDLE_INSTALL_FLAGS=${BUNDLE_INSTALL_FLAGS:-"--without=production development --jobs=$(nproc) --path=vendor --retry=3 --quiet"} export BUNDLE_INSTALL_FLAGS=${BUNDLE_INSTALL_FLAGS:-"--without=production development --jobs=$(nproc) --path=vendor --retry=3 --quiet"}
   
if [ "$USE_BUNDLE_INSTALL" != "false" ]; then if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
# This is for backwards compatibility for Gitaly
run_timed_command "gem install bundler:1.17.3"
bundle --version bundle --version
run_timed_command "bundle install --clean ${BUNDLE_INSTALL_FLAGS}" run_timed_command "bundle install --clean ${BUNDLE_INSTALL_FLAGS}"
run_timed_command "bundle check" run_timed_command "bundle check"
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
end end
   
it 'tracks the event' do it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_repositories', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_repositories')
   
go_to_index(format: :json) go_to_index(format: :json)
end end
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
end end
   
it 'tracks the event' do it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_repository', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_repository')
allow(DeleteContainerRepositoryWorker).to receive(:perform_async).with(user.id, repository.id) allow(DeleteContainerRepositoryWorker).to receive(:perform_async).with(user.id, repository.id)
   
delete_repository(repository) delete_repository(repository)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment