summaryrefslogtreecommitdiff
path: root/.gitlab/ci/rails.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci/rails.gitlab-ci.yml')
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml304
1 files changed, 142 insertions, 162 deletions
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index 064aa5a8351..5cd64baf4d3 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -8,7 +8,8 @@
.minimal-bundle-install:
script:
- - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
+ - export BUNDLE_WITHOUT="${BUNDLE_WITHOUT}:default:test:puma:unicorn:kerberos:metrics:omnibus:ed25519"
+ - bundle_install_script
.base-script:
script:
@@ -67,11 +68,11 @@
- .rspec-base
- .use-pg12
-.rspec-base-pg11-as-if-foss:
+.rspec-base-pg12-as-if-foss:
extends:
- .rspec-base
- .as-if-foss
- - .use-pg11
+ - .use-pg12
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests"]
.rspec-ee-base-pg11:
@@ -104,7 +105,7 @@
extends:
- .rails-job-base
- .rails:rules:ee-and-foss-migration
- - .use-pg11
+ - .use-pg12
stage: test
needs: ["setup-test-env"]
# rspec job base specs
@@ -113,10 +114,10 @@
############################
# rspec job parallel configs
.rspec-migration-parallel:
- parallel: 5
+ parallel: 7
.rspec-ee-migration-parallel:
- parallel: 2
+ parallel: 3
.rspec-unit-parallel:
parallel: 20
@@ -148,7 +149,7 @@ setup-test-env:
- .rails-job-base
- .setup-test-env-cache
- .rails:rules:code-backstage-qa
- - .use-pg11
+ - .use-pg12
stage: prepare
variables:
GITLAB_TEST_EAGER_LOAD: "0"
@@ -159,18 +160,13 @@ setup-test-env:
expire_in: 7d
paths:
- config/secrets.yml
+ - tmp/tests/gitaly/_build/bin/
- tmp/tests/gitaly/config.toml
- - tmp/tests/gitaly/gitaly
- tmp/tests/gitaly/gitaly2.config.toml
- - tmp/tests/gitaly/gitaly-git2go
- - tmp/tests/gitaly/gitaly-hooks
- - tmp/tests/gitaly/gitaly-lfs-smudge
- - tmp/tests/gitaly/gitaly-ssh
- tmp/tests/gitaly/internal/
- tmp/tests/gitaly/internal_gitaly2/
- tmp/tests/gitaly/internal_sockets/
- tmp/tests/gitaly/Makefile
- - tmp/tests/gitaly/praefect
- tmp/tests/gitaly/praefect.config.toml
- tmp/tests/gitaly/ruby/
- tmp/tests/gitlab-elasticsearch-indexer/bin/gitlab-elasticsearch-indexer
@@ -191,18 +187,10 @@ setup-test-env:
update-setup-test-env-cache:
extends:
- setup-test-env
+ - .setup-test-env-cache-push
- .shared:rules:update-cache
artifacts:
paths: [] # This job's purpose is only to update the cache.
- cache:
- policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
-
-update-rails-cache:
- extends:
- - update-setup-test-env-cache
- - .rails-cache
- cache:
- policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.coverage-base:
extends:
@@ -213,16 +201,6 @@ update-rails-cache:
SETUP_DB: "false"
USE_BUNDLE_INSTALL: "false"
-update-coverage-cache:
- extends:
- - .coverage-base
- - .shared:rules:update-cache
- stage: prepare
- script:
- - !reference [.minimal-bundle-install, script]
- cache:
- policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
-
.static-analysis-base:
extends:
- .default-retry
@@ -236,80 +214,81 @@ update-coverage-cache:
update-static-analysis-cache:
extends:
- .static-analysis-base
+ - .static-analysis-cache-push
- .shared:rules:update-cache
stage: prepare
script:
- - rm -rf ./node_modules # We remove node_modules because there's no mechanism to remove stall entries.
- - run_timed_command "retry yarn install --frozen-lockfile"
- - run_timed_command "bundle exec rubocop --parallel" # For the moment we only cache `vendor/ruby/`, `node_modules/`, and `tmp/rubocop_cache` so we don't need to run all the tasks,
- cache:
- # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up but RuboCop has a mechanism
- # for keeping only the N latest cache files, so we take advantage of it with `pull-push` and removing `node_modules` at the start of the job.
- policy: pull-push
+ - run_timed_command "bundle exec rubocop --parallel" # For the moment we only cache `tmp/rubocop_cache` so we don't need to run all the tasks.
static-analysis:
extends:
- .static-analysis-base
- - .rails:rules:code-backstage-qa
+ - .static-analysis:rules:ee-and-foss
stage: test
parallel: 4
script:
- run_timed_command "retry yarn install --frozen-lockfile"
- scripts/static-analysis
-rspec migration pg11:
+static-analysis as-if-foss:
extends:
- - .rspec-base-pg11
+ - static-analysis
+ - .static-analysis:rules:as-if-foss
+ - .as-if-foss
+
+rspec migration pg12:
+ extends:
+ - .rspec-base-pg12
- .rspec-base-migration
- .rspec-migration-parallel
-rspec migration pg11 minimal:
+rspec migration pg12 minimal:
extends:
- - rspec migration pg11
+ - rspec migration pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-migration:minimal
-rspec unit pg11:
+rspec unit pg12:
extends:
- - .rspec-base-pg11
+ - .rspec-base-pg12
- .rails:rules:ee-and-foss-unit
- .rspec-unit-parallel
-rspec unit pg11 minimal:
+rspec unit pg12 minimal:
extends:
- - rspec unit pg11
+ - rspec unit pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-unit:minimal
-rspec integration pg11:
+rspec integration pg12:
extends:
- - .rspec-base-pg11
+ - .rspec-base-pg12
- .rails:rules:ee-and-foss-integration
- .rspec-integration-parallel
-rspec integration pg11 minimal:
+rspec integration pg12 minimal:
extends:
- - rspec integration pg11
+ - rspec integration pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-integration:minimal
-rspec system pg11:
+rspec system pg12:
extends:
- - .rspec-base-pg11
+ - .rspec-base-pg12
- .rails:rules:ee-and-foss-system
- .rspec-system-parallel
-rspec system pg11 minimal:
+rspec system pg12 minimal:
extends:
- - rspec system pg11
+ - rspec system pg12
- .minimal-rspec-tests
- .rails:rules:ee-and-foss-system:minimal
-# Dedicated job to test DB library code against PG12.
-# Note that these are already tested against PG11 in the `rspec unit pg11` / `rspec-ee unit pg11` jobs.
-rspec db-library-code pg12:
+# Dedicated job to test DB library code against PG11.
+# Note that these are already tested against PG12 in the `rspec unit pg12` / `rspec-ee unit pg12` jobs.
+rspec db-library-code pg11:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg11
- .rails:rules:ee-and-foss-db-library-code
script:
- !reference [.base-script, script]
@@ -317,7 +296,7 @@ rspec db-library-code pg12:
rspec fast_spec_helper:
extends:
- - .rspec-base-pg11
+ - .rspec-base-pg12
- .rails:rules:ee-and-foss-fast_spec_helper
script:
- bin/rspec spec/fast_spec_helper.rb
@@ -339,6 +318,7 @@ db:check-schema:
- .rails:rules:ee-mr-and-default-branch-only
script:
- source scripts/schema_changed.sh
+ - scripts/validate_migration_timestamps
db:check-migrations:
extends:
@@ -434,17 +414,17 @@ rspec:deprecations:
# We cannot use needs since it would mean needing 84 jobs (since most are parallelized)
# so we use `dependencies` here.
dependencies:
- - rspec migration pg11
- - rspec unit pg11
- - rspec integration pg11
- - rspec system pg11
- - rspec-ee migration pg11
- - rspec-ee unit pg11
- - rspec-ee integration pg11
- - rspec-ee system pg11
- - rspec-ee unit pg11 geo
- - rspec-ee integration pg11 geo
- - rspec-ee system pg11 geo
+ - rspec migration pg12
+ - rspec unit pg12
+ - rspec integration pg12
+ - rspec system pg12
+ - rspec-ee migration pg12
+ - rspec-ee unit pg12
+ - rspec-ee integration pg12
+ - rspec-ee system pg12
+ - rspec-ee unit pg12 geo
+ - rspec-ee integration pg12 geo
+ - rspec-ee system pg12 geo
variables:
SETUP_DB: "false"
script:
@@ -466,17 +446,17 @@ rspec:coverage:
# so we use `dependencies` here.
dependencies:
- setup-test-env
- - rspec migration pg11
- - rspec unit pg11
- - rspec integration pg11
- - rspec system pg11
- - rspec-ee migration pg11
- - rspec-ee unit pg11
- - rspec-ee integration pg11
- - rspec-ee system pg11
- - rspec-ee unit pg11 geo
- - rspec-ee integration pg11 geo
- - rspec-ee system pg11 geo
+ - rspec migration pg12
+ - rspec unit pg12
+ - rspec integration pg12
+ - rspec system pg12
+ - rspec-ee migration pg12
+ - rspec-ee unit pg12
+ - rspec-ee integration pg12
+ - rspec-ee system pg12
+ - rspec-ee unit pg12 geo
+ - rspec-ee integration pg12 geo
+ - rspec-ee system pg12 geo
- memory-static
- memory-on-boot
script:
@@ -503,17 +483,17 @@ rspec:feature-flags:
# so we use `dependencies` here.
dependencies:
- setup-test-env
- - rspec migration pg11
- - rspec unit pg11
- - rspec integration pg11
- - rspec system pg11
- - rspec-ee migration pg11
- - rspec-ee unit pg11
- - rspec-ee integration pg11
- - rspec-ee system pg11
- - rspec-ee unit pg11 geo
- - rspec-ee integration pg11 geo
- - rspec-ee system pg11 geo
+ - rspec migration pg12
+ - rspec unit pg12
+ - rspec integration pg12
+ - rspec system pg12
+ - rspec-ee migration pg12
+ - rspec-ee unit pg12
+ - rspec-ee integration pg12
+ - rspec-ee system pg12
+ - rspec-ee unit pg12 geo
+ - rspec-ee integration pg12 geo
+ - rspec-ee system pg12 geo
- memory-static
- memory-on-boot
script:
@@ -529,138 +509,138 @@ rspec:feature-flags:
##################################################
# EE: default refs (MRs, default branch, schedules) jobs #
-rspec migration pg11-as-if-foss:
+rspec migration pg12-as-if-foss:
extends:
- - .rspec-base-pg11-as-if-foss
+ - .rspec-base-pg12-as-if-foss
- .rspec-base-migration
- .rails:rules:as-if-foss-migration
- .rspec-migration-parallel
-rspec migration pg11-as-if-foss minimal:
+rspec migration pg12-as-if-foss minimal:
extends:
- - rspec migration pg11-as-if-foss
+ - rspec migration pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-migration:minimal
-rspec unit pg11-as-if-foss:
+rspec unit pg12-as-if-foss:
extends:
- - .rspec-base-pg11-as-if-foss
+ - .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-unit
- .rspec-unit-parallel
-rspec unit pg11-as-if-foss minimal:
+rspec unit pg12-as-if-foss minimal:
extends:
- - rspec unit pg11-as-if-foss
+ - rspec unit pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-unit:minimal
-rspec integration pg11-as-if-foss:
+rspec integration pg12-as-if-foss:
extends:
- - .rspec-base-pg11-as-if-foss
+ - .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-integration
- .rspec-integration-parallel
-rspec integration pg11-as-if-foss minimal:
+rspec integration pg12-as-if-foss minimal:
extends:
- - rspec integration pg11-as-if-foss
+ - rspec integration pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-integration:minimal
-rspec system pg11-as-if-foss:
+rspec system pg12-as-if-foss:
extends:
- - .rspec-base-pg11-as-if-foss
+ - .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-system
- .rspec-system-parallel
-rspec system pg11-as-if-foss minimal:
+rspec system pg12-as-if-foss minimal:
extends:
- - rspec system pg11-as-if-foss
+ - rspec system pg12-as-if-foss
- .minimal-rspec-tests
- .rails:rules:as-if-foss-system:minimal
-rspec-ee migration pg11:
+rspec-ee migration pg12:
extends:
- - .rspec-ee-base-pg11
+ - .rspec-ee-base-pg12
- .rspec-base-migration
- .rails:rules:ee-only-migration
- .rspec-ee-migration-parallel
-rspec-ee migration pg11 minimal:
+rspec-ee migration pg12 minimal:
extends:
- - rspec-ee migration pg11
+ - rspec-ee migration pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-migration:minimal
-rspec-ee unit pg11:
+rspec-ee unit pg12:
extends:
- - .rspec-ee-base-pg11
+ - .rspec-ee-base-pg12
- .rails:rules:ee-only-unit
- .rspec-ee-unit-parallel
-rspec-ee unit pg11 minimal:
+rspec-ee unit pg12 minimal:
extends:
- - rspec-ee unit pg11
+ - rspec-ee unit pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-unit:minimal
-rspec-ee integration pg11:
+rspec-ee integration pg12:
extends:
- - .rspec-ee-base-pg11
+ - .rspec-ee-base-pg12
- .rails:rules:ee-only-integration
- .rspec-ee-integration-parallel
-rspec-ee integration pg11 minimal:
+rspec-ee integration pg12 minimal:
extends:
- - rspec-ee integration pg11
+ - rspec-ee integration pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-integration:minimal
-rspec-ee system pg11:
+rspec-ee system pg12:
extends:
- - .rspec-ee-base-pg11
+ - .rspec-ee-base-pg12
- .rails:rules:ee-only-system
- .rspec-ee-system-parallel
-rspec-ee system pg11 minimal:
+rspec-ee system pg12 minimal:
extends:
- - rspec-ee system pg11
+ - rspec-ee system pg12
- .minimal-rspec-tests
- .rails:rules:ee-only-system:minimal
-rspec-ee unit pg11 geo:
+rspec-ee unit pg12 geo:
extends:
- - .rspec-ee-base-geo-pg11
+ - .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-unit
- .rspec-ee-unit-geo-parallel
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
-#rspec-ee unit pg11 geo minimal:
+#rspec-ee unit pg12 geo minimal:
# extends:
-# - rspec-ee unit pg11 geo
+# - rspec-ee unit pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-unit:minimal
-rspec-ee integration pg11 geo:
+rspec-ee integration pg12 geo:
extends:
- - .rspec-ee-base-geo-pg11
+ - .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-integration
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
-#rspec-ee integration pg11 geo minimal:
+#rspec-ee integration pg12 geo minimal:
# extends:
-# - rspec-ee integration pg11 geo
+# - rspec-ee integration pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-integration:minimal
-rspec-ee system pg11 geo:
+rspec-ee system pg12 geo:
extends:
- - .rspec-ee-base-geo-pg11
+ - .rspec-ee-base-geo-pg12
- .rails:rules:ee-only-system
# FIXME: Temporarily disable geo minimal rspec jobs https://gitlab.com/gitlab-org/gitlab/-/issues/294212
-#rspec-ee system pg11 geo minimal:
+#rspec-ee system pg12 geo minimal:
# extends:
-# - rspec-ee system pg11 geo
+# - rspec-ee system pg12 geo
# - .minimal-rspec-tests
# - .rails:rules:ee-only-system:minimal
@@ -676,28 +656,28 @@ db:rollback geo:
##########################################
# EE/FOSS: default branch nightly scheduled jobs #
-rspec migration pg12:
+rspec migration pg11:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg11
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-migration-parallel
-rspec unit pg12:
+rspec unit pg11:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-unit-parallel
-rspec integration pg12:
+rspec integration pg11:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-integration-parallel
-rspec system pg12:
+rspec system pg11:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-system-parallel
# EE/FOSS: default branch nightly scheduled jobs #
@@ -705,45 +685,45 @@ rspec system pg12:
#####################################
# EE: default branch nightly scheduled jobs #
-rspec-ee migration pg12:
+rspec-ee migration pg11:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg11
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel
-rspec-ee unit pg12:
+rspec-ee unit pg11:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-parallel
-rspec-ee integration pg12:
+rspec-ee integration pg11:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-integration-parallel
-rspec-ee system pg12:
+rspec-ee system pg11:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-system-parallel
-rspec-ee unit pg12 geo:
+rspec-ee unit pg11 geo:
extends:
- - .rspec-ee-base-geo-pg12
+ - .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-geo-parallel
-rspec-ee integration pg12 geo:
+rspec-ee integration pg11 geo:
extends:
- - .rspec-ee-base-geo-pg12
+ - .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-rspec-ee system pg12 geo:
+rspec-ee system pg11 geo:
extends:
- - .rspec-ee-base-geo-pg12
+ - .rspec-ee-base-geo-pg11
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
# EE: default branch nightly scheduled jobs #
#####################################
@@ -752,7 +732,7 @@ rspec-ee system pg12 geo:
# EE: Canonical MR pipelines
rspec fail-fast:
extends:
- - .rspec-ee-base-pg11 # This job also runs EE spec which needs elasticsearch
+ - .rspec-ee-base-pg12 # This job also runs EE spec which needs elasticsearch
- .rails:rules:rspec fail-fast
stage: test
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
@@ -766,7 +746,7 @@ rspec fail-fast:
rspec foss-impact:
extends:
- - .rspec-base-pg11-as-if-foss
+ - .rspec-base-pg12-as-if-foss
- .rails:rules:rspec-foss-impact
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets as-if-foss", "detect-tests as-if-foss"]
script: