From b1ded808323d25cdf6185b4da0e75a8089aa6031 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Tue, 2 May 2023 13:26:22 -0300 Subject: [PATCH 01/10] Swap PG 14 to be default, and 13 to be nightly Since we're going to postgres 14 on gitlab.com, we should make that the primary version we test against, and we should add nightly tests for postgres 15 Changelog: changed --- .gitlab-ci.yml | 2 +- .gitlab/ci/ci-templates.gitlab-ci.yml | 2 +- .gitlab/ci/dev-fixtures.gitlab-ci.yml | 4 +- .gitlab/ci/frontend.gitlab-ci.yml | 2 +- .gitlab/ci/glfm.gitlab-ci.yml | 2 +- .gitlab/ci/global.gitlab-ci.yml | 77 +++ .gitlab/ci/memory.gitlab-ci.yml | 2 +- .gitlab/ci/rails.gitlab-ci.yml | 462 ++++++++++-------- .../rails/rspec-foss-impact.gitlab-ci.yml.erb | 2 +- .gitlab/ci/rails/shared.gitlab-ci.yml | 38 +- .gitlab/ci/rules.gitlab-ci.yml | 9 + .gitlab/ci/setup.gitlab-ci.yml | 2 +- .gitlab/ci/static-analysis.gitlab-ci.yml | 2 +- .gitlab/ci/test-metadata.gitlab-ci.yml | 20 +- doc/development/pipelines/index.md | 28 +- doc/development/pipelines/internals.md | 4 +- scripts/failed_tests.rb | 4 +- 17 files changed, 429 insertions(+), 233 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 443807bfb90101..7816ae1391c8ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,7 +121,7 @@ workflow: PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline' variables: - PG_VERSION: "13" + PG_VERSION: "14" DEFAULT_CI_IMAGE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}.patched-golang-${GO_VERSION}-rust-${RUST_VERSION}-node-18.16-postgresql-${PG_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-yarn-1.22-graphicsmagick-1.3.36" # We set $GITLAB_DEPENDENCY_PROXY to another variable (since it's set at the group level and has higher precedence than .gitlab-ci.yml) # so that we can override $GITLAB_DEPENDENCY_PROXY_ADDRESS in workflow rules. diff --git a/.gitlab/ci/ci-templates.gitlab-ci.yml b/.gitlab/ci/ci-templates.gitlab-ci.yml index c6681db96856c6..a00de8cb533ed7 100644 --- a/.gitlab/ci/ci-templates.gitlab-ci.yml +++ b/.gitlab/ci/ci-templates.gitlab-ci.yml @@ -4,7 +4,7 @@ templates-shellcheck: - .default-before_script - .default-retry - .ruby-cache - - .use-pg14 + - .use-pg15 stage: test needs: - setup-test-env diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml index 5464e154b3f08f..642bad53772ad5 100644 --- a/.gitlab/ci/dev-fixtures.gitlab-ci.yml +++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml @@ -3,7 +3,7 @@ - .default-retry - .ruby-cache - .default-before_script - - .use-pg13 + - .use-pg14 stage: test needs: ["setup-test-env"] variables: @@ -29,7 +29,7 @@ run-dev-fixtures-ee: extends: - .run-dev-fixtures - .dev-fixtures:rules:ee-only - - .use-pg13-es7-ee + - .use-pg14-es7-ee script: - cp ee/db/fixtures/development/* $FIXTURE_PATH - *run-dev-fixtures-script diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index 790a9140445482..0e630fcd8114d7 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -129,7 +129,7 @@ retrieve-frontend-fixtures: - .default-retry - .default-before_script - .ruby-cache - - .use-pg13 + - .use-pg14 stage: fixtures needs: ["setup-test-env", "retrieve-tests-metadata", "retrieve-frontend-fixtures"] variables: diff --git a/.gitlab/ci/glfm.gitlab-ci.yml b/.gitlab/ci/glfm.gitlab-ci.yml index 008bb03de251ed..3f9ddaa791c28d 100644 --- a/.gitlab/ci/glfm.gitlab-ci.yml +++ b/.gitlab/ci/glfm.gitlab-ci.yml @@ -2,7 +2,7 @@ glfm-verify: extends: - .rails-job-base - .glfm:rules:glfm-verify - - .use-pg13 + - .use-pg14 stage: test needs: ["setup-test-env"] script: diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 120e5117fb2f14..0b034179263a58 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -249,6 +249,16 @@ POSTGRES_HOST_AUTH_METHOD: trust PG_VERSION: "14" +.use-pg15: + services: + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres + - name: redis:6.2-alpine + variables: + POSTGRES_HOST_AUTH_METHOD: trust + PG_VERSION: "15" + .use-pg12-es7-ee: services: - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-12-pgvector-0.4.1 @@ -303,6 +313,22 @@ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 +.use-pg15-es7-ee: + services: + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres + - name: redis:6.2-alpine + - name: elasticsearch:7.17.6 + command: ["elasticsearch", "-E", "discovery.type=single-node", "-E", "xpack.security.enabled=false"] + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0 + alias: zoekt-ci-image + variables: + POSTGRES_HOST_AUTH_METHOD: trust + PG_VERSION: "15" + ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 + ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 + .use-pg13-es8-ee: services: - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-13-pgvector-0.4.1 @@ -341,6 +367,23 @@ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 +.use-pg15-es8-ee: + services: + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres + - name: redis:6.0-alpine + - name: elasticsearch:8.6.2 + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0 + alias: zoekt-ci-image + variables: + POSTGRES_HOST_AUTH_METHOD: trust + PG_VERSION: "15" + ES_SETTING_DISCOVERY_TYPE: "single-node" + ES_SETTING_XPACK_SECURITY_ENABLED: "false" + ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 + ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 + .use-pg13-opensearch1-ee: services: - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-13-pgvector-0.4.1 @@ -417,6 +460,40 @@ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 +.use-pg15-opensearch1-ee: + services: + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres + - name: redis:6.0-alpine + - name: opensearchproject/opensearch:1.3.5 + alias: elasticsearch + command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"] + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0 + alias: zoekt-ci-image + variables: + POSTGRES_HOST_AUTH_METHOD: trust + PG_VERSION: "15" + ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 + ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 + +.use-pg15-opensearch2-ee: + services: + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres + - name: redis:6.0-alpine + - name: opensearchproject/opensearch:2.2.1 + alias: elasticsearch + command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"] + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0 + alias: zoekt-ci-image + variables: + POSTGRES_HOST_AUTH_METHOD: trust + PG_VERSION: "15" + ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060 + ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070 + .use-kaniko: image: name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:kaniko diff --git a/.gitlab/ci/memory.gitlab-ci.yml b/.gitlab/ci/memory.gitlab-ci.yml index 004188b502cc6d..33fbed15a2344d 100644 --- a/.gitlab/ci/memory.gitlab-ci.yml +++ b/.gitlab/ci/memory.gitlab-ci.yml @@ -20,7 +20,7 @@ memory-on-boot: extends: - .only-code-memory-job-base - .production - - .use-pg13 + - .use-pg14 stage: test needs: ["setup-test-env", "compile-test-assets"] variables: diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 9c3055033575f5..abe1d5f30bf579 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -64,145 +64,145 @@ update-gitaly-binaries-cache: - export BUNDLE_WITHOUT="${BUNDLE_WITHOUT}:default:test:puma:kerberos:metrics:omnibus:ed25519" - bundle_install_script -rspec migration pg13: +rspec migration pg14: extends: - - .rspec-base-pg13 + - .rspec-base-pg14 - .rspec-base-migration - .rails:rules:ee-and-foss-migration - .rspec-migration-parallel -rspec background_migration pg13: +rspec background_migration pg14: extends: - - .rspec-base-pg13 + - .rspec-base-pg14 - .rspec-base-migration - .rails:rules:ee-and-foss-background-migration - .rspec-background-migration-parallel -rspec migration pg13 single-db: +rspec migration pg14 single-db: extends: - - rspec migration pg13 + - rspec migration pg14 - .single-db-rspec - .rails:rules:single-db -rspec background_migration pg13 single-db: +rspec background_migration pg14 single-db: extends: - - rspec background_migration pg13 + - rspec background_migration pg14 - .single-db-rspec - .rails:rules:single-db -rspec migration pg13 single-db-ci-connection: +rspec migration pg14 single-db-ci-connection: extends: - - rspec migration pg13 + - rspec migration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec background_migration pg13 single-db-ci-connection: +rspec background_migration pg14 single-db-ci-connection: extends: - - rspec background_migration pg13 + - rspec background_migration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec migration pg13 praefect: +rspec migration pg14 praefect: extends: - - rspec migration pg13 + - rspec migration pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec background_migration pg13 praefect: +rspec background_migration pg14 praefect: extends: - - rspec background_migration pg13 + - rspec background_migration pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec unit pg13: +rspec unit pg14: extends: - - .rspec-base-pg13 + - .rspec-base-pg14 - .rails:rules:ee-and-foss-unit - .rspec-unit-parallel -rspec unit pg13 single-redis: +rspec unit pg14 single-redis: extends: - - rspec unit pg13 + - rspec unit pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec unit pg13 single-db: +rspec unit pg14 single-db: extends: - - rspec unit pg13 + - rspec unit pg14 - .single-db-rspec - .rails:rules:single-db -rspec unit pg13 single-db-ci-connection: +rspec unit pg14 single-db-ci-connection: extends: - - rspec unit pg13 + - rspec unit pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec unit pg13 praefect: +rspec unit pg14 praefect: extends: - - rspec unit pg13 + - rspec unit pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec integration pg13: +rspec integration pg14: extends: - - .rspec-base-pg13 + - .rspec-base-pg14 - .rails:rules:ee-and-foss-integration - .rspec-integration-parallel -rspec integration pg13 single-redis: +rspec integration pg14 single-redis: extends: - - rspec integration pg13 + - rspec integration pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec integration pg13 single-db: +rspec integration pg14 single-db: extends: - - rspec integration pg13 + - rspec integration pg14 - .single-db-rspec - .rails:rules:single-db -rspec integration pg13 single-db-ci-connection: +rspec integration pg14 single-db-ci-connection: extends: - - rspec integration pg13 + - rspec integration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec integration pg13 praefect: +rspec integration pg14 praefect: extends: - - rspec integration pg13 + - rspec integration pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec system pg13: +rspec system pg14: extends: - - .rspec-base-pg13 + - .rspec-base-pg14 - .rails:rules:ee-and-foss-system - .rspec-system-parallel variables: DEBUG_GITLAB_TRANSACTION_STACK: "true" -rspec system pg13 single-redis: +rspec system pg14 single-redis: extends: - - rspec system pg13 + - rspec system pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec system pg13 single-db: +rspec system pg14 single-db: extends: - - rspec system pg13 + - rspec system pg14 - .single-db-rspec - .rails:rules:single-db -rspec system pg13 single-db-ci-connection: +rspec system pg14 single-db-ci-connection: extends: - - rspec system pg13 + - rspec system pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec system pg13 praefect: +rspec system pg14 praefect: extends: - - rspec system pg13 + - rspec system pg14 - .praefect-with-db - .rails:rules:praefect-with-db @@ -216,9 +216,19 @@ rspec db-library-code pg12: - !reference [.base-script, script] - rspec_db_library_code -rspec fast_spec_helper: +# Dedicated job to test DB library code against PG13. +# Note that these are already tested against PG13 in the `rspec unit pg13` / `rspec-ee unit pg13` jobs. +rspec db-library-code pg13: extends: - .rspec-base-pg13 + - .rails:rules:ee-and-foss-db-library-code + script: + - !reference [.base-script, script] + - rspec_db_library_code + +rspec fast_spec_helper: + extends: + - .rspec-base-pg14 - .rails:rules:ee-and-foss-fast_spec_helper script: - fast_spec_helper_specs=$(git grep -l -E '^require.*fast_spec_helper') @@ -253,16 +263,16 @@ 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 pg13 - - rspec background_migration pg13 - - rspec unit pg13 - - rspec integration pg13 - - rspec system pg13 - - rspec-ee migration pg13 - - rspec-ee background_migration pg13 - - rspec-ee unit pg13 - - rspec-ee integration pg13 - - rspec-ee system pg13 + - rspec migration pg14 + - rspec background_migration pg14 + - rspec unit pg14 + - rspec integration pg14 + - rspec system pg14 + - rspec-ee migration pg14 + - rspec-ee background_migration pg14 + - rspec-ee unit pg14 + - rspec-ee integration pg14 + - rspec-ee system pg14 variables: SETUP_DB: "false" script: @@ -285,29 +295,29 @@ rspec:coverage: dependencies: - setup-test-env # FOSS/EE jobs - - rspec migration pg13 - - rspec background_migration pg13 - - rspec unit pg13 - - rspec unit pg13 single-redis - - rspec integration pg13 - - rspec integration pg13 single-redis - - rspec system pg13 - - rspec system pg13 single-redis + - rspec migration pg14 + - rspec background_migration pg14 + - rspec unit pg14 + - rspec unit pg14 single-redis + - rspec integration pg14 + - rspec integration pg14 single-redis + - rspec system pg14 + - rspec system pg14 single-redis # as-if-foss jobs - - rspec migration pg13-as-if-foss - - rspec background_migration pg13-as-if-foss - - rspec unit pg13-as-if-foss - - rspec integration pg13-as-if-foss - - rspec system pg13-as-if-foss + - rspec migration pg14-as-if-foss + - rspec background_migration pg14-as-if-foss + - rspec unit pg14-as-if-foss + - rspec integration pg14-as-if-foss + - rspec system pg14-as-if-foss # EE jobs - - rspec-ee migration pg13 - - rspec-ee background_migration pg13 - - rspec-ee unit pg13 - - rspec-ee unit pg13 single-redis - - rspec-ee integration pg13 - - rspec-ee integration pg13 single-redis - - rspec-ee system pg13 - - rspec-ee system pg13 single-redis + - rspec-ee migration pg14 + - rspec-ee background_migration pg14 + - rspec-ee unit pg14 + - rspec-ee unit pg14 single-redis + - rspec-ee integration pg14 + - rspec-ee integration pg14 single-redis + - rspec-ee system pg14 + - rspec-ee system pg14 single-redis # Memory jobs - memory-on-boot script: @@ -437,232 +447,232 @@ rspec-ee:predictive:trigger: - artifact: "${RSPEC_PREDICTIVE_PIPELINE_TEMPLATE_YML}-ee.yml" job: rspec-predictive:pipeline-generate -rspec migration pg13-as-if-foss: +rspec migration pg14-as-if-foss: extends: - - .rspec-base-pg13-as-if-foss + - .rspec-base-pg14-as-if-foss - .rspec-base-migration - .rails:rules:as-if-foss-migration - .rspec-migration-parallel -rspec background_migration pg13-as-if-foss: +rspec background_migration pg14-as-if-foss: extends: - - .rspec-base-pg13-as-if-foss + - .rspec-base-pg14-as-if-foss - .rspec-base-migration - .rails:rules:as-if-foss-background-migration - .rspec-background-migration-parallel -rspec migration pg13-as-if-foss single-db: +rspec migration pg14-as-if-foss single-db: extends: - - rspec migration pg13-as-if-foss + - rspec migration pg14-as-if-foss - .single-db-rspec - .rails:rules:single-db -rspec background_migration pg13-as-if-foss single-db: +rspec background_migration pg14-as-if-foss single-db: extends: - - rspec background_migration pg13-as-if-foss + - rspec background_migration pg14-as-if-foss - .single-db-rspec - .rails:rules:single-db -rspec migration pg13-as-if-foss single-db-ci-connection: +rspec migration pg14-as-if-foss single-db-ci-connection: extends: - - rspec migration pg13-as-if-foss + - rspec migration pg14-as-if-foss - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec background_migration pg13-as-if-foss single-db-ci-connection: +rspec background_migration pg14-as-if-foss single-db-ci-connection: extends: - - rspec background_migration pg13-as-if-foss + - rspec background_migration pg14-as-if-foss - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec unit pg13-as-if-foss: +rspec unit pg14-as-if-foss: extends: - - .rspec-base-pg13-as-if-foss + - .rspec-base-pg14-as-if-foss - .rails:rules:as-if-foss-unit - .rspec-unit-parallel -rspec unit pg13-as-if-foss single-db: +rspec unit pg14-as-if-foss single-db: extends: - - rspec unit pg13-as-if-foss + - rspec unit pg14-as-if-foss - .single-db-rspec - .rails:rules:single-db -rspec unit pg13-as-if-foss single-db-ci-connection: +rspec unit pg14-as-if-foss single-db-ci-connection: extends: - - rspec unit pg13-as-if-foss + - rspec unit pg14-as-if-foss - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec integration pg13-as-if-foss: +rspec integration pg14-as-if-foss: extends: - - .rspec-base-pg13-as-if-foss + - .rspec-base-pg14-as-if-foss - .rails:rules:as-if-foss-integration - .rspec-integration-parallel -rspec integration pg13-as-if-foss single-db: +rspec integration pg14-as-if-foss single-db: extends: - - rspec integration pg13-as-if-foss + - rspec integration pg14-as-if-foss - .single-db-rspec - .rails:rules:single-db -rspec integration pg13-as-if-foss single-db-ci-connection: +rspec integration pg14-as-if-foss single-db-ci-connection: extends: - - rspec integration pg13-as-if-foss + - rspec integration pg14-as-if-foss - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec system pg13-as-if-foss: +rspec system pg14-as-if-foss: extends: - - .rspec-base-pg13-as-if-foss + - .rspec-base-pg14-as-if-foss - .rails:rules:as-if-foss-system - .rspec-system-parallel -rspec system pg13-as-if-foss single-db: +rspec system pg14-as-if-foss single-db: extends: - - rspec system pg13-as-if-foss + - rspec system pg14-as-if-foss - .single-db-rspec - .rails:rules:single-db -rspec system pg13-as-if-foss single-db-ci-connection: +rspec system pg14-as-if-foss single-db-ci-connection: extends: - - rspec system pg13-as-if-foss + - rspec system pg14-as-if-foss - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec-ee migration pg13: +rspec-ee migration pg14: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rspec-base-migration - .rails:rules:ee-only-migration - .rspec-ee-migration-parallel -rspec-ee background_migration pg13: +rspec-ee background_migration pg14: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rspec-base-migration - .rails:rules:ee-only-background-migration - .rspec-ee-background-migration-parallel -rspec-ee migration pg13 single-db: +rspec-ee migration pg14 single-db: extends: - - rspec-ee migration pg13 + - rspec-ee migration pg14 - .single-db-rspec - .rails:rules:single-db -rspec-ee background_migration pg13 single-db: +rspec-ee background_migration pg14 single-db: extends: - - rspec-ee background_migration pg13 + - rspec-ee background_migration pg14 - .single-db-rspec - .rails:rules:single-db -rspec-ee migration pg13 single-db-ci-connection: +rspec-ee migration pg14 single-db-ci-connection: extends: - - rspec-ee migration pg13 + - rspec-ee migration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec-ee background_migration pg13 single-db-ci-connection: +rspec-ee background_migration pg14 single-db-ci-connection: extends: - - rspec-ee background_migration pg13 + - rspec-ee background_migration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec-ee migration pg13 praefect: +rspec-ee migration pg14 praefect: extends: - - rspec migration pg13 + - rspec migration pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec-ee background_migration pg13 praefect: +rspec-ee background_migration pg14 praefect: extends: - - rspec background_migration pg13 + - rspec background_migration pg14 - .praefect-with-db - .rails:rules:praefect-with-db -rspec-ee unit pg13: +rspec-ee unit pg14: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rails:rules:ee-only-unit - .rspec-ee-unit-parallel -rspec-ee unit pg13 es8: +rspec-ee unit pg14 es8: extends: - - .rspec-ee-base-pg13-es8 + - .rspec-ee-base-pg14-es8 - .rspec-ee-unit-parallel -rspec-ee unit pg13 single-db: +rspec-ee unit pg14 single-db: extends: - - rspec-ee unit pg13 + - rspec-ee unit pg14 - .single-db-rspec - .rails:rules:single-db -rspec-ee unit pg13 single-redis: +rspec-ee unit pg14 single-redis: extends: - - rspec-ee unit pg13 + - rspec-ee unit pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec-ee unit pg13 single-db-ci-connection: +rspec-ee unit pg14 single-db-ci-connection: extends: - - rspec-ee unit pg13 + - rspec-ee unit pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec-ee integration pg13: +rspec-ee integration pg14: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rails:rules:ee-only-integration - .rspec-ee-integration-parallel -rspec-ee integration pg13 es8: +rspec-ee integration pg14 es8: extends: - - .rspec-ee-base-pg13-es8 + - .rspec-ee-base-pg14-es8 - .rspec-ee-integration-parallel -rspec-ee integration pg13 single-db: +rspec-ee integration pg14 single-db: extends: - - rspec-ee integration pg13 + - rspec-ee integration pg14 - .single-db-rspec - .rails:rules:single-db -rspec-ee integration pg13 single-redis: +rspec-ee integration pg14 single-redis: extends: - - rspec-ee integration pg13 + - rspec-ee integration pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec-ee integration pg13 single-db-ci-connection: +rspec-ee integration pg14 single-db-ci-connection: extends: - - rspec-ee integration pg13 + - rspec-ee integration pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection -rspec-ee system pg13: +rspec-ee system pg14: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rails:rules:ee-only-system - .rspec-ee-system-parallel -rspec-ee system pg13 es8: +rspec-ee system pg14 es8: extends: - - .rspec-ee-base-pg13-es8 + - .rspec-ee-base-pg14-es8 - .rspec-ee-system-parallel -rspec-ee system pg13 single-db: +rspec-ee system pg14 single-db: extends: - - rspec-ee system pg13 + - rspec-ee system pg14 - .single-db-rspec - .rails:rules:single-db -rspec-ee system pg13 single-redis: +rspec-ee system pg14 single-redis: extends: - - rspec-ee system pg13 + - rspec-ee system pg14 - .no-redis-cluster - .rails:rules:single-redis -rspec-ee system pg13 single-db-ci-connection: +rspec-ee system pg14 single-db-ci-connection: extends: - - rspec-ee system pg13 + - rspec-ee system pg14 - .single-db-ci-connection-rspec - .rails:rules:single-db-ci-connection # EE: default refs (MRs, default branch, schedules) jobs # @@ -704,36 +714,69 @@ rspec system pg12: - .rails:rules:rspec-on-pg12 - .rspec-system-parallel -# PG14 -rspec migration pg14: +# PG13 +rspec migration pg13: extends: - - .rspec-base-pg14 + - .rspec-base-pg13 + - .rspec-base-migration + - .rails:rules:rspec-on-pg13 + - .rspec-migration-parallel + +rspec background_migration pg13: + extends: + - .rspec-base-pg13 + - .rspec-base-migration + - .rails:rules:rspec-on-pg13 + - .rspec-background-migration-parallel + +rspec unit pg13: + extends: + - .rspec-base-pg13 + - .rails:rules:rspec-on-pg13 + - .rspec-unit-parallel + +rspec integration pg13: + extends: + - .rspec-base-pg13 + - .rails:rules:rspec-on-pg13 + - .rspec-integration-parallel + +rspec system pg13: + extends: + - .rspec-base-pg13 + - .rails:rules:rspec-on-pg13 + - .rspec-system-parallel + +# PG15 +rspec migration pg15: + extends: + - .rspec-base-pg15 - .rspec-base-migration - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-migration-parallel -rspec background_migration pg14: +rspec background_migration pg15: extends: - - .rspec-base-pg14 + - .rspec-base-pg15 - .rspec-base-migration - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-background-migration-parallel -rspec unit pg14: +rspec unit pg15: extends: - - .rspec-base-pg14 + - .rspec-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-unit-parallel -rspec integration pg14: +rspec integration pg15: extends: - - .rspec-base-pg14 + - .rspec-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-integration-parallel -rspec system pg14: +rspec system pg15: extends: - - .rspec-base-pg14 + - .rspec-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-system-parallel # EE/FOSS: default branch nightly scheduled jobs # @@ -843,51 +886,88 @@ rspec-ee system pg14 opensearch2: - .rspec-ee-system-parallel - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only -rspec-ee migration pg14: +# PG15 +rspec-ee unit pg15 opensearch1: extends: - - .rspec-ee-base-pg14 + - .rspec-ee-base-pg15-opensearch1 + - .rspec-ee-unit-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee unit pg15 opensearch2: + extends: + - .rspec-ee-base-pg15-opensearch2 + - .rspec-ee-unit-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee integration pg15 opensearch1: + extends: + - .rspec-ee-base-pg15-opensearch1 + - .rspec-ee-integration-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee integration pg15 opensearch2: + extends: + - .rspec-ee-base-pg15-opensearch2 + - .rspec-ee-integration-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee system pg15 opensearch1: + extends: + - .rspec-ee-base-pg15-opensearch1 + - .rspec-ee-system-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee system pg15 opensearch2: + extends: + - .rspec-ee-base-pg15-opensearch2 + - .rspec-ee-system-parallel + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + +rspec-ee migration pg15: + extends: + - .rspec-ee-base-pg15 - .rspec-base-migration - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-migration-parallel -rspec-ee background_migration pg14: +rspec-ee background_migration pg15: extends: - - .rspec-ee-base-pg14 + - .rspec-ee-base-pg15 - .rspec-base-migration - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-background-migration-parallel -rspec-ee unit pg14: +rspec-ee unit pg15: extends: - - .rspec-ee-base-pg14 + - .rspec-ee-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-unit-parallel -rspec-ee unit pg14 es8: +rspec-ee unit pg15 es8: extends: - - .rspec-ee-base-pg14-es8 + - .rspec-ee-base-pg15-es8 - .rspec-ee-unit-parallel -rspec-ee integration pg14: +rspec-ee integration pg15: extends: - - .rspec-ee-base-pg14 + - .rspec-ee-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-integration-parallel -rspec-ee integration pg14 es8: +rspec-ee integration pg15 es8: extends: - - .rspec-ee-base-pg14-es8 + - .rspec-ee-base-pg15-es8 - .rspec-ee-integration-parallel -rspec-ee system pg14: +rspec-ee system pg15: extends: - - .rspec-ee-base-pg14 + - .rspec-ee-base-pg15 - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-system-parallel -rspec-ee system pg14 es8: +rspec-ee system pg15 es8: extends: - - .rspec-ee-base-pg14-es8 + - .rspec-ee-base-pg15-es8 - .rspec-ee-system-parallel # EE: default branch nightly scheduled jobs # ##################################### @@ -905,14 +985,14 @@ rspec-ee system pg14 es8: rspec fail-fast: extends: - - .rspec-base-pg13 - - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-base-pg13 + - .rspec-base-pg14 + - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-base-pg14 variables: MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_FOSS_PATH}" rspec-ee fail-fast: extends: - - .rspec-ee-base-pg13 + - .rspec-ee-base-pg14 - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-ee-base-pg13 variables: MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_EE_PATH}" @@ -969,7 +1049,7 @@ fail-pipeline-early: script: - fail_pipeline_early -.base-rspec-pg13-rerun-previous-failed-tests: +.base-rspec-pg14-rerun-previous-failed-tests: extends: - .rails:rules:rerun-previous-failed-tests stage: test @@ -978,17 +1058,17 @@ fail-pipeline-early: - !reference [.base-script, script] - rspec_rerun_previous_failed_tests "${PREVIOUS_FAILED_TESTS_FILE}" -rspec rspec-pg13-rerun-previous-failed-tests: +rspec rspec-pg14-rerun-previous-failed-tests: extends: - - .rspec-base-pg13 - - .base-rspec-pg13-rerun-previous-failed-tests + - .rspec-base-pg14 + - .base-rspec-pg14-rerun-previous-failed-tests variables: PREVIOUS_FAILED_TESTS_FILE: tmp/previous_failed_tests/rspec_failed_tests.txt -rspec rspec-ee-pg13-rerun-previous-failed-tests: +rspec rspec-ee-pg14-rerun-previous-failed-tests: extends: - - .rspec-ee-base-pg13 - - .base-rspec-pg13-rerun-previous-failed-tests + - .rspec-ee-base-pg14 + - .base-rspec-pg14-rerun-previous-failed-tests variables: PREVIOUS_FAILED_TESTS_FILE: tmp/previous_failed_tests/rspec_ee_failed_files.txt # EE: Canonical MR pipelines diff --git a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb index 84aa67de4c9e6a..dc469c302070f9 100644 --- a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb +++ b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb @@ -22,7 +22,7 @@ dont-interrupt-me: - echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible." .base-rspec-foss-impact: - extends: .rspec-base-pg13-as-if-foss + extends: .rspec-base-pg14-as-if-foss needs: - pipeline: $PARENT_PIPELINE_ID job: detect-tests diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml index 618c4e3b654c68..c0ea7d7078a8d5 100644 --- a/.gitlab/ci/rails/shared.gitlab-ci.yml +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -109,11 +109,16 @@ include: - .rspec-base - .use-pg13 -.rspec-base-pg13-as-if-foss: +.rspec-base-pg14: + extends: + - .rspec-base + - .use-pg14 + +.rspec-base-pg14-as-if-foss: extends: - .rspec-base - .as-if-foss - - .use-pg13 + - .use-pg14 needs: - job: "setup-test-env" - job: "retrieve-tests-metadata" @@ -121,10 +126,10 @@ include: - job: "detect-tests" optional: true -.rspec-base-pg14: +.rspec-base-pg15: extends: - .rspec-base - - .use-pg14 + - .use-pg15 .rspec-ee-base-pg12: extends: @@ -177,11 +182,34 @@ include: - .use-pg14-opensearch2-ee - .rails:rules:run-search-tests +.rspec-ee-base-pg15: + extends: + - .rspec-base + - .use-pg15-es7-ee + +.rspec-ee-base-pg15-es8: + extends: + - .rspec-base + - .use-pg15-es8-ee + - .rails:rules:run-search-tests + +.rspec-ee-base-pg15-opensearch1: + extends: + - .rspec-base + - .use-pg15-opensearch1-ee + - .rails:rules:run-search-tests + +.rspec-ee-base-pg15-opensearch2: + extends: + - .rspec-base + - .use-pg15-opensearch2-ee + - .rails:rules:run-search-tests + .db-job-base: extends: - .rails-job-base - .rails:rules:ee-and-foss-migration - - .use-pg13 + - .use-pg14 stage: test needs: ["setup-test-env"] # rspec job base specs diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index f57662acac9b91..c14d76009d8bf0 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -83,6 +83,9 @@ .if-merge-request-labels-run-on-pg12: &if-merge-request-labels-run-on-pg12 if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg12/' +.if-merge-request-labels-run-on-pg13: &if-merge-request-labels-run-on-pg13 + if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg13/' + .if-merge-request-labels-skip-undercoverage: &if-merge-request-labels-skip-undercoverage if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/' @@ -1899,6 +1902,7 @@ changes: *db-library-patterns - <<: *if-merge-request-labels-run-all-rspec - <<: *if-merge-request-labels-run-on-pg12 + - <<: *if-merge-request-labels-run-on-pg13 .rails:rules:ee-mr-and-default-branch-only: rules: @@ -2003,6 +2007,11 @@ - <<: *if-merge-request-labels-run-on-pg12 - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules] +.rails:rules:rspec-on-pg13: + rules: + - <<: *if-merge-request-labels-run-on-pg13 + - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules] + .rails:rules:default-branch-schedule-nightly--code-backstage-default-rules: rules: - <<: *if-merge-request-labels-pipeline-expedite diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index bacd7efce3e9d3..7b7eee6c55b6b9 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -83,7 +83,7 @@ verify-approvals: generate-frontend-fixtures-mapping: extends: - .setup:rules:generate-frontend-fixtures-mapping - - .use-pg13 + - .use-pg14 - .ruby-cache needs: ["setup-test-env"] stage: prepare diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml index b9c9200d78b3a9..3d030026e90a0c 100644 --- a/.gitlab/ci/static-analysis.gitlab-ci.yml +++ b/.gitlab/ci/static-analysis.gitlab-ci.yml @@ -45,7 +45,7 @@ static-verification-with-database: - .static-analysis-base - .rubocop-job-cache - .static-analysis:rules:static-verification-with-database - - .use-pg13 + - .use-pg14 script: - bundle exec rake lint:static_verification_with_database variables: diff --git a/.gitlab/ci/test-metadata.gitlab-ci.yml b/.gitlab/ci/test-metadata.gitlab-ci.yml index 41fd0b49173fcb..3f06fcbce40b7e 100644 --- a/.gitlab/ci/test-metadata.gitlab-ci.yml +++ b/.gitlab/ci/test-metadata.gitlab-ci.yml @@ -32,17 +32,17 @@ update-tests-metadata: - retrieve-tests-metadata - generate-frontend-fixtures-mapping - setup-test-env - - rspec migration pg13 + - rspec migration pg14 - rspec-all frontend_fixture - - rspec unit pg13 - - rspec integration pg13 - - rspec system pg13 - - rspec background_migration pg13 - - rspec-ee migration pg13 - - rspec-ee unit pg13 - - rspec-ee integration pg13 - - rspec-ee system pg13 - - rspec-ee background_migration pg13 + - rspec unit pg14 + - rspec integration pg14 + - rspec system pg14 + - rspec background_migration pg14 + - rspec-ee migration pg14 + - rspec-ee unit pg14 + - rspec-ee integration pg14 + - rspec-ee system pg14 + - rspec-ee background_migration pg14 script: - run_timed_command "retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document" - source ./scripts/rspec_helpers.sh diff --git a/doc/development/pipelines/index.md b/doc/development/pipelines/index.md index 383bc338dc5c15..80ce967187d599 100644 --- a/doc/development/pipelines/index.md +++ b/doc/development/pipelines/index.md @@ -186,8 +186,8 @@ This number can be overridden by setting a CI/CD variable named `RSPEC_FAIL_FAST ## Re-run previously failed tests in merge request pipelines -In order to reduce the feedback time after resolving failed tests for a merge request, the `rspec rspec-pg13-rerun-previous-failed-tests` -and `rspec rspec-ee-pg13-rerun-previous-failed-tests` jobs run the failed tests from the previous MR pipeline. +In order to reduce the feedback time after resolving failed tests for a merge request, the `rspec rspec-pg14-rerun-previous-failed-tests` +and `rspec rspec-ee-pg14-rerun-previous-failed-tests` jobs run the failed tests from the previous MR pipeline. This was introduced on August 25th 2021, with . @@ -195,7 +195,7 @@ This was introduced on August 25th 2021, with B & C @@ -625,22 +625,22 @@ This should let us: ### PostgreSQL versions testing -Our test suite runs against PG13 as GitLab.com runs on PG13 and -[Omnibus defaults to PG13 for new installs and upgrades](../../administration/package_information/postgresql_versions.md). +Our test suite runs against PG14 as GitLab.com runs on PG14 and +[Omnibus defaults to PG14 for new installs and upgrades](../../administration/package_information/postgresql_versions.md). -We do run our test suite against PG13 on nightly scheduled pipelines. +We do run our test suite against PG14 on nightly scheduled pipelines. -We also run our test suite against PG13 upon specific database library changes in MRs and `main` pipelines (with the `rspec db-library-code pg13` job). +We also run our test suite against PG12 and PG13 upon specific database library changes in MRs and `main` pipelines (with the `rspec db-library-code pg12` and `rspec db-library-code pg13` jobs). #### Current versions testing | Where? | PostgreSQL version | Ruby version | |------------------------------------------------------------------------------------------------|-------------------------------------------------|-----------------------| -| Merge requests | 13 (default version), 12 for DB library changes | 3.0 (default version) | -| `master` branch commits | 13 (default version), 12 for DB library changes | 3.0 (default version) | -| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour) | 13 (default version), 12 for DB library changes | 3.0 (default version) | -| `maintenance` scheduled pipelines for the `ruby2` branch (every odd-numbered hour), see below. | 13 (default version), 12 for DB library changes | 2.7 | -| `nightly` scheduled pipelines for the `master` branch | 13 (default version), 12, 14 | 3.0 (default version) | +| Merge requests | 14 (default version), 13 for DB library changes | 3.0 (default version) | +| `master` branch commits | 14 (default version), 13 for DB library changes | 3.0 (default version) | +| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour) | 14 (default version), 13 for DB library changes | 3.0 (default version) | +| `maintenance` scheduled pipelines for the `ruby2` branch (every odd-numbered hour), see below. | 14 (default version), 13 for DB library changes | 2.7 | +| `nightly` scheduled pipelines for the `master` branch | 14 (default version), 12, 13, 15 | 3.0 (default version) | There are 2 pipeline schedules used for testing Ruby 2.7. One is triggering a pipeline in `ruby2-sync` branch, which updates the `ruby2` branch with latest diff --git a/doc/development/pipelines/internals.md b/doc/development/pipelines/internals.md index 4cdaf50641e2f0..af151360a96cd5 100644 --- a/doc/development/pipelines/internals.md +++ b/doc/development/pipelines/internals.md @@ -139,7 +139,9 @@ that are scoped to a single [configuration keyword](../../ci/yaml/index.md#job-k | `.use-pg13` | Allows a job to use the `postgres` 13, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | | `.use-pg13-ee` | Same as `.use-pg13` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | | `.use-pg14` | Allows a job to use the `postgres` 14, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | -| `.use-pg14-ee` | Same as `.use-pg14` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | +| `.use-pg14-ee` | Same as `.use-pg15` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | +| `.use-pg15` | Allows a job to use the `postgres` 15, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | +| `.use-pg15-ee` | Same as `.use-pg15` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | | `.use-kaniko` | Allows a job to use the `kaniko` tool to build Docker images. | | `.as-if-foss` | Simulate the FOSS project by setting the `FOSS_ONLY='1'` CI/CD variable. | | `.use-docker-in-docker` | Allows a job to use Docker in Docker. | diff --git a/scripts/failed_tests.rb b/scripts/failed_tests.rb index 0ba454894b77c0..f828155f6f00fc 100755 --- a/scripts/failed_tests.rb +++ b/scripts/failed_tests.rb @@ -12,8 +12,8 @@ class FailedTests previous_tests_report_path: 'test_results/previous/test_reports.json', output_directory: 'tmp/previous_failed_tests/', format: :oneline, - rspec_pg_regex: /rspec .+ pg13( .+)?/, - rspec_ee_pg_regex: /rspec-ee .+ pg13( .+)?/ + rspec_pg_regex: /rspec .+ pg14( .+)?/, + rspec_ee_pg_regex: /rspec-ee .+ pg14( .+)?/ }.freeze def initialize(options) -- GitLab From ce8e614e457f2683c1beeedf3bf260e06d718dbb Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Wed, 3 May 2023 10:29:31 -0300 Subject: [PATCH 02/10] Update PG version in specs --- spec/fixtures/scripts/test_report.json | 2 +- spec/scripts/failed_tests_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/fixtures/scripts/test_report.json b/spec/fixtures/scripts/test_report.json index 520ab3a8578534..820c45c6c5a976 100644 --- a/spec/fixtures/scripts/test_report.json +++ b/spec/fixtures/scripts/test_report.json @@ -1,7 +1,7 @@ { "suites": [ { - "name": "rspec unit pg13", + "name": "rspec unit pg14", "total_time": 975.6635620000018, "total_count": 3811, "success_count": 3800, diff --git a/spec/scripts/failed_tests_spec.rb b/spec/scripts/failed_tests_spec.rb index c9fe6eecd11136..c379d3448a6cd8 100644 --- a/spec/scripts/failed_tests_spec.rb +++ b/spec/scripts/failed_tests_spec.rb @@ -13,7 +13,7 @@ 'suites' => [ { 'failed_count' => 1, - 'name' => 'rspec unit pg13 10/12', + 'name' => 'rspec unit pg14 10/12', 'test_cases' => [ { 'status' => 'failed', @@ -23,7 +23,7 @@ }, { 'failed_count' => 1, - 'name' => 'rspec-ee unit pg13', + 'name' => 'rspec-ee unit pg14', 'test_cases' => [ { 'status' => 'failed', @@ -33,7 +33,7 @@ }, { 'failed_count' => 1, - 'name' => 'rspec unit pg14 10/12', + 'name' => 'rspec unit pg15 10/12', 'test_cases' => [ { 'status' => 'failed', -- GitLab From e5d972ebfd571f1776a9adffe7a20f181353b0ce Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Wed, 3 May 2023 21:42:17 -0300 Subject: [PATCH 03/10] Adds a logger to check failing migrations in pipelines --- spec/support/db_cleaner.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index b9a99eff41359c..85f2372d65d2bb 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -9,6 +9,10 @@ def delete_from_all_tables!(except: []) except << 'ar_internal_metadata' DatabaseCleaner.clean_with(:deletion, cache_tables: false, except: except) + rescue StandardError => e + Logger.new($stdout).error("========== ERROR TRYING TO EXECUTE '#{e.sql}' ==========") + + raise end def deletion_except_tables -- GitLab From 1608e269c2cd836f09857af0adca0a5c328d15e9 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Thu, 4 May 2023 10:02:38 -0300 Subject: [PATCH 04/10] It moves PG13 to nightly jobs Includes rules to run PG13 integration on nightly jobs Changelog: changed --- .gitlab/ci/rails.gitlab-ci.yml | 10 +++++----- .gitlab/ci/rules.gitlab-ci.yml | 9 --------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index abe1d5f30bf579..f465be5cff3c81 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -719,32 +719,32 @@ rspec migration pg13: extends: - .rspec-base-pg13 - .rspec-base-migration - - .rails:rules:rspec-on-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:rspec-on-pg13 + - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-background-migration-parallel rspec unit pg13: extends: - .rspec-base-pg13 - - .rails:rules:rspec-on-pg13 + - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-unit-parallel rspec integration pg13: extends: - .rspec-base-pg13 - - .rails:rules:rspec-on-pg13 + - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-integration-parallel rspec system pg13: extends: - .rspec-base-pg13 - - .rails:rules:rspec-on-pg13 + - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-system-parallel # PG15 diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index c14d76009d8bf0..f57662acac9b91 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -83,9 +83,6 @@ .if-merge-request-labels-run-on-pg12: &if-merge-request-labels-run-on-pg12 if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg12/' -.if-merge-request-labels-run-on-pg13: &if-merge-request-labels-run-on-pg13 - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg13/' - .if-merge-request-labels-skip-undercoverage: &if-merge-request-labels-skip-undercoverage if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/' @@ -1902,7 +1899,6 @@ changes: *db-library-patterns - <<: *if-merge-request-labels-run-all-rspec - <<: *if-merge-request-labels-run-on-pg12 - - <<: *if-merge-request-labels-run-on-pg13 .rails:rules:ee-mr-and-default-branch-only: rules: @@ -2007,11 +2003,6 @@ - <<: *if-merge-request-labels-run-on-pg12 - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules] -.rails:rules:rspec-on-pg13: - rules: - - <<: *if-merge-request-labels-run-on-pg13 - - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules] - .rails:rules:default-branch-schedule-nightly--code-backstage-default-rules: rules: - <<: *if-merge-request-labels-pipeline-expedite -- GitLab From 266347e199a2067a7a9f9aaeef6b4e11f0d2544a Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Thu, 4 May 2023 14:32:04 -0300 Subject: [PATCH 05/10] Fixes issues when cleaning up tables If table fails to be cleaned, ensures that the DB is re-created instead Changelog: changed --- spec/support/db_cleaner.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index 85f2372d65d2bb..d4dcc9b0034e74 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -9,10 +9,8 @@ def delete_from_all_tables!(except: []) except << 'ar_internal_metadata' DatabaseCleaner.clean_with(:deletion, cache_tables: false, except: except) - rescue StandardError => e - Logger.new($stdout).error("========== ERROR TRYING TO EXECUTE '#{e.sql}' ==========") - - raise + rescue ActiveRecord::InvalidForeignKey, ActiveRecord::NotNullViolation + recreate_and_seed! end def deletion_except_tables @@ -87,10 +85,7 @@ def recreate_databases_and_seed_if_needed # We drop and recreate the database if any table has more than 1200 columns, just to be safe. return false unless any_connection_class_with_more_than_allowed_columns? - recreate_all_databases! - - # Seed required data as recreating DBs will delete it - TestEnv.seed_db + recreate_and_seed! true end @@ -109,6 +104,13 @@ def force_disconnect_all_connections! ActiveRecord::Base.clear_all_connections! # rubocop:disable Database/MultipleDatabases end + + def recreate_and_seed! + recreate_all_databases! + + # Seed required data as recreating DBs will delete it + TestEnv.seed_db + end end DbCleaner.prepend_mod_with('DbCleaner') -- GitLab From 1c5d33cb9f1f05a6bab57b98550b5e8a6fca7d45 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Thu, 4 May 2023 15:07:24 -0300 Subject: [PATCH 06/10] Undo db_cleaner changes and update PG15 base image --- .gitlab/ci/global.gitlab-ci.yml | 3 +-- spec/support/db_cleaner.rb | 14 ++++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 0b034179263a58..4e74d7c39e7eb9 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -251,9 +251,8 @@ .use-pg15: services: - - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 + - name: postgres:15 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] - alias: postgres - name: redis:6.2-alpine variables: POSTGRES_HOST_AUTH_METHOD: trust diff --git a/spec/support/db_cleaner.rb b/spec/support/db_cleaner.rb index d4dcc9b0034e74..b9a99eff41359c 100644 --- a/spec/support/db_cleaner.rb +++ b/spec/support/db_cleaner.rb @@ -9,8 +9,6 @@ def delete_from_all_tables!(except: []) except << 'ar_internal_metadata' DatabaseCleaner.clean_with(:deletion, cache_tables: false, except: except) - rescue ActiveRecord::InvalidForeignKey, ActiveRecord::NotNullViolation - recreate_and_seed! end def deletion_except_tables @@ -85,7 +83,10 @@ def recreate_databases_and_seed_if_needed # We drop and recreate the database if any table has more than 1200 columns, just to be safe. return false unless any_connection_class_with_more_than_allowed_columns? - recreate_and_seed! + recreate_all_databases! + + # Seed required data as recreating DBs will delete it + TestEnv.seed_db true end @@ -104,13 +105,6 @@ def force_disconnect_all_connections! ActiveRecord::Base.clear_all_connections! # rubocop:disable Database/MultipleDatabases end - - def recreate_and_seed! - recreate_all_databases! - - # Seed required data as recreating DBs will delete it - TestEnv.seed_db - end end DbCleaner.prepend_mod_with('DbCleaner') -- GitLab From 174e3cda092bd027fb3d22aac1acdd98637d6eba Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Thu, 4 May 2023 15:38:54 -0300 Subject: [PATCH 07/10] Uses an new image of PG15 (with PG Vector) --- .gitlab/ci/global.gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 4e74d7c39e7eb9..0b034179263a58 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -251,8 +251,9 @@ .use-pg15: services: - - name: postgres:15 + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + alias: postgres - name: redis:6.2-alpine variables: POSTGRES_HOST_AUTH_METHOD: trust -- GitLab From 8409dcf7adcb57cd4b132a70c67fdb940565ed06 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Fri, 19 May 2023 12:52:12 -0300 Subject: [PATCH 08/10] Add small changes to pipeline docs --- doc/development/pipelines/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/development/pipelines/index.md b/doc/development/pipelines/index.md index 80ce967187d599..7c9340b55714aa 100644 --- a/doc/development/pipelines/index.md +++ b/doc/development/pipelines/index.md @@ -625,12 +625,12 @@ This should let us: ### PostgreSQL versions testing -Our test suite runs against PG14 as GitLab.com runs on PG14 and +Our test suite runs against PostgreSQL 14 as GitLab.com runs on PostgreSQL 14 and [Omnibus defaults to PG14 for new installs and upgrades](../../administration/package_information/postgresql_versions.md). -We do run our test suite against PG14 on nightly scheduled pipelines. +We do run our test suite against PostgreSQL 14 on nightly scheduled pipelines. -We also run our test suite against PG12 and PG13 upon specific database library changes in MRs and `main` pipelines (with the `rspec db-library-code pg12` and `rspec db-library-code pg13` jobs). +We also run our test suite against PostgreSQL 12 and PostgreSQL 13 upon specific database library changes in merge requests and `main` pipelines (with the `rspec db-library-code pg12` and `rspec db-library-code pg13` jobs). #### Current versions testing -- GitLab From 9a23df41f6bef4d976bcef78304a6167643e9676 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Fri, 2 Jun 2023 10:03:35 -0300 Subject: [PATCH 09/10] Add redis cluster dependency to PG 15 --- .gitlab/ci/global.gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 0b034179263a58..39eb005ac2deb8 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -254,6 +254,8 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] alias: postgres + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:redis-cluster-6.2.12 + alias: rediscluster # configure connections in config/redis.yml - name: redis:6.2-alpine variables: POSTGRES_HOST_AUTH_METHOD: trust @@ -318,6 +320,8 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] alias: postgres + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:redis-cluster-6.2.12 + alias: rediscluster # configure connections in config/redis.yml - name: redis:6.2-alpine - name: elasticsearch:7.17.6 command: ["elasticsearch", "-E", "discovery.type=single-node", "-E", "xpack.security.enabled=false"] @@ -372,6 +376,8 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] alias: postgres + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:redis-cluster-6.2.12 + alias: rediscluster # configure connections in config/redis.yml - name: redis:6.0-alpine - name: elasticsearch:8.6.2 - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0 @@ -465,6 +471,8 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] alias: postgres + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:redis-cluster-6.2.12 + alias: rediscluster # configure connections in config/redis.yml - name: redis:6.0-alpine - name: opensearchproject/opensearch:1.3.5 alias: elasticsearch @@ -482,6 +490,8 @@ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:postgres-15-pgvector-0.4.1 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] alias: postgres + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:redis-cluster-6.2.12 + alias: rediscluster # configure connections in config/redis.yml - name: redis:6.0-alpine - name: opensearchproject/opensearch:2.2.1 alias: elasticsearch -- GitLab From dd42cd458397f4ff23fb1fa3e268757c90bf6428 Mon Sep 17 00:00:00 2001 From: Leonardo Rosa Date: Mon, 5 Jun 2023 15:13:42 -0300 Subject: [PATCH 10/10] Fix PG14 description --- doc/development/pipelines/internals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/development/pipelines/internals.md b/doc/development/pipelines/internals.md index af151360a96cd5..35881db8c6d64b 100644 --- a/doc/development/pipelines/internals.md +++ b/doc/development/pipelines/internals.md @@ -139,7 +139,7 @@ that are scoped to a single [configuration keyword](../../ci/yaml/index.md#job-k | `.use-pg13` | Allows a job to use the `postgres` 13, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | | `.use-pg13-ee` | Same as `.use-pg13` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | | `.use-pg14` | Allows a job to use the `postgres` 14, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | -| `.use-pg14-ee` | Same as `.use-pg15` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | +| `.use-pg14-ee` | Same as `.use-pg14` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | | `.use-pg15` | Allows a job to use the `postgres` 15, `redis`, and `rediscluster` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). | | `.use-pg15-ee` | Same as `.use-pg15` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). | | `.use-kaniko` | Allows a job to use the `kaniko` tool to build Docker images. | -- GitLab