2020-02-18 10:08:51 -05:00
##############
# Conditions #
##############
.if-not-canonical-namespace : &if-not-canonical-namespace
if : '$CI_PROJECT_NAMESPACE !~ /^gitlab(-org)?($|\/)/'
.if-not-ee : &if-not-ee
if : '$CI_PROJECT_NAME !~ /^gitlab(-ee)?$/'
.if-not-foss : &if-not-foss
if : '$CI_PROJECT_NAME != "gitlab-foss" && $CI_PROJECT_NAME != "gitlab-ce" && $CI_PROJECT_NAME != "gitlabhq"'
.if-default-refs : &if-default-refs
2020-07-03 11:09:13 -04:00
if : '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/ || $CI_COMMIT_REF_NAME =~ /^\d+-\d+-auto-deploy-\d+$/ || $CI_COMMIT_REF_NAME =~ /^security\// || $CI_MERGE_REQUEST_IID || $CI_COMMIT_TAG || $FORCE_GITLAB_CI'
2020-02-18 10:08:51 -05:00
.if-master-refs : &if-master-refs
if : '$CI_COMMIT_REF_NAME == "master"'
2020-04-28 05:09:34 -04:00
.if-master-push : &if-master-push
if : '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push"'
.if-master-schedule-2-hourly : &if-master-schedule-2-hourly
if : '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"'
.if-master-schedule-nightly : &if-master-schedule-nightly
if : '$CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"'
2020-03-27 05:08:28 -04:00
.if-auto-deploy-branches : &if-auto-deploy-branches
if : '$CI_COMMIT_BRANCH =~ /^\d+-\d+-auto-deploy-\d+$/'
2020-02-18 10:08:51 -05:00
.if-master-or-tag : &if-master-or-tag
if : '$CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_TAG'
.if-merge-request : &if-merge-request
if : '$CI_MERGE_REQUEST_IID'
2020-05-15 11:08:04 -04:00
.if-merge-request-title-as-if-foss : &if-merge-request-title-as-if-foss
if : '$CI_MERGE_REQUEST_TITLE =~ /RUN AS-IF-FOSS/'
2020-06-02 08:08:33 -04:00
.if-merge-request-title-update-caches : &if-merge-request-title-update-caches
if : '$CI_MERGE_REQUEST_TITLE =~ /UPDATE CACHE/'
2020-07-13 05:09:29 -04:00
.if-merge-request-title-run-all-rspec : &if-merge-request-title-run-all-rspec
if : '$CI_MERGE_REQUEST_TITLE =~ /RUN ALL RSPEC/'
2020-05-15 11:08:04 -04:00
.if-security-merge-request : &if-security-merge-request
if : '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_MERGE_REQUEST_IID'
2020-02-18 10:08:51 -05:00
.if-dot-com-gitlab-org-schedule : &if-dot-com-gitlab-org-schedule
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "schedule"'
.if-dot-com-gitlab-org-master : &if-dot-com-gitlab-org-master
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_COMMIT_REF_NAME == "master"'
.if-dot-com-gitlab-org-merge-request : &if-dot-com-gitlab-org-merge-request
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_MERGE_REQUEST_IID'
2020-06-10 14:09:15 -04:00
.if-dot-com-gitlab-org-and-security-merge-request : &if-dot-com-gitlab-org-and-security-merge-request
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_MERGE_REQUEST_IID'
2020-02-18 10:08:51 -05:00
.if-dot-com-gitlab-org-and-security-tag : &if-dot-com-gitlab-org-and-security-tag
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_COMMIT_TAG'
.if-dot-com-ee-schedule : &if-dot-com-ee-schedule
if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule"'
.if-cache-credentials-schedule : &if-cache-credentials-schedule
if : '$CI_REPO_CACHE_CREDENTIALS && $CI_PIPELINE_SOURCE == "schedule"'
2020-09-14 11:09:28 -04:00
.if-rspec-fail-fast-disabled : &if-rspec-fail-fast-disabled
if : '$RSPEC_FAIL_FAST_ENABLED != "true"'
.if-rspec-fail-fast-skipped : &if-rspec-fail-fast-skipped
if : '$CI_MERGE_REQUEST_TITLE =~ /SKIP RSPEC FAIL-FAST/'
2020-02-18 10:08:51 -05:00
####################
# Changes patterns #
####################
2020-05-07 05:09:51 -04:00
.ci-patterns : &ci-patterns
2020-05-15 11:08:04 -04:00
- ".gitlab-ci.yml"
2020-05-07 05:09:51 -04:00
- ".gitlab/ci/**/*"
2020-06-18 14:08:58 -04:00
.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"
2020-08-22 08:10:10 -04:00
- "scripts/trigger-build"
2020-06-18 14:08:58 -04:00
.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"
2020-02-18 10:08:51 -05:00
.yaml-patterns : &yaml-patterns
- "**/*.yml"
.docs-patterns : &docs-patterns
- ".gitlab/route-map.yml"
- "doc/**/*"
- ".markdownlint.json"
2020-03-19 20:09:29 -04:00
.frontend-dependency-patterns : &frontend-dependency-patterns
- "{package.json,yarn.lock}"
.frontend-patterns : &frontend-patterns
- "{package.json,yarn.lock}"
2020-05-20 14:08:00 -04:00
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2020-03-19 20:09:29 -04:00
- ".csscomb.json"
- "Dockerfile.assets"
2020-05-20 14:08:00 -04:00
- "config/**/*.js"
2020-03-19 20:09:29 -04:00
- "vendor/assets/**/*"
- "{,ee/}{app/assets,app/helpers,app/presenters,app/views,locale,public,symbol}/**/*"
2020-06-18 08:09:25 -04:00
.backend-patterns : &backend-patterns
- "Gemfile{,.lock}"
- "Rakefile"
- "config.ru"
2020-06-26 05:08:59 -04:00
# List explicitly all the app/ dirs that are backend (i.e. all except app/assets).
2020-06-18 08:09:25 -04:00
- "{,ee/}{app/channels,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}/**/*"
- "{,ee/}{bin,cable,config,db,lib}/**/*"
2020-06-26 05:08:59 -04:00
- "{,ee/}spec/**/*.rb"
2020-07-09 08:08:56 -04:00
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-09-16 11:09:32 -04:00
- "*_VERSION"
2020-06-18 08:09:25 -04:00
.db-patterns : &db-patterns
2020-07-07 11:08:49 -04:00
- "{,ee/}{,spec/}{db,migrations}/**/*"
- "{,ee/}{,spec/}lib/{,ee/}gitlab/background_migration/**/*"
2020-07-20 05:09:22 -04:00
- "config/prometheus/common_metrics.yml" # Used by Gitlab::DatabaseImporters::CommonMetrics::Importer
2020-08-25 05:10:42 -04:00
- "{,ee/}app/models/project_statistics.rb" # Used to calculate sizes in migration specs
2020-06-18 08:09:25 -04:00
2020-02-18 10:08:51 -05:00
.backstage-patterns : &backstage-patterns
- "Dangerfile"
- "danger/**/*"
- "{,ee/}fixtures/**/*"
- "{,ee/}rubocop/**/*"
- "{,ee/}spec/**/*"
.code-patterns : &code-patterns
2020-03-19 20:09:29 -04:00
- "{package.json,yarn.lock}"
2020-05-20 14:08:00 -04:00
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2020-03-19 20:09:29 -04:00
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-02-18 10:08:51 -05:00
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
2020-08-25 11:10:17 -04:00
- "tests.yml"
2020-02-18 10:08:51 -05:00
- "config.ru"
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
.qa-patterns : &qa-patterns
- ".dockerignore"
- "qa/**/*"
.code-backstage-patterns : &code-backstage-patterns
2020-03-19 20:09:29 -04:00
- "{package.json,yarn.lock}"
2020-05-20 14:08:00 -04:00
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2020-03-19 20:09:29 -04:00
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-02-18 10:08:51 -05:00
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
2020-08-25 11:10:17 -04:00
- "tests.yml"
2020-02-18 10:08:51 -05:00
- "config.ru"
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
# Backstage changes
- "Dangerfile"
- "danger/**/*"
- "{,ee/}fixtures/**/*"
- "{,ee/}rubocop/**/*"
- "{,ee/}spec/**/*"
.code-qa-patterns : &code-qa-patterns
2020-03-19 20:09:29 -04:00
- "{package.json,yarn.lock}"
2020-05-20 14:08:00 -04:00
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2020-03-19 20:09:29 -04:00
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-02-18 10:08:51 -05:00
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
2020-08-25 11:10:17 -04:00
- "tests.yml"
2020-02-18 10:08:51 -05:00
- "config.ru"
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
# QA changes
- ".dockerignore"
- "qa/**/*"
.code-backstage-qa-patterns : &code-backstage-qa-patterns
2020-03-19 20:09:29 -04:00
- "{package.json,yarn.lock}"
2020-05-20 14:08:00 -04:00
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
2020-03-19 20:09:29 -04:00
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-02-18 10:08:51 -05:00
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
- "*_VERSION"
- "Gemfile{,.lock}"
- "Rakefile"
2020-08-25 11:10:17 -04:00
- "tests.yml"
2020-02-18 10:08:51 -05:00
- "config.ru"
- "{,ee/}{app,bin,config,db,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
# Backstage changes
- "Dangerfile"
- "danger/**/*"
- "{,ee/}fixtures/**/*"
- "{,ee/}rubocop/**/*"
- "{,ee/}spec/**/*"
# QA changes
- ".dockerignore"
- "qa/**/*"
2020-06-02 08:08:33 -04:00
################
# Shared rules #
################
.shared:rules:update-cache :
rules :
- << : *if-master-schedule-2-hourly
- << : *if-merge-request-title-update-caches
2020-06-18 14:08:58 -04:00
######################
# Build images rules #
######################
.build-images:rules:build-qa-image :
rules :
- << : *if-not-ee
when : never
- << : *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
- << : *if-dot-com-gitlab-org-schedule
.build-images:rules:build-assets-image :
rules :
- << : *if-not-canonical-namespace
when : never
- changes : *ci-build-images-patterns
2020-06-19 02:08:36 -04:00
- changes : *code-qa-patterns
2020-06-18 14:08:58 -04:00
2020-02-18 10:08:51 -05:00
####################
# Cache repo rules #
####################
.cache-repo:rules :
rules :
- << : *if-cache-credentials-schedule
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
#############
# CNG rules #
#############
.cng:rules :
rules :
- << : *if-dot-com-gitlab-org-and-security-tag
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
######################
# Dev fixtures rules #
######################
.dev-fixtures:rules:ee-and-foss :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
.dev-fixtures:rules:ee-only :
rules :
- << : *if-not-ee
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
##############
# Docs rules #
##############
.docs:rules:review-docs :
rules :
- << : *if-dot-com-gitlab-org-merge-request
changes : *docs-patterns
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.docs:rules:docs-lint :
rules :
- << : *if-default-refs
changes : *docs-patterns
when : on_success
.docs:rules:graphql-reference-verify :
rules :
- << : *if-not-ee
when : never
- << : *if-default-refs
changes : *code-backstage-qa-patterns
when : on_success
##################
# Frontend rules #
##################
2020-06-02 08:08:33 -04:00
.frontend:rules:compile-production-assets :
2020-02-18 10:08:51 -05:00
rules :
- << : *if-not-canonical-namespace
when : never
- << : *if-default-refs
2020-06-18 05:08:41 -04:00
changes : *code-qa-patterns
2020-02-18 10:08:51 -05:00
2020-06-02 08:08:33 -04:00
.frontend:rules:compile-test-assets :
2020-02-18 10:08:51 -05:00
rules :
2020-06-02 08:08:33 -04:00
- changes : *code-backstage-qa-patterns
2020-02-18 10:08:51 -05:00
2020-06-02 08:08:33 -04:00
.frontend:rules:compile-test-assets-as-if-foss :
2020-02-18 10:08:51 -05:00
rules :
- << : *if-not-ee
when : never
2020-07-08 02:09:13 -04:00
- << : *if-merge-request # Always run for MRs since `compile-test-assets as-if-foss` is either needed by `rspec foss-impact` or the `rspec * as-if-foss` jobs.
2020-05-15 11:08:04 -04:00
changes : *code-backstage-qa-patterns
2020-02-18 10:08:51 -05:00
.frontend:rules:default-frontend-jobs :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
2020-05-15 11:08:04 -04:00
.frontend:rules:default-frontend-jobs-as-if-foss :
2020-02-18 10:08:51 -05:00
rules :
- << : *if-not-ee
when : never
2020-05-15 11:08:04 -04:00
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-merge-request-title-as-if-foss
- << : *if-merge-request
changes : *ci-patterns
2020-02-18 10:08:51 -05:00
2020-07-09 05:09:27 -04:00
.frontend:rules:eslint-as-if-foss :
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request-title-as-if-foss
when : never
- << : *if-merge-request
changes : *frontend-patterns
2020-04-24 14:09:46 -04:00
.frontend:rules:ee-mr-and-master-only :
rules :
- << : *if-not-ee
when : never
- << : *if-merge-request
changes : *code-backstage-patterns
- << : *if-master-refs
changes : *code-backstage-patterns
2020-02-18 10:08:51 -05:00
.frontend:rules:qa-frontend-node :
rules :
- << : *if-master-refs
2020-04-06 08:10:44 -04:00
changes : *frontend-dependency-patterns
2020-03-12 11:09:39 -04:00
- << : *if-merge-request
changes : *frontend-dependency-patterns
2020-02-18 10:08:51 -05:00
2020-05-07 05:09:51 -04:00
.frontend:rules:qa-frontend-node-latest :
rules :
- << : *if-master-refs
changes : *frontend-dependency-patterns
allow_failure : true
- << : *if-merge-request
changes : *frontend-dependency-patterns
allow_failure : true
2020-05-20 14:08:00 -04:00
.frontend:rules:bundle-size-review :
rules :
- if : '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
changes : *frontend-patterns
allow_failure : true
2020-02-18 10:08:51 -05:00
################
# Memory rules #
################
.memory:rules :
rules :
- << : *if-default-refs
changes : *code-patterns
when : on_success
###############
# Pages rules #
###############
.pages:rules :
rules :
2020-03-18 14:09:35 -04:00
- << : *if-not-ee
when : never
2020-06-30 05:08:37 -04:00
- << : *if-master-schedule-2-hourly
2020-02-18 10:08:51 -05:00
############
# QA rules #
############
.qa:rules:ee-and-foss :
rules :
- << : *if-default-refs
changes : *code-qa-patterns
when : on_success
2020-05-15 11:08:04 -04:00
.qa:rules:as-if-foss :
2020-02-18 10:08:51 -05:00
rules :
- << : *if-not-ee
when : never
2020-05-15 11:08:04 -04:00
- << : *if-security-merge-request
changes : *code-qa-patterns
- << : *if-merge-request-title-as-if-foss
- << : *if-merge-request
changes : *ci-patterns
2020-02-18 10:08:51 -05:00
.qa:rules:package-and-qa :
rules :
2020-06-10 14:09:15 -04:00
- << : *if-dot-com-gitlab-org-and-security-merge-request
2020-06-18 14:08:58 -04:00
changes : *ci-qa-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-06-10 14:09:15 -04:00
- << : *if-dot-com-gitlab-org-and-security-merge-request
2020-02-18 10:08:51 -05:00
changes : *qa-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-06-10 14:09:15 -04:00
- << : *if-dot-com-gitlab-org-and-security-merge-request
2020-02-18 10:08:51 -05:00
changes : *code-patterns
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-schedule
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
###############
# Rails rules #
###############
2020-06-18 08:09:25 -04:00
.rails:rules:ee-and-foss-migration :
2020-02-18 10:08:51 -05:00
rules :
2020-06-18 08:09:25 -04:00
- changes : *db-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-and-foss-unit :
rules :
- changes : *backend-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-and-foss-integration :
rules :
- changes : *backend-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-and-foss-system :
rules :
- changes : *code-backstage-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-and-foss-fast_spec_helper :
rules :
- changes : [ "config/**/*" ]
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-02-18 10:08:51 -05:00
.rails:rules:default-refs-code-backstage-qa :
rules :
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2020-06-18 08:09:25 -04:00
.rails:rules:ee-only-migration :
2020-02-18 10:08:51 -05:00
rules :
- << : *if-not-ee
when : never
2020-06-18 08:09:25 -04:00
- changes : *db-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-only-unit :
rules :
- << : *if-not-ee
when : never
- changes : *backend-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-only-integration :
rules :
- << : *if-not-ee
when : never
- changes : *backend-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:ee-only-system :
rules :
- << : *if-not-ee
when : never
- changes : *code-backstage-patterns
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-18 08:09:25 -04:00
.rails:rules:as-if-foss-migration :
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *db-patterns
- << : *if-merge-request-title-as-if-foss
2020-09-11 17:08:44 -04:00
changes : *db-patterns
2020-06-18 08:09:25 -04:00
- << : *if-merge-request
changes : *ci-patterns
.rails:rules:as-if-foss-unit :
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *backend-patterns
- << : *if-merge-request-title-as-if-foss
2020-09-11 17:08:44 -04:00
changes : *backend-patterns
2020-06-18 08:09:25 -04:00
- << : *if-merge-request
changes : *ci-patterns
.rails:rules:as-if-foss-integration :
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *backend-patterns
- << : *if-merge-request-title-as-if-foss
2020-09-11 17:08:44 -04:00
changes : *backend-patterns
2020-06-18 08:09:25 -04:00
- << : *if-merge-request
changes : *ci-patterns
2020-02-18 10:08:51 -05:00
2020-06-18 08:09:25 -04:00
.rails:rules:as-if-foss-system :
2020-05-15 11:08:04 -04:00
rules :
- << : *if-not-ee
when : never
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-merge-request-title-as-if-foss
2020-09-11 17:08:44 -04:00
changes : *code-backstage-patterns
2020-05-15 11:08:04 -04:00
- << : *if-merge-request
changes : *ci-patterns
2020-04-24 14:09:46 -04:00
.rails:rules:ee-mr-and-master-only :
rules :
- << : *if-not-ee
when : never
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-04-24 14:09:46 -04:00
- << : *if-merge-request
changes : *code-backstage-patterns
- << : *if-master-refs
changes : *code-backstage-patterns
2020-09-01 08:11:01 -04:00
.rails:rules:detect-tests :
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:rspec-foss-impact :
2020-06-02 05:08:01 -04:00
rules :
- << : *if-not-ee
when : never
2020-06-16 08:09:00 -04:00
- << : *if-merge-request-title-as-if-foss
when : never
2020-06-02 05:08:01 -04:00
- << : *if-security-merge-request
changes : *code-backstage-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-backstage-patterns
2020-09-14 11:09:28 -04:00
.rails:rules:rspec fail-fast :
rules :
- << : *if-rspec-fail-fast-disabled
when : never
- << : *if-rspec-fail-fast-skipped
when : never
- << : *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-rspec-fail-fast-disabled
when : never
- << : *if-rspec-fail-fast-skipped
when : never
- << : *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
2020-02-18 10:08:51 -05:00
.rails:rules:downtime_check :
rules :
- << : *if-merge-request
changes : *code-backstage-patterns
2020-06-30 05:08:37 -04:00
.rails:rules:rspec-coverage :
rules :
- << : *if-not-ee
when : never
2020-09-10 14:08:54 -04:00
- << : *if-merge-request
changes : *code-backstage-patterns
2020-06-30 05:08:37 -04:00
- << : *if-master-schedule-2-hourly
2020-07-13 05:09:29 -04:00
- << : *if-merge-request-title-run-all-rspec
2020-06-30 05:08:37 -04:00
2020-07-09 08:08:56 -04:00
.rails:rules:master-schedule-nightly--code-backstage :
rules :
- << : *if-master-schedule-nightly
- << : *if-merge-request
changes : [ ".gitlab/ci/rails.gitlab-ci.yml" ]
.rails:rules:master-schedule-nightly--code-backstage-ee-only :
rules :
- << : *if-not-ee
when : never
- << : *if-master-schedule-nightly
- << : *if-merge-request
changes : [ ".gitlab/ci/rails.gitlab-ci.yml" ]
2020-02-18 10:08:51 -05:00
##################
# Releases rules #
##################
.releases:rules:canonical-dot-com-gitlab-stable-branch-only :
rules :
2020-02-20 07:08:51 -05:00
- if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/'
2020-02-18 10:08:51 -05:00
.releases:rules:canonical-dot-com-security-gitlab-stable-branch-only :
rules :
2020-02-20 07:08:51 -05:00
- if : '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/security/gitlab" && $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable-ee$/'
2020-02-18 10:08:51 -05:00
#################
# Reports rules #
#################
.reports:rules:code_quality :
rules :
- if : '$CODE_QUALITY_DISABLED'
when : never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- << : *if-default-refs
changes : *code-backstage-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.reports:rules:sast :
rules :
- if : '$SAST_DISABLED || $GITLAB_FEATURES !~ /\bsast\b/'
when : never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.reports:rules:dependency_scanning :
rules :
- if : '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/'
when : never
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- << : *if-default-refs
changes : *code-backstage-qa-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.reports:rules:dast :
rules :
- if : '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when : never
2020-03-19 20:09:29 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
2020-03-19 20:09:29 -04:00
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.reports:schedule-dast :
rules :
- if : '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when : never
2020-08-25 08:04:30 -04:00
- << : *if-master-schedule-nightly
2020-08-24 14:10:19 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
################
# Review rules #
################
2020-06-18 14:08:58 -04:00
.review:rules:review-build-cng :
2020-02-18 10:08:51 -05:00
rules :
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-05-07 05:09:51 -04:00
- << : *if-dot-com-gitlab-org-merge-request
2020-06-18 14:08:58 -04:00
changes : *ci-review-patterns
2020-05-07 05:09:51 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-schedule
2020-02-18 10:08:51 -05:00
2020-08-27 11:10:21 -04:00
.review:rules:review-deploy :
rules :
- << : *if-not-ee
when : never
- << : *if-dot-com-gitlab-org-merge-request
changes : *ci-review-patterns
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-patterns
allow_failure : true
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-schedule
allow_failure : true
.review:rules:review-performance :
2020-03-19 20:09:29 -04:00
rules :
2020-08-24 14:10:19 -04:00
- if : '$DAST_RUN == "true"' # Skip this job when DAST is run
when : never
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-05-07 05:09:51 -04:00
- << : *if-dot-com-gitlab-org-merge-request
2020-06-18 14:08:58 -04:00
changes : *ci-review-patterns
2020-03-19 20:09:29 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-19 20:09:29 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
allow_failure : true
- << : *if-dot-com-gitlab-org-schedule
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-19 20:09:29 -04:00
2020-05-07 05:09:51 -04:00
.review:rules:review-stop-failed-deployment :
2020-02-18 10:08:51 -05:00
rules :
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
2020-05-07 05:09:51 -04:00
.review:rules:review-qa-smoke :
2020-03-19 20:09:29 -04:00
rules :
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-05-07 05:09:51 -04:00
- << : *if-dot-com-gitlab-org-merge-request
2020-06-18 14:08:58 -04:00
changes : *ci-review-patterns
2020-03-19 20:09:29 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *frontend-patterns
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-19 20:09:29 -04:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-19 20:09:29 -04:00
2020-02-18 10:08:51 -05:00
.review:rules:mr-only-manual :
rules :
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.review:rules:review-cleanup :
rules :
2020-05-05 08:09:31 -04:00
- << : *if-not-ee
when : never
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
- << : *if-dot-com-gitlab-org-schedule
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
2020-09-01 14:10:48 -04:00
.review:rules:review-stop :
rules :
- << : *if-not-ee
when : never
- << : *if-dot-com-gitlab-org-merge-request
changes : *code-qa-patterns
when : manual
allow_failure : true
2020-09-02 11:10:54 -04:00
- << : *if-dot-com-gitlab-org-schedule
2020-09-01 14:10:48 -04:00
allow_failure : true
2020-02-18 10:08:51 -05:00
.review:rules:danger :
rules :
- if : '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID'
###############
# Setup rules #
###############
.setup:rules:cache-gems :
rules :
- << : *if-not-canonical-namespace
when : never
- << : *if-master-or-tag
changes : *code-backstage-qa-patterns
when : on_success
2020-03-27 05:08:28 -04:00
.setup:rules:dont-interrupt-me :
rules :
- << : *if-master-or-tag
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-27 05:08:28 -04:00
- << : *if-auto-deploy-branches
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-27 05:08:28 -04:00
- when : manual
2020-05-07 05:09:51 -04:00
allow_failure : true
2020-03-27 05:08:28 -04:00
2020-02-18 10:08:51 -05:00
.setup:rules:gitlab_git_test :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
.setup:rules:no_ee_check :
rules :
- << : *if-not-foss
when : never
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
2020-08-25 11:10:17 -04:00
.setup:rules:verify-tests-yml :
rules :
2020-08-26 02:10:34 -04:00
- << : *if-not-ee
when : never
2020-08-25 11:10:17 -04:00
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
2020-02-18 10:08:51 -05:00
#######################
# Test metadata rules #
#######################
.test-metadata:rules:retrieve-tests-metadata :
rules :
- << : *if-default-refs
changes : *code-backstage-patterns
when : on_success
.test-metadata:rules:update-tests-metadata :
rules :
2020-04-23 08:09:46 -04:00
- << : *if-not-ee
when : never
2020-04-21 17:09:38 -04:00
- changes :
- ".gitlab/ci/test-metadata.gitlab-ci.yml"
- "scripts/rspec_helpers.sh"
2020-04-23 08:09:46 -04:00
- << : *if-dot-com-ee-schedule
changes : *code-backstage-patterns
2020-02-18 10:08:51 -05:00
##############
# YAML rules #
##############
.yaml:rules :
rules :
- << : *if-default-refs
changes : *yaml-patterns