summaryrefslogtreecommitdiff
path: root/.gitlab/ci
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab/ci')
-rw-r--r--.gitlab/ci/build-images.gitlab-ci.yml5
-rw-r--r--.gitlab/ci/docs.gitlab-ci.yml9
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml14
-rw-r--r--.gitlab/ci/global.gitlab-ci.yml4
-rw-r--r--.gitlab/ci/package-and-test/main.gitlab-ci.yml11
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml253
-rw-r--r--.gitlab/ci/rails/shared.gitlab-ci.yml34
-rw-r--r--.gitlab/ci/review-apps/main.gitlab-ci.yml4
-rw-r--r--.gitlab/ci/review-apps/qa.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/rules.gitlab-ci.yml201
-rw-r--r--.gitlab/ci/setup.gitlab-ci.yml37
-rw-r--r--.gitlab/ci/static-analysis.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/test-metadata.gitlab-ci.yml3
-rw-r--r--.gitlab/ci/workhorse.gitlab-ci.yml3
14 files changed, 374 insertions, 208 deletions
diff --git a/.gitlab/ci/build-images.gitlab-ci.yml b/.gitlab/ci/build-images.gitlab-ci.yml
index 09ffc87f087..05748cff266 100644
--- a/.gitlab/ci/build-images.gitlab-ci.yml
+++ b/.gitlab/ci/build-images.gitlab-ci.yml
@@ -23,6 +23,11 @@ build-qa-image:
script:
- run_timed_command "scripts/build_qa_image"
+build-qa-image as-if-foss:
+ extends:
+ - build-qa-image
+ - .as-if-foss
+
build-assets-image:
extends:
- .base-image-build
diff --git a/.gitlab/ci/docs.gitlab-ci.yml b/.gitlab/ci/docs.gitlab-ci.yml
index 18954e7b8e0..02fc58f8580 100644
--- a/.gitlab/ci/docs.gitlab-ci.yml
+++ b/.gitlab/ci/docs.gitlab-ci.yml
@@ -70,21 +70,22 @@ docs-lint markdown:
script:
- scripts/lint-doc.sh
-docs-code-quality:
+docs code_quality:
extends:
- - .docs:rules:docs-code-quality
+ - .reports:rules:code_quality
- .docs-markdown-lint-image
stage: lint
needs: []
+ dependencies: []
allow_failure: true
script:
- - scripts/lint-doc-quality.sh
+ - vale --output=doc/.vale/vale-json.tmpl --minAlertLevel warning doc > gl-code-quality-report-docs.json || exit_code=$?
artifacts:
reports:
codequality: gl-code-quality-report-docs.json
paths:
- gl-code-quality-report-docs.json
- expire_in: 1 week
+ expire_in: 2 weeks
when: always
ui-docs-links lint:
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index cde023c149a..0c9cdc28136 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -204,15 +204,15 @@ jest:
junit: junit_jest.xml
parallel: 5
-jest minimal:
+jest predictive:
extends:
- jest
- - .frontend:rules:jest:minimal
+ - .frontend:rules:jest:predictive
needs:
- !reference [jest, needs]
- "detect-tests"
script:
- - if [[ -s "$RSPEC_CHANGED_FILES_PATH" ]]; then run_timed_command "yarn jest:ci:minimal"; fi
+ - if [[ -s "$RSPEC_CHANGED_FILES_PATH" ]] || [[ -s "$RSPEC_MATCHING_JS_FILES_PATH" ]]; then run_timed_command "yarn jest:ci:predictive"; fi
jest as-if-foss:
extends:
@@ -222,16 +222,16 @@ jest as-if-foss:
needs: ["rspec-all frontend_fixture as-if-foss"]
parallel: 2
-jest minimal as-if-foss:
+jest predictive as-if-foss:
extends:
- .jest-base
- - .frontend:rules:jest:minimal:as-if-foss
+ - .frontend:rules:jest:predictive:as-if-foss
- .as-if-foss
needs:
- "rspec-all frontend_fixture as-if-foss"
- "detect-tests"
script:
- - if [[ -s "$RSPEC_CHANGED_FILES_PATH" ]]; then run_timed_command "yarn jest:ci:minimal"; fi
+ - if [[ -s "$RSPEC_CHANGED_FILES_PATH" ]] || [[ -s "$RSPEC_MATCHING_JS_FILES_PATH" ]]; then run_timed_command "yarn jest:ci:predictive"; fi
jest-integration:
extends:
@@ -252,7 +252,7 @@ coverage-frontend:
needs:
- job: "jest"
optional: true
- - job: "jest minimal"
+ - job: "jest predictive"
optional: true
stage: post-test
script:
diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml
index 5e35ae6aff3..90f00c887f7 100644
--- a/.gitlab/ci/global.gitlab-ci.yml
+++ b/.gitlab/ci/global.gitlab-ci.yml
@@ -288,7 +288,7 @@
- name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
- - name: elasticsearch:8.5.2
+ - name: elasticsearch:8.5.3
variables:
POSTGRES_HOST_AUTH_METHOD: trust
PG_VERSION: "12"
@@ -350,7 +350,7 @@
variables:
QEMU_IMAGE: tonistiigi/binfmt:qemu-v7.0.0
before_script:
- - source scripts/utils.sh
+ - !reference [.default-utils-before_script, before_script]
- echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
- |
if [[ "${ARCH}" =~ arm64 ]]; then
diff --git a/.gitlab/ci/package-and-test/main.gitlab-ci.yml b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
index c53c3b1d32b..48059d9518f 100644
--- a/.gitlab/ci/package-and-test/main.gitlab-ci.yml
+++ b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
@@ -7,7 +7,7 @@ include:
- local: .gitlab/ci/package-and-test/rules.gitlab-ci.yml
- local: .gitlab/ci/package-and-test/variables.gitlab-ci.yml
- project: gitlab-org/quality/pipeline-common
- ref: 1.7.0
+ ref: 1.14.1
file:
- /ci/base.gitlab-ci.yml
- /ci/allure-report.yml
@@ -396,13 +396,13 @@ ee:update-major:
- if: $QA_SUITES =~ /Test::Instance::Smoke/
- !reference [.rules:test:manual, rules]
-ee:gitab-pages:
+ee:gitlab-pages:
extends: .qa
variables:
QA_SCENARIO: Test::Integration::GitlabPages
rules:
- !reference [.rules:test:qa, rules]
- - if: $QA_SUITES =~ /Test::Integration::GitlabPages/
+ - if: $QA_SUITES =~ /Test::Instance::GitlabPages/
- !reference [.rules:test:manual, rules]
ee:gitaly-cluster:
@@ -440,7 +440,7 @@ ee:jira:
JIRA_ADMIN_PASSWORD: $QA_JIRA_ADMIN_PASSWORD
rules:
- !reference [.rules:test:qa, rules]
- - if: $QA_SUITES =~ /Test::Integration::Jira/
+ - if: $QA_SUITES =~ /Test::Instance::Jira/
- !reference [.rules:test:manual, rules]
ee:integrations:
@@ -557,7 +557,7 @@ ee:cloud-activation:
QA_RSPEC_TAGS: --tag cloud_activation
rules:
- !reference [.rules:test:qa, rules]
- - if: $QA_SUITES =~ /Test::Integration::CloudActivation/
+ - if: $QA_SUITES =~ /Test::Instance::CloudActivation/
- !reference [.rules:test:manual, rules]
ee:large-setup:
@@ -603,6 +603,7 @@ ee:importers:
extends: .qa
variables:
QA_SCENARIO: Test::Integration::Import
+ QA_MOCK_GITHUB: "true"
GITLAB_QA_OPTS: --set-feature-flags bulk_import_projects=enabled
rules:
- !reference [.rules:test:qa, rules]
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index 0e0aeb2954b..df3b3704a52 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -71,13 +71,27 @@ rspec migration pg12:
extends:
- .rspec-base-pg12
- .rspec-base-migration
+ - .rails:rules:ee-and-foss-migration
- .rspec-migration-parallel
-rspec migration pg12 minimal:
+rspec migration pg12 predictive:
extends:
- rspec migration pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-and-foss-migration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-and-foss-migration:predictive
+
+rspec background_migration pg12:
+ extends:
+ - .rspec-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:ee-and-foss-background-migration
+ - .rspec-background-migration-parallel
+
+rspec background_migration pg12 predictive:
+ extends:
+ - rspec background_migration pg12
+ - .predictive-rspec-tests
+ - .rails:rules:ee-and-foss-background-migration:predictive
rspec migration pg12 single-db:
extends:
@@ -85,23 +99,35 @@ rspec migration pg12 single-db:
- .single-db-rspec
- .rails:rules:single-db
+rspec background_migration pg12 single-db:
+ extends:
+ - rspec background_migration pg12
+ - .single-db-rspec
+ - .rails:rules:single-db
+
rspec migration pg12 praefect:
extends:
- rspec migration pg12
- .praefect-with-db
- .rails:rules:praefect-with-db
+rspec background_migration pg12 praefect:
+ extends:
+ - rspec background_migration pg12
+ - .praefect-with-db
+ - .rails:rules:praefect-with-db
+
rspec unit pg12:
extends:
- .rspec-base-pg12
- .rails:rules:ee-and-foss-unit
- .rspec-unit-parallel
-rspec unit pg12 minimal:
+rspec unit pg12 predictive:
extends:
- rspec unit pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-and-foss-unit:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-and-foss-unit:predictive
rspec unit pg12 single-db:
extends:
@@ -121,11 +147,11 @@ rspec integration pg12:
- .rails:rules:ee-and-foss-integration
- .rspec-integration-parallel
-rspec integration pg12 minimal:
+rspec integration pg12 predictive:
extends:
- rspec integration pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-and-foss-integration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-and-foss-integration:predictive
rspec integration pg12 single-db:
extends:
@@ -147,11 +173,11 @@ rspec system pg12:
variables:
DEBUG_GITLAB_TRANSACTION_STACK: "true"
-rspec system pg12 minimal:
+rspec system pg12 predictive:
extends:
- rspec system pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-and-foss-system:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-and-foss-system:predictive
rspec system pg12 single-db:
extends:
@@ -187,7 +213,7 @@ rspec fast_spec_helper:
db:rollback:
extends: .db-job-base
script:
- - scripts/db_tasks db:migrate VERSION=20210301200959
+ - scripts/db_tasks db:migrate VERSION=20210602155110
- scripts/db_tasks db:migrate SKIP_SCHEMA_VERSION_CHECK=true
db:rollback single-db:
@@ -287,7 +313,9 @@ gitlab:setup:
- log/*.log
db:backup_and_restore:
- extends: .db-job-base
+ extends:
+ - .db-job-base
+ - .rails:rules:db-backup
variables:
SETUP_DB: "false"
GITLAB_ASSUME_YES: "1"
@@ -298,16 +326,12 @@ db:backup_and_restore:
- bundle exec rake gitlab:backup:create
- date
- bundle exec rake gitlab:backup:restore
- rules:
- - changes:
- - "lib/backup/**/*"
- - "lib/tasks/gitlab/backup.rake"
db:backup_and_restore single-db:
extends:
- db:backup_and_restore
- .single-db
- - .rails:rules:single-db
+ - .rails:rules:db-backup
rspec:deprecations:
extends:
@@ -321,10 +345,12 @@ rspec:deprecations:
# so we use `dependencies` here.
dependencies:
- rspec migration pg12
+ - rspec background_migration pg12
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- rspec-ee migration pg12
+ - rspec-ee background_migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
@@ -351,31 +377,37 @@ rspec:coverage:
- setup-test-env
# FOSS/EE jobs
- rspec migration pg12
+ - rspec background_migration pg12
- rspec unit pg12
- rspec integration pg12
- rspec system pg12
- # FOSS/EE minimal jobs
- - rspec migration pg12 minimal
- - rspec unit pg12 minimal
- - rspec integration pg12 minimal
- - rspec system pg12 minimal
+ # FOSS/EE predictive jobs
+ - rspec migration pg12 predictive
+ - rspec background_migration pg12 predictive
+ - rspec unit pg12 predictive
+ - rspec integration pg12 predictive
+ - rspec system pg12 predictive
# FOSS/EE single-db jobs
- rspec migration pg12 single-db
+ - rspec background_migration pg12 single-db
- rspec unit pg12 single-db
- rspec integration pg12 single-db
- rspec system pg12 single-db
# EE jobs
- rspec-ee migration pg12
+ - rspec-ee background_migration pg12
- rspec-ee unit pg12
- rspec-ee integration pg12
- rspec-ee system pg12
- # EE minimal jobs
- - rspec-ee migration pg12 minimal
- - rspec-ee unit pg12 minimal
- - rspec-ee integration pg12 minimal
- - rspec-ee system pg12 minimal
+ # EE predictive jobs
+ - rspec-ee migration pg12 predictive
+ - rspec-ee background_migration pg12 predictive
+ - rspec-ee unit pg12 predictive
+ - rspec-ee integration pg12 predictive
+ - rspec-ee system pg12 predictive
# EE single-db jobs
- rspec-ee migration pg12 single-db
+ - rspec-ee background_migration pg12 single-db
- rspec-ee unit pg12 single-db
- rspec-ee integration pg12 single-db
- rspec-ee system pg12 single-db
@@ -383,16 +415,19 @@ rspec:coverage:
- memory-on-boot
# As-if-FOSS jobs
- rspec migration pg12-as-if-foss
- - rspec migration pg12-as-if-foss minimal
+ - rspec migration pg12-as-if-foss predictive
- rspec migration pg12-as-if-foss single-db
+ - rspec background_migration pg12-as-if-foss
+ - rspec background_migration pg12-as-if-foss predictive
+ - rspec background_migration pg12-as-if-foss single-db
- rspec unit pg12-as-if-foss
- - rspec unit pg12-as-if-foss minimal
+ - rspec unit pg12-as-if-foss predictive
- rspec unit pg12-as-if-foss single-db
- rspec integration pg12-as-if-foss
- - rspec integration pg12-as-if-foss minimal
+ - rspec integration pg12-as-if-foss predictive
- rspec integration pg12-as-if-foss single-db
- rspec system pg12-as-if-foss
- - rspec system pg12-as-if-foss minimal
+ - rspec system pg12-as-if-foss predictive
- rspec system pg12-as-if-foss single-db
script:
- run_timed_command "bundle exec scripts/merge-simplecov"
@@ -478,11 +513,24 @@ rspec migration pg12-as-if-foss:
- .rails:rules:as-if-foss-migration
- .rspec-migration-parallel
-rspec migration pg12-as-if-foss minimal:
+rspec migration pg12-as-if-foss predictive:
extends:
- rspec migration pg12-as-if-foss
- - .minimal-rspec-tests
- - .rails:rules:as-if-foss-migration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:as-if-foss-migration:predictive
+
+rspec background_migration pg12-as-if-foss:
+ extends:
+ - .rspec-base-pg12-as-if-foss
+ - .rspec-base-migration
+ - .rails:rules:as-if-foss-background-migration
+ - .rspec-background-migration-parallel
+
+rspec background_migration pg12-as-if-foss predictive:
+ extends:
+ - rspec background_migration pg12-as-if-foss
+ - .predictive-rspec-tests
+ - .rails:rules:as-if-foss-background-migration:predictive
rspec migration pg12-as-if-foss single-db:
extends:
@@ -490,17 +538,23 @@ rspec migration pg12-as-if-foss single-db:
- .single-db-rspec
- .rails:rules:single-db
+rspec background_migration pg12-as-if-foss single-db:
+ extends:
+ - rspec background_migration pg12-as-if-foss
+ - .single-db-rspec
+ - .rails:rules:single-db
+
rspec unit pg12-as-if-foss:
extends:
- .rspec-base-pg12-as-if-foss
- .rails:rules:as-if-foss-unit
- .rspec-unit-parallel
-rspec unit pg12-as-if-foss minimal:
+rspec unit pg12-as-if-foss predictive:
extends:
- rspec unit pg12-as-if-foss
- - .minimal-rspec-tests
- - .rails:rules:as-if-foss-unit:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:as-if-foss-unit:predictive
rspec unit pg12-as-if-foss single-db:
extends:
@@ -514,11 +568,11 @@ rspec integration pg12-as-if-foss:
- .rails:rules:as-if-foss-integration
- .rspec-integration-parallel
-rspec integration pg12-as-if-foss minimal:
+rspec integration pg12-as-if-foss predictive:
extends:
- rspec integration pg12-as-if-foss
- - .minimal-rspec-tests
- - .rails:rules:as-if-foss-integration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:as-if-foss-integration:predictive
rspec integration pg12-as-if-foss single-db:
extends:
@@ -532,11 +586,11 @@ rspec system pg12-as-if-foss:
- .rails:rules:as-if-foss-system
- .rspec-system-parallel
-rspec system pg12-as-if-foss minimal:
+rspec system pg12-as-if-foss predictive:
extends:
- rspec system pg12-as-if-foss
- - .minimal-rspec-tests
- - .rails:rules:as-if-foss-system:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:as-if-foss-system:predictive
rspec system pg12-as-if-foss single-db:
extends:
@@ -551,11 +605,24 @@ rspec-ee migration pg12:
- .rails:rules:ee-only-migration
- .rspec-ee-migration-parallel
-rspec-ee migration pg12 minimal:
+rspec-ee migration pg12 predictive:
extends:
- rspec-ee migration pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-only-migration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-only-migration:predictive
+
+rspec-ee background_migration pg12:
+ extends:
+ - .rspec-ee-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:ee-only-background-migration
+ - .rspec-ee-background-migration-parallel
+
+rspec-ee background_migration pg12 predictive:
+ extends:
+ - rspec-ee background_migration pg12
+ - .predictive-rspec-tests
+ - .rails:rules:ee-only-background-migration:predictive
rspec-ee migration pg12 single-db:
extends:
@@ -563,6 +630,24 @@ rspec-ee migration pg12 single-db:
- .single-db-rspec
- .rails:rules:single-db
+rspec-ee background_migration pg12 single-db:
+ extends:
+ - rspec-ee background_migration pg12
+ - .single-db-rspec
+ - .rails:rules:single-db
+
+rspec-ee migration pg12 praefect:
+ extends:
+ - rspec migration pg12
+ - .praefect-with-db
+ - .rails:rules:praefect-with-db
+
+rspec-ee background_migration pg12 praefect:
+ extends:
+ - rspec background_migration pg12
+ - .praefect-with-db
+ - .rails:rules:praefect-with-db
+
rspec-ee unit pg12:
extends:
- .rspec-ee-base-pg12
@@ -574,11 +659,11 @@ rspec-ee unit pg12 es8:
- .rspec-ee-base-pg12-es8
- .rspec-ee-unit-parallel
-rspec-ee unit pg12 minimal:
+rspec-ee unit pg12 predictive:
extends:
- rspec-ee unit pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-only-unit:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-only-unit:predictive
rspec-ee unit pg12 single-db:
extends:
@@ -597,11 +682,11 @@ rspec-ee integration pg12 es8:
- .rspec-ee-base-pg12-es8
- .rspec-ee-integration-parallel
-rspec-ee integration pg12 minimal:
+rspec-ee integration pg12 predictive:
extends:
- rspec-ee integration pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-only-integration:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-only-integration:predictive
rspec-ee integration pg12 single-db:
extends:
@@ -620,11 +705,11 @@ rspec-ee system pg12 es8:
- .rspec-ee-base-pg12-es8
- .rspec-ee-system-parallel
-rspec-ee system pg12 minimal:
+rspec-ee system pg12 predictive:
extends:
- rspec-ee system pg12
- - .minimal-rspec-tests
- - .rails:rules:ee-only-system:minimal
+ - .predictive-rspec-tests
+ - .rails:rules:ee-only-system:predictive
rspec-ee system pg12 single-db:
extends:
@@ -650,25 +735,32 @@ rspec migration pg11:
extends:
- .rspec-base-pg11
- .rspec-base-migration
- - .rails:rules:default-branch-schedule-nightly--code-backstage
+ - .rails:rules:rspec-on-pg11
- .rspec-migration-parallel
+rspec background_migration pg11:
+ extends:
+ - .rspec-base-pg11
+ - .rspec-base-migration
+ - .rails:rules:rspec-on-pg11
+ - .rspec-background-migration-parallel
+
rspec unit pg11:
extends:
- .rspec-base-pg11
- - .rails:rules:default-branch-schedule-nightly--code-backstage
+ - .rails:rules:rspec-on-pg11
- .rspec-unit-parallel
rspec integration pg11:
extends:
- .rspec-base-pg11
- - .rails:rules:default-branch-schedule-nightly--code-backstage
+ - .rails:rules:rspec-on-pg11
- .rspec-integration-parallel
rspec system pg11:
extends:
- .rspec-base-pg11
- - .rails:rules:default-branch-schedule-nightly--code-backstage
+ - .rails:rules:rspec-on-pg11
- .rspec-system-parallel
# PG13
@@ -679,6 +771,13 @@ rspec migration pg13:
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-migration-parallel
+rspec background_migration pg13:
+ extends:
+ - .rspec-base-pg13
+ - .rspec-base-migration
+ - .rails:rules:default-branch-schedule-nightly--code-backstage
+ - .rspec-background-migration-parallel
+
rspec unit pg13:
extends:
- .rspec-base-pg13
@@ -710,6 +809,13 @@ rspec-ee migration pg11:
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel
+rspec-ee background_migration pg11:
+ extends:
+ - .rspec-ee-base-pg11
+ - .rspec-base-migration
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-background-migration-parallel
+
rspec-ee unit pg11:
extends:
- .rspec-ee-base-pg11
@@ -729,12 +835,6 @@ rspec-ee system pg11:
- .rspec-ee-system-parallel
# PG12
-rspec-ee unit pg12 es7:
- extends:
- - .rspec-ee-base-pg12-es7
- - .rspec-ee-unit-parallel
- - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-
rspec-ee unit pg12 opensearch1:
extends:
- .rspec-ee-base-pg12-opensearch1
@@ -747,12 +847,6 @@ rspec-ee unit pg12 opensearch2:
- .rspec-ee-unit-parallel
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-rspec-ee integration pg12 es7:
- extends:
- - .rspec-ee-base-pg12-es7
- - .rspec-ee-integration-parallel
- - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-
rspec-ee integration pg12 opensearch1:
extends:
- .rspec-ee-base-pg12-opensearch1
@@ -765,12 +859,6 @@ rspec-ee integration pg12 opensearch2:
- .rspec-ee-integration-parallel
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-rspec-ee system pg12 es7:
- extends:
- - .rspec-ee-base-pg12-es7
- - .rspec-ee-system-parallel
- - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
-
rspec-ee system pg12 opensearch1:
extends:
- .rspec-ee-base-pg12-opensearch1
@@ -791,6 +879,13 @@ rspec-ee migration pg13:
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel
+rspec-ee background_migration pg13:
+ extends:
+ - .rspec-ee-base-pg13
+ - .rspec-base-migration
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-background-migration-parallel
+
rspec-ee unit pg13:
extends:
- .rspec-ee-base-pg13
diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml
index e282781b7b5..4ca82f55b63 100644
--- a/.gitlab/ci/rails/shared.gitlab-ci.yml
+++ b/.gitlab/ci/rails/shared.gitlab-ci.yml
@@ -28,7 +28,7 @@ include:
- run_timed_command "scripts/gitaly-test-spawn" # Do not use 'bundle exec' here
- echo -e "\e[0Ksection_end:`date +%s`:gitaly-test-spawn\r\e[0K"
-.minimal-rspec-tests:
+.predictive-rspec-tests:
variables:
RSPEC_TESTS_MAPPING_ENABLED: "true"
@@ -58,10 +58,13 @@ include:
needs: ["setup-test-env", "retrieve-tests-metadata", "compile-test-assets", "detect-tests"]
script:
- !reference [.base-script, script]
- - rspec_paralellized_job "--tag ~quarantine --tag ~level:migration"
+ # We need to exclude background migration because unit tests run with
+ # spec/lib, yet background migration tests are also sitting there,
+ # and they should run on their own jobs so we don't need to run them
+ # in unit tests again.
+ - rspec_paralellized_job "--tag ~quarantine --tag ~level:background_migration"
allow_failure:
- # the exit code listed here must match the one defined for the variable SUCCESSFULLY_RETRIED_TEST_EXIT_CODE
- exit_codes: 137
+ exit_codes: !reference [.rspec-base, variables, SUCCESSFULLY_RETRIED_TEST_EXIT_CODE]
.base-artifacts:
artifacts:
@@ -80,14 +83,9 @@ include:
junit: ${JUNIT_RESULT_FILE}
.rspec-base-migration:
- extends:
- - .base-artifacts
- - .rails:rules:ee-and-foss-migration
- variables:
- RSPEC_TESTS_FILTER_FILE: "${RSPEC_MATCHING_TESTS_PATH}"
script:
- !reference [.base-script, script]
- - rspec_paralellized_job "--tag ~quarantine --tag level:migration"
+ - rspec_paralellized_job "--tag ~quarantine"
.rspec-base-pg11:
extends:
@@ -121,12 +119,6 @@ include:
- .rspec-base
- .use-pg12-es7-ee
-.rspec-ee-base-pg12-es7:
- extends:
- - .rspec-base
- - .use-pg12-es7-ee
- - .rails:rules:run-search-tests
-
.rspec-ee-base-pg12-es8:
extends:
- .rspec-base
@@ -163,11 +155,17 @@ include:
############################
# rspec job parallel configs
.rspec-migration-parallel:
- parallel: 12
+ parallel: 8
-.rspec-ee-migration-parallel:
+.rspec-background-migration-parallel:
parallel: 4
+.rspec-ee-migration-parallel:
+ parallel: 2
+
+.rspec-ee-background-migration-parallel:
+ parallel: 2
+
.rspec-unit-parallel:
parallel: 28
diff --git a/.gitlab/ci/review-apps/main.gitlab-ci.yml b/.gitlab/ci/review-apps/main.gitlab-ci.yml
index b72afedc3b0..13e8ea330da 100644
--- a/.gitlab/ci/review-apps/main.gitlab-ci.yml
+++ b/.gitlab/ci/review-apps/main.gitlab-ci.yml
@@ -32,7 +32,7 @@ review-build-cng-env:
extends:
- .default-retry
- .review:rules:review-build-cng
- image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3
+ image: ${GITLAB_DEPENDENCY_PROXY}ruby:${RUBY_VERSION}-alpine3.16
stage: prepare
needs:
# We need this job because we need its `cached-assets-hash.txt` artifact, so that we can pass the assets image tag to the downstream CNG pipeline.
@@ -109,6 +109,7 @@ review-deploy:
- .review-workflow-base
- .review:rules:review-deploy
stage: deploy
+ image: ${GITLAB_DEPENDENCY_PROXY}dtzar/helm-kubectl:3.10.3
needs: ["review-build-cng"]
cache:
key: "review-deploy-dependencies-charts-${GITLAB_HELM_CHART_REF}-v1"
@@ -130,6 +131,7 @@ review-deploy:
- run_timed_command "deploy" || (display_deployment_debug && exit 1)
- run_timed_command "verify_deploy" || (display_deployment_debug && exit 1)
- run_timed_command "disable_sign_ups" || (display_deployment_debug && exit 1)
+ - run_timed_command "verify_commit_sha" || (display_deployment_debug && exit 1)
after_script:
# Run seed-dast-test-data.sh only when DAST_RUN is set to true. This is to pupulate review app with data for DAST scan.
# Set DAST_RUN to true when jobs are manually scheduled.
diff --git a/.gitlab/ci/review-apps/qa.gitlab-ci.yml b/.gitlab/ci/review-apps/qa.gitlab-ci.yml
index d28819208b7..01a738127f7 100644
--- a/.gitlab/ci/review-apps/qa.gitlab-ci.yml
+++ b/.gitlab/ci/review-apps/qa.gitlab-ci.yml
@@ -1,6 +1,6 @@
include:
- project: gitlab-org/quality/pipeline-common
- ref: 1.7.0
+ ref: 1.14.1
file:
- /ci/base.gitlab-ci.yml
- /ci/allure-report.yml
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml
index 8b7aee8de9d..9596594ad26 100644
--- a/.gitlab/ci/rules.gitlab-ci.yml
+++ b/.gitlab/ci/rules.gitlab-ci.yml
@@ -21,7 +21,7 @@
if: '$FORCE_GITLAB_CI'
.if-default-refs: &if-default-refs
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_COMMIT_REF_NAME == "ruby3" || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG || $FORCE_GITLAB_CI'
+ if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_COMMIT_REF_NAME == "ruby2" || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG || $FORCE_GITLAB_CI'
.if-default-branch-refs: &if-default-branch-refs
if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID == null'
@@ -55,8 +55,8 @@
.if-merge-request-targeting-stable-branch: &if-merge-request-targeting-stable-branch
if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/'
-.if-merge-request-labels-run-in-ruby3: &if-merge-request-labels-run-in-ruby3
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3/'
+.if-merge-request-labels-run-in-ruby2: &if-merge-request-labels-run-in-ruby2
+ if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby2/'
.if-merge-request-labels-as-if-foss: &if-merge-request-labels-as-if-foss
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/'
@@ -79,6 +79,9 @@
.if-merge-request-labels-run-review-app: &if-merge-request-labels-run-review-app
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-review-app/'
+.if-merge-request-labels-run-on-pg11: &if-merge-request-labels-run-on-pg11
+ if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg11/'
+
.if-merge-request-labels-skip-undercoverage: &if-merge-request-labels-skip-undercoverage
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/'
@@ -89,7 +92,7 @@
if: '$CI_MERGE_REQUEST_LABELS =~ /group::global search/'
.if-merge-request-labels-pipeline-expedite: &if-merge-request-labels-pipeline-expedite
- if: '$CI_MERGE_REQUEST_LABELS =~ /master:(foss-)?broken/ && $CI_MERGE_REQUEST_LABELS =~ /pipeline:expedite/'
+ if: '($CI_MERGE_REQUEST_LABELS =~ /master:(foss-)?broken/ || $CI_MERGE_REQUEST_TITLE =~ /^[Rr]evert/) && $CI_MERGE_REQUEST_LABELS =~ /pipeline:expedite/'
.if-merge-request-labels-frontend-and-feature-flag: &if-merge-request-labels-frontend-and-feature-flag
if: '$CI_MERGE_REQUEST_LABELS =~ /frontend/ && $CI_MERGE_REQUEST_LABELS =~ /feature flag/'
@@ -109,8 +112,8 @@
.if-default-branch-schedule-nightly: &if-default-branch-schedule-nightly
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"'
-.if-ruby3-branch-schedule-nightly: &if-ruby3-branch-schedule-nightly
- if: '$CI_COMMIT_BRANCH == "ruby3" && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"'
+.if-ruby2-branch-schedule-nightly: &if-ruby2-branch-schedule-nightly
+ if: '$CI_COMMIT_BRANCH == "ruby2" && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"'
.if-security-schedule: &if-security-schedule
if: '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_PIPELINE_SOURCE == "schedule"'
@@ -142,8 +145,8 @@
.if-dot-com-gitlab-org-and-security-tag: &if-dot-com-gitlab-org-and-security-tag
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_COMMIT_TAG'
-.if-ruby3-branch: &if-ruby3-branch
- if: '$CI_COMMIT_BRANCH == "ruby3"'
+.if-ruby2-branch: &if-ruby2-branch
+ if: '$CI_COMMIT_BRANCH == "ruby2"'
# For Security merge requests, the gitlab-release-tools-bot triggers a new
# pipeline for the "Pipelines for merged results" feature. If the pipeline
@@ -217,9 +220,6 @@
- "scripts/lint-doc.sh"
- ".gitlab/ci/docs.gitlab-ci.yml"
-.docs-code-quality-patterns: &docs-code-quality-patterns
- - "doc/**/*.md"
-
.docs-deprecations-and-removals-patterns: &docs-deprecations-and-removals-patterns
- "doc/update/deprecations.md"
- "doc/update/removals.md"
@@ -350,6 +350,11 @@
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
+# DB backup patterns
+.db-backup-patterns: &db-backup-patterns
+ - "lib/backup/**/*"
+ - "lib/tasks/gitlab/backup.rake"
+
.db-library-patterns: &db-library-patterns
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database{,_spec}.rb"
@@ -586,7 +591,7 @@
- <<: *if-merge-request-targeting-stable-branch
when: never
-.rails:rules:minimal-default-rules:
+.rails:rules:predictive-default-rules:
rules:
- <<: *if-merge-request-approved
when: never
@@ -614,7 +619,7 @@
- <<: *if-merge-request-not-approved
when: never
-.rails:rules:as-if-foss-migration-unit-integration:minimal-default-rules:
+.rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules:
rules:
- <<: *if-merge-request
changes: *core-backend-patterns
@@ -623,11 +628,11 @@
changes: *ci-patterns
when: never
-.rails:rules:unit-integration:minimal-default-rules:
+.rails:rules:unit-integration:predictive-default-rules:
rules:
- <<: *if-merge-request-labels-run-all-rspec
when: never
- - !reference [".rails:rules:as-if-foss-migration-unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules]
.rails:rules:system-default-rules:
rules:
@@ -643,7 +648,7 @@
- <<: *if-merge-request-not-approved
when: never
-.rails:rules:system:minimal-default-rules:
+.rails:rules:system:predictive-default-rules:
rules:
- <<: *if-merge-request-labels-run-all-rspec
when: never
@@ -705,7 +710,7 @@
variables:
ARCH: amd64,arm64
- <<: *if-force-ci
- - <<: *if-ruby3-branch
+ - <<: *if-ruby2-branch
.build-images:rules:build-assets-image:
rules:
@@ -714,7 +719,7 @@
- <<: *if-merge-request-targeting-stable-branch
- <<: *if-merge-request-labels-run-review-app
- <<: *if-auto-deploy-branches
- - <<: *if-ruby3-branch
+ - <<: *if-ruby2-branch
- <<: *if-default-refs
changes: *ci-build-images-patterns
- <<: *if-default-refs
@@ -812,11 +817,6 @@
when: manual
allow_failure: true
-.docs:rules:docs-code-quality:
- rules:
- - <<: *if-merge-request
- changes: *docs-code-quality-patterns
-
.docs:rules:docs-lint:
rules:
- <<: *if-default-refs
@@ -871,7 +871,7 @@
# Frontend rules #
##################
-.frontend:rules:minimal-default-rules:
+.frontend:rules:predictive-default-rules:
rules:
- <<: *if-merge-request-approved
when: never
@@ -887,7 +887,7 @@
- <<: *if-merge-request-targeting-stable-branch
- <<: *if-merge-request-labels-run-review-app
- <<: *if-auto-deploy-branches
- - <<: *if-ruby3-branch
+ - <<: *if-ruby2-branch
- <<: *if-default-refs
changes: *ci-build-images-patterns
- <<: *if-default-refs
@@ -963,11 +963,11 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
-.frontend:rules:jest:minimal:
+.frontend:rules:jest:predictive:
rules:
- <<: *if-fork-merge-request
changes: *code-backstage-patterns
- - !reference [".frontend:rules:minimal-default-rules", rules]
+ - !reference [".frontend:rules:predictive-default-rules", rules]
- <<: *if-merge-request-labels-run-all-jest
when: never
- <<: *if-merge-request-labels-frontend-and-feature-flag
@@ -995,10 +995,10 @@
- <<: *if-merge-request
changes: *frontend-patterns-for-as-if-foss
-.frontend:rules:jest:minimal:as-if-foss:
+.frontend:rules:jest:predictive:as-if-foss:
rules:
- !reference [".strict-ee-only-rules", rules]
- - !reference [".frontend:rules:minimal-default-rules", rules]
+ - !reference [".frontend:rules:predictive-default-rules", rules]
- <<: *if-merge-request-labels-as-if-foss
when: never
- <<: *if-merge-request-labels-run-all-jest
@@ -1107,7 +1107,7 @@
allow_failure: true
- <<: *if-force-ci
allow_failure: true
- - <<: *if-ruby3-branch
+ - <<: *if-ruby2-branch
.qa:rules:package-and-test:
rules:
@@ -1119,7 +1119,7 @@
when: never
- <<: *if-merge-request-targeting-stable-branch
allow_failure: true
- - <<: *if-ruby3-branch
+ - <<: *if-ruby2-branch
allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-e2e
changes: *feature-flag-development-config-patterns
@@ -1172,6 +1172,16 @@
changes: *db-patterns
- <<: *if-default-branch-schedule-nightly
+.rails:rules:db-backup:
+ rules:
+ - <<: *if-merge-request-labels-run-all-rspec
+ - <<: *if-default-refs
+ changes: *db-backup-patterns
+ - <<: *if-merge-request-not-approved
+ when: never
+ - <<: *if-default-refs
+ changes: *db-patterns
+
.rails:rules:praefect-with-db:
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-praefect-with-db/'
@@ -1188,27 +1198,35 @@
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
- <<: *if-merge-request
changes: *db-patterns
- - <<: *if-automated-merge-request
- changes: *db-patterns
- - <<: *if-security-merge-request
- changes: *db-patterns
- <<: *if-merge-request-not-approved
when: never
- <<: *if-default-refs
changes: *db-patterns
-.rails:rules:ee-and-foss-migration:minimal:
+.rails:rules:ee-and-foss-migration:predictive:
rules:
- <<: *if-fork-merge-request
changes: *db-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
- <<: *if-merge-request
changes: *db-patterns
when: never
+.rails:rules:ee-and-foss-background-migration:
+ rules:
+ - !reference [".rails:rules:ee-and-foss-migration", rules]
+ - <<: *if-default-refs
+ changes: *backend-patterns
+
+.rails:rules:ee-and-foss-background-migration:predictive:
+ rules:
+ - !reference [".rails:rules:ee-and-foss-migration:predictive", rules]
+ - <<: *if-merge-request
+ changes: *backend-patterns
+
.rails:rules:ee-and-foss-mr-with-migration:
rules:
- <<: *if-merge-request
@@ -1231,12 +1249,12 @@
- <<: *if-default-refs
changes: *backend-patterns
-.rails:rules:ee-and-foss-unit:minimal:
+.rails:rules:ee-and-foss-unit:predictive:
rules:
- <<: *if-fork-merge-request
changes: *backend-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *backend-patterns
@@ -1248,12 +1266,12 @@
- <<: *if-default-refs
changes: *backend-patterns
-.rails:rules:ee-and-foss-integration:minimal:
+.rails:rules:ee-and-foss-integration:predictive:
rules:
- <<: *if-fork-merge-request
changes: *backend-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *backend-patterns
@@ -1265,12 +1283,12 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
-.rails:rules:ee-and-foss-system:minimal:
+.rails:rules:ee-and-foss-system:predictive:
rules:
- <<: *if-fork-merge-request
changes: *code-backstage-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:system:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:system:predictive-default-rules", rules]
.rails:rules:ee-and-foss-fast_spec_helper:
rules:
@@ -1306,18 +1324,30 @@
- <<: *if-default-refs
changes: *db-patterns
-.rails:rules:ee-only-migration:minimal:
+.rails:rules:ee-only-migration:predictive:
rules:
- <<: *if-not-ee
when: never
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
- <<: *if-merge-request
changes: *db-patterns
when: never
+.rails:rules:ee-only-background-migration:
+ rules:
+ - !reference [".rails:rules:ee-only-migration", rules]
+ - <<: *if-default-refs
+ changes: *backend-patterns
+
+.rails:rules:ee-only-background-migration:predictive:
+ rules:
+ - !reference [".rails:rules:ee-only-migration:predictive", rules]
+ - <<: *if-merge-request
+ changes: *backend-patterns
+
.rails:rules:ee-only-unit:
rules:
- <<: *if-not-ee
@@ -1328,14 +1358,14 @@
- <<: *if-default-refs
changes: *backend-patterns
-.rails:rules:ee-only-unit:minimal:
+.rails:rules:ee-only-unit:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
changes: *backend-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *backend-patterns
@@ -1349,14 +1379,14 @@
- <<: *if-default-refs
changes: *backend-patterns
-.rails:rules:ee-only-integration:minimal:
+.rails:rules:ee-only-integration:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
changes: *backend-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *backend-patterns
@@ -1370,14 +1400,14 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
-.rails:rules:ee-only-system:minimal:
+.rails:rules:ee-only-system:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
changes: *code-backstage-patterns
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:system:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:system:predictive-default-rules", rules]
.rails:rules:as-if-foss-migration:
rules:
@@ -1397,18 +1427,30 @@
- <<: *if-merge-request-not-approved
when: never
-.rails:rules:as-if-foss-migration:minimal:
+.rails:rules:as-if-foss-migration:predictive:
rules:
- <<: *if-not-ee
when: never
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:as-if-foss-migration-unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules]
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
- <<: *if-merge-request-labels-as-if-foss
changes: *db-patterns
when: never
+.rails:rules:as-if-foss-background-migration:
+ rules:
+ - !reference [".rails:rules:as-if-foss-migration", rules]
+ - <<: *if-merge-request-labels-as-if-foss
+ changes: *backend-patterns
+
+.rails:rules:as-if-foss-background-migration:predictive:
+ rules:
+ - !reference [".rails:rules:as-if-foss-migration:predictive", rules]
+ - <<: *if-merge-request-labels-as-if-foss
+ changes: *backend-patterns
+
.rails:rules:as-if-foss-unit:
rules:
- <<: *if-not-ee
@@ -1419,14 +1461,14 @@
- <<: *if-merge-request-labels-as-if-foss
changes: *backend-patterns
-.rails:rules:as-if-foss-unit:minimal:
+.rails:rules:as-if-foss-unit:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
when: never
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:as-if-foss-migration-unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request-labels-as-if-foss
changes: *backend-patterns
@@ -1440,14 +1482,14 @@
- <<: *if-merge-request-labels-as-if-foss
changes: *backend-patterns
-.rails:rules:as-if-foss-integration:minimal:
+.rails:rules:as-if-foss-integration:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
when: never
- - !reference [".rails:rules:minimal-default-rules", rules]
- - !reference [".rails:rules:as-if-foss-migration-unit-integration:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
+ - !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules]
- <<: *if-merge-request-labels-as-if-foss
changes: *backend-patterns
@@ -1461,13 +1503,13 @@
- <<: *if-merge-request-labels-as-if-foss
changes: *code-backstage-patterns
-.rails:rules:as-if-foss-system:minimal:
+.rails:rules:as-if-foss-system:predictive:
rules:
- <<: *if-not-ee
when: never
- <<: *if-fork-merge-request
when: never
- - !reference [".rails:rules:minimal-default-rules", rules]
+ - !reference [".rails:rules:predictive-default-rules", rules]
- <<: *if-merge-request
changes: *core-backend-patterns
when: never
@@ -1485,6 +1527,7 @@
- <<: *if-default-refs
changes: *db-library-patterns
- <<: *if-merge-request-labels-run-all-rspec
+ - <<: *if-merge-request-labels-run-on-pg11
.rails:rules:ee-mr-and-default-branch-only:
rules:
@@ -1548,7 +1591,7 @@
- <<: *if-not-ee
when: never
- <<: *if-default-branch-schedule-nightly
- - <<: *if-ruby3-branch-schedule-nightly
+ - <<: *if-ruby2-branch-schedule-nightly
- <<: *if-merge-request-labels-run-all-rspec
.rails:rules:rspec-coverage:
@@ -1574,6 +1617,11 @@
- <<: *if-merge-request
changes: *backend-patterns
+.rails:rules:rspec-on-pg11:
+ rules:
+ - <<: *if-merge-request-labels-run-on-pg11
+ - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]
+
.rails:rules:default-branch-schedule-nightly--code-backstage-default-rules:
rules:
- <<: *if-default-branch-schedule-nightly
@@ -1768,6 +1816,8 @@
- <<: *if-default-branch-refs
- <<: *if-default-refs
changes: *code-backstage-qa-patterns
+ - <<: *if-default-refs
+ changes: *docs-patterns
.reports:rules:brakeman-sast:
rules:
@@ -2062,9 +2112,9 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
-.setup:rules:verify-ruby-2.7:
+.setup:rules:verify-ruby-3.0:
rules:
- - <<: *if-merge-request-labels-run-in-ruby3
+ - <<: *if-merge-request-labels-run-in-ruby2
.setup:rules:verify-tests-yml:
rules:
@@ -2145,6 +2195,8 @@
- !reference [".strict-ee-only-rules", rules]
- !reference [".as-if-jh-default-exclusion-rules", rules]
- <<: *if-merge-request-labels-as-if-jh
+ - <<: *if-dot-com-gitlab-org-merge-request
+ changes: *feature-flag-development-config-patterns
# This rule should share the same logic with .as-if-jh:rules:prepare-as-if-jh
# Because the jobs using this need jobs using the preparation rules
@@ -2154,3 +2206,6 @@
- !reference [".as-if-jh-default-exclusion-rules", rules]
- <<: *if-merge-request-labels-as-if-jh
allow_failure: true # See https://gitlab.com/gitlab-org/gitlab/-/issues/351136
+ - <<: *if-dot-com-gitlab-org-merge-request
+ changes: *feature-flag-development-config-patterns
+ allow_failure: true # See https://gitlab.com/gitlab-org/gitlab/-/issues/351136
diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml
index e417b054cd6..852c4739d9d 100644
--- a/.gitlab/ci/setup.gitlab-ci.yml
+++ b/.gitlab/ci/setup.gitlab-ci.yml
@@ -22,21 +22,21 @@ cache gems:
- vendor/cache
expire_in: 31d
-.minimal-job:
+.predictive-job:
extends:
- .default-retry
needs: []
-.absolutely-minimal-job:
+.absolutely-predictive-job:
extends:
- - .minimal-job
+ - .predictive-job
image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}alpine:edge
variables:
GIT_STRATEGY: none
dont-interrupt-me:
extends:
- - .absolutely-minimal-job
+ - .absolutely-predictive-job
- .setup:rules:dont-interrupt-me
stage: sync
interruptible: false
@@ -45,7 +45,7 @@ dont-interrupt-me:
gitlab_git_test:
extends:
- - .minimal-job
+ - .predictive-job
- .setup:rules:gitlab_git_test
stage: test
script:
@@ -53,7 +53,7 @@ gitlab_git_test:
no-ee-check:
extends:
- - .minimal-job
+ - .predictive-job
- .setup:rules:no-ee-check
stage: test
script:
@@ -61,19 +61,19 @@ no-ee-check:
no-jh-check:
extends:
- - .minimal-job
+ - .predictive-job
- .setup:rules:no-jh-check
stage: test
script:
- scripts/no-dir-check jh
-verify-ruby-2.7:
+verify-ruby-3.0:
extends:
- - .absolutely-minimal-job
- - .setup:rules:verify-ruby-2.7
+ - .absolutely-predictive-job
+ - .setup:rules:verify-ruby-3.0
stage: prepare
script:
- - echo 'Please remove label ~"pipeline:run-in-ruby3" so we do test against Ruby 2.7 (default version) before merging the merge request'
+ - echo 'Please remove label ~"pipeline:run-in-ruby2" so we do test against Ruby 3.0 (default version) before merging the merge request'
- exit 1
verify-tests-yml:
@@ -89,7 +89,7 @@ verify-tests-yml:
verify-approvals:
extends:
- - .minimal-job
+ - .predictive-job
- .setup:rules:jh-contribution
script:
- source scripts/utils.sh
@@ -116,11 +116,13 @@ generate-frontend-fixtures-mapping:
detect-tests:
extends: .rails:rules:detect-tests
- image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}
+ image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-slim
needs: []
stage: prepare
variables:
RSPEC_TESTS_MAPPING_ENABLED: "true"
+ before_script:
+ - apt-get update && apt-get install -y curl # Not present in ruby-slim, so we add it manually
script:
- source ./scripts/utils.sh
- source ./scripts/rspec_helpers.sh
@@ -135,17 +137,20 @@ detect-tests:
tooling/bin/find_tests ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH};
tooling/bin/find_changes ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_TESTS_PATH} ${FRONTEND_FIXTURES_MAPPING_PATH};
filter_rspec_matched_foss_tests ${RSPEC_MATCHING_TESTS_PATH} ${RSPEC_MATCHING_TESTS_FOSS_PATH};
+ tooling/bin/view_to_js_mappings ${RSPEC_CHANGED_FILES_PATH} ${RSPEC_MATCHING_JS_FILES_PATH};
echoinfo "Changed files: $(cat $RSPEC_CHANGED_FILES_PATH)";
echoinfo "Related RSpec tests: $(cat $RSPEC_MATCHING_TESTS_PATH)";
echoinfo "Related FOSS RSpec tests: $(cat $RSPEC_MATCHING_TESTS_FOSS_PATH)";
+ echoinfo "Related JS files: $(cat $RSPEC_MATCHING_JS_FILES_PATH)";
fi
artifacts:
expire_in: 7d
paths:
+ - ${FRONTEND_FIXTURES_MAPPING_PATH}
- ${RSPEC_CHANGED_FILES_PATH}
- - ${RSPEC_MATCHING_TESTS_PATH}
+ - ${RSPEC_MATCHING_JS_FILES_PATH}
- ${RSPEC_MATCHING_TESTS_FOSS_PATH}
- - ${FRONTEND_FIXTURES_MAPPING_PATH}
+ - ${RSPEC_MATCHING_TESTS_PATH}
detect-previous-failed-tests:
extends:
@@ -167,7 +172,7 @@ detect-previous-failed-tests:
e2e-test-pipeline-generate:
extends:
- .qa-job-base
- - .minimal-job
+ - .predictive-job
- .qa:rules:determine-e2e-tests
stage: prepare
variables:
diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml
index 6df2c5f403f..13013d9a9db 100644
--- a/.gitlab/ci/static-analysis.gitlab-ci.yml
+++ b/.gitlab/ci/static-analysis.gitlab-ci.yml
@@ -32,7 +32,7 @@ static-analysis:
parallel: 2
script:
- yarn_install_script
- - scripts/static-analysis
+ - fail_on_warnings scripts/static-analysis
static-analysis as-if-foss:
extends:
diff --git a/.gitlab/ci/test-metadata.gitlab-ci.yml b/.gitlab/ci/test-metadata.gitlab-ci.yml
index e147305e25a..3f6760394c4 100644
--- a/.gitlab/ci/test-metadata.gitlab-ci.yml
+++ b/.gitlab/ci/test-metadata.gitlab-ci.yml
@@ -14,8 +14,11 @@ retrieve-tests-metadata:
extends:
- .tests-metadata-state
- .test-metadata:rules:retrieve-tests-metadata
+ # We use a smaller image for this job only (update-tests-metadata compiles some gems)
+ image: ${GITLAB_DEPENDENCY_PROXY_ADDRESS}ruby:${RUBY_VERSION}-slim
stage: prepare
script:
+ - apt-get update && apt-get install -y curl # Not present in ruby-slim, so we add it manually
- install_gitlab_gem
- source ./scripts/rspec_helpers.sh
- retrieve_tests_metadata
diff --git a/.gitlab/ci/workhorse.gitlab-ci.yml b/.gitlab/ci/workhorse.gitlab-ci.yml
index 3aa9eaee6f8..389906dbbff 100644
--- a/.gitlab/ci/workhorse.gitlab-ci.yml
+++ b/.gitlab/ci/workhorse.gitlab-ci.yml
@@ -37,8 +37,9 @@ workhorse:test go:
workhorse:test fips:
extends: .workhorse:test
+ image: registry.gitlab.com/gitlab-org/gitlab-omnibus-builder/ubuntu_20.04_fips:4.0.0
variables:
- WORKHORSE_TEST_FIPS_ENABLED: 1
+ FIPS_MODE: 1
workhorse:test race:
extends: .workhorse:test