2020-03-13 15:44:24 +05:30
##############
# Conditions #
##############
.if-not-canonical-namespace : &if-not-canonical-namespace
if : '$CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/'
.if-not-ee : &if-not-ee
2023-01-13 00:05:48 +05:30
# Only consider FOSS not EE
if : '$CI_PROJECT_NAME !~ /^gitlab(-ee)?$/ && $CI_PROJECT_NAME !~ /^gitlab-jh/'
2020-03-13 15:44:24 +05:30
.if-not-foss : &if-not-foss
if : '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"'
2021-11-18 22:05:49 +05:30
.if-jh : &if-jh
2023-01-13 00:05:48 +05:30
# Example of these projects:
# https://jihulab.com/gitlab-cn/gitlab
# https://gitlab.com/gitlab-org-sandbox/gitlab-jh-validation
if : '$CI_PROJECT_PATH =~ /^gitlab-(jh|cn)\/.*/ || $CI_PROJECT_NAME =~ /^gitlab-jh/'
2021-11-18 22:05:49 +05:30
2022-06-21 17:19:12 +05:30
.if-force-ci : &if-force-ci
if : '$FORCE_GITLAB_CI'
2020-03-13 15:44:24 +05:30
.if-default-refs : &if-default-refs
2023-04-23 21:23:45 +05:30
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'
2020-03-13 15:44:24 +05:30
2021-04-29 21:17:54 +05:30
.if-default-branch-refs : &if-default-branch-refs
2022-10-11 01:57:18 +05:30
if : '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID == null'
2020-05-24 23:13:21 +05:30
2020-04-22 19:07:51 +05:30
.if-auto-deploy-branches : &if-auto-deploy-branches
if : '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
2021-04-29 21:17:54 +05:30
.if-default-branch-or-tag : &if-default-branch-or-tag
2023-04-23 21:23:45 +05:30
if : '($CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID == null) || $CI_COMMIT_TAG'
.if-tag : &if-tag
if : '$CI_COMMIT_TAG'
2020-03-13 15:44:24 +05:30
.if-merge-request : &if-merge-request
2023-04-23 21:23:45 +05:30
if : '$CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached"'
2020-03-13 15:44:24 +05:30
2022-11-25 23:54:43 +05:30
# Once https://gitlab.com/gitlab-org/gitlab/-/issues/373904 is implemented, we should be able to change this back to
2023-04-23 21:23:45 +05:30
# if: '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_APPROVALS_COUNT > 0'
2022-11-25 23:54:43 +05:30
# or any similar condition to check that the MR has *any* approval (not just required approval).
2023-03-04 22:38:38 +05:30
#
# Temprorarily adding || $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-full-rspec/ for backward compatibility,
# remove once https://gitlab.com/gitlab-org/quality/quality-engineering/team-tasks/-/issues/1557 is fully rolled out
2021-10-27 15:23:28 +05:30
.if-merge-request-approved : &if-merge-request-approved
2023-04-23 21:23:45 +05:30
if : '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:mr-approved/ || $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-full-rspec/'
2021-10-27 15:23:28 +05:30
2023-03-04 22:38:38 +05:30
# Temprorarily adding && $CI_MERGE_REQUEST_LABELS !~ /pipeline:run-full-rspec/ for backward compatibility,
# remove once https://gitlab.com/gitlab-org/quality/quality-engineering/team-tasks/-/issues/1557 is fully rolled out
2021-10-27 15:23:28 +05:30
.if-merge-request-not-approved : &if-merge-request-not-approved
2023-04-23 21:23:45 +05:30
if : '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_LABELS !~ /pipeline:mr-approved/ && $CI_MERGE_REQUEST_LABELS !~ /pipeline:run-full-rspec/'
2021-10-27 15:23:28 +05:30
.if-automated-merge-request : &if-automated-merge-request
if : '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == "release-tools/update-gitaly" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /stable-ee$/'
2021-12-07 22:27:20 +05:30
.if-merge-request-targeting-stable-branch : &if-merge-request-targeting-stable-branch
2023-04-23 21:23:45 +05:30
if : '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/'
2021-12-07 22:27:20 +05:30
2023-03-17 16:20:25 +05:30
.if-merge-request-labels-run-in-ruby2 : &if-merge-request-labels-run-in-ruby2
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby2/'
2022-08-13 15:12:31 +05:30
2021-11-18 22:05:49 +05:30
.if-merge-request-labels-as-if-foss : &if-merge-request-labels-as-if-foss
2021-10-27 15:23:28 +05:30
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-foss/'
2020-05-24 23:13:21 +05:30
2021-11-18 22:05:49 +05:30
.if-merge-request-labels-as-if-jh : &if-merge-request-labels-as-if-jh
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-as-if-jh/'
.if-merge-request-labels-update-caches : &if-merge-request-labels-update-caches
2021-10-27 15:23:28 +05:30
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:update-cache/'
2020-06-23 00:09:42 +05:30
2021-11-18 22:05:49 +05:30
.if-merge-request-labels-run-all-rspec : &if-merge-request-labels-run-all-rspec
2021-10-27 15:23:28 +05:30
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-rspec/'
2020-07-28 23:09:34 +05:30
2021-11-18 22:05:49 +05:30
.if-merge-request-labels-run-all-jest : &if-merge-request-labels-run-all-jest
2021-11-11 11:23:49 +05:30
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-jest/'
2023-04-23 21:23:45 +05:30
.if-merge-request-labels-run-all-e2e : &if-merge-request-labels-run-all-e2e
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-all-e2e/'
2022-05-07 20:08:51 +05:30
.if-merge-request-labels-run-single-db : &if-merge-request-labels-run-single-db
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-single-db/'
2021-11-11 11:23:49 +05:30
2021-12-11 22:18:48 +05:30
.if-merge-request-labels-run-review-app : &if-merge-request-labels-run-review-app
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-review-app/'
2023-06-20 00:43:36 +05:30
.if-merge-request-labels-run-on-pg12 : &if-merge-request-labels-run-on-pg12
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg12/'
2022-01-26 12:08:38 +05:30
.if-merge-request-labels-skip-undercoverage : &if-merge-request-labels-skip-undercoverage
if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/'
2022-06-21 17:19:12 +05:30
.if-merge-request-labels-jh-contribution : &if-merge-request-labels-jh-contribution
if : '$CI_MERGE_REQUEST_LABELS =~ /JiHu contribution/'
2022-07-16 23:28:13 +05:30
.if-merge-request-labels-group-global-search : &if-merge-request-labels-group-global-search
if : '$CI_MERGE_REQUEST_LABELS =~ /group::global search/'
2023-03-04 22:38:38 +05:30
.if-merge-request-labels-pipeline-expedite : &if-merge-request-labels-pipeline-expedite
2023-03-17 16:20:25 +05:30
if : '($CI_MERGE_REQUEST_LABELS =~ /master:(foss-)?broken/ || $CI_MERGE_REQUEST_TITLE =~ /^[Rr]evert/) && $CI_MERGE_REQUEST_LABELS =~ /pipeline:expedite/'
2023-01-13 00:05:48 +05:30
.if-merge-request-labels-frontend-and-feature-flag : &if-merge-request-labels-frontend-and-feature-flag
if : '$CI_MERGE_REQUEST_LABELS =~ /frontend/ && $CI_MERGE_REQUEST_LABELS =~ /feature flag/'
2022-07-23 23:45:48 +05:30
2020-05-24 23:13:21 +05:30
.if-security-merge-request : &if-security-merge-request
2023-04-23 21:23:45 +05:30
if : '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached")'
2020-04-08 14:13:33 +05:30
2022-04-04 11:22:00 +05:30
.if-fork-merge-request : &if-fork-merge-request
2023-04-23 21:23:45 +05:30
if : '$CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/ && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_LABELS !~ /pipeline:run-all-rspec/'
2022-04-04 11:22:00 +05:30
2023-03-04 22:38:38 +05:30
.if-schedule-pipeline : &if-schedule-pipeline
if : '$CI_PIPELINE_SOURCE == "schedule"'
.if-schedule-maintenance : &if-schedule-maintenance
if : '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "maintenance"'
2021-10-27 15:23:28 +05:30
.if-default-branch-schedule-nightly : &if-default-branch-schedule-nightly
2022-08-13 15:12:31 +05:30
if : '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"'
2021-10-27 15:23:28 +05:30
2023-03-17 16:20:25 +05:30
.if-ruby2-branch-schedule-nightly : &if-ruby2-branch-schedule-nightly
if : '$CI_COMMIT_BRANCH == "ruby2" && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "nightly"'
2023-03-04 22:38:38 +05:30
2021-02-22 17:27:13 +05:30
.if-security-schedule : &if-security-schedule
if : '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_PIPELINE_SOURCE == "schedule"'
2023-04-23 21:23:45 +05:30
.if-foss-schedule : &if-foss-schedule
if : '$CI_PROJECT_PATH == "gitlab-org/gitlab-foss" && $CI_PIPELINE_SOURCE == "schedule"'
2023-05-27 22:25:52 +05:30
.if-foss-default-branch : &if-foss-default-branch
if : '$CI_PROJECT_PATH == "gitlab-org/gitlab-foss" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
2020-03-13 15:44:24 +05:30
.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"'
2023-03-04 22:38:38 +05:30
.if-dot-com-ee-schedule-default-branch-maintenance : &if-dot-com-ee-schedule-default-branch-maintenance
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "maintenance"'
2021-10-27 15:23:28 +05:30
2021-04-29 21:17:54 +05:30
.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 == $CI_DEFAULT_BRANCH'
2020-03-13 15:44:24 +05:30
.if-dot-com-gitlab-org-merge-request : &if-dot-com-gitlab-org-merge-request
2023-04-23 21:23:45 +05:30
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached")'
2020-03-13 15:44:24 +05:30
2020-06-23 00:09:42 +05:30
.if-dot-com-gitlab-org-and-security-merge-request : &if-dot-com-gitlab-org-and-security-merge-request
2023-04-23 21:23:45 +05:30
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached")'
2020-06-23 00:09:42 +05:30
2022-08-13 15:12:31 +05:30
.if-dot-com-gitlab-org-and-security-merge-request-and-qa-tests-specified : &if-dot-com-gitlab-org-and-security-merge-request-and-qa-tests-specified
2023-04-23 21:23:45 +05:30
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $QA_TESTS'
2022-08-13 15:12:31 +05:30
2022-10-11 01:57:18 +05:30
.if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-e2e : &if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-e2e
2023-04-23 21:23:45 +05:30
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $QA_MANUAL_FF_PACKAGE_AND_QA'
2021-12-11 22:18:48 +05:30
2020-03-13 15:44:24 +05:30
.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'
2023-03-17 16:20:25 +05:30
.if-ruby2-branch : &if-ruby2-branch
if : '$CI_COMMIT_BRANCH == "ruby2"'
2022-11-25 23:54:43 +05:30
2020-03-13 15:44:24 +05:30
####################
# Changes patterns #
####################
2020-05-24 23:13:21 +05:30
.ci-patterns : &ci-patterns
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2022-04-04 11:22:00 +05:30
- "scripts/rspec_helpers.sh"
2020-05-24 23:13:21 +05:30
2020-07-28 23:09:34 +05:30
.ci-build-images-patterns : &ci-build-images-patterns
- ".gitlab-ci.yml"
- ".gitlab/ci/build-images.gitlab-ci.yml"
.ci-review-patterns : &ci-review-patterns
- ".gitlab-ci.yml"
- ".gitlab/ci/frontend.gitlab-ci.yml"
- ".gitlab/ci/build-images.gitlab-ci.yml"
- ".gitlab/ci/review.gitlab-ci.yml"
2021-11-18 22:05:49 +05:30
- ".gitlab/ci/review-apps/**/*"
2023-04-23 21:23:45 +05:30
- "scripts/review_apps/**/*"
2022-04-04 11:22:00 +05:30
- "scripts/trigger-build.rb"
2021-11-11 11:23:49 +05:30
- "{,ee/,jh/}{bin,config}/**/*.rb"
2020-07-28 23:09:34 +05:30
2022-05-07 20:08:51 +05:30
.ci-templates-patterns : &ci-templates-patterns
- "lib/gitlab/ci/templates/**/*.gitlab-ci.yml"
2020-07-28 23:09:34 +05:30
.ci-qa-patterns : &ci-qa-patterns
- ".gitlab-ci.yml"
- ".gitlab/ci/frontend.gitlab-ci.yml"
- ".gitlab/ci/build-images.gitlab-ci.yml"
- ".gitlab/ci/qa.gitlab-ci.yml"
2022-10-11 01:57:18 +05:30
- ".gitlab/ci/package-and-test/*.yml"
- ".gitlab/ci/review-apps/qa.gitlab-ci.yml"
- ".gitlab/ci/review-apps/rules.gitlab-ci.yml"
2020-07-28 23:09:34 +05:30
2021-09-04 01:27:46 +05:30
.gitaly-patterns : &gitaly-patterns
- "GITALY_SERVER_VERSION"
2022-06-21 17:19:12 +05:30
- "lib/gitlab/setup_helper.rb"
2021-09-04 01:27:46 +05:30
2021-02-22 17:27:13 +05:30
.workhorse-patterns : &workhorse-patterns
- "GITLAB_WORKHORSE_VERSION"
- "workhorse/**/*"
2021-03-11 19:13:27 +05:30
- ".gitlab/ci/workhorse.gitlab-ci.yml"
2022-11-25 23:54:43 +05:30
- "spec/support/gitlab-git-test.git/**/*"
2021-02-22 17:27:13 +05:30
2021-01-29 00:20:46 +05:30
.yaml-lint-patterns : &yaml-lint-patterns
2023-03-04 22:38:38 +05:30
- "**/*.{yml,yaml}{,.*}"
2022-07-23 23:45:48 +05:30
.lint-pipeline-yaml-patterns : &lint-pipeline-yaml-patterns
2021-01-29 00:20:46 +05:30
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*.yml"
- "lib/gitlab/ci/templates/**/*.yml"
2022-07-23 23:45:48 +05:30
- "data/deprecations/**/*.yml"
- "data/removals/**/*.yml"
- "data/whats_new/**/*.yml"
.lint-metrics-yaml-patterns : &lint-metrics-yaml-patterns
- "config/metrics/**/*.yml"
2020-03-13 15:44:24 +05:30
.docs-patterns : &docs-patterns
- ".gitlab/route-map.yml"
- "doc/**/*"
2021-06-08 01:23:25 +05:30
- ".markdownlint.yml"
2021-03-11 19:13:27 +05:30
- "scripts/lint-doc.sh"
2022-07-23 23:45:48 +05:30
- ".gitlab/ci/docs.gitlab-ci.yml"
2020-03-13 15:44:24 +05:30
2023-04-23 21:23:45 +05:30
.docs-blueprints-patterns : &docs-blueprints-patterns
- "doc/architecture/blueprints/**/*"
- "scripts/lint-docs-blueprints.rb"
- ".gitlab/ci/docs.gitlab-ci.yml"
2022-03-02 08:16:31 +05:30
.docs-deprecations-and-removals-patterns : &docs-deprecations-and-removals-patterns
2022-01-26 12:08:38 +05:30
- "doc/update/deprecations.md"
2022-03-02 08:16:31 +05:30
- "doc/update/removals.md"
- "data/deprecations/**/*"
- "data/removals/**/*"
- "tooling/docs/**/*"
2021-12-11 22:18:48 +05:30
- "lib/tasks/gitlab/docs/compile_deprecations.rake"
2021-09-30 23:02:18 +05:30
.bundler-patterns : &bundler-patterns
- '{Gemfile.lock,*/Gemfile.lock,*/*/Gemfile.lock}'
.nodejs-patterns : &nodejs-patterns
- '{package.json,*/package.json,*/*/package.json}'
2021-12-11 22:18:48 +05:30
- '{yarn.lock,*/yarn.lock,*/*/yarn.lock}'
2021-09-30 23:02:18 +05:30
.python-patterns : &python-patterns
- '{requirements.txt,*/requirements.txt,*/*/requirements.txt}'
- '{requirements.pip,*/requirements.pip,*/*/requirements.pip}'
- '{Pipfile,*/Pipfile,*/*/Pipfile}'
- '{requires.txt,*/requires.txt,*/*/requires.txt}'
- '{setup.py,*/setup.py,*/*/setup.py}'
.dependency-patterns : &dependency-patterns
- '{Gemfile.lock,*/Gemfile.lock,*/*/Gemfile.lock}'
- '{composer.lock,*/composer.lock,*/*/composer.lock}'
- '{gems.locked,*/gems.locked,*/*/gems.locked}'
- '{go.sum,*/go.sum,*/*/go.sum}'
- '{npm-shrinkwrap.json,*/npm-shrinkwrap.json,*/*/npm-shrinkwrap.json}'
- '{package-lock.json,*/package-lock.json,*/*/package-lock.json}'
- '{yarn.lock,*/yarn.lock,*/*/yarn.lock}'
- '{packages.lock.json,*/packages.lock.json,*/*/packages.lock.json}'
- '{conan.lock,*/conan.lock,*/*/conan.lock}'
2020-04-22 19:07:51 +05:30
.frontend-dependency-patterns : &frontend-dependency-patterns
- "{package.json,yarn.lock}"
2021-03-11 19:13:27 +05:30
- "config/webpack.config.js"
- "config/helpers/*.js"
2020-04-22 19:07:51 +05:30
2021-04-29 21:17:54 +05:30
.frontend-build-patterns : &frontend-build-patterns
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2021-04-29 21:17:54 +05:30
- "babel.config.js"
- "config/webpack.config.js"
- "config/**/*.js"
2022-11-25 23:54:43 +05:30
- "{,ee/,jh/}app/assets/**/*"
2021-04-29 21:17:54 +05:30
- "vendor/assets/**/*"
2022-11-25 23:54:43 +05:30
# This list should match the list in Tasks::Gitlab::Assets.assets_impacting_compilation
.assets-compilation-patterns : &assets-compilation-patterns
- "{package.json,yarn.lock}"
2023-06-20 00:43:36 +05:30
- "{Gemfile,Gemfile.lock}"
2022-11-25 23:54:43 +05:30
- ".browserslistrc"
- "babel.config.js"
- "config/webpack.config.js"
- "*.js"
- "config/**/*.js"
- "locale/**/gitlab.po"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}app/assets/**/*"
2022-11-25 23:54:43 +05:30
- "fixtures/emojis/**/*"
- "vendor/assets/**/*"
2021-04-29 21:17:54 +05:30
2022-08-27 11:52:29 +05:30
.frontend-patterns-for-as-if-foss : &frontend-patterns-for-as-if-foss
2020-04-22 19:07:51 +05:30
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2020-06-23 00:09:42 +05:30
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2020-04-22 19:07:51 +05:30
- "Dockerfile.assets"
2020-06-23 00:09:42 +05:30
- "config/**/*.js"
2020-04-22 19:07:51 +05:30
- "vendor/assets/**/*"
2023-01-13 00:05:48 +05:30
- "{app/assets,app/components,app/helpers,app/presenters,app/views,locale,public,spec/frontend,storybook,symbol}/**/*"
2021-09-04 01:27:46 +05:30
2023-04-23 21:23:45 +05:30
.initializers-patterns : &initializers-patterns
- "{,ee/,jh/}config/initializers/**/*"
2022-03-02 08:16:31 +05:30
.controllers-patterns : &controllers-patterns
- "{,ee/,jh/}{app/controllers}/**/*"
2022-04-04 11:22:00 +05:30
.models-patterns : &models-patterns
- "{,ee/,jh/}{app/models}/**/*"
2023-05-27 22:25:52 +05:30
.decomposed-db-models-patterns : &decomposed-db-models-patterns
- "{,ee/,jh/}app/models/{ci,geo}/**/*"
2022-07-16 23:28:13 +05:30
.lib-gitlab-patterns : &lib-gitlab-patterns
- "{,ee/,jh/}lib/{,ee/,jh/}gitlab/**/*"
2021-09-04 01:27:46 +05:30
.startup-css-patterns : &startup-css-patterns
- "{,ee/,jh/}app/assets/stylesheets/startup/**/*"
2020-04-22 19:07:51 +05:30
2021-12-11 22:18:48 +05:30
# Backend patterns + .ci-patterns
2020-07-28 23:09:34 +05:30
.backend-patterns : &backend-patterns
2021-11-11 11:23:49 +05:30
- "{,jh/}Gemfile{,.lock}"
2020-07-28 23:09:34 +05:30
- "Rakefile"
- "config.ru"
# List explicitly all the app/ dirs that are backend (i.e. all except app/assets).
2022-10-11 01:57:18 +05:30
- "{,ee/,jh/}{app/channels,app/components,app/controllers,app/finders,app/graphql,app/helpers,app/mailers,app/models,app/policies,app/presenters,app/serializers,app/services,app/uploaders,app/validators,app/views,app/workers}/**/*"
2022-07-16 23:28:13 +05:30
- "{,ee/,jh/}{bin,config,db,generator_templates,lib}/**/*"
2022-05-07 20:08:51 +05:30
- "{,ee/,jh/}spec/**/*"
2021-04-17 20:07:23 +05:30
# CI changes
2020-07-28 23:09:34 +05:30
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-11-24 15:15:51 +05:30
- "*_VERSION"
2022-04-04 11:22:00 +05:30
- "scripts/rspec_helpers.sh"
2022-06-21 17:19:12 +05:30
# Mapped patterns (see tests.yml)
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2020-07-28 23:09:34 +05:30
2022-07-16 23:28:13 +05:30
.search-backend-patterns : &search-backend-patterns
- "{,jh/}Gemfile.lock"
- "GITLAB_ELASTICSEARCH_INDEXER_VERSION"
# List explicitly all the app/ dirs that are backend (i.e. all except app/assets).
2022-10-11 01:57:18 +05:30
- "{,ee/,jh/}{app/channels,app/components,app/controllers,app/finders,app/graphql,app/helpers,app/mailers,app/models,app/policies,app/presenters,app/serializers,app/services,app/uploaders,app/validators,app/views,app/workers}/**/*"
2022-07-16 23:28:13 +05:30
- "{,ee/,jh/}{bin,config,db,generator_templates,lib}/**/*"
- "{,ee/,jh/}spec/**/*"
2021-12-11 22:18:48 +05:30
# DB patterns + .ci-patterns
2020-07-28 23:09:34 +05:30
.db-patterns : &db-patterns
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}{,spec/}{db,migrations}/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/background_migration{,_spec}.rb"
2023-04-23 21:23:45 +05:30
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/background_migration/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database{,_spec}.rb"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database/**/*"
2023-05-27 22:25:52 +05:30
- "{,ee/,jh/}spec/support/db_cleaner.rb"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}spec/support/helpers/database/**/*"
2023-03-04 22:38:38 +05:30
- "{,ee/,jh/}spec/support/helpers/migrations_helpers/**/*"
2022-10-11 01:57:18 +05:30
- "lib/api/admin/batched_background_migrations.rb"
2023-04-23 21:23:45 +05:30
- "lib/gitlab/markdown_cache/active_record/**/*"
2022-10-11 01:57:18 +05:30
- "spec/requests/api/admin/batched_background_migrations_spec.rb"
2023-05-27 22:25:52 +05:30
- "spec/support/database_cleaner.rb"
2021-01-29 00:20:46 +05:30
- "config/prometheus/common_metrics.yml" # Used by Gitlab::DatabaseImporters::CommonMetrics::Importer
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}app/models/project_statistics.rb" # Used to calculate sizes in migration specs
2022-06-21 17:19:12 +05:30
# Gitaly has interactions with background migrations: https://gitlab.com/gitlab-org/gitlab/-/issues/336538
- "GITALY_SERVER_VERSION"
- "lib/gitlab/setup_helper.rb"
2021-04-17 20:07:23 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-07-28 23:09:34 +05:30
2023-03-17 16:20:25 +05:30
# DB backup patterns
.db-backup-patterns : &db-backup-patterns
- "lib/backup/**/*"
- "lib/tasks/gitlab/backup.rake"
2021-03-08 18:12:59 +05:30
.db-library-patterns : &db-library-patterns
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database{,_spec}.rb"
- "{,ee/,jh/}spec/support/helpers/database/**/*"
2021-03-08 18:12:59 +05:30
2020-03-13 15:44:24 +05:30
.backstage-patterns : &backstage-patterns
- "Dangerfile"
- "danger/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}fixtures/**/*"
- "{,ee/,jh/}rubocop/**/*"
- "{,ee/,jh/}spec/**/*"
2021-02-22 17:27:13 +05:30
- "{,spec/}tooling/**/*"
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
.qa-patterns : &qa-patterns
- ".dockerignore"
2022-10-11 01:57:18 +05:30
- "{,jh/}qa/**/*"
2021-12-11 22:18:48 +05:30
2022-03-02 08:16:31 +05:30
# Code patterns + .ci-patterns
2020-03-13 15:44:24 +05:30
.code-patterns : &code-patterns
2020-04-22 19:07:51 +05:30
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2020-06-23 00:09:42 +05:30
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2020-04-22 19:07:51 +05:30
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2022-08-13 15:12:31 +05:30
- ".gitlab-ci.yml"
2020-03-13 15:44:24 +05:30
- "*_VERSION"
2021-11-11 11:23:49 +05:30
- "{,jh/}Gemfile{,.lock}"
2020-03-13 15:44:24 +05:30
- "Rakefile"
2020-11-24 15:15:51 +05:30
- "tests.yml"
2020-03-13 15:44:24 +05:30
- "config.ru"
2021-09-30 23:02:18 +05:30
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
2020-03-13 15:44:24 +05:30
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
2021-12-11 22:18:48 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2022-06-21 17:19:12 +05:30
# Mapped patterns (see tests.yml)
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
# .code-patterns + .backstage-patterns
2020-03-13 15:44:24 +05:30
.code-backstage-patterns : &code-backstage-patterns
2020-04-22 19:07:51 +05:30
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2020-06-23 00:09:42 +05:30
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2020-04-22 19:07:51 +05:30
- "Dockerfile.assets"
- "vendor/assets/**/*"
2023-06-20 00:43:36 +05:30
- ".{eslintrc.yml,eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2020-03-13 15:44:24 +05:30
- "*_VERSION"
2021-11-11 11:23:49 +05:30
- "{,jh/}Gemfile{,.lock}"
2020-03-13 15:44:24 +05:30
- "Rakefile"
2020-11-24 15:15:51 +05:30
- "tests.yml"
2020-03-13 15:44:24 +05:30
- "config.ru"
2023-01-13 00:05:48 +05:30
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
2020-03-13 15:44:24 +05:30
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
2021-12-11 22:18:48 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-03-13 15:44:24 +05:30
# Backstage changes
- "Dangerfile"
- "danger/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}fixtures/**/*"
- "{,ee/,jh/}rubocop/**/*"
- "{,ee/,jh/}spec/**/*"
2021-02-22 17:27:13 +05:30
- "{,spec/}tooling/**/*"
2022-06-21 17:19:12 +05:30
# Mapped patterns (see tests.yml)
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
# .code-patterns + .qa-patterns
2020-03-13 15:44:24 +05:30
.code-qa-patterns : &code-qa-patterns
2020-04-22 19:07:51 +05:30
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2020-06-23 00:09:42 +05:30
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2020-04-22 19:07:51 +05:30
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- "*_VERSION"
2021-11-11 11:23:49 +05:30
- "{,jh/}Gemfile{,.lock}"
2020-03-13 15:44:24 +05:30
- "Rakefile"
2020-11-24 15:15:51 +05:30
- "tests.yml"
2020-03-13 15:44:24 +05:30
- "config.ru"
2021-09-30 23:02:18 +05:30
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
2020-03-13 15:44:24 +05:30
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
2021-12-11 22:18:48 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-03-13 15:44:24 +05:30
# QA changes
- ".dockerignore"
2022-10-11 01:57:18 +05:30
- "{,jh/}qa/**/*"
2022-06-21 17:19:12 +05:30
# Mapped patterns (see tests.yml)
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
# .code-patterns + .backstage-patterns + .qa-patterns
2020-03-13 15:44:24 +05:30
.code-backstage-qa-patterns : &code-backstage-qa-patterns
2020-04-22 19:07:51 +05:30
- "{package.json,yarn.lock}"
2021-09-30 23:02:18 +05:30
- ".browserslistrc"
2020-06-23 00:09:42 +05:30
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2020-04-22 19:07:51 +05:30
- "Dockerfile.assets"
- "vendor/assets/**/*"
2021-12-11 22:18:48 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2022-08-13 15:12:31 +05:30
- ".gitlab-ci.yml"
2021-12-11 22:18:48 +05:30
- "*_VERSION"
- "{,jh/}Gemfile{,.lock}"
- "Rakefile"
- "tests.yml"
- "config.ru"
2023-01-13 00:05:48 +05:30
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
2021-12-11 22:18:48 +05:30
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
2021-04-17 20:07:23 +05:30
# CI changes
- ".gitlab-ci.yml"
2020-03-13 15:44:24 +05:30
- ".gitlab/ci/**/*"
2021-12-11 22:18:48 +05:30
# Backstage changes
- "Dangerfile"
- "danger/**/*"
- "{,ee/,jh/}fixtures/**/*"
- "{,ee/,jh/}rubocop/**/*"
- "{,ee/,jh/}spec/**/*"
- "{,spec/}tooling/**/*"
# QA changes
- ".dockerignore"
2022-10-11 01:57:18 +05:30
- "{,jh/}qa/**/*"
2022-06-21 17:19:12 +05:30
# Mapped patterns (see tests.yml)
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2021-12-11 22:18:48 +05:30
# .code-backstage-qa-patterns + .workhorse-patterns
2023-01-13 00:05:48 +05:30
# NOTE: `setup-test-env-patterns` intentionally does not include docs files, because this would
# result in docs-only pipelines having failures of jobs which use `setup-test-env-patterns`
# in their rules and thus require `setup-test-env`, which isn't present in docs-only pipelines.
2021-12-11 22:18:48 +05:30
.setup-test-env-patterns : &setup-test-env-patterns
- "{package.json,yarn.lock}"
- ".browserslistrc"
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2023-04-23 21:23:45 +05:30
- ".stylelintrc"
2021-12-11 22:18:48 +05:30
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2022-08-13 15:12:31 +05:30
- ".gitlab-ci.yml"
2020-03-13 15:44:24 +05:30
- "*_VERSION"
2021-11-11 11:23:49 +05:30
- "{,jh/}Gemfile{,.lock}"
2020-03-13 15:44:24 +05:30
- "Rakefile"
2020-11-24 15:15:51 +05:30
- "tests.yml"
2020-03-13 15:44:24 +05:30
- "config.ru"
2023-01-13 00:05:48 +05:30
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,storybook,symbol,vendor}/**/*"
2020-03-13 15:44:24 +05:30
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
2023-03-04 22:38:38 +05:30
# Mapped patterns (see tests.yml)
2021-04-17 20:07:23 +05:30
- "data/whats_new/*.yml"
2023-03-04 22:38:38 +05:30
- "doc/index.md"
2021-12-11 22:18:48 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-03-13 15:44:24 +05:30
# Backstage changes
- "Dangerfile"
- "danger/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}fixtures/**/*"
- "{,ee/,jh/}rubocop/**/*"
- "{,ee/,jh/}spec/**/*"
2021-02-22 17:27:13 +05:30
- "{,spec/}tooling/**/*"
2020-03-13 15:44:24 +05:30
# QA changes
- ".dockerignore"
2022-10-11 01:57:18 +05:30
- "{,jh/}qa/**/*"
2021-12-11 22:18:48 +05:30
# Workhorse changes
- "GITLAB_WORKHORSE_VERSION"
- "workhorse/**/*"
- ".gitlab/ci/workhorse.gitlab-ci.yml"
2022-05-07 20:08:51 +05:30
# CI Templates changes
- "scripts/lint_templates_bash.rb"
- "lib/gitlab/ci/templates/**/*.gitlab-ci.yml"
2023-01-13 00:05:48 +05:30
# GLFM specification changes
- "glfm_specification/**/*"
2020-03-13 15:44:24 +05:30
2022-08-13 15:12:31 +05:30
.static-analysis-patterns : &static-analysis-patterns
- ".{codeclimate,eslintrc,haml-lint,haml-lint_todo}.yml"
2022-10-11 01:57:18 +05:30
.rubocop-patterns : &rubocop-patterns
- ".{rubocop,rubocop_todo}.yml"
2022-08-13 15:12:31 +05:30
- ".rubocop_todo/**/*.yml"
2022-10-11 01:57:18 +05:30
- "{,ee/,jh/}rubocop/**/*" # We might be changing custom cops
- "{,ee/,jh/}Gemfile.lock" # This should include gitlab-styles, rubocop itself, and any plugins we might be using
- "lib/gitlab_edition.rb" # This is required in RuboCop::CodeReuseHelpers
- ".gitlab/ci/static-analysis.gitlab-ci.yml"
2023-04-23 21:23:45 +05:30
- "config/feature_categories.yml" # Used by RSpec/InvalidFeatureCategory
2022-08-13 15:12:31 +05:30
2021-12-11 22:18:48 +05:30
.danger-patterns : &danger-patterns
2021-09-30 23:02:18 +05:30
- "Dangerfile"
- "danger/**/*"
- "tooling/danger/**/*"
2021-11-18 22:05:49 +05:30
.core-backend-patterns : &core-backend-patterns
- "{,jh/}Gemfile{,.lock}"
- "{,ee/,jh/}config/**/*.rb"
2021-11-11 11:23:49 +05:30
.core-frontend-patterns : &core-frontend-patterns
- "{package.json,yarn.lock}"
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
- "config/helpers/**/*.js"
- "vendor/assets/javascripts/**/*"
2021-12-11 22:18:48 +05:30
.feature-flag-development-config-patterns : &feature-flag-development-config-patterns
2022-11-25 23:54:43 +05:30
- "{,ee/,jh/}config/feature_flags/{development,ops}/*.yml"
2021-12-11 22:18:48 +05:30
2023-01-13 00:05:48 +05:30
.glfm-patterns : &glfm-patterns
- ".gitlab/ci/rules.gitlab-ci.yml"
- "glfm_specification/**/*"
- "scripts/glfm/**/*"
- "scripts/lib/glfm/**/*"
2022-04-04 11:22:00 +05:30
##################
# Conditions set #
##################
.strict-ee-only-rules :
rules :
- << : *if-not-ee
when : never
- << : *if-jh
when : never
2023-01-13 00:05:48 +05:30
.as-if-jh-default-exclusion-rules :
rules :
- << : *if-security-merge-request
when : never
- << : *if-merge-request-targeting-stable-branch
when : never
2023-04-23 21:23:45 +05:30
- << : *if-merge-request-labels-pipeline-expedite
when : never
2023-01-13 00:05:48 +05:30
2022-07-16 23:28:13 +05:30
.rails:rules:run-search-tests :
rules :
2023-05-27 22:25:52 +05:30
- !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-ee-only", rules]
2022-07-16 23:28:13 +05:30
- << : *if-merge-request-labels-group-global-search
changes : *search-backend-patterns
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-labels-group-global-search
changes : *ci-patterns
2022-04-04 11:22:00 +05:30
.rails:rules:ee-and-foss-default-rules :
rules :
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *core-backend-patterns
- << : *if-automated-merge-request
changes : *backend-patterns
- << : *if-security-merge-request
changes : *backend-patterns
2022-11-25 23:54:43 +05:30
- << : *if-merge-request-not-approved
when : never
2022-04-04 11:22:00 +05:30
2023-06-20 00:43:36 +05:30
.rails:rules:system-default-rules :
rules :
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *core-backend-patterns
- << : *if-merge-request
changes : *workhorse-patterns
- << : *if-automated-merge-request
changes : *code-backstage-patterns
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-merge-request-not-approved
when : never
.rails:rules:previous-failed-tests-default-rules :
rules :
- << : *if-security-merge-request
when : never
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *code-backstage-patterns
###########################
# Conditions set for JiHu #
###########################
.rails:rules:predictive-default-rules :
rules :
- << : *if-merge-request-approved
when : never
- << : *if-automated-merge-request
when : never
- << : *if-security-merge-request
when : never
2023-03-17 16:20:25 +05:30
.rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules :
2022-04-04 11:22:00 +05:30
rules :
- << : *if-merge-request
changes : *core-backend-patterns
when : never
- << : *if-merge-request
changes : *ci-patterns
when : never
2023-03-17 16:20:25 +05:30
.rails:rules:unit-integration:predictive-default-rules :
2022-04-04 11:22:00 +05:30
rules :
- << : *if-merge-request-labels-run-all-rspec
when : never
2023-03-17 16:20:25 +05:30
- !reference [".rails:rules:as-if-foss-migration-unit-integration:predictive-default-rules", rules]
2022-04-04 11:22:00 +05:30
2023-06-20 00:43:36 +05:30
.rails:rules:system:predictive-default-rules :
2022-04-04 11:22:00 +05:30
rules :
- << : *if-merge-request-labels-run-all-rspec
2023-06-20 00:43:36 +05:30
when : never
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
changes : *core-backend-patterns
2023-06-20 00:43:36 +05:30
when : never
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
changes : *workhorse-patterns
2022-11-25 23:54:43 +05:30
when : never
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
changes : *ci-patterns
when : never
- << : *if-merge-request
changes : *code-backstage-patterns
2022-04-04 11:22:00 +05:30
2023-06-20 00:43:36 +05:30
.rails:rules:ee-and-foss-migration:predictive :
2022-04-04 11:22:00 +05:30
rules :
2023-06-20 00:43:36 +05:30
- << : *if-fork-merge-request
changes : *db-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
- << : *if-merge-request
changes : *db-patterns
2022-04-04 11:22:00 +05:30
when : never
2023-06-20 00:43:36 +05:30
.rails:rules:ee-and-foss-background-migration:predictive :
rules :
- !reference [".rails:rules:ee-and-foss-migration:predictive", rules]
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
2023-06-20 00:43:36 +05:30
changes : *backend-patterns
.rails:rules:ee-and-foss-unit:predictive :
rules :
- << : *if-fork-merge-request
changes : *backend-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- << : *if-merge-request
changes : *backend-patterns
- << : *if-merge-request
changes : *backstage-patterns
.rails:rules:ee-and-foss-integration:predictive :
rules :
- << : *if-fork-merge-request
changes : *backend-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
- << : *if-merge-request
changes : *backend-patterns
.rails:rules:ee-and-foss-system:predictive :
rules :
- << : *if-fork-merge-request
changes : *code-backstage-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:system:predictive-default-rules", rules]
.rails:rules:ee-only-migration:predictive :
rules :
- << : *if-not-ee
2022-04-04 11:22:00 +05:30
when : never
2023-06-20 00:43:36 +05:30
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
2023-06-20 00:43:36 +05:30
changes : *db-patterns
2022-04-04 11:22:00 +05:30
when : never
2023-06-20 00:43:36 +05:30
.rails:rules:ee-only-background-migration:predictive :
rules :
- !reference [".rails:rules:ee-only-migration:predictive", rules]
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
2023-06-20 00:43:36 +05:30
changes : *backend-patterns
.rails:rules:ee-only-unit:predictive :
rules :
- << : *if-not-ee
2022-04-04 11:22:00 +05:30
when : never
2023-06-20 00:43:36 +05:30
- << : *if-fork-merge-request
changes : *backend-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
2023-06-20 00:43:36 +05:30
changes : *backend-patterns
2022-04-04 11:22:00 +05:30
2023-06-20 00:43:36 +05:30
.rails:rules:ee-only-integration:predictive :
2022-04-04 11:22:00 +05:30
rules :
2023-06-20 00:43:36 +05:30
- << : *if-not-ee
2022-04-04 11:22:00 +05:30
when : never
2023-06-20 00:43:36 +05:30
- << : *if-fork-merge-request
changes : *backend-patterns
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:unit-integration:predictive-default-rules", rules]
2022-04-04 11:22:00 +05:30
- << : *if-merge-request
2023-06-20 00:43:36 +05:30
changes : *backend-patterns
.rails:rules:ee-only-system:predictive :
rules :
- << : *if-not-ee
when : never
- << : *if-fork-merge-request
2022-04-04 11:22:00 +05:30
changes : *code-backstage-patterns
2023-06-20 00:43:36 +05:30
- !reference [".rails:rules:predictive-default-rules", rules]
- !reference [".rails:rules:system:predictive-default-rules", rules]
2022-04-04 11:22:00 +05:30
2020-06-23 00:09:42 +05:30
################
# Shared rules #
################
.shared:rules:update-cache :
rules :
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2021-02-22 17:27:13 +05:30
- << : *if-security-schedule
2023-04-23 21:23:45 +05:30
- << : *if-foss-schedule
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-update-caches
2020-06-23 00:09:42 +05:30
2021-09-04 01:27:46 +05:30
.shared:rules:update-gitaly-binaries-cache :
rules :
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-update-caches
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *gitaly-patterns
2021-09-04 01:27:46 +05:30
2020-07-28 23:09:34 +05:30
######################
# Build images rules #
######################
2023-04-23 21:23:45 +05:30
.build-images:rules:build-qa-image-merge-requests :
2020-07-28 23:09:34 +05:30
rules :
2022-10-11 01:57:18 +05:30
- << : *if-not-canonical-namespace
when : never
2022-07-16 23:28:13 +05:30
- << : *if-merge-request-targeting-stable-branch
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-review-app
2020-07-28 23:09:34 +05:30
- << : *if-dot-com-gitlab-org-and-security-merge-request
changes : *ci-build-images-patterns
- << : *if-dot-com-gitlab-org-and-security-merge-request
changes : *code-qa-patterns
2023-04-23 21:23:45 +05:30
.build-images:rules:build-qa-image :
rules :
- !reference [".build-images:rules:build-qa-image-merge-requests", "rules"]
2022-10-11 01:57:18 +05:30
- << : *if-auto-deploy-branches
2023-03-04 22:38:38 +05:30
variables :
ARCH : amd64,arm64
2023-04-23 21:23:45 +05:30
- << : *if-default-branch-refs
variables :
ARCH : amd64,arm64
- << : *if-tag
2023-01-13 00:05:48 +05:30
variables :
ARCH : amd64,arm64
2023-04-23 21:23:45 +05:30
# TODO: Remove once confirmed on a tag pipeline
allow_failure : true
2020-07-28 23:09:34 +05:30
- << : *if-dot-com-gitlab-org-schedule
2023-01-13 00:05:48 +05:30
variables :
ARCH : amd64,arm64
2022-06-21 17:19:12 +05:30
- << : *if-force-ci
2023-03-17 16:20:25 +05:30
- << : *if-ruby2-branch
2020-07-28 23:09:34 +05:30
2023-04-23 21:23:45 +05:30
.build-images:rules:build-qa-image-as-if-foss :
rules :
- !reference [".build-images:rules:build-qa-image-merge-requests", "rules"]
# We want to rebuild the master image when the full e2e test pipeline runs. Currently this happens on a 2 hour schedule.
.build-images:rules:build-qa-on-gdk-master-image :
rules :
- if : '$QA_RUN_TESTS_ON_GDK !~ /true|yes|1/i'
when : never
- << : *if-not-canonical-namespace
when : never
- << : *if-not-ee
when : never
- << : *if-dot-com-gitlab-org-schedule
variables :
ARCH : amd64,arm64
2020-07-28 23:09:34 +05:30
.build-images:rules:build-assets-image :
rules :
- << : *if-not-canonical-namespace
when : never
2022-07-16 23:28:13 +05:30
- << : *if-merge-request-targeting-stable-branch
2023-06-20 00:43:36 +05:30
- << : *if-ruby2-branch
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-review-app
2023-06-20 00:43:36 +05:30
- << : *if-merge-request-labels-run-all-e2e
2021-04-29 21:17:54 +05:30
- << : *if-auto-deploy-branches
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *ci-build-images-patterns
- << : *if-default-refs
changes : *code-qa-patterns
2023-06-20 00:43:36 +05:30
# Rules to support .qa:rules:package-and-test-mrs
- << : *if-merge-request
changes : *dependency-patterns
- << : *if-merge-request-labels-run-all-e2e
- << : *if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-e2e
changes : *feature-flag-development-config-patterns
- << : *if-merge-request
changes : *feature-flag-development-config-patterns
- << : *if-merge-request
changes : *nodejs-patterns
- << : *if-merge-request
changes : *ci-qa-patterns
- << : *if-force-ci
.build-images:rules:build-assets-image-as-if-foss :
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request-labels-pipeline-expedite
when : never
- !reference [".build-images:rules:build-assets-image", "rules"]
2020-07-28 23:09:34 +05:30
2022-11-25 23:54:43 +05:30
#################
# Caching rules #
#################
.caching:rules:cache-workhorse :
rules :
# That would run for any project that has a "maintenance" pipeline schedule
# but in fact, the cache package is only uploaded for gitlab.com/gitlab-org/gitlab and jihulab.com/gitlab-cn/gitlab
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2022-11-25 23:54:43 +05:30
- << : *if-dot-com-gitlab-org-default-branch
changes : [ "workhorse/**/*" ]
- << : *if-dot-com-gitlab-org-merge-request
changes :
- ".gitlab/ci/caching.gitlab-ci.yml"
- "scripts/gitlab_component_helpers.sh"
when : manual
allow_failure : true
.caching:rules:cache-assets :
rules :
# The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable
- if : '$CACHE_ASSETS_AS_PACKAGE != "true"'
when : never
# That would run for any project that has a "maintenance" pipeline schedule
# but in fact, the cache package is only uploaded for gitlab.com/gitlab-org/gitlab and jihulab.com/gitlab-cn/gitlab
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2022-11-25 23:54:43 +05:30
- << : *if-dot-com-gitlab-org-default-branch
changes : *assets-compilation-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes :
- ".gitlab/ci/caching.gitlab-ci.yml"
- "scripts/gitlab_component_helpers.sh"
- "lib/tasks/gitlab/assets.rake"
when : manual
allow_failure : true
.caching:rules:packages-cleanup :
rules :
# The new strategy to cache assets as generic packages is experimental and can be disabled by removing the `CACHE_ASSETS_AS_PACKAGE` variable
- if : '$CACHE_ASSETS_AS_PACKAGE != "true"'
when : never
# That would run for any project that has a "maintenance" pipeline schedule
# but in fact, the cache package is only uploaded for gitlab.com/gitlab-org/gitlab and jihulab.com/gitlab-cn/gitlab
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2022-11-25 23:54:43 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes :
- ".gitlab/ci/caching.gitlab-ci.yml"
- "scripts/packages/automated_cleanup.rb"
when : manual
allow_failure : true
2022-05-07 20:08:51 +05:30
######################
# CI Templates Rules #
######################
.ci-templates:rules:shellcheck :
rules :
- changes : *ci-templates-patterns
- changes :
- scripts/lint_templates_bash.rb
2020-03-13 15:44:24 +05:30
######################
# Dev fixtures rules #
######################
.dev-fixtures:rules:ee-and-foss :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
.dev-fixtures:rules:ee-only :
rules :
- << : *if-not-ee
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
##############
# Docs rules #
##############
.docs:rules:review-docs :
rules :
- << : *if-dot-com-gitlab-org-merge-request
changes : *docs-patterns
when : manual
2020-05-24 23:13:21 +05:30
allow_failure : true
2020-03-13 15:44:24 +05:30
.docs:rules:docs-lint :
rules :
- << : *if-default-refs
changes : *docs-patterns
2023-04-23 21:23:45 +05:30
.docs:rules:docs-blueprints-lint :
rules :
- << : *if-default-refs
changes : *docs-blueprints-patterns
2022-03-02 08:16:31 +05:30
.docs:rules:deprecations-and-removals :
2021-12-11 22:18:48 +05:30
rules :
- << : *if-default-refs
2022-03-02 08:16:31 +05:30
changes : *docs-deprecations-and-removals-patterns
2021-12-11 22:18:48 +05:30
2023-01-13 00:05:48 +05:30
##################
# GLFM rules #
##################
.glfm:rules:glfm-verify :
# NOTES ON RULES:
# 1. We only run this job in EE because some of the markdown examples in the generated files depend
# on EE-only features. This means that it may fail when it is first run in a full EE pipeline.
# 2. We run this job for the `.setup-test-env-patterns` subset of file changes because:
# A. There are potentially many different source files within the codebase which could
# change the contents of the generated GLFM files, and it is therefore safer to always
# run this job to ensure that no changes are missed.
# B. The `.setup-test-env-patterns` restriction is needed because the job `needs` the
# `setup-test-env` job.
# See more context on each rule in the inline comments below:
rules :
# The `glfm-verify` job has dependencies on EE, so only run it for EE
- !reference [".strict-ee-only-rules", rules]
# If any of the files that are DIRECTLY related to generating or managing the GLFM specification change,
# run `glfm-verify` to get quick feedback on any needed updates, even if the MR is not yet approved
- changes : *glfm-patterns
# Otherwise do not run `glfm-verify` if the MR is not approved
- << : *if-merge-request-not-approved
when : never
# If we passed all the previous rules, run `glfm-verify` if there are any changes that could impact `glfm-verify`.
# This could potentially be a wide range of files, so we reuse `setup-test-env-patterns`, which includes
# almost all app files except docs files.
- changes : *setup-test-env-patterns
# If we are forcing all rspec to run, run this job too.
- << : *if-merge-request-labels-run-all-rspec
2021-03-08 18:12:59 +05:30
##################
# GraphQL rules #
##################
.graphql:rules:graphql-verify :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-not-ee
when : never
- << : *if-default-refs
changes : *code-backstage-qa-patterns
##################
# Frontend rules #
##################
2022-10-11 01:57:18 +05:30
2023-03-17 16:20:25 +05:30
.frontend:rules:predictive-default-rules :
2022-10-11 01:57:18 +05:30
rules :
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-approved
when : never
2022-10-11 01:57:18 +05:30
- << : *if-automated-merge-request
when : never
- << : *if-security-merge-request
when : never
2020-06-23 00:09:42 +05:30
.frontend:rules:compile-production-assets :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-not-canonical-namespace
when : never
2022-07-16 23:28:13 +05:30
- << : *if-merge-request-targeting-stable-branch
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-review-app
2023-06-20 00:43:36 +05:30
- << : *if-merge-request-labels-run-all-e2e
2021-04-29 21:17:54 +05:30
- << : *if-auto-deploy-branches
2023-03-17 16:20:25 +05:30
- << : *if-ruby2-branch
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *ci-build-images-patterns
- << : *if-default-refs
changes : *code-qa-patterns
- << : *if-default-refs
changes : *workhorse-patterns
2020-03-13 15:44:24 +05:30
2023-06-20 00:43:36 +05:30
.frontend:rules:compile-production-assets-as-if-foss :
rules :
- << : *if-not-canonical-namespace
when : never
- << : *if-not-ee
when : never
- << : *if-merge-request-labels-pipeline-expedite
when : never
- !reference [.frontend:rules:compile-production-assets, rules]
2020-06-23 00:09:42 +05:30
.frontend:rules:compile-test-assets :
2020-03-13 15:44:24 +05:30
rules :
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
- << : *if-default-refs
changes : *workhorse-patterns
2020-03-13 15:44:24 +05:30
2020-06-23 00:09:42 +05:30
.frontend:rules:compile-test-assets-as-if-foss :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
- << : *if-merge-request-labels-run-all-rspec
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
- << : *if-default-refs
changes : *startup-css-patterns
- << : *if-default-refs
changes : *workhorse-patterns
2021-11-18 22:05:49 +05:30
2020-03-13 15:44:24 +05:30
.frontend:rules:default-frontend-jobs :
rules :
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-all-rspec
2023-05-27 22:25:52 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-patterns
2020-03-13 15:44:24 +05:30
2021-11-18 22:05:49 +05:30
.frontend:rules:default-frontend-jobs-as-if-foss :
2021-06-08 01:23:25 +05:30
rules :
2022-04-04 11:22:00 +05:30
- !reference [".strict-ee-only-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-security-merge-request
2021-06-08 01:23:25 +05:30
changes : *code-backstage-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *startup-css-patterns
2023-01-13 00:05:48 +05:30
- << : *if-merge-request
changes : *frontend-patterns-for-as-if-foss
2021-06-08 01:23:25 +05:30
2022-08-27 11:52:29 +05:30
.frontend:rules:frontend_fixture-as-if-foss :
2020-03-13 15:44:24 +05:30
rules :
2022-04-04 11:22:00 +05:30
- !reference [".strict-ee-only-rules", rules]
2022-08-27 11:52:29 +05:30
- !reference [".frontend:rules:default-frontend-jobs-as-if-foss", rules]
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-labels-run-all-jest
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
2022-10-11 01:57:18 +05:30
- << : *if-merge-request
changes : *frontend-patterns-for-as-if-foss
2020-05-24 23:13:21 +05:30
2023-05-27 22:25:52 +05:30
.frontend:rules:upload-frontend-fixtures :
rules :
# The new strategy to upload fixtures as generic packages is experimental and can be disabled by removing the `REUSE_FRONTEND_FIXTURES_ENABLED` variable
- if : '$REUSE_FRONTEND_FIXTURES_ENABLED != "true"'
when : never
- << : *if-dot-com-gitlab-org-default-branch
changes : *code-backstage-patterns
- << : *if-foss-default-branch
changes : *code-backstage-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes :
- ".gitlab/ci/frontend.gitlab-ci.yml"
- "scripts/gitlab_component_helpers.sh"
when : manual
allow_failure : true
2021-11-11 11:23:49 +05:30
.frontend:rules:jest :
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-jest
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
- << : *if-merge-request
changes : *frontend-dependency-patterns
2021-11-11 11:23:49 +05:30
- << : *if-merge-request
2022-10-11 01:57:18 +05:30
changes : [ ".gitlab/ci/rules.gitlab-ci.yml" , ".gitlab/ci/frontend.gitlab-ci.yml" ]
2021-11-11 11:23:49 +05:30
- << : *if-automated-merge-request
changes : *code-backstage-patterns
2022-01-26 12:08:38 +05:30
- << : *if-security-merge-request
changes : *code-backstage-patterns
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-not-approved
when : never
- << : *if-default-refs
2021-11-11 11:23:49 +05:30
changes : *code-backstage-patterns
2023-03-17 16:20:25 +05:30
.frontend:rules:jest:predictive :
2021-11-11 11:23:49 +05:30
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
changes : *code-backstage-patterns
2023-03-17 16:20:25 +05:30
- !reference [".frontend:rules:predictive-default-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-jest
2021-11-11 11:23:49 +05:30
when : never
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
2021-11-11 11:23:49 +05:30
when : never
- << : *if-merge-request
2023-01-13 00:05:48 +05:30
changes : *frontend-dependency-patterns
when : never
- << : *if-merge-request
changes : [ ".gitlab/ci/rules.gitlab-ci.yml" , ".gitlab/ci/frontend.gitlab-ci.yml" ]
2021-11-11 11:23:49 +05:30
when : never
- << : *if-merge-request
changes : *code-backstage-patterns
2022-10-11 01:57:18 +05:30
.frontend:rules:jest:as-if-foss :
2022-08-27 11:52:29 +05:30
rules :
- !reference [".strict-ee-only-rules", rules]
2022-10-11 01:57:18 +05:30
- << : *if-merge-request-labels-as-if-foss
- << : *if-merge-request-labels-run-all-jest
2023-01-13 00:05:48 +05:30
- << : *if-merge-request
changes : *frontend-dependency-patterns
2022-08-27 11:52:29 +05:30
- << : *if-security-merge-request
changes : *code-backstage-patterns
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-not-approved
when : never
- << : *if-merge-request
changes : *frontend-patterns-for-as-if-foss
2022-10-11 01:57:18 +05:30
2023-03-17 16:20:25 +05:30
.frontend:rules:jest:predictive:as-if-foss :
2022-10-11 01:57:18 +05:30
rules :
- !reference [".strict-ee-only-rules", rules]
2023-03-17 16:20:25 +05:30
- !reference [".frontend:rules:predictive-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-merge-request-labels-as-if-foss
when : never
2022-08-27 11:52:29 +05:30
- << : *if-merge-request-labels-run-all-jest
when : never
2023-01-13 00:05:48 +05:30
- << : *if-merge-request
changes : *frontend-dependency-patterns
when : never
2022-08-27 11:52:29 +05:30
- << : *if-fork-merge-request
when : never
- << : *if-merge-request
2022-10-11 01:57:18 +05:30
changes : *frontend-patterns-for-as-if-foss
2022-08-27 11:52:29 +05:30
2020-07-28 23:09:34 +05:30
.frontend:rules:eslint-as-if-foss :
rules :
2022-04-04 11:22:00 +05:30
- !reference [".strict-ee-only-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-07-28 23:09:34 +05:30
- << : *if-merge-request
2022-08-27 11:52:29 +05:30
changes : *frontend-patterns-for-as-if-foss
2020-07-28 23:09:34 +05:30
2022-10-11 01:57:18 +05:30
.frontend:rules:coverage-frontend :
2020-05-24 23:13:21 +05:30
rules :
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-10-11 01:57:18 +05:30
when : never
2020-05-24 23:13:21 +05:30
- << : *if-merge-request
changes : *code-backstage-patterns
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-refs
2020-03-13 15:44:24 +05:30
changes : *code-backstage-patterns
2020-06-23 00:09:42 +05:30
.frontend:rules:bundle-size-review :
rules :
2021-04-17 20:07:23 +05:30
- << : *if-not-canonical-namespace
when : never
2022-10-11 01:57:18 +05:30
- << : *if-default-branch-refs
changes : *frontend-build-patterns
allow_failure : true
2023-04-23 21:23:45 +05:30
- if : '$DANGER_GITLAB_API_TOKEN && ($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
2021-04-29 21:17:54 +05:30
changes : *frontend-build-patterns
2020-06-23 00:09:42 +05:30
allow_failure : true
2020-03-13 15:44:24 +05:30
################
# Memory rules #
################
.memory:rules :
rules :
- << : *if-default-refs
changes : *code-patterns
2023-01-13 00:05:48 +05:30
##########
# Notify #
##########
2023-05-27 22:25:52 +05:30
.notify:rules:create-issues-for-failing-tests :
rules :
# Don't report child pipeline failures
- if : '$CI_PIPELINE_SOURCE == "parent_pipeline"'
when : never
- if : '$CREATE_ISSUES_FOR_FAILING_TESTS == "true"'
when : on_failure
allow_failure : true
.notify:rules:notify-package-and-test-failure :
rules :
- << : *if-not-canonical-namespace
when : never
- << : *if-merge-request-targeting-stable-branch
when : always
2020-03-13 15:44:24 +05:30
###############
# Pages rules #
###############
.pages:rules :
rules :
2023-03-04 22:38:38 +05:30
- << : *if-dot-com-ee-schedule-default-branch-maintenance
2020-03-13 15:44:24 +05:30
############
# QA rules #
############
2022-06-21 17:19:12 +05:30
.qa:rules:internal :
rules :
- << : *if-default-refs
changes : *qa-patterns
2020-03-13 15:44:24 +05:30
.qa:rules:ee-and-foss :
rules :
- << : *if-default-refs
changes : *code-qa-patterns
2020-05-24 23:13:21 +05:30
.qa:rules:as-if-foss :
2020-03-13 15:44:24 +05:30
rules :
2022-04-04 11:22:00 +05:30
- !reference [".strict-ee-only-rules", rules]
2020-05-24 23:13:21 +05:30
- << : *if-security-merge-request
changes : *code-qa-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
- << : *if-merge-request-labels-run-all-rspec
2020-03-13 15:44:24 +05:30
2022-06-21 17:19:12 +05:30
.qa:rules:internal-as-if-foss :
rules :
- !reference [".strict-ee-only-rules", rules]
- << : *if-default-refs
changes : *qa-patterns
2022-10-11 01:57:18 +05:30
.qa:rules:determine-e2e-tests :
2022-07-23 23:45:48 +05:30
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request-targeting-stable-branch
allow_failure : true
- << : *if-dot-com-gitlab-org-and-security-merge-request
changes : *code-backstage-qa-patterns
allow_failure : true
- << : *if-dot-com-gitlab-org-schedule
allow_failure : true
- << : *if-force-ci
allow_failure : true
2023-03-17 16:20:25 +05:30
- << : *if-ruby2-branch
2022-07-23 23:45:48 +05:30
2023-06-20 00:43:36 +05:30
.qa:rules:package-and-test-common :
2020-03-13 15:44:24 +05:30
rules :
2022-10-11 01:57:18 +05:30
- << : *if-not-canonical-namespace
when : never
2021-06-08 01:23:25 +05:30
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-07-23 23:45:48 +05:30
when : never
2022-07-16 23:28:13 +05:30
- << : *if-merge-request-targeting-stable-branch
allow_failure : true
2023-03-17 16:20:25 +05:30
- << : *if-ruby2-branch
2022-11-25 23:54:43 +05:30
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
changes : *dependency-patterns
allow_failure : true
variables :
OMNIBUS_GITLAB_BUILD_ON_ALL_OS : 'true'
2023-04-23 21:23:45 +05:30
- << : *if-merge-request-labels-run-all-e2e
allow_failure : true
2022-10-11 01:57:18 +05:30
- << : *if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-e2e
changes : *feature-flag-development-config-patterns
when : manual
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
2022-10-11 01:57:18 +05:30
changes : *feature-flag-development-config-patterns
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
2023-04-23 21:23:45 +05:30
changes : *initializers-patterns
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
2022-06-21 17:19:12 +05:30
changes : *nodejs-patterns
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
2020-07-28 23:09:34 +05:30
changes : *ci-qa-patterns
2020-05-24 23:13:21 +05:30
allow_failure : true
2023-06-20 00:43:36 +05:30
- << : *if-merge-request
changes :
- qa/Gemfile.lock # qa/Gemfile.lock is a part of *qa-patterns, so this rule must be placed before the one with *qa-patterns changes
variables :
UPDATE_QA_CACHE : "true"
- << : *if-merge-request
2020-03-13 15:44:24 +05:30
changes : *qa-patterns
2020-05-24 23:13:21 +05:30
allow_failure : true
2022-08-13 15:12:31 +05:30
- << : *if-dot-com-gitlab-org-and-security-merge-request-and-qa-tests-specified
changes : *code-patterns
allow_failure : true
2023-06-20 00:43:36 +05:30
.qa:rules:package-and-test-mrs :
rules :
- !reference [".qa:rules:package-and-test-common", rules]
- << : *if-merge-request
2020-03-13 15:44:24 +05:30
changes : *code-patterns
when : manual
2020-05-24 23:13:21 +05:30
allow_failure : true
2023-04-23 21:23:45 +05:30
- << : *if-force-ci
when : manual
allow_failure : true
2023-06-20 00:43:36 +05:30
.qa:rules:package-and-test-ee :
2023-04-23 21:23:45 +05:30
rules :
- !reference [".qa:rules:package-and-test-mrs", rules]
2020-03-13 15:44:24 +05:30
- << : *if-dot-com-gitlab-org-schedule
2020-05-24 23:13:21 +05:30
allow_failure : true
2022-10-11 01:57:18 +05:30
variables :
SKIP_REPORT_IN_ISSUES : "false"
PROCESS_TEST_RESULTS : "true"
KNAPSACK_GENERATE_REPORT : "true"
2023-06-20 00:43:36 +05:30
UPDATE_QA_CACHE : "true"
2023-01-13 00:05:48 +05:30
QA_SAVE_TEST_METRICS : "true"
QA_EXPORT_TEST_METRICS : "false" # on main runs, metrics are exported to separate bucket via rake task for better consistency
2023-04-23 21:23:45 +05:30
2023-06-20 00:43:36 +05:30
.qa:rules:package-and-test-ce :
rules :
- << : *if-not-canonical-namespace
when : never
- << : *if-not-ee
when : never
- << : *if-merge-request-labels-pipeline-expedite
when : never
- << : *if-dot-com-gitlab-org-and-security-merge-request
changes : *ci-build-images-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-and-security-merge-request
changes : *code-qa-patterns
when : manual
allow_failure : true
2023-04-23 21:23:45 +05:30
.qa:rules:e2e:test-on-gdk :
rules :
- if : '$QA_RUN_TESTS_ON_GDK !~ /true|yes|1/i'
when : never
2023-06-20 00:43:36 +05:30
- !reference [".qa:rules:package-and-test-common", rules]
- << : *if-merge-request
changes : *code-patterns
allow_failure : true
- << : *if-force-ci
when : manual
allow_failure : true
.qa:rules:package-and-test-sidebar :
rules :
- !reference [".qa:rules:package-and-test-mrs", rules]
- << : *if-dot-com-gitlab-org-schedule
allow_failure : true
variables :
SKIP_REPORT_IN_ISSUES : "true"
PROCESS_TEST_RESULTS : "false"
KNAPSACK_GENERATE_REPORT : "false"
UPDATE_QA_CACHE : "false"
QA_SAVE_TEST_METRICS : "true"
QA_EXPORT_TEST_METRICS : "false" # on main runs, metrics are exported to separate bucket via rake task for better consistency
2020-03-13 15:44:24 +05:30
###############
# Rails rules #
###############
2021-12-11 22:18:48 +05:30
.rails:rules:setup-test-env :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *setup-test-env-patterns
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-all-rspec
2022-05-07 20:08:51 +05:30
.rails:rules:single-db :
2021-11-11 11:23:49 +05:30
rules :
2022-05-07 20:08:51 +05:30
- << : *if-merge-request-labels-run-single-db
- << : *if-merge-request
changes : *db-patterns
2023-05-27 22:25:52 +05:30
- << : *if-merge-request
changes : *decomposed-db-models-patterns
2021-12-11 22:18:48 +05:30
- << : *if-default-branch-schedule-nightly
2021-11-11 11:23:49 +05:30
2023-04-23 21:23:45 +05:30
.rails:rules:db:check-migrations-single-db :
rules :
- << : *if-merge-request-labels-run-single-db
- << : *if-merge-request
changes : *db-patterns
2023-05-27 22:25:52 +05:30
- << : *if-merge-request
changes : *decomposed-db-models-patterns
.rails:rules:single-db-ci-connection :
rules :
- << : *if-merge-request-labels-run-single-db
- << : *if-merge-request
changes : *db-patterns
- << : *if-merge-request
changes : *decomposed-db-models-patterns
- << : *if-default-branch-schedule-nightly
.rails:rules:db:check-migrations-single-db-ci-connection :
rules :
- << : *if-merge-request-labels-run-single-db
- << : *if-merge-request
changes : *db-patterns
- << : *if-merge-request
changes : *decomposed-db-models-patterns
2023-04-23 21:23:45 +05:30
2023-03-17 16:20:25 +05:30
.rails:rules:db-backup :
rules :
- << : *if-merge-request-labels-run-all-rspec
- << : *if-default-refs
changes : *db-backup-patterns
- << : *if-merge-request-not-approved
when : never
- << : *if-default-refs
changes : *db-patterns
2023-04-23 21:23:45 +05:30
.rails:rules:db-rollback :
rules :
- !reference [".rails:rules:ee-and-foss-migration", rules]
- << : *if-default-refs
changes : *initializers-patterns
- << : *if-default-refs
changes :
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/content_security_policy/config_loader{,_spec}.rb"
2022-07-16 23:28:13 +05:30
.rails:rules:praefect-with-db :
rules :
- if : '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-praefect-with-db/'
allow_failure : true
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-migration :
2020-03-13 15:44:24 +05:30
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *core-backend-patterns
2022-04-04 11:22:00 +05:30
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
2021-11-11 11:23:49 +05:30
- << : *if-merge-request
changes : *db-patterns
2022-11-25 23:54:43 +05:30
- << : *if-merge-request-not-approved
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *db-patterns
2020-07-28 23:09:34 +05:30
2023-06-20 00:43:36 +05:30
.rails:rules:rspec-predictive :
2021-02-22 17:27:13 +05:30
rules :
2023-06-20 00:43:36 +05:30
- << : *if-merge-request-approved
when : never
- << : *if-automated-merge-request
when : never
- << : *if-security-merge-request
2021-11-11 11:23:49 +05:30
when : never
2023-06-20 00:43:36 +05:30
- << : *if-merge-request-labels-run-all-rspec
when : never
- << : *if-merge-request
changes : *code-backstage-patterns
2021-02-22 17:27:13 +05:30
2023-03-17 16:20:25 +05:30
.rails:rules:ee-and-foss-background-migration :
rules :
- !reference [".rails:rules:ee-and-foss-migration", rules]
- << : *if-default-refs
changes : *backend-patterns
2021-03-08 18:12:59 +05:30
.rails:rules:ee-and-foss-mr-with-migration :
rules :
- << : *if-merge-request
changes : *db-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2021-03-08 18:12:59 +05:30
2021-03-11 19:13:27 +05:30
.rails:rules:db:gitlabcom-database-testing :
rules :
- if : '$GITLABCOM_DATABASE_TESTING_TRIGGER_TOKEN == null'
when : never
- << : *if-merge-request
changes : *db-patterns
2021-04-29 21:17:54 +05:30
when : manual
2021-03-11 19:13:27 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-unit :
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *backend-patterns
2023-05-27 22:25:52 +05:30
- << : *if-default-refs
changes : *backstage-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-integration :
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-system :
rules :
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:system-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-fast_spec_helper :
rules :
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
2022-07-23 23:45:48 +05:30
changes : *backend-patterns
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *core-backend-patterns
2020-03-13 15:44:24 +05:30
2021-04-17 20:07:23 +05:30
.rails:rules:code-backstage-qa :
2020-03-13 15:44:24 +05:30
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2020-03-13 15:44:24 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-migration :
2020-03-13 15:44:24 +05:30
rules :
2020-05-24 23:13:21 +05:30
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *core-backend-patterns
2022-04-04 11:22:00 +05:30
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
2021-11-11 11:23:49 +05:30
- << : *if-merge-request
changes : *db-patterns
2021-10-27 15:23:28 +05:30
- << : *if-automated-merge-request
changes : *db-patterns
2022-01-26 12:08:38 +05:30
- << : *if-security-merge-request
changes : *db-patterns
2022-11-25 23:54:43 +05:30
- << : *if-merge-request-not-approved
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *db-patterns
2020-03-13 15:44:24 +05:30
2023-03-17 16:20:25 +05:30
.rails:rules:ee-only-background-migration :
rules :
- !reference [".rails:rules:ee-only-migration", rules]
- << : *if-default-refs
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-unit :
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-integration :
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-system :
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2021-10-27 15:23:28 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:system-default-rules", rules]
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:as-if-foss-migration :
rules :
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *core-backend-patterns
2022-04-04 11:22:00 +05:30
# When DB schema changes, many migrations spec may be affected. However, the test mapping from Crystalball does not map db change to a specific migration spec well.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68840.
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-11-24 15:15:51 +05:30
changes : *db-patterns
2021-11-11 11:23:49 +05:30
- << : *if-automated-merge-request
changes : *db-patterns
2022-01-26 12:08:38 +05:30
- << : *if-security-merge-request
changes : *db-patterns
2022-11-25 23:54:43 +05:30
- << : *if-merge-request-not-approved
when : never
2020-07-28 23:09:34 +05:30
2023-03-17 16:20:25 +05:30
.rails:rules:as-if-foss-background-migration :
rules :
- !reference [".rails:rules:as-if-foss-migration", rules]
- << : *if-merge-request-labels-as-if-foss
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:as-if-foss-unit :
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2022-01-26 12:08:38 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-11-24 15:15:51 +05:30
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:as-if-foss-integration :
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2022-01-26 12:08:38 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:ee-and-foss-default-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-11-24 15:15:51 +05:30
changes : *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:as-if-foss-system :
2020-04-08 14:13:33 +05:30
rules :
2020-04-22 19:07:51 +05:30
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- << : *if-fork-merge-request
2022-01-26 12:08:38 +05:30
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:system-default-rules", rules]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-11-24 15:15:51 +05:30
changes : *code-backstage-patterns
2020-04-08 14:13:33 +05:30
2021-03-08 18:12:59 +05:30
.rails:rules:ee-and-foss-db-library-code :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *db-library-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2023-06-20 00:43:36 +05:30
- << : *if-merge-request-labels-run-on-pg12
2021-03-08 18:12:59 +05:30
2021-04-29 21:17:54 +05:30
.rails:rules:ee-mr-and-default-branch-only :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2020-05-24 23:13:21 +05:30
- << : *if-merge-request
changes : *code-backstage-patterns
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-refs
2020-03-13 15:44:24 +05:30
changes : *code-backstage-patterns
2020-11-24 15:15:51 +05:30
.rails:rules:detect-tests :
rules :
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-all-rspec
2023-04-23 21:23:45 +05:30
- << : *if-merge-request
2023-01-13 00:05:48 +05:30
changes : *code-backstage-qa-patterns
2023-04-23 21:23:45 +05:30
- << : *if-merge-request
2023-01-13 00:05:48 +05:30
changes : *workhorse-patterns
2021-12-11 22:18:48 +05:30
.rails:rules:detect-previous-failed-tests :
rules :
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:previous-failed-tests-default-rules", rules]
2021-12-11 22:18:48 +05:30
.rails:rules:rerun-previous-failed-tests :
rules :
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:previous-failed-tests-default-rules", rules]
2020-11-24 15:15:51 +05:30
.rails:rules:rspec-foss-impact :
2020-06-23 00:09:42 +05:30
rules :
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2020-06-23 00:09:42 +05:30
when : never
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-backstage-patterns
2020-11-24 15:15:51 +05:30
.rails:rules:rspec fail-fast :
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-backstage-patterns
.rails:rules:fail-pipeline-early :
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *code-backstage-patterns
when : on_failure
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-backstage-patterns
when : on_failure
2021-03-08 18:12:59 +05:30
.rails:rules:deprecations :
rules :
- << : *if-not-ee
when : never
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-schedule-nightly
2023-03-17 16:20:25 +05:30
- << : *if-ruby2-branch-schedule-nightly
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2021-03-08 18:12:59 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:rspec-coverage :
rules :
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-10-11 01:57:18 +05:30
when : never
2020-11-24 15:15:51 +05:30
- << : *if-merge-request
changes : *code-backstage-patterns
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2020-07-28 23:09:34 +05:30
2022-01-26 12:08:38 +05:30
.rails:rules:rspec-undercoverage :
rules :
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-07-23 23:45:48 +05:30
when : never
2022-01-26 12:08:38 +05:30
- << : *if-merge-request-labels-skip-undercoverage
when : never
2023-06-20 00:43:36 +05:30
# We cannot get the coverage data from child pipeline so we only run undercoverage on full pipelines for now
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113410#note_1335422806
- << : *if-merge-request-not-approved
when : never
2022-01-26 12:08:38 +05:30
- << : *if-merge-request-labels-run-all-rspec
- << : *if-merge-request
changes : *backend-patterns
2023-06-20 00:43:36 +05:30
.rails:rules:rspec-on-pg12 :
rules :
- << : *if-merge-request-labels-run-on-pg12
- !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]
2022-04-04 11:22:00 +05:30
.rails:rules:default-branch-schedule-nightly--code-backstage-default-rules :
2020-07-28 23:09:34 +05:30
rules :
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-schedule-nightly
2020-07-28 23:09:34 +05:30
- << : *if-merge-request
changes : [ ".gitlab/ci/rails.gitlab-ci.yml" ]
2022-04-04 11:22:00 +05:30
.rails:rules:default-branch-schedule-nightly--code-backstage :
rules :
- !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]
2021-04-29 21:17:54 +05:30
.rails:rules:default-branch-schedule-nightly--code-backstage-ee-only :
2020-07-28 23:09:34 +05:30
rules :
- << : *if-not-ee
when : never
2022-04-04 11:22:00 +05:30
- !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]
2020-07-28 23:09:34 +05:30
2021-09-30 23:02:18 +05:30
.rails:rules:rspec-feature-flags :
rules :
- << : *if-not-ee
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-patterns
2021-09-30 23:02:18 +05:30
2022-04-04 11:22:00 +05:30
.rails:rules:flaky-tests-report :
2021-12-11 22:18:48 +05:30
rules :
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-10-11 01:57:18 +05:30
when : never
2023-06-20 00:43:36 +05:30
- if : '$SKIP_FLAKY_TESTS_AUTOMATICALLY != "true" && $RETRY_FAILED_TESTS_IN_NEW_PROCESS != "true"'
when : never
- << : *if-merge-request
changes : *code-backstage-patterns
when : always
- << : *if-default-branch-refs
2021-12-11 22:18:48 +05:30
changes : *code-backstage-patterns
2022-04-04 11:22:00 +05:30
when : always
2021-12-11 22:18:48 +05:30
2021-06-08 01:23:25 +05:30
#########################
# Static analysis rules #
#########################
2022-10-11 01:57:18 +05:30
.static-analysis:rules:static-analysis :
2021-06-08 01:23:25 +05:30
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
- << : *if-default-refs
changes : *static-analysis-patterns
2021-06-08 01:23:25 +05:30
2022-10-11 01:57:18 +05:30
.static-analysis:rules:static-verification-with-database :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2022-10-11 01:57:18 +05:30
.static-analysis:rules:rubocop :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *rubocop-patterns
2022-10-11 01:57:18 +05:30
variables :
RUN_ALL_RUBOCOP : "true"
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2022-10-11 01:57:18 +05:30
.static-analysis:rules:qa:metadata-lint :
2022-06-21 17:19:12 +05:30
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *qa-patterns
- << : *if-default-refs
changes : [ ".gitlab/ci/static-analysis.gitlab-ci.yml" ]
2022-10-11 01:57:18 +05:30
.static-analysis:rules:haml-lint :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *rubocop-patterns
- << : *if-default-refs
changes : *static-analysis-patterns
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2022-06-21 17:19:12 +05:30
2022-10-11 01:57:18 +05:30
.static-analysis:rules:haml-lint-ee :
2021-12-11 22:18:48 +05:30
rules :
- << : *if-not-ee
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *rubocop-patterns
- << : *if-default-refs
changes : *static-analysis-patterns
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2021-12-11 22:18:48 +05:30
2022-10-11 01:57:18 +05:30
.static-analysis:rules:static-analysis-as-if-foss :
2021-06-08 01:23:25 +05:30
rules :
- << : *if-not-ee
when : never
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-as-if-foss
2021-06-08 01:23:25 +05:30
changes : *code-backstage-qa-patterns
- << : *if-security-merge-request
changes : *code-backstage-qa-patterns
- << : *if-merge-request
2022-10-11 01:57:18 +05:30
changes : [ ".gitlab/ci/static-analysis.gitlab-ci.yml" ]
2022-08-13 15:12:31 +05:30
- << : *if-merge-request
changes : *static-analysis-patterns
2021-06-08 01:23:25 +05:30
2023-04-23 21:23:45 +05:30
.semgrep-appsec-custom-rules:rules :
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request
changes : *code-backstage-qa-patterns
.ping-appsec-for-sast-findings:rules :
rules :
# Requiring $CUSTOM_SAST_RULES_BOT_PAT prevents the bot from running on forks or CE
# Without it the script would fail too.
- if : "$CUSTOM_SAST_RULES_BOT_PAT == null"
when : never
- << : *if-not-ee
when : never
- << : *if-merge-request
changes : *code-backstage-qa-patterns
2021-04-29 21:17:54 +05:30
#######################
# Vendored gems rules #
#######################
.vendor:rules:mail-smtp_pool :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/mail-smtp_pool/**/*" ]
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2021-04-29 21:17:54 +05:30
2022-11-25 23:54:43 +05:30
.vendor:rules:attr_encrypted :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/attr_encrypted/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-10-11 01:57:18 +05:30
.vendor:rules:microsoft_graph_mailer :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/microsoft_graph_mailer/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-08-13 15:12:31 +05:30
.vendor:rules:ipynbdiff :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/ipynbdiff/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-08-27 11:52:29 +05:30
.vendor:rules:omniauth-azure-oauth2 :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/omniauth-azure-oauth2/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
.vendor:rules:omniauth-cas3 :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/omniauth-cas3/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-08-13 15:12:31 +05:30
.vendor:rules:omniauth_crowd :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/omniauth_crowd/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
.vendor:rules:omniauth-gitlab :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/omniauth-gitlab/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-10-11 01:57:18 +05:30
.vendor:rules:omniauth-salesforce :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/omniauth-salesforce/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-08-13 15:12:31 +05:30
.vendor:rules:devise-pbkdf2-encryptable :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/devise-pbkdf2-encryptable/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2023-04-23 21:23:45 +05:30
.vendor:rules:gitlab_active_record :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/gitlab_active_record/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2022-10-11 01:57:18 +05:30
.vendor:rules:bundler-checksum :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/bundler-checksum/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2023-05-27 22:25:52 +05:30
.vendor:rules:cloud_profiler_agent :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/cloud_profiler_agent/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2023-06-20 00:43:36 +05:30
.vendor:rules:sidekiq-reliable-fetch :
rules :
- << : *if-merge-request
changes : [ "vendor/gems/sidekiq-reliable-fetch/**/*" ]
- << : *if-merge-request-labels-run-all-rspec
2020-03-13 15:44:24 +05:30
##################
# Releases rules #
##################
.releases:rules:canonical-dot-com-gitlab-stable-branch-only :
rules :
2021-01-29 00:20:46 +05:30
- if : '$CI_COMMIT_MESSAGE =~ /\[merge-train skip\]/'
when : never
2020-03-13 15:44:24 +05:30
- if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/'
2023-05-08 21:46:49 +05:30
.releases:rules:canonical-dot-com-gitlab-stable-branch-only-setup-test-env-patterns :
rules :
- if : '$CI_COMMIT_MESSAGE =~ /\[merge-train skip\]/'
when : never
- if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/'
changes : *setup-test-env-patterns
2020-03-13 15:44:24 +05:30
.releases:rules:canonical-dot-com-security-gitlab-stable-branch-only :
rules :
2021-01-29 00:20:46 +05:30
- if : '$CI_COMMIT_MESSAGE =~ /\[merge-train skip\]/'
when : never
2020-03-13 15:44:24 +05:30
- if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/security/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/'
#################
# Reports rules #
#################
.reports:rules:code_quality :
rules :
- if : '$CODE_QUALITY_DISABLED'
when : never
2023-01-13 00:05:48 +05:30
# Run code_quality on master until https://gitlab.com/gitlab-org/gitlab/-/issues/363747 is resolved
- << : *if-default-branch-refs
2020-03-13 15:44:24 +05:30
- << : *if-default-refs
2023-01-13 00:05:48 +05:30
changes : *code-backstage-qa-patterns
2023-03-17 16:20:25 +05:30
- << : *if-default-refs
changes : *docs-patterns
2020-03-13 15:44:24 +05:30
2021-11-18 22:05:49 +05:30
.reports:rules:brakeman-sast :
2020-03-13 15:44:24 +05:30
rules :
2021-11-18 22:05:49 +05:30
- if : $SAST_DISABLED
2020-03-13 15:44:24 +05:30
when : never
2021-11-18 22:05:49 +05:30
- if : $SAST_EXCLUDED_ANALYZERS =~ /brakeman/
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes :
2021-11-18 22:05:49 +05:30
- '**/*.rb'
- '**/Gemfile'
.reports:rules:semgrep-sast :
rules :
- if : $SAST_DISABLED
when : never
- if : $SAST_EXCLUDED_ANALYZERS =~ /semgrep/
when : never
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes :
2021-11-18 22:05:49 +05:30
- '**/*.py'
- '**/*.js'
- '**/*.jsx'
- '**/*.ts'
- '**/*.tsx'
- '**/*.c'
- '**/*.go'
2022-08-13 15:12:31 +05:30
- '**/*.rb'
2020-03-13 15:44:24 +05:30
2021-06-08 01:23:25 +05:30
.reports:rules:secret_detection :
rules :
- if : '$SECRET_DETECTION_DISABLED'
when : never
2022-07-16 23:28:13 +05:30
# Scan each commit on master to feed the Vulnerability Reports with detected secrets
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2021-06-08 01:23:25 +05:30
2021-09-30 23:02:18 +05:30
.reports:rules:gemnasium-dependency_scanning :
2020-03-13 15:44:24 +05:30
rules :
2022-07-16 23:28:13 +05:30
- if : '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /gemnasium([^-]|$)/'
2020-03-13 15:44:24 +05:30
when : never
2022-07-16 23:28:13 +05:30
# Run Dependency Scanning on master until https://gitlab.com/gitlab-org/gitlab/-/issues/361657 is resolved
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *dependency-patterns
2021-09-30 23:02:18 +05:30
.reports:rules:gemnasium-python-dependency_scanning :
rules :
2022-07-16 23:28:13 +05:30
- if : '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /gemnasium-python/'
2021-09-30 23:02:18 +05:30
when : never
2022-07-16 23:28:13 +05:30
# Run Dependency Scanning on master until https://gitlab.com/gitlab-org/gitlab/-/issues/361657 is resolved
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *python-patterns
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
.reports:rules:yarn-audit-dependency_scanning :
rules :
- if : '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/'
when : never
2022-07-16 23:28:13 +05:30
# Run Dependency Scanning on master until https://gitlab.com/gitlab-org/gitlab/-/issues/361657 is resolved
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *nodejs-patterns
2021-12-11 22:18:48 +05:30
2023-01-13 00:05:48 +05:30
.reports:rules:test-dast :
rules :
- if : '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when : never
- << : *if-merge-request
2021-09-30 23:02:18 +05:30
.reports:rules:package_hunter-yarn :
2021-06-08 01:23:25 +05:30
rules :
2021-09-30 23:02:18 +05:30
- if : "$PACKAGE_HUNTER_USER == null || $PACKAGE_HUNTER_USER == ''"
when : never
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2021-06-08 01:23:25 +05:30
- << : *if-merge-request
changes : [ "yarn.lock" ]
2021-09-30 23:02:18 +05:30
.reports:rules:package_hunter-bundler :
rules :
- if : "$PACKAGE_HUNTER_USER == null || $PACKAGE_HUNTER_USER == ''"
when : never
2023-03-04 22:38:38 +05:30
- << : *if-schedule-maintenance
2021-09-30 23:02:18 +05:30
- << : *if-merge-request
changes : [ "Gemfile.lock" ]
2020-03-13 15:44:24 +05:30
################
# Review rules #
################
2022-10-11 01:57:18 +05:30
.review-change-pattern : &review-change-pattern
APP_CHANGE_TRIGGER : "true"
# The following rules needs to be the same as the one for .review:rules:review-cleanup
# except that:
# - most rules re automatic here (i.e. no `when: manual`) and not allowed to fail (i.e. no `allow_failure: true`) here
# - several rules have `variables: *review-change-pattern` here
2022-01-26 12:08:38 +05:30
.review:rules:start-review-app-pipeline :
2020-03-13 15:44:24 +05:30
rules :
2020-05-24 23:13:21 +05:30
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-07-23 23:45:48 +05:30
when : never
2021-12-11 22:18:48 +05:30
- << : *if-merge-request-labels-run-review-app
2020-05-24 23:13:21 +05:30
- << : *if-dot-com-gitlab-org-merge-request
2020-07-28 23:09:34 +05:30
changes : *ci-review-patterns
2023-03-04 22:38:38 +05:30
allow_failure : true
2020-05-24 23:13:21 +05:30
- << : *if-dot-com-gitlab-org-merge-request
2022-08-27 11:52:29 +05:30
changes : *frontend-build-patterns
2022-10-11 01:57:18 +05:30
variables : *review-change-pattern
2023-03-04 22:38:38 +05:30
allow_failure : true
2022-03-02 08:16:31 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *controllers-patterns
2022-10-11 01:57:18 +05:30
variables : *review-change-pattern
2023-03-04 22:38:38 +05:30
when : manual
allow_failure : true
2022-04-04 11:22:00 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *models-patterns
2022-10-11 01:57:18 +05:30
variables : *review-change-pattern
2023-03-04 22:38:38 +05:30
when : manual
allow_failure : true
2022-07-16 23:28:13 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *lib-gitlab-patterns
2022-10-11 01:57:18 +05:30
variables : *review-change-pattern
2023-03-04 22:38:38 +05:30
when : manual
allow_failure : true
2022-03-02 08:16:31 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *qa-patterns
2023-03-04 22:38:38 +05:30
allow_failure : true
2020-05-24 23:13:21 +05:30
- << : *if-dot-com-gitlab-org-merge-request
2021-04-29 21:17:54 +05:30
changes : *code-patterns
2020-05-24 23:13:21 +05:30
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-schedule
2022-08-13 15:12:31 +05:30
allow_failure : true
2022-01-26 12:08:38 +05:30
variables :
KNAPSACK_GENERATE_REPORT : "true"
2023-01-13 00:05:48 +05:30
QA_SAVE_TEST_METRICS : "true"
QA_EXPORT_TEST_METRICS : "false" # on main runs, metrics are exported to separate bucket via rake task for better consistency
2020-03-13 15:44:24 +05:30
2022-10-11 01:57:18 +05:30
# The following rules needs to be the same as the one for .review:rules:start-review-app-pipeline
# except that:
# - all rules have `when: manual` and `allow_failure: true` here
2023-04-23 21:23:45 +05:30
.review:rules:review-stop-merge-requests :
2020-03-13 15:44:24 +05:30
rules :
2020-05-24 23:13:21 +05:30
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-merge-request-labels-pipeline-expedite
2022-10-11 01:57:18 +05:30
when : never
- << : *if-merge-request-labels-run-review-app
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *ci-review-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-build-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *controllers-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *models-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *lib-gitlab-patterns
when : manual
allow_failure : true
2022-08-13 15:12:31 +05:30
- << : *if-dot-com-gitlab-org-merge-request
2022-10-11 01:57:18 +05:30
changes : *qa-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-patterns
2022-08-13 15:12:31 +05:30
when : manual
allow_failure : true
2023-04-23 21:23:45 +05:30
.review:rules:review-cleanup :
rules :
- !reference [".review:rules:review-stop-merge-requests", rules]
- << : *if-dot-com-ee-schedule-default-branch-maintenance
allow_failure : true
.review:rules:review-stop :
rules :
- !reference [".review:rules:review-stop-merge-requests", rules]
2021-12-11 22:18:48 +05:30
- << : *if-dot-com-gitlab-org-schedule
2023-04-23 21:23:45 +05:30
when : manual
2020-05-24 23:13:21 +05:30
allow_failure : true
2020-04-22 19:07:51 +05:30
2023-03-04 22:38:38 +05:30
.review:rules:review-k8s-resources-count-checks :
rules :
2023-04-23 21:23:45 +05:30
- << : *if-dot-com-ee-schedule-default-branch-maintenance
2023-03-04 22:38:38 +05:30
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes :
- "scripts/review_apps/k8s-resources-count-checks.sh"
allow_failure : true
.review:rules:review-gcp-quotas-checks :
rules :
2023-04-23 21:23:45 +05:30
- << : *if-dot-com-ee-schedule-default-branch-maintenance
2023-03-04 22:38:38 +05:30
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes :
- "scripts/review_apps/gcp-quotas-checks.rb"
allow_failure : true
2020-03-13 15:44:24 +05:30
.review:rules:danger :
rules :
2022-01-26 12:08:38 +05:30
- << : *if-merge-request
2020-03-13 15:44:24 +05:30
2021-09-30 23:02:18 +05:30
.review:rules:danger-local :
rules :
2022-01-26 12:08:38 +05:30
- << : *if-merge-request
2021-12-11 22:18:48 +05:30
changes : *danger-patterns
2021-09-30 23:02:18 +05:30
2020-03-13 15:44:24 +05:30
###############
# Setup rules #
###############
.setup:rules:cache-gems :
rules :
- << : *if-not-canonical-namespace
when : never
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-or-tag
2020-03-13 15:44:24 +05:30
changes : *code-backstage-qa-patterns
2022-10-11 01:57:18 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : [ ".gitlab/ci/setup.gitlab-ci.yml" ]
when : manual
allow_failure : true
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
.setup:rules:dont-interrupt-me :
rules :
2021-04-29 21:17:54 +05:30
- << : *if-default-branch-or-tag
2020-05-24 23:13:21 +05:30
allow_failure : true
2023-03-04 22:38:38 +05:30
- << : *if-schedule-pipeline
allow_failure : true
2020-04-22 19:07:51 +05:30
- << : *if-auto-deploy-branches
2020-05-24 23:13:21 +05:30
allow_failure : true
2020-04-22 19:07:51 +05:30
- when : manual
2020-05-24 23:13:21 +05:30
allow_failure : true
2020-04-22 19:07:51 +05:30
2020-03-13 15:44:24 +05:30
.setup:rules:gitlab_git_test :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
2023-05-27 22:25:52 +05:30
.setup:rules:rails-production-server-boot :
2023-04-23 21:23:45 +05:30
rules :
- << : *if-default-refs
changes : *code-patterns
2021-12-11 22:18:48 +05:30
.setup:rules:no-ee-check :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-not-foss
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
2021-12-11 22:18:48 +05:30
.setup:rules:no-jh-check :
rules :
- << : *if-jh
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
2023-03-17 16:20:25 +05:30
.setup:rules:verify-ruby-3.0 :
2022-08-13 15:12:31 +05:30
rules :
2023-03-17 16:20:25 +05:30
- << : *if-merge-request-labels-run-in-ruby2
2022-08-13 15:12:31 +05:30
2020-11-24 15:15:51 +05:30
.setup:rules:verify-tests-yml :
rules :
- << : *if-not-ee
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
2022-06-21 17:19:12 +05:30
.setup:rules:jh-contribution :
rules :
- << : *if-jh
when : never
- << : *if-merge-request-labels-jh-contribution
2022-01-26 12:08:38 +05:30
.setup:rules:generate-frontend-fixtures-mapping :
rules :
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-dot-com-ee-schedule-default-branch-maintenance
2023-04-23 21:23:45 +05:30
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
changes :
2022-01-26 12:08:38 +05:30
- ".gitlab/ci/setup.gitlab-ci.yml"
- ".gitlab/ci/test-metadata.gitlab-ci.yml"
- "scripts/rspec_helpers.sh"
2020-03-13 15:44:24 +05:30
#######################
# Test metadata rules #
#######################
.test-metadata:rules:retrieve-tests-metadata :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *code-backstage-patterns
- << : *if-default-refs
changes : *workhorse-patterns
2021-11-18 22:05:49 +05:30
- << : *if-merge-request-labels-run-all-rspec
2023-05-27 22:25:52 +05:30
- << : *if-merge-request-labels-frontend-and-feature-flag
2020-03-13 15:44:24 +05:30
.test-metadata:rules:update-tests-metadata :
rules :
2020-05-24 23:13:21 +05:30
- << : *if-not-ee
when : never
2023-03-04 22:38:38 +05:30
- << : *if-dot-com-ee-schedule-default-branch-maintenance
2023-04-23 21:23:45 +05:30
when : always
- << : *if-default-branch-refs
2023-01-13 00:05:48 +05:30
changes :
2020-05-24 23:13:21 +05:30
- ".gitlab/ci/test-metadata.gitlab-ci.yml"
- "scripts/rspec_helpers.sh"
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
###################
# workhorse rules #
###################
.workhorse:rules:workhorse :
rules :
2023-01-13 00:05:48 +05:30
- << : *if-default-refs
changes : *workhorse-patterns
2021-02-22 17:27:13 +05:30
2021-01-29 00:20:46 +05:30
###################
# yaml-lint rules #
###################
.yaml-lint:rules :
2020-03-13 15:44:24 +05:30
rules :
- << : *if-default-refs
2021-01-29 00:20:46 +05:30
changes : *yaml-lint-patterns
2022-07-23 23:45:48 +05:30
.lint-pipeline-yaml:rules :
rules :
- << : *if-default-refs
changes : *lint-pipeline-yaml-patterns
.lint-metrics-yaml:rules :
rules :
- << : *if-default-refs
changes : *lint-metrics-yaml-patterns
2023-01-13 00:05:48 +05:30
##################
# as-if-jh rules #
##################
.as-if-jh:rules:prepare-as-if-jh :
rules :
- !reference [".strict-ee-only-rules", rules]
- !reference [".as-if-jh-default-exclusion-rules", rules]
- << : *if-merge-request-labels-as-if-jh
2023-03-17 16:20:25 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *feature-flag-development-config-patterns
2023-01-13 00:05:48 +05:30
# This rule should share the same logic with .as-if-jh:rules:prepare-as-if-jh
# Because the jobs using this need jobs using the preparation rules
.as-if-jh:rules:start-as-if-jh :
rules :
- !reference [".strict-ee-only-rules", rules]
- !reference [".as-if-jh-default-exclusion-rules", rules]
- << : *if-merge-request-labels-as-if-jh
allow_failure : true # See https://gitlab.com/gitlab-org/gitlab/-/issues/351136
2023-03-17 16:20:25 +05:30
- << : *if-dot-com-gitlab-org-merge-request
changes : *feature-flag-development-config-patterns
allow_failure : true # See https://gitlab.com/gitlab-org/gitlab/-/issues/351136
2023-05-08 21:46:49 +05:30
##############################
# release-environments rules #
##############################
.release-environments:rules:start-release-environments-pipeline :
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request-labels-pipeline-expedite
when : never
- !reference [".releases:rules:canonical-dot-com-gitlab-stable-branch-only-setup-test-env-patterns", rules]