From 5667867f40e4e635d3e286a4db7bb64c47f43db3 Mon Sep 17 00:00:00 2001 From: Leonardo da Rosa <ldarosa@gitlab.com> Date: Tue, 4 Mar 2025 11:11:36 -0300 Subject: [PATCH] Add PG 17 to nightly rspec builds In preparation for adding support for PG 17, these tests ensures the basic level of compatibility for Postgres Note: PG17 integration jobs for opensearch and es8 were disabled for now, as they'll exceed the limits of jobs that a pipeline can have Changelog: changed --- .gitlab/ci/database.gitlab-ci.yml | 4 +- .gitlab/ci/global.gitlab-ci.yml | 53 ++++++++++++++---- .gitlab/ci/rails.gitlab-ci.yml | 68 ++++++++++++++++++++++++ .gitlab/ci/rails/shared.gitlab-ci.yml | 10 ++++ .gitlab/ci/static-analysis.gitlab-ci.yml | 2 +- doc/development/pipelines/_index.md | 18 ++++--- doc/development/pipelines/internals.md | 2 + 7 files changed, 136 insertions(+), 21 deletions(-) diff --git a/.gitlab/ci/database.gitlab-ci.yml b/.gitlab/ci/database.gitlab-ci.yml index 7806cc15b1837..30c5f346ccfb9 100644 --- a/.gitlab/ci/database.gitlab-ci.yml +++ b/.gitlab/ci/database.gitlab-ci.yml @@ -107,10 +107,10 @@ db:migrate:multi-version-upgrade: - bundle exec rake gitlab:db:configure # Validate minimum PG version supported by GitLab -db:migrate:multi-version-upgrade-pg13: +db:migrate:multi-version-upgrade-pg14: extends: - db:migrate:multi-version-upgrade - - .use-pg13 + - .use-pg14 db:migrate:reset: extends: .db-job-base diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 003f0d8de840e..bdf2fc12e3a14 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -360,16 +360,6 @@ - | mkdir -p /tmp && echo "${LITELLM_CONFIG_CONTENT}" > /tmp/config.yaml && litellm --config /tmp/config.yaml -.use-pg13: - extends: - - .pg-base-variables - services: - - !reference [.db-services, services] - variables: - PG_VERSION: "13" - REDIS_VERSION: "6.0" - REDIS_CLUSTER_VERSION: "6.0" - .use-pg14: extends: - .pg-base-variables @@ -400,6 +390,16 @@ REDIS_VERSION: "7.0" REDIS_CLUSTER_VERSION: "7.0.11" +.use-pg17: + extends: + - .pg-base-variables + services: + - !reference [.db-services-with-auto-explain, services] + variables: + PG_VERSION: "17" + REDIS_VERSION: "7.0" + REDIS_CLUSTER_VERSION: "7.0.11" + .es7-services: services: - !reference [.zoekt-services, services] @@ -434,6 +434,14 @@ - !reference [.db-services-with-auto-explain, services] - !reference [.es7-services, services] +.use-pg17-es7-ee: + extends: + - .use-pg17 + - .zoekt-variables + services: + - !reference [.db-services-with-auto-explain, services] + - !reference [.es7-services, services] + .es8-services: services: - !reference [.zoekt-services, services] @@ -473,6 +481,15 @@ - !reference [.db-services-with-auto-explain, services] - !reference [.es8-services, services] +.use-pg17-es8-ee: + extends: + - .use-pg17 + - .zoekt-variables + - .es8-variables + services: + - !reference [.db-services-with-auto-explain, services] + - !reference [.es8-services, services] + .os1-services: services: - !reference [.zoekt-services, services] @@ -504,6 +521,14 @@ - !reference [.db-services-with-auto-explain, services] - !reference [.os1-services, services] +.use-pg17-opensearch1-ee: + extends: + - .use-pg17 + - .zoekt-variables + services: + - !reference [.db-services-with-auto-explain, services] + - !reference [.os1-services, services] + .os2-services: services: - !reference [.zoekt-services, services] @@ -535,6 +560,14 @@ - !reference [.db-services-with-auto-explain, services] - !reference [.os2-services, services] +.use-pg17-opensearch2-ee: + extends: + - .use-pg17 + - .zoekt-variables + services: + - !reference [.db-services-with-auto-explain, services] + - !reference [.os2-services, services] + .use-pg14-clickhouse23: extends: .use-pg14 services: diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 7314decad00c6..0b56735a0c3e0 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -1017,6 +1017,39 @@ rspec system pg16: - .rspec-base-pg16 - .rails:rules:default-branch-schedule-nightly--code-backstage - .rspec-system-parallel + +# PG17 +rspec migration pg17: + extends: + - .rspec-base-pg17 + - .rspec-base-migration + - .rails:rules:default-branch-schedule-nightly--code-backstage + - .rspec-migration-parallel + +rspec background_migration pg17: + extends: + - .rspec-base-pg17 + - .rspec-base-migration + - .rails:rules:default-branch-schedule-nightly--code-backstage + - .rspec-background-migration-parallel + +rspec unit pg17: + extends: + - .rspec-base-pg17 + - .rails:rules:default-branch-schedule-nightly--code-backstage + - .rspec-unit-parallel + +rspec integration pg17: + extends: + - .rspec-base-pg16 + - .rails:rules:default-branch-schedule-nightly--code-backstage + - .rspec-integration-parallel + +rspec system pg17: + extends: + - .rspec-base-pg17 + - .rails:rules:default-branch-schedule-nightly--code-backstage + - .rspec-system-parallel # EE/FOSS: default branch nightly scheduled jobs # ########################################## @@ -1144,6 +1177,41 @@ rspec-ee system pg16 es8: - .rspec-ee-base-pg16-es8 - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only - .rspec-ee-system-parallel + +# PG17 +# Note: PG17 brought us close to the limit of nightly jobs, with 1946 out of 2000. +# Adding new job families can cause the nightly pipeline to fail. +rspec-ee migration pg17: + extends: + - .rspec-ee-base-pg17 + - .rspec-base-migration + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + - .rspec-ee-migration-parallel + +rspec-ee background_migration pg17: + extends: + - .rspec-ee-base-pg17 + - .rspec-base-migration + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + - .rspec-ee-background-migration-parallel + +rspec-ee unit pg17: + extends: + - .rspec-ee-base-pg17 + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + - .rspec-ee-unit-parallel + +rspec-ee integration pg17: + extends: + - .rspec-ee-base-pg17 + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + - .rspec-ee-integration-parallel + +rspec-ee system pg17: + extends: + - .rspec-ee-base-pg17 + - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only + - .rspec-ee-system-parallel # EE: default branch nightly scheduled jobs # ##################################### diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml index 636d44b19d5e8..dc71e991a5e78 100644 --- a/.gitlab/ci/rails/shared.gitlab-ci.yml +++ b/.gitlab/ci/rails/shared.gitlab-ci.yml @@ -238,6 +238,11 @@ include: - .rspec-base - .use-pg16 +.rspec-base-pg17: + extends: + - .rspec-base + - .use-pg17 + .rspec-ee-base-pg14: extends: - .rspec-base @@ -271,6 +276,11 @@ include: - .use-pg16-opensearch2-ee - .rails:rules:run-search-tests +.rspec-ee-base-pg17: + extends: + - .rspec-base + - .use-pg17-es7-ee + .ci-config-validation-base: extends: - .rspec-base-pg14 diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml index d65b64e54b91e..4fc5fba66934f 100644 --- a/.gitlab/ci/static-analysis.gitlab-ci.yml +++ b/.gitlab/ci/static-analysis.gitlab-ci.yml @@ -261,7 +261,7 @@ templates-shellcheck: - .default-before_script - .default-retry - .ruby-cache - - .use-pg16 + - .use-pg17 stage: lint needs: - setup-test-env diff --git a/doc/development/pipelines/_index.md b/doc/development/pipelines/_index.md index 12b1a3e6873ee..aed3a2eeda48e 100644 --- a/doc/development/pipelines/_index.md +++ b/doc/development/pipelines/_index.md @@ -742,17 +742,19 @@ Ruby version only: 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 run our test suite against PostgreSQL 14, 15 and 16 on nightly scheduled pipelines. +We run our test suite against PostgreSQL 14, 15, 16, and 17 on nightly scheduled pipelines. + +NOTE: With the addition of PG17, we are close to the limit of nightly jobs, with 1946 out of 2000 jobs per pipeline. Adding new job families could cause the nightly pipeline to fail. #### Current versions testing -| Where? | PostgreSQL version | Ruby version | -|-----------------------------------------------------------------------------------------------|------------------------------|-----------------------| -| Merge requests | 14 (default version) | 3.2 (default version) | -| `master` branch commits | 14 (default version) | 3.2 (default version) | -| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour at XX:05) | 14 (default version) | 3.2 (default version) | -| `maintenance` scheduled pipelines for the `ruby-next` branch (every odd-numbered hour at XX:10) | 14 (default version) | 3.3 | -| `nightly` scheduled pipelines for the `master` branch | 14 (default version), 15, 16 | 3.2 (default version) | +| Where? | PostgreSQL version | Ruby version | +|-------------------------------------------------------------------------------------------------|-------------------------------------|-----------------------| +| Merge requests | 14 (default version) | 3.2 (default version) | +| `master` branch commits | 14 (default version) | 3.2 (default version) | +| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour at XX:05) | 14 (default version) | 3.2 (default version) | +| `maintenance` scheduled pipelines for the `ruby-next` branch (every odd-numbered hour at XX:10) | 14 (default version) | 3.3 | +| `nightly` scheduled pipelines for the `master` branch | 14 (default version), 15, 16 and 17 | 3.2 (default version) | For the next Ruby versions we're testing against with, we run maintenance scheduled pipelines every 2 hours on the `ruby-next` branch. diff --git a/doc/development/pipelines/internals.md b/doc/development/pipelines/internals.md index ff8921164a5ed..25467807a3c18 100644 --- a/doc/development/pipelines/internals.md +++ b/doc/development/pipelines/internals.md @@ -183,6 +183,8 @@ that are scoped to a single [configuration keyword](../../ci/yaml/_index.md#job- | `.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-pg16` | Allows a job to use the `postgres` 16, `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-pg16-ee` | Same as `.use-pg16` 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-pg17` | Allows a job to use the `postgres` 17, `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-pg17-ee` | Same as `.use-pg17` 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. For more details, see the [handbook about CI/CD configuration](https://handbook.gitlab.com/handbook/engineering/gitlab-repositories/#cicd-configuration). | -- GitLab