Skip to content
代码片段 群组 项目
未验证 提交 6c2c0ecf 编辑于 作者: Rémy Coutable's avatar Rémy Coutable
浏览文件

Run merge requests in Ruby 3.2 by default


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
上级 97ad3cad
No related branches found
No related tags found
无相关合并请求
......@@ -27,10 +27,6 @@ default:
# Default job timeout doesn't work: https://gitlab.com/gitlab-org/gitlab/-/issues/387528
timeout: 90m
.old-ruby-variables: &old-ruby-variables
RUBY_VERSION: "3.0"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3_0"
.default-ruby-variables: &default-ruby-variables
RUBY_VERSION: "3.1"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3_1"
......@@ -45,6 +41,7 @@ default:
CREATE_RAILS_TEST_FAILURE_ISSUES: "true"
.default-merge-request-variables: &default-merge-request-variables
NO_SOURCEMAPS: "true"
ADD_SLOW_TEST_NOTE_TO_MERGE_REQUEST: "true"
.if-merge-request-security-canonical-sync: &if-merge-request-security-canonical-sync
......@@ -76,27 +73,15 @@ 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
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_0/'
variables:
<<: *old-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/'
variables:
<<: *default-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_2/'
variables:
<<: *next-ruby-variables
<<: [*default-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/'
variables:
<<: *default-ruby-variables
<<: [*next-ruby-variables, *default-merge-request-variables]
GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (community contribution)'
NO_SOURCEMAPS: 'true'
# This work around https://gitlab.com/gitlab-org/gitlab/-/issues/332411 which prevents usage of dependency proxy
# when pipeline is triggered by a project access token.
# Example of project bot usernames (the format changed over time):
......@@ -104,30 +89,25 @@ workflow:
# - project_278964_bot_7fb4d1cca8242cb399a0b8f483783120
- if: '$CI_MERGE_REQUEST_IID && $GITLAB_USER_LOGIN =~ /project_\d+_bot/'
variables:
<<: *default-ruby-variables
<<: [*next-ruby-variables, *default-merge-request-variables]
GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (triggered by a project token)'
- <<: *if-merge-request-security-canonical-sync
variables:
<<: *default-ruby-variables
<<: [*next-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: '$CI_DEFAULT_BRANCH security->canonical sync'
SKIP_MESSAGE: 'MR only contains changes from the security mirror, which have already been reviewed, tested and deployed.'
# For (detached) merge request pipelines.
- if: '$CI_MERGE_REQUEST_IID'
variables:
<<: [*default-ruby-variables, *default-merge-request-variables]
<<: [*next-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
# For the scheduled pipelines, we set specific variables.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"'
variables:
<<: [*default-ruby-variables, *default-branch-pipeline-failure-variables]
CRYSTALBALL: "true"
PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch'
- if: '$CI_COMMIT_BRANCH == "ruby3_0" && $CI_PIPELINE_SOURCE == "schedule"'
variables:
<<: *old-ruby-variables
PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch'
- if: '$CI_COMMIT_BRANCH == "ruby3_2" && $CI_PIPELINE_SOURCE == "schedule"'
variables:
<<: *next-ruby-variables
......
......@@ -62,9 +62,6 @@
.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-ruby: &if-merge-request-labels-run-in-ruby
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby\d+(_\d)*/'
.if-merge-request-labels-as-if-foss: &if-merge-request-labels-as-if-foss
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/'
......@@ -2924,10 +2921,6 @@
- <<: *if-default-refs
changes: *code-backstage-patterns
.setup:rules:verify-default-ruby:
rules:
- <<: *if-merge-request-labels-run-in-ruby
.setup:rules:set-pipeline-name:
rules:
- <<: *if-not-merge-request # This is only designed to run in a merge request
......
......@@ -88,15 +88,6 @@ gitlab_git_test:
script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
verify-default-ruby:
extends:
- .absolutely-predictive-job
- .setup:rules:verify-default-ruby
stage: prepare
script:
- echo 'Please remove label ~"pipeline:run-in-ruby3_2" or ~"pipeline:run-in-ruby3_0" so we do test against default Ruby version before merging the merge request'
- exit 1
verify-tests-yml:
extends:
- .setup:rules:verify-tests-yml
......
......@@ -648,8 +648,8 @@ Exceptions to this general guideline should be motivated and documented.
### Ruby versions testing
We're running Ruby 3.1 on GitLab.com, as well as for the default branch.
To prepare for the next Ruby version, we will run merge requests in Ruby 3.2,
starting on February 2024. Please see the roadmap at
To prepare for the next Ruby version, we run merge requests in Ruby 3.2.
Please see the roadmap at
[Ruby 3.2 epic](https://gitlab.com/groups/gitlab-org/-/epics/9684#plan)
for more details.
......@@ -659,19 +659,7 @@ suite on dedicated 2-hourly scheduled pipelines for each supported versions.
For merge requests, you can add the following labels to run the respective
Ruby version only:
- `pipeline:run-in-ruby3_0`
- `pipeline:run-in-ruby3_1`
- `pipeline:run-in-ruby3_2`
Note that when you do this, the test suite will no longer run in the default
Ruby version for merge requests. In this case, an additional job
`verify-default-ruby` will also run and always fail to remind us to remove
the label and run in default Ruby before merging the merge request.
This should let us:
- Test changes for any supported Ruby versions
- Make sure it will not break anything when it's merged into the default branch
### PostgreSQL versions testing
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册