diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1fbc0119bd661a2f956d00fd3c7998400aec4e1..fc2f061bd81454e866b1c088b675b4c6ef2fb901 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,13 +29,9 @@ default: .default-ruby-variables: &default-ruby-variables RUBY_VERSION: "3.0" - OMNIBUS_GITLAB_RUBY3_BUILD: "true" - OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3" -.backcompat-ruby-variables: &backcompat-ruby-variables - RUBY_VERSION: "2.7" - OMNIBUS_GITLAB_RUBY2_BUILD: "true" - OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY2" +.next-ruby-variables: &next-ruby-variables + RUBY_VERSION: "3.1" .default-branch-pipeline-failure-variables: &default-branch-pipeline-failure-variables CREATE_RAILS_TEST_FAILURE_ISSUES: "true" @@ -59,10 +55,10 @@ workflow: # they serve no purpose and will run anyway when the changes are merged. - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^release-tools\/\d+\.\d+\.\d+-rc\d+$/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/ && $CI_PROJECT_PATH == "gitlab-org/gitlab"' when: never - # For merge requests running exclusively in Ruby 2.7 - - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby2/' + # For merge requests running exclusively in Ruby 3.1 + - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/' variables: - <<: *backcompat-ruby-variables + <<: *next-ruby-variables PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline' NO_SOURCEMAPS: 'true' - if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/' @@ -84,10 +80,10 @@ workflow: <<: *default-branch-pipeline-failure-variables CRYSTALBALL: "true" PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline' - # Run pipelines for ruby2 branch - - if: '$CI_COMMIT_BRANCH == "ruby2" && $CI_PIPELINE_SOURCE == "schedule"' + # Run pipelines for ruby3_1 branch + - if: '$CI_COMMIT_BRANCH == "ruby3_1" && $CI_PIPELINE_SOURCE == "schedule"' variables: - <<: *backcompat-ruby-variables + <<: *next-ruby-variables PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline' # This work around https://gitlab.com/gitlab-org/gitlab/-/issues/332411 whichs prevents usage of dependency proxy # when pipeline is triggered by a project access token. @@ -147,7 +143,6 @@ variables: UBI_VERSION: "8.6" CHROME_VERSION: "113" DOCKER_VERSION: "23.0.1" - RUBY_VERSION: "2.7" RUBYGEMS_VERSION: "3.4" GO_VERSION: "1.20" RUST_VERSION: "1.65" diff --git a/.gitlab/ci/qa-common/variables.gitlab-ci.yml b/.gitlab/ci/qa-common/variables.gitlab-ci.yml index 817f2e0020a6b361ff2c2d8d95bde72a4b959722..fe980293f3a9e3ee7cc3f554cd84b5c963d57ed2 100644 --- a/.gitlab/ci/qa-common/variables.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/variables.gitlab-ci.yml @@ -3,12 +3,6 @@ variables: REGISTRY_HOST: "registry.gitlab.com" REGISTRY_GROUP: "gitlab-org" - SKIP_OMNIBUS_TRIGGER: "true" - OMNIBUS_GITLAB_CACHE_UPDATE: "false" - OMNIBUS_GITLAB_RUBY3_BUILD: "false" - OMNIBUS_GITLAB_RUBY2_BUILD: "false" - OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB" - OMNIBUS_GITLAB_BUILD_ON_ALL_OS: "false" ALLURE_JOB_NAME: $CI_PROJECT_NAME COLORIZED_LOGS: "true" QA_LOG_LEVEL: "info" @@ -17,3 +11,4 @@ variables: # run all tests by default when package-and-test is included natively in other projects # this will be overridden when selective test execution is used in gitlab canonical project QA_RUN_ALL_TESTS: "true" + USE_OLD_RUBY_VERSION: "true" diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index b10a02fd9fba5886cd634bb4051e9c2b9555c59e..6d9f75a2c9a4676b0a2a71ec2892b6054d77d7fe 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -35,9 +35,6 @@ - DEBIAN_VERSION - REGISTRY_GROUP - REGISTRY_HOST - - OMNIBUS_GITLAB_CACHE_EDITION - - OMNIBUS_GITLAB_RUBY3_BUILD - - OMNIBUS_GITLAB_RUBY2_BUILD trigger: strategy: depend forward: @@ -101,9 +98,9 @@ trigger-omnibus: TOP_UPSTREAM_SOURCE_PROJECT: $CI_PROJECT_PATH SECURITY_SOURCES: $SECURITY_SOURCES CACHE_UPDATE: $OMNIBUS_GITLAB_CACHE_UPDATE - RUBY3_BUILD: $OMNIBUS_GITLAB_RUBY3_BUILD - RUBY2_BUILD: $OMNIBUS_GITLAB_RUBY2_BUILD - CACHE_EDITION: $OMNIBUS_GITLAB_CACHE_EDITION + USE_OLD_RUBY_VERSION: "true" + CACHE_EDITION: "GITLAB_RUBY3_0" + NEXT_RUBY_VERSION: "3.1.4" BUILD_ON_ALL_OS: $OMNIBUS_GITLAB_BUILD_ON_ALL_OS SKIP_QA_TEST: "true" ee: $EE diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 129f82f916579a4f9eabff8498bedd6be5067943..d0ce284fcef8a10f58c5dc36ef69a171f43e92ce 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 == "ruby2" || ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") || $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 == "ruby3_1" || ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") || $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' @@ -53,8 +53,8 @@ .if-merge-request-targeting-stable-branch: &if-merge-request-targeting-stable-branch if: '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee|-jh)?$/' -.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-run-in-ruby3_1: &if-merge-request-labels-run-in-ruby3_1 + if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/' .if-merge-request-labels-as-if-foss: &if-merge-request-labels-as-if-foss if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/' @@ -113,8 +113,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-ruby2-branch-schedule-nightly: &if-ruby2-branch-schedule-nightly - if: '$CI_COMMIT_BRANCH == "ruby2" && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"' +.if-ruby3_1-branch-schedule-nightly: &if-ruby3_1-branch-schedule-nightly + if: '$CI_COMMIT_BRANCH == "ruby3_1" && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"' .if-security-schedule: &if-security-schedule if: '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_PIPELINE_SOURCE == "schedule"' @@ -149,8 +149,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-ruby2-branch: &if-ruby2-branch - if: '$CI_COMMIT_BRANCH == "ruby2"' +.if-ruby3_1-branch: &if-ruby3_1-branch + if: '$CI_COMMIT_BRANCH == "ruby3_1" || $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/' #################### # Changes patterns # @@ -868,7 +868,7 @@ - <<: *if-dot-com-gitlab-org-schedule variables: ARCH: amd64,arm64 - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch .build-images:rules:build-qa-image-as-if-foss: rules: @@ -913,7 +913,7 @@ - <<: *if-merge-request-targeting-stable-branch changes: *setup-test-env-patterns allow_failure: true - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch allow_failure: true # We include the job under the matching conditions below, but unlike in .qa:rules:e2e:test-on-gdk we don't need to # set OMNIBUS_GITLAB_BUILD_ON_ALL_OS when testing against GDK @@ -948,7 +948,7 @@ when: never - <<: *if-merge-request-targeting-stable-branch changes: *setup-test-env-patterns - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch - <<: *if-merge-request-labels-run-review-app - <<: *if-auto-deploy-branches - <<: *if-default-refs @@ -1151,7 +1151,7 @@ changes: *setup-test-env-patterns - <<: *if-merge-request-labels-run-review-app - <<: *if-auto-deploy-branches - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch - <<: *if-default-refs changes: *ci-build-images-patterns - <<: *if-default-refs @@ -1422,7 +1422,7 @@ allow_failure: true - <<: *if-dot-com-gitlab-org-schedule allow_failure: true - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch # Rules to support .qa:rules:package-and-test-ee - <<: *if-merge-request changes: *dependency-patterns @@ -1459,7 +1459,10 @@ - <<: *if-merge-request-targeting-stable-branch changes: *setup-test-env-patterns allow_failure: true - - <<: *if-ruby2-branch + - <<: *if-ruby3_1-branch + variables: + USE_OLD_RUBY_VERSION: 'false' + CACHE_EDITION: 'GITLAB_RUBY3_1' allow_failure: true - <<: *if-merge-request changes: *dependency-patterns @@ -1977,7 +1980,7 @@ - <<: *if-merge-request-labels-pipeline-expedite when: never - <<: *if-default-branch-schedule-nightly - - <<: *if-ruby2-branch-schedule-nightly + - <<: *if-ruby3_1-branch-schedule-nightly - <<: *if-merge-request-labels-run-all-rspec .rails:rules:rspec-coverage: @@ -2451,7 +2454,7 @@ .setup:rules:verify-ruby-3.0: rules: - - <<: *if-merge-request-labels-run-in-ruby2 + - <<: *if-merge-request-labels-run-in-ruby3_1 .setup:rules:verify-tests-yml: rules: diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index 85409d37fa44365db36c24ebfd46ab4505fc3c78..aaa7f7255c76fce19b5a8b8a106475ece17378f8 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -57,7 +57,7 @@ verify-ruby-3.0: - .setup:rules:verify-ruby-3.0 stage: prepare script: - - echo 'Please remove label ~"pipeline:run-in-ruby2" so we do test against Ruby 3.0 (default version) before merging the merge request' + - echo 'Please remove label ~"pipeline:run-in-ruby3_1" so we do test against Ruby 3.0 (default version) before merging the merge request' - exit 1 verify-tests-yml: @@ -185,15 +185,15 @@ trigger-omnibus-env: before_script: - source scripts/utils.sh script: + # Note that OMNIBUS_GITLAB_CACHE_UPDATE is not used in the code, but it is actually used in the 2-hourly maintenance pipeline schedule. - | SECURITY_SOURCES=$([[ ! "$CI_PROJECT_NAMESPACE" =~ ^gitlab-org\/security ]] || echo "true") echo "SECURITY_SOURCES=${SECURITY_SOURCES:-false}" > $BUILD_ENV echo "OMNIBUS_GITLAB_CACHE_UPDATE=${OMNIBUS_GITLAB_CACHE_UPDATE:-false}" >> $BUILD_ENV for version_file in *_VERSION; do echo "$version_file=$(cat $version_file)" >> $BUILD_ENV; done - echo "OMNIBUS_GITLAB_RUBY3_BUILD=${OMNIBUS_GITLAB_RUBY3_BUILD:-false}" >> $BUILD_ENV - echo "OMNIBUS_GITLAB_RUBY2_BUILD=${OMNIBUS_GITLAB_RUBY2_BUILD:-false}" >> $BUILD_ENV - echo "OMNIBUS_GITLAB_CACHE_EDITION=${OMNIBUS_GITLAB_CACHE_EDITION:-GITLAB}" >> $BUILD_ENV echo "OMNIBUS_GITLAB_BUILD_ON_ALL_OS=${OMNIBUS_GITLAB_BUILD_ON_ALL_OS:-false}" >> $BUILD_ENV + echo "USE_OLD_RUBY_VERSION=${USE_OLD_RUBY_VERSION:-false}" >> $BUILD_ENV + echo "NEXT_RUBY_VERSION=${NEXT_RUBY_VERSION}" >> $BUILD_ENV echo "GITLAB_ASSETS_TAG=$(assets_image_tag)" >> $BUILD_ENV echo "EE=$([[ $FOSS_ONLY == '1' ]] && echo 'false' || echo 'true')" >> $BUILD_ENV target_branch_name="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_REF_NAME}}" diff --git a/doc/development/pipelines/index.md b/doc/development/pipelines/index.md index 9e6abaa8eb3738aaeafa98315fbe6ef9ab54403d..5a9f706219c108f2a148124c47021978a7c004c6 100644 --- a/doc/development/pipelines/index.md +++ b/doc/development/pipelines/index.md @@ -609,18 +609,18 @@ Exceptions to this general guideline should be motivated and documented. ### Ruby versions testing We're running Ruby 3.0 on GitLab.com, as well as for merge requests and the default branch. -However, there are older versions for which we need to support Ruby 2.7, so we also run our -test suite against Ruby 2.7 on a dedicated 2-hourly scheduled pipelines. +To prepare for the next release, Ruby 3.1, we also run our test suite against Ruby 3.1 on +a dedicated 2-hourly scheduled pipelines. -For merge requests, you can add the `pipeline:run-in-ruby2` label to switch -the Ruby version used for running the whole test suite to 2.7. When you do +For merge requests, you can add the `pipeline:run-in-ruby3_1` label to switch +the Ruby version used for running the whole test suite to 3.1. When you do this, the test suite will no longer run in Ruby 3.0 (default), and an additional job `verify-ruby-3.0` will also run and always fail to remind us to remove the label and run in Ruby 3.0 before merging the merge request. This should let us: -- Test changes for Ruby 2.7 +- Test changes for Ruby 3.1 - Make sure it will not break anything when it's merged into the default branch ### PostgreSQL versions testing @@ -634,26 +634,26 @@ We also run our test suite against PostgreSQL 12 and PostgreSQL 13 upon specific #### Current versions testing -| Where? | PostgreSQL version | Ruby 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) | +| Where? | PostgreSQL version | Ruby 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 `ruby3_1` branch (every odd-numbered hour), see below. | 14 (default version), 13 for DB library changes | 3.1 | +| `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 +There are 2 pipeline schedules used for testing Ruby 3.1. One is triggering a +pipeline in `ruby3_1-sync` branch, which updates the `ruby3_1` branch with latest `master`, and no pipelines will be triggered by this push. The other schedule -is triggering a pipeline in `ruby2` 5 minutes after it, which is considered +is triggering a pipeline in `ruby3_1` 5 minutes after it, which is considered the maintenance schedule to run test suites and update cache. -The `ruby2` branch must not have any changes. The branch is only there to set -`RUBY_VERSION` to `2.7` in the maintenance pipeline schedule. +The `ruby3_1` branch must not have any changes. The branch is only there to set +`RUBY_VERSION` to `3.1` in the maintenance pipeline schedule. -The `gitlab` job in the `ruby2-sync` branch uses a `gitlab-org/gitlab` project +The `gitlab` job in the `ruby3_1-sync` branch uses a `gitlab-org/gitlab` project token with `write_repository` scope and `Maintainer` role with no expiration. -The token is stored in the `RUBY2_SYNC_TOKEN` variable in `gitlab-org/gitlab`. +The token is stored in the `RUBY3_1_SYNC_TOKEN` variable in `gitlab-org/gitlab`. ### Redis versions testing