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: ...@@ -27,10 +27,6 @@ default:
# Default job timeout doesn't work: https://gitlab.com/gitlab-org/gitlab/-/issues/387528 # Default job timeout doesn't work: https://gitlab.com/gitlab-org/gitlab/-/issues/387528
timeout: 90m 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 .default-ruby-variables: &default-ruby-variables
RUBY_VERSION: "3.1" RUBY_VERSION: "3.1"
OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3_1" OMNIBUS_GITLAB_CACHE_EDITION: "GITLAB_RUBY3_1"
...@@ -45,6 +41,7 @@ default: ...@@ -45,6 +41,7 @@ default:
CREATE_RAILS_TEST_FAILURE_ISSUES: "true" CREATE_RAILS_TEST_FAILURE_ISSUES: "true"
.default-merge-request-variables: &default-merge-request-variables .default-merge-request-variables: &default-merge-request-variables
NO_SOURCEMAPS: "true"
ADD_SLOW_TEST_NOTE_TO_MERGE_REQUEST: "true" ADD_SLOW_TEST_NOTE_TO_MERGE_REQUEST: "true"
.if-merge-request-security-canonical-sync: &if-merge-request-security-canonical-sync .if-merge-request-security-canonical-sync: &if-merge-request-security-canonical-sync
...@@ -76,27 +73,15 @@ workflow: ...@@ -76,27 +73,15 @@ workflow:
# they serve no purpose and will run anyway when the changes are merged. # 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"' - 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 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/' - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/'
variables: variables:
<<: *default-ruby-variables <<: [*default-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_2/'
variables:
<<: *next-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR' PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/' - if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/'
variables: variables:
<<: *default-ruby-variables <<: [*next-ruby-variables, *default-merge-request-variables]
GITLAB_DEPENDENCY_PROXY_ADDRESS: "" GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (community contribution)' 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 # 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. # when pipeline is triggered by a project access token.
# Example of project bot usernames (the format changed over time): # Example of project bot usernames (the format changed over time):
...@@ -104,30 +89,25 @@ workflow: ...@@ -104,30 +89,25 @@ workflow:
# - project_278964_bot_7fb4d1cca8242cb399a0b8f483783120 # - project_278964_bot_7fb4d1cca8242cb399a0b8f483783120
- if: '$CI_MERGE_REQUEST_IID && $GITLAB_USER_LOGIN =~ /project_\d+_bot/' - if: '$CI_MERGE_REQUEST_IID && $GITLAB_USER_LOGIN =~ /project_\d+_bot/'
variables: variables:
<<: *default-ruby-variables <<: [*next-ruby-variables, *default-merge-request-variables]
GITLAB_DEPENDENCY_PROXY_ADDRESS: "" GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (triggered by a project token)' PIPELINE_NAME: 'Ruby $RUBY_VERSION MR (triggered by a project token)'
- <<: *if-merge-request-security-canonical-sync - <<: *if-merge-request-security-canonical-sync
variables: variables:
<<: *default-ruby-variables <<: [*next-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: '$CI_DEFAULT_BRANCH security->canonical sync' 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.' SKIP_MESSAGE: 'MR only contains changes from the security mirror, which have already been reviewed, tested and deployed.'
# For (detached) merge request pipelines. # For (detached) merge request pipelines.
- if: '$CI_MERGE_REQUEST_IID' - if: '$CI_MERGE_REQUEST_IID'
variables: variables:
<<: [*default-ruby-variables, *default-merge-request-variables] <<: [*next-ruby-variables, *default-merge-request-variables]
PIPELINE_NAME: 'Ruby $RUBY_VERSION MR' PIPELINE_NAME: 'Ruby $RUBY_VERSION MR'
NO_SOURCEMAPS: 'true'
# For the scheduled pipelines, we set specific variables. # For the scheduled pipelines, we set specific variables.
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"'
variables: variables:
<<: [*default-ruby-variables, *default-branch-pipeline-failure-variables] <<: [*default-ruby-variables, *default-branch-pipeline-failure-variables]
CRYSTALBALL: "true" CRYSTALBALL: "true"
PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch' 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"' - if: '$CI_COMMIT_BRANCH == "ruby3_2" && $CI_PIPELINE_SOURCE == "schedule"'
variables: variables:
<<: *next-ruby-variables <<: *next-ruby-variables
......
...@@ -62,9 +62,6 @@ ...@@ -62,9 +62,6 @@
.if-merge-request-targeting-stable-branch: &if-merge-request-targeting-stable-branch .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: '($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-merge-request-labels-as-if-foss: &if-merge-request-labels-as-if-foss
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/' if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/'
...@@ -2924,10 +2921,6 @@ ...@@ -2924,10 +2921,6 @@
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
.setup:rules:verify-default-ruby:
rules:
- <<: *if-merge-request-labels-run-in-ruby
.setup:rules:set-pipeline-name: .setup:rules:set-pipeline-name:
rules: rules:
- <<: *if-not-merge-request # This is only designed to run in a merge request - <<: *if-not-merge-request # This is only designed to run in a merge request
......
...@@ -88,15 +88,6 @@ gitlab_git_test: ...@@ -88,15 +88,6 @@ gitlab_git_test:
script: script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes - 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: verify-tests-yml:
extends: extends:
- .setup:rules:verify-tests-yml - .setup:rules:verify-tests-yml
......
...@@ -648,8 +648,8 @@ Exceptions to this general guideline should be motivated and documented. ...@@ -648,8 +648,8 @@ Exceptions to this general guideline should be motivated and documented.
### Ruby versions testing ### Ruby versions testing
We're running Ruby 3.1 on GitLab.com, as well as for the default branch. 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, To prepare for the next Ruby version, we run merge requests in Ruby 3.2.
starting on February 2024. Please see the roadmap at Please see the roadmap at
[Ruby 3.2 epic](https://gitlab.com/groups/gitlab-org/-/epics/9684#plan) [Ruby 3.2 epic](https://gitlab.com/groups/gitlab-org/-/epics/9684#plan)
for more details. for more details.
...@@ -659,19 +659,7 @@ suite on dedicated 2-hourly scheduled pipelines for each supported versions. ...@@ -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 For merge requests, you can add the following labels to run the respective
Ruby version only: Ruby version only:
- `pipeline:run-in-ruby3_0`
- `pipeline:run-in-ruby3_1` - `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 ### PostgreSQL versions testing
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册