Commit b2dc5e15 authored by Rémy Coutable's avatar Rémy Coutable

Get rid of 'master' in favor of 'default-branch' in CI config

This is mostly a renaming to transition from `master` to
`default-branch`/`$CI_DEFAULT_BRANCH` where applicable in
the CI config.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 549ea1d9
...@@ -38,7 +38,7 @@ workflow: ...@@ -38,7 +38,7 @@ workflow:
when: never when: never
# For merge requests, create a pipeline. # For merge requests, create a pipeline.
- if: '$CI_MERGE_REQUEST_IID' - if: '$CI_MERGE_REQUEST_IID'
# For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.). # For `$CI_DEFAULT_BRANCH` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# For tags, create a pipeline. # For tags, create a pipeline.
- if: '$CI_COMMIT_TAG' - if: '$CI_COMMIT_TAG'
......
# Builds a cached .tar.gz of the master branch with full history and # Builds a cached .tar.gz of the $CI_DEFAULT_BRANCH branch with full history and
# uploads it to Google Cloud Storage. This archive is downloaded by a # uploads it to Google Cloud Storage. This archive is downloaded by a
# script defined by a CI/CD variable named CI_PRE_CLONE_SCRIPT. This has # script defined by a CI/CD variable named CI_PRE_CLONE_SCRIPT. This has
# two benefits: # two benefits:
......
...@@ -246,7 +246,7 @@ coverage-frontend: ...@@ -246,7 +246,7 @@ coverage-frontend:
extends: extends:
- .default-retry - .default-retry
- .yarn-cache - .yarn-cache
- .frontend:rules:ee-mr-and-master-only - .frontend:rules:ee-mr-and-default-branch-only
needs: ["jest"] needs: ["jest"]
stage: post-test stage: post-test
before_script: before_script:
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
############################ ############################
####################################################### #######################################################
# EE/FOSS: default refs (MRs, master, schedules) jobs # # EE/FOSS: default refs (MRs, default branch, schedules) jobs #
setup-test-env: setup-test-env:
extends: extends:
- .rails-job-base - .rails-job-base
...@@ -347,7 +347,7 @@ db:migrate:reset: ...@@ -347,7 +347,7 @@ db:migrate:reset:
db:check-schema: db:check-schema:
extends: extends:
- .db-job-base - .db-job-base
- .rails:rules:ee-mr-and-master-only - .rails:rules:ee-mr-and-default-branch-only
script: script:
- source scripts/schema_changed.sh - source scripts/schema_changed.sh
...@@ -538,11 +538,11 @@ rspec:feature-flags: ...@@ -538,11 +538,11 @@ rspec:feature-flags:
run_timed_command "bundle exec scripts/used-feature-flags"; run_timed_command "bundle exec scripts/used-feature-flags";
fi fi
# EE/FOSS: default refs (MRs, master, schedules) jobs # # EE/FOSS: default refs (MRs, default branch, schedules) jobs #
####################################################### #######################################################
################################################## ##################################################
# EE: default refs (MRs, master, schedules) jobs # # EE: default refs (MRs, default branch, schedules) jobs #
rspec migration pg11-as-if-foss: rspec migration pg11-as-if-foss:
extends: extends:
- .rspec-base-pg11-as-if-foss - .rspec-base-pg11-as-if-foss
...@@ -685,81 +685,81 @@ db:rollback geo: ...@@ -685,81 +685,81 @@ db:rollback geo:
script: script:
- bundle exec rake geo:db:migrate VERSION=20170627195211 - bundle exec rake geo:db:migrate VERSION=20170627195211
- bundle exec rake geo:db:migrate - bundle exec rake geo:db:migrate
# EE: default refs (MRs, master, schedules) jobs # # EE: default refs (MRs, default branch, schedules) jobs #
################################################## ##################################################
########################################## ##########################################
# EE/FOSS: master nightly scheduled jobs # # EE/FOSS: default branch nightly scheduled jobs #
rspec migration pg12: rspec migration pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
- .rspec-base-migration - .rspec-base-migration
- .rails:rules:master-schedule-nightly--code-backstage - .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-migration-parallel - .rspec-migration-parallel
rspec unit pg12: rspec unit pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage - .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-unit-parallel - .rspec-unit-parallel
rspec integration pg12: rspec integration pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage - .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-integration-parallel - .rspec-integration-parallel
rspec system pg12: rspec system pg12:
extends: extends:
- .rspec-base-pg12 - .rspec-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage - .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-system-parallel - .rspec-system-parallel
# EE/FOSS: master nightly scheduled jobs # # EE/FOSS: default branch nightly scheduled jobs #
########################################## ##########################################
##################################### #####################################
# EE: master nightly scheduled jobs # # EE: default branch nightly scheduled jobs #
rspec-ee migration pg12: rspec-ee migration pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
- .rspec-base-migration - .rspec-base-migration
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel - .rspec-ee-migration-parallel
rspec-ee unit pg12: rspec-ee unit pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-parallel - .rspec-ee-unit-parallel
rspec-ee integration pg12: rspec-ee integration pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-integration-parallel - .rspec-ee-integration-parallel
rspec-ee system pg12: rspec-ee system pg12:
extends: extends:
- .rspec-ee-base-pg12 - .rspec-ee-base-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-system-parallel - .rspec-ee-system-parallel
rspec-ee unit pg12 geo: rspec-ee unit pg12 geo:
extends: extends:
- .rspec-ee-base-geo-pg12 - .rspec-ee-base-geo-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-geo-parallel - .rspec-ee-unit-geo-parallel
rspec-ee integration pg12 geo: rspec-ee integration pg12 geo:
extends: extends:
- .rspec-ee-base-geo-pg12 - .rspec-ee-base-geo-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
rspec-ee system pg12 geo: rspec-ee system pg12 geo:
extends: extends:
- .rspec-ee-base-geo-pg12 - .rspec-ee-base-geo-pg12
- .rails:rules:master-schedule-nightly--code-backstage-ee-only - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
# EE: master nightly scheduled jobs # # EE: default branch nightly scheduled jobs #
##################################### #####################################
################################################## ##################################################
......
...@@ -11,25 +11,25 @@ ...@@ -11,25 +11,25 @@
if: '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"' if: '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"'
.if-default-refs: &if-default-refs .if-default-refs: &if-default-refs
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $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_MERGE_REQUEST_IID || $CI_COMMIT_TAG || $FORCE_GITLAB_CI'
.if-master-refs: &if-master-refs .if-default-branch-refs: &if-default-branch-refs
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main"' if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
.if-master-push: &if-master-push .if-default-branch-push: &if-default-branch-push
if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_REF_NAME == "main") && $CI_PIPELINE_SOURCE == "push"' if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
.if-master-schedule-2-hourly: &if-master-schedule-2-hourly .if-default-branch-schedule-2-hourly: &if-default-branch-schedule-2-hourly
if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_REF_NAME == "main") && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"' if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"'
.if-master-schedule-nightly: &if-master-schedule-nightly .if-default-branch-schedule-nightly: &if-default-branch-schedule-nightly
if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_REF_NAME == "main") && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"' if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"'
.if-auto-deploy-branches: &if-auto-deploy-branches .if-auto-deploy-branches: &if-auto-deploy-branches
if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/' if: '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
.if-master-or-tag: &if-master-or-tag .if-default-branch-or-tag: &if-default-branch-or-tag
if: '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_TAG' if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG'
.if-merge-request: &if-merge-request .if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID' if: '$CI_MERGE_REQUEST_IID'
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
.if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule .if-dot-com-gitlab-org-schedule: &if-dot-com-gitlab-org-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"'
.if-dot-com-gitlab-org-master: &if-dot-com-gitlab-org-master .if-dot-com-gitlab-org-default-branch: &if-dot-com-gitlab-org-default-branch
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && ($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "main")' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
.if-dot-com-gitlab-org-merge-request: &if-dot-com-gitlab-org-merge-request .if-dot-com-gitlab-org-merge-request: &if-dot-com-gitlab-org-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_MERGE_REQUEST_IID' if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_MERGE_REQUEST_IID'
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
################ ################
.shared:rules:update-cache: .shared:rules:update-cache:
rules: rules:
- <<: *if-master-schedule-2-hourly - <<: *if-default-branch-schedule-2-hourly
- <<: *if-security-schedule - <<: *if-security-schedule
- <<: *if-merge-request-title-update-caches - <<: *if-merge-request-title-update-caches
...@@ -434,26 +434,26 @@ ...@@ -434,26 +434,26 @@
- <<: *if-merge-request - <<: *if-merge-request
changes: *frontend-patterns changes: *frontend-patterns
.frontend:rules:ee-mr-and-master-only: .frontend:rules:ee-mr-and-default-branch-only:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request - <<: *if-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: always when: always
- <<: *if-master-refs - <<: *if-default-branch-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
.frontend:rules:qa-frontend-node: .frontend:rules:qa-frontend-node:
rules: rules:
- <<: *if-master-refs - <<: *if-default-branch-refs
changes: *frontend-dependency-patterns changes: *frontend-dependency-patterns
- <<: *if-merge-request - <<: *if-merge-request
changes: *frontend-dependency-patterns changes: *frontend-dependency-patterns
.frontend:rules:qa-frontend-node-latest: .frontend:rules:qa-frontend-node-latest:
rules: rules:
- <<: *if-master-refs - <<: *if-default-branch-refs
changes: *frontend-dependency-patterns changes: *frontend-dependency-patterns
allow_failure: true allow_failure: true
- <<: *if-merge-request - <<: *if-merge-request
...@@ -464,7 +464,7 @@ ...@@ -464,7 +464,7 @@
rules: rules:
- <<: *if-not-canonical-namespace - <<: *if-not-canonical-namespace
when: never when: never
- if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main")' - if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
changes: *frontend-patterns changes: *frontend-patterns
allow_failure: true allow_failure: true
...@@ -484,7 +484,7 @@ ...@@ -484,7 +484,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-master-schedule-2-hourly - <<: *if-default-branch-schedule-2-hourly
############ ############
# QA rules # # QA rules #
...@@ -824,14 +824,14 @@ ...@@ -824,14 +824,14 @@
- changes: *db-library-patterns - changes: *db-library-patterns
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
.rails:rules:ee-mr-and-master-only: .rails:rules:ee-mr-and-default-branch-only:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
- <<: *if-merge-request - <<: *if-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
- <<: *if-master-refs - <<: *if-default-branch-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
.rails:rules:detect-tests: .rails:rules:detect-tests:
...@@ -887,7 +887,7 @@ ...@@ -887,7 +887,7 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-master-schedule-nightly - <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
.rails:rules:rspec-coverage: .rails:rules:rspec-coverage:
...@@ -897,7 +897,7 @@ ...@@ -897,7 +897,7 @@
- <<: *if-merge-request - <<: *if-merge-request
changes: *code-backstage-patterns changes: *code-backstage-patterns
when: always when: always
- <<: *if-master-schedule-2-hourly - <<: *if-default-branch-schedule-2-hourly
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
when: always when: always
...@@ -905,21 +905,21 @@ ...@@ -905,21 +905,21 @@
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-master-schedule-2-hourly - <<: *if-default-branch-schedule-2-hourly
allow_failure: true allow_failure: true
- <<: *if-merge-request-title-run-all-rspec - <<: *if-merge-request-title-run-all-rspec
.rails:rules:master-schedule-nightly--code-backstage: .rails:rules:default-branch-schedule-nightly--code-backstage:
rules: rules:
- <<: *if-master-schedule-nightly - <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request - <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"] changes: [".gitlab/ci/rails.gitlab-ci.yml"]
.rails:rules:master-schedule-nightly--code-backstage-ee-only: .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only:
rules: rules:
- <<: *if-not-ee - <<: *if-not-ee
when: never when: never
- <<: *if-master-schedule-nightly - <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request - <<: *if-merge-request
changes: [".gitlab/ci/rails.gitlab-ci.yml"] changes: [".gitlab/ci/rails.gitlab-ci.yml"]
...@@ -945,7 +945,7 @@ ...@@ -945,7 +945,7 @@
rules: rules:
- if: '$CODE_QUALITY_DISABLED' - if: '$CODE_QUALITY_DISABLED'
when: never when: never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-default-branch-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
allow_failure: true allow_failure: true
...@@ -954,7 +954,7 @@ ...@@ -954,7 +954,7 @@
rules: rules:
- if: '$SAST_DISABLED || $GITLAB_FEATURES !~ /\bsast\b/' - if: '$SAST_DISABLED || $GITLAB_FEATURES !~ /\bsast\b/'
when: never when: never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-default-branch-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
allow_failure: true allow_failure: true
...@@ -963,7 +963,7 @@ ...@@ -963,7 +963,7 @@
rules: rules:
- if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/' - if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/'
when: never when: never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-default-branch-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
allow_failure: true allow_failure: true
...@@ -984,7 +984,7 @@ ...@@ -984,7 +984,7 @@
rules: rules:
- if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/' - if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when: never when: never
- <<: *if-master-schedule-nightly - <<: *if-default-branch-schedule-nightly
allow_failure: true allow_failure: true
.reports:rules:license_scanning: .reports:rules:license_scanning:
...@@ -1118,13 +1118,13 @@ ...@@ -1118,13 +1118,13 @@
rules: rules:
- <<: *if-not-canonical-namespace - <<: *if-not-canonical-namespace
when: never when: never
- <<: *if-master-or-tag - <<: *if-default-branch-or-tag
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
when: on_success when: on_success
.setup:rules:dont-interrupt-me: .setup:rules:dont-interrupt-me:
rules: rules:
- <<: *if-master-or-tag - <<: *if-default-branch-or-tag
allow_failure: true allow_failure: true
- <<: *if-auto-deploy-branches - <<: *if-auto-deploy-branches
allow_failure: true allow_failure: true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment