debian-mirror-gitlab/.gitlab/ci/rules.gitlab-ci.yml

1872 lines
56 KiB
YAML
Raw Normal View History

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
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"'
2021-11-18 22:05:49 +05:30
.if-jh: &if-jh
if: '$CI_PROJECT_PATH == "gitlab-jh/gitlab"'
2020-03-13 15:44:24 +05:30
.if-default-refs: &if-default-refs
2021-04-29 21:17:54 +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_MERGE_REQUEST_IID || $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
if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
2020-03-13 15:44:24 +05:30
2021-12-07 22:27:20 +05:30
.if-stable-branch-refs: &if-stable-branch-refs
if: '$CI_COMMIT_REF_NAME =~ /^[\d-]+-stable(-ee)?$/'
2021-04-29 21:17:54 +05:30
.if-default-branch-push: &if-default-branch-push
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"'
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
if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG'
2020-03-13 15:44:24 +05:30
.if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_IID'
2021-10-27 15:23:28 +05:30
.if-merge-request-approved: &if-merge-request-approved
if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_APPROVED'
.if-merge-request-not-approved: &if-merge-request-not-approved
if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_APPROVED != "true"'
.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
if: '$CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/'
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/'
2021-11-18 22:05:49 +05:30
.if-merge-request-labels-run-decomposed: &if-merge-request-labels-run-decomposed
2021-11-11 11:23:49 +05:30
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-decomposed/'
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/'
2020-05-24 23:13:21 +05:30
.if-security-merge-request: &if-security-merge-request
if: '$CI_PROJECT_NAMESPACE == "gitlab-org/security" && $CI_MERGE_REQUEST_IID'
2020-04-08 14:13:33 +05:30
2021-10-27 15:23:28 +05:30
.if-default-branch-schedule-2-hourly: &if-default-branch-schedule-2-hourly
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"'
.if-default-branch-schedule-nightly: &if-default-branch-schedule-nightly
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"'
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"'
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"'
2021-11-18 22:05:49 +05:30
.if-dot-com-gitlab-org-schedule-child-pipeline: &if-dot-com-gitlab-org-schedule-child-pipeline
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $FREQUENCY'
2021-10-27 15:23:28 +05:30
.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"'
2021-11-18 22:05:49 +05:30
.if-dot-com-ee-schedule-child-pipeline: &if-dot-com-ee-schedule-child-pipeline
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $FREQUENCY'
2021-10-27 15:23:28 +05:30
.if-dot-com-ee-2-hourly-schedule: &if-dot-com-ee-2-hourly-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "2-hourly"'
.if-dot-com-ee-nightly-schedule: &if-dot-com-ee-nightly-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "schedule" && $FREQUENCY == "nightly"'
2021-11-18 22:05:49 +05:30
.if-dot-com-ee-nightly-schedule-child-pipeline: &if-dot-com-ee-nightly-schedule-child-pipeline
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $FREQUENCY == "nightly"'
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
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" && $CI_MERGE_REQUEST_IID'
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
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_MERGE_REQUEST_IID'
2021-12-11 22:18:48 +05:30
.if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-qa: &if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-qa
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/security$)/ && $CI_MERGE_REQUEST_IID && $QA_MANUAL_FF_PACKAGE_AND_QA'
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'
2021-01-03 14:25:43 +05:30
# For Security merge requests, the gitlab-release-tools-bot triggers a new
# pipeline for the "Pipelines for merged results" feature. If the pipeline
# fails, we notify release managers.
.if-security-pipeline-merge-result: &if-security-pipeline-merge-result
if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "gitlab-org/security" && $GITLAB_USER_LOGIN == "gitlab-release-tools-bot"'
2021-12-11 22:18:48 +05:30
.if-skip-flaky-tests-automatically: &if-skip-flaky-tests-automatically
if: '$SKIP_FLAKY_TESTS_AUTOMATICALLY == "true"'
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/**/*"
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/**/*"
2021-04-29 21:17:54 +05:30
- "scripts/review_apps/base-config.yaml"
2021-09-04 01:27:46 +05:30
- "scripts/review_apps/review-apps.sh"
2020-11-24 15:15:51 +05:30
- "scripts/trigger-build"
2021-11-11 11:23:49 +05:30
- "{,ee/,jh/}{bin,config}/**/*.rb"
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"
2021-09-04 01:27:46 +05:30
.gitaly-patterns: &gitaly-patterns
- "GITALY_SERVER_VERSION"
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"
2021-02-22 17:27:13 +05:30
2021-01-29 00:20:46 +05:30
.yaml-lint-patterns: &yaml-lint-patterns
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*.yml"
- "lib/gitlab/ci/templates/**/*.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"
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
.docs-deprecations-patterns: &docs-deprecations-patterns
- "doc/deprecations/index.md"
- "data/deprecations/*.yml"
- "data/deprecations/templates/_deprecation_template.md.erb"
- "lib/tasks/gitlab/docs/compile_deprecations.rake"
- "tooling/deprecations/docs.rb"
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"
- "vendor/assets/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}app/assets/**/*"
2021-04-29 21:17:54 +05:30
2020-04-22 19:07:51 +05:30
.frontend-patterns: &frontend-patterns
- "{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"
2020-04-22 19:07:51 +05:30
- ".csscomb.json"
- "Dockerfile.assets"
2020-06-23 00:09:42 +05:30
- "config/**/*.js"
2020-04-22 19:07:51 +05:30
- "vendor/assets/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}{app/assets,app/helpers,app/presenters,app/views,locale,public,symbol}/**/*"
.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).
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}{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}/**/*"
2021-09-30 23:02:18 +05:30
- "{,ee/,jh/}{bin,cable,config,db,generator_templates,lib}/**/*"
2021-09-04 01:27:46 +05:30
- "{,ee/,jh/}spec/**/*.rb"
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"
2020-07-28 23:09:34 +05:30
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/database/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/database{,_spec}.rb"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/background_migration/**/*"
- "{,ee/,jh/}{,spec/}lib/{,ee/,jh/}gitlab/background_migration{,_spec}.rb"
- "{,ee/,jh/}spec/support/helpers/database/**/*"
2021-11-11 11:23:49 +05:30
- "lib/gitlab/markdown_cache/active_record/**/*"
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
2021-10-27 15:23:28 +05:30
- "GITALY_SERVER_VERSION" # Has interactions with background migrations:https://gitlab.com/gitlab-org/gitlab/-/issues/336538
2021-04-17 20:07:23 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
2020-07-28 23:09:34 +05:30
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"
- "qa/**/*"
# Code patterns + .ci-patterns + .workhorse-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"
2020-04-22 19:07:51 +05:30
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2021-04-17 20:07:23 +05:30
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,rubocop_manual_todo}.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-04-17 20:07:23 +05:30
- "data/whats_new/*.yml"
2021-12-11 22:18:48 +05:30
# CI changes
- ".gitlab-ci.yml"
- ".gitlab/ci/**/*"
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"
2020-04-22 19:07:51 +05:30
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2021-04-17 20:07:23 +05:30
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,rubocop_manual_todo}.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-04-17 20:07:23 +05:30
- "data/whats_new/*.yml"
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
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"
2020-04-22 19:07:51 +05:30
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2021-04-17 20:07:23 +05:30
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,rubocop_manual_todo}.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-04-17 20:07:23 +05:30
- "data/whats_new/*.yml"
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"
- "qa/**/*"
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"
2020-04-22 19:07:51 +05:30
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2021-12-11 22:18:48 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,rubocop_manual_todo}.yml"
- "*_VERSION"
- "{,jh/}Gemfile{,.lock}"
- "Rakefile"
- "tests.yml"
- "config.ru"
- "{,ee/,jh/}{app,bin,config,db,generator_templates,haml_lint,lib,locale,public,scripts,symbol,vendor}/**/*"
- "doc/api/graphql/reference/*" # Files in this folder are auto-generated
- "data/whats_new/*.yml"
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"
- "qa/**/*"
# .code-backstage-qa-patterns + .workhorse-patterns
.setup-test-env-patterns: &setup-test-env-patterns
- "{package.json,yarn.lock}"
- ".browserslistrc"
- "babel.config.js"
- "jest.config.{base,integration,unit}.js"
- ".csscomb.json"
- "Dockerfile.assets"
- "vendor/assets/**/*"
2020-03-13 15:44:24 +05:30
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
2021-04-17 20:07:23 +05:30
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,rubocop_manual_todo}.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-04-17 20:07:23 +05:30
- "data/whats_new/*.yml"
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"
- "qa/**/*"
2021-12-11 22:18:48 +05:30
# Workhorse changes
- "GITLAB_WORKHORSE_VERSION"
- "workhorse/**/*"
- ".gitlab/ci/workhorse.gitlab-ci.yml"
2020-03-13 15:44:24 +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
- "{,ee/}config/feature_flags/{development,ops}/*.yml"
2020-06-23 00:09:42 +05:30
################
# Shared rules #
################
.shared:rules:update-cache:
rules:
2021-04-29 21:17:54 +05:30
- <<: *if-default-branch-schedule-2-hourly
2021-02-22 17:27:13 +05:30
- <<: *if-security-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
2021-09-04 01:27:46 +05:30
- changes: *gitaly-patterns
2020-07-28 23:09:34 +05:30
######################
# Build images rules #
######################
.build-images:rules:build-qa-image:
rules:
- <<: *if-not-ee
when: never
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
2021-09-04 01:27:46 +05:30
- <<: *if-dot-com-gitlab-org-default-branch
changes: *code-qa-patterns
2020-07-28 23:09:34 +05:30
- <<: *if-dot-com-gitlab-org-schedule
.build-images:rules:build-assets-image:
rules:
- <<: *if-not-canonical-namespace
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2021-04-29 21:17:54 +05:30
- <<: *if-auto-deploy-branches
2020-07-28 23:09:34 +05:30
- changes: *ci-build-images-patterns
- changes: *code-qa-patterns
2020-03-13 15:44:24 +05:30
#############
# CNG rules #
#############
.cng:rules:
rules:
- <<: *if-dot-com-gitlab-org-and-security-tag
when: manual
2020-05-24 23:13:21 +05:30
allow_failure: true
2020-03-13 15:44:24 +05:30
2021-01-03 14:25:43 +05:30
##################
# Delivery rules #
##################
.delivery:rules:security-pipeline-merge-result-failure:
rules:
- <<: *if-security-pipeline-merge-result
when: on_failure
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
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-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
when: on_success
2021-12-11 22:18:48 +05:30
.docs:rules:deprecations:
rules:
- <<: *if-default-refs
changes: *docs-deprecations-patterns
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
when: on_success
##################
# Frontend rules #
##################
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
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2021-04-29 21:17:54 +05:30
- <<: *if-auto-deploy-branches
- changes: *code-qa-patterns
2020-03-13 15:44:24 +05:30
2020-06-23 00:09:42 +05:30
.frontend:rules:compile-test-assets:
2020-03-13 15:44:24 +05:30
rules:
2020-06-23 00:09:42 +05:30
- 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-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
- changes: *code-backstage-qa-patterns
- changes: *startup-css-patterns
.frontend:rules:compile-test-assets-as-if-jh:
rules:
- <<: *if-not-ee
when: never
- <<: *if-jh
when: never
2021-12-07 22:27:20 +05:30
- <<: *if-security-merge-request
when: never
- <<: *if-merge-request-targeting-stable-branch
when: never
- <<: *if-stable-branch-refs
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-jh
- <<: *if-merge-request-labels-run-all-rspec
2021-11-11 11:23:49 +05:30
- changes: *code-backstage-qa-patterns
2021-11-18 22:05:49 +05:30
- changes: *startup-css-patterns
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
- 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:
- <<: *if-not-ee
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-jh
when: never
- <<: *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
- <<: *if-merge-request
changes: *ci-patterns
2021-06-08 01:23:25 +05:30
2021-11-18 22:05:49 +05:30
.frontend:rules:default-frontend-jobs-as-if-jh:
2020-03-13 15:44:24 +05:30
rules:
- <<: *if-not-ee
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-jh
when: never
2020-05-24 23:13:21 +05:30
- <<: *if-security-merge-request
2021-12-07 22:27:20 +05:30
when: never
- <<: *if-merge-request-targeting-stable-branch
when: never
- <<: *if-stable-branch-refs
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-jh
- <<: *if-merge-request-labels-run-all-rspec
2021-09-04 01:27:46 +05:30
- <<: *if-merge-request
changes: *startup-css-patterns
2020-05-24 23:13:21 +05:30
- <<: *if-merge-request
changes: *ci-patterns
2021-11-11 11:23:49 +05:30
.frontend:rules:jest:
rules:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-jest
2021-11-11 11:23:49 +05:30
- <<: *if-default-refs
changes: *core-frontend-patterns
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-default-refs
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
.frontend:rules:jest:minimal:
rules:
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
when: never
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
- <<: *if-default-refs
changes: *core-frontend-patterns
when: never
- <<: *if-default-refs
changes: *backend-patterns
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *code-backstage-patterns
2020-07-28 23:09:34 +05:30
.frontend:rules:eslint-as-if-foss:
rules:
- <<: *if-not-ee
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-jh
when: never
# We already have `static-analysis as-if-foss` which already runs `lint:eslint:all` if the `pipeline:run-as-if-foss` label is set.
- <<: *if-merge-request-labels-as-if-foss
2020-07-28 23:09:34 +05:30
when: never
- <<: *if-merge-request
changes: *frontend-patterns
2021-04-29 21:17:54 +05:30
.frontend:rules:ee-mr-and-default-branch-only:
2020-05-24 23:13:21 +05:30
rules:
- <<: *if-not-ee
when: never
- <<: *if-merge-request
changes: *code-backstage-patterns
2021-02-22 17:27:13 +05:30
when: always
2021-04-29 21:17:54 +05:30
- <<: *if-default-branch-refs
2020-03-13 15:44:24 +05:30
changes: *code-backstage-patterns
.frontend:rules:qa-frontend-node:
rules:
2021-04-29 21:17:54 +05:30
- <<: *if-default-branch-refs
2020-04-22 19:07:51 +05:30
changes: *frontend-dependency-patterns
2020-04-08 14:13:33 +05:30
- <<: *if-merge-request
changes: *frontend-dependency-patterns
2020-03-13 15:44:24 +05:30
2020-05-24 23:13:21 +05:30
.frontend:rules:qa-frontend-node-latest:
rules:
2021-04-29 21:17:54 +05:30
- <<: *if-default-branch-refs
2020-05-24 23:13:21 +05:30
changes: *frontend-dependency-patterns
allow_failure: true
- <<: *if-merge-request
changes: *frontend-dependency-patterns
allow_failure: true
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
2021-04-29 21:17:54 +05:30
- if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
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
when: on_success
###############
# Pages rules #
###############
.pages:rules:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-dot-com-ee-2-hourly-schedule
2020-03-13 15:44:24 +05:30
############
# QA rules #
############
.qa:rules:ee-and-foss:
rules:
- <<: *if-default-refs
changes: *code-qa-patterns
when: on_success
2020-05-24 23:13:21 +05:30
.qa:rules: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-jh
when: never
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-05-24 23:13:21 +05:30
- <<: *if-merge-request
changes: *ci-patterns
2020-03-13 15:44:24 +05:30
.qa:rules:package-and-qa:
rules:
2021-06-08 01:23:25 +05:30
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *feature-flag-development-config-patterns
when: never
2020-06-23 00:09:42 +05:30
- <<: *if-dot-com-gitlab-org-and-security-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
2020-06-23 00:09:42 +05:30
- <<: *if-dot-com-gitlab-org-and-security-merge-request
2020-03-13 15:44:24 +05:30
changes: *qa-patterns
2020-05-24 23:13:21 +05:30
allow_failure: true
2020-06-23 00:09:42 +05:30
- <<: *if-dot-com-gitlab-org-and-security-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
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
2020-03-13 15:44:24 +05:30
2021-12-11 22:18:48 +05:30
.qa:rules:package-and-qa:feature-flags:
rules:
- <<: *if-not-ee
when: never
- <<: *if-dot-com-gitlab-org-and-security-merge-request-manual-ff-package-and-qa
changes: *feature-flag-development-config-patterns
when: manual
allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *feature-flag-development-config-patterns
allow_failure: true
.qa:rules:reliable-reports:schedule:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" && $QA_RELIABLE_REPORT == "true"'
allow_failure: true
2020-03-13 15:44:24 +05:30
###############
# Rails rules #
###############
2021-12-11 22:18:48 +05:30
.rails:rules:setup-test-env:
rules:
- changes: *setup-test-env-patterns
- <<: *if-merge-request-labels-run-all-rspec
2021-11-11 11:23:49 +05:30
.rails:rules:decomposed-databases:
rules:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-decomposed
2021-12-11 22:18:48 +05:30
- <<: *if-default-branch-schedule-nightly
2021-11-11 11:23:49 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-migration:
2020-03-13 15:44:24 +05:30
rules:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
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
- <<: *if-merge-request-not-approved
when: never
- changes: *db-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-and-foss-migration:minimal:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *db-patterns
2021-11-11 11:23:49 +05:30
when: never
2021-02-22 17:27:13 +05:30
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:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-and-foss-unit:minimal:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-integration:
rules:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-and-foss-integration:minimal:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-and-foss-system:
rules:
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *code-backstage-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-and-foss-system:minimal:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
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
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: ["config/**/*"]
- <<: *if-merge-request-not-approved
when: never
- changes: ["config/**/*"]
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-and-foss-fast_spec_helper:minimal:
rules:
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: ["config/**/*"]
2021-04-17 20:07:23 +05:30
.rails:rules:code-backstage-qa:
2020-03-13 15:44:24 +05:30
rules:
2021-04-17 20:07:23 +05:30
- 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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
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
- <<: *if-merge-request-not-approved
when: never
- changes: *db-patterns
2020-03-13 15:44:24 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-only-migration:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *db-patterns
2021-11-11 11:23:49 +05:30
when: never
2021-02-22 17:27:13 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-unit:
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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-only-unit:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-integration:
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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *backend-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-only-integration:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
changes: *backend-patterns
2020-07-28 23:09:34 +05:30
.rails:rules:ee-only-system:
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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved
when: never
- changes: *code-backstage-patterns
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:ee-only-system:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
when: never
- <<: *if-merge-request
changes: *core-backend-patterns
2021-02-22 17:27:13 +05:30
when: never
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-merge-request
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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
2020-07-28 23:09:34 +05:30
- <<: *if-security-merge-request
changes: *db-patterns
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
- <<: *if-merge-request-not-approved
when: never
2020-07-28 23:09:34 +05:30
2021-02-22 17:27:13 +05:30
.rails:rules:as-if-foss-migration:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request
changes: *core-backend-patterns
when: never
2021-02-22 17:27:13 +05:30
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-security-merge-request
changes: *db-patterns
2021-11-11 11:23:49 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-foss
2021-02-22 17:27:13 +05:30
changes: *db-patterns
2021-11-11 11:23:49 +05:30
when: never
2021-02-22 17:27:13 +05:30
2020-07-28 23:09:34 +05:30
.rails:rules:as-if-foss-unit:
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
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
2020-07-28 23:09:34 +05:30
- <<: *if-security-merge-request
changes: *backend-patterns
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
2021-02-22 17:27:13 +05:30
.rails:rules:as-if-foss-unit:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request
changes: *core-backend-patterns
when: never
2021-02-22 17:27:13 +05:30
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-security-merge-request
changes: *backend-patterns
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-foss
2021-02-22 17:27:13 +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
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *backend-patterns
- <<: *if-merge-request-not-approved
when: never
2020-07-28 23:09:34 +05:30
- <<: *if-security-merge-request
changes: *backend-patterns
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
2021-02-22 17:27:13 +05:30
.rails:rules:as-if-foss-integration:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request
changes: *core-backend-patterns
when: never
2021-02-22 17:27:13 +05:30
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-security-merge-request
changes: *backend-patterns
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-foss
2021-02-22 17:27:13 +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
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *core-backend-patterns
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request
changes: *ci-patterns
- <<: *if-automated-merge-request
changes: *code-backstage-patterns
- <<: *if-merge-request-not-approved
when: never
2020-05-24 23:13:21 +05:30
- <<: *if-security-merge-request
changes: *code-backstage-patterns
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-02-22 17:27:13 +05:30
.rails:rules:as-if-foss-system:minimal:
rules:
- <<: *if-not-ee
when: never
2021-10-27 15:23:28 +05:30
- <<: *if-merge-request-approved
when: never
- <<: *if-automated-merge-request
2021-02-22 17:27:13 +05:30
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request
changes: *core-backend-patterns
when: never
2021-02-22 17:27:13 +05:30
- <<: *if-merge-request
changes: *ci-patterns
when: never
- <<: *if-security-merge-request
changes: *code-backstage-patterns
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-foss
2021-02-22 17:27:13 +05:30
changes: *code-backstage-patterns
2021-12-07 22:27:20 +05:30
.rails:rules:as-if-jh-rspec:
rules:
- <<: *if-not-ee
when: never
- <<: *if-jh
when: never
- <<: *if-security-merge-request
when: never
- <<: *if-merge-request-targeting-stable-branch
when: never
- <<: *if-stable-branch-refs
when: never
- <<: *if-merge-request-labels-as-if-jh
allow_failure: true
- <<: *if-merge-request
changes: *ci-patterns
allow_failure: true
2021-03-08 18:12:59 +05:30
.rails:rules:ee-and-foss-db-library-code:
rules:
- changes: *db-library-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-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
- changes: *code-backstage-qa-patterns
- <<: *if-merge-request-labels-run-all-rspec
.rails:rules:detect-previous-failed-tests:
rules:
- <<: *if-security-merge-request
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request
changes: *code-backstage-patterns
.rails:rules:rerun-previous-failed-tests:
rules:
- <<: *if-security-merge-request
when: never
- <<: *if-merge-request-labels-run-all-rspec
- <<: *if-merge-request
changes: *code-backstage-patterns
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
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
2020-11-24 15:15:51 +05:30
- <<: *if-merge-request
changes: *code-backstage-patterns
2021-02-22 17:27:13 +05:30
when: always
2021-04-29 21:17:54 +05:30
- <<: *if-default-branch-schedule-2-hourly
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
2021-02-22 17:27:13 +05:30
when: always
2020-07-28 23:09:34 +05:30
2021-04-29 21:17:54 +05:30
.rails:rules:default-branch-schedule-nightly--code-backstage:
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"]
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
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"]
2021-09-30 23:02:18 +05:30
.rails:rules:rspec-feature-flags:
rules:
- <<: *if-not-ee
when: never
- changes: *code-backstage-patterns
2021-12-11 22:18:48 +05:30
.rails:rules:skipped-flaky-tests-report:
rules:
- <<: *if-not-ee
when: never
- <<: *if-skip-flaky-tests-automatically
changes: *code-backstage-patterns
- changes: *ci-patterns
2021-06-08 01:23:25 +05:30
#########################
# Static analysis rules #
#########################
.static-analysis:rules:ee-and-foss:
rules:
- changes: *code-backstage-qa-patterns
2021-12-11 22:18:48 +05:30
.static-analysis:rules:ee:
rules:
- <<: *if-not-ee
when: never
- changes: *code-backstage-qa-patterns
2021-06-08 01:23:25 +05:30
.static-analysis:rules:as-if-foss:
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
changes: *ci-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
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$/'
.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
- <<: *if-default-refs
changes: *code-backstage-patterns
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
- changes:
- '**/*.rb'
- '**/Gemfile'
.reports:rules:gosec-sast:
rules:
- if: $SAST_DISABLED
when: never
- if: $SAST_EXCLUDED_ANALYZERS =~ /gosec/
when: never
- changes:
- '**/*.go'
.reports:rules:semgrep-sast:
rules:
- if: $SAST_DISABLED
when: never
- if: $SAST_EXCLUDED_ANALYZERS =~ /semgrep/
when: never
- changes:
- '**/*.py'
- '**/*.js'
- '**/*.jsx'
- '**/*.ts'
- '**/*.tsx'
- '**/*.c'
- '**/*.go'
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
- changes: *code-backstage-qa-patterns
2021-09-30 23:02:18 +05:30
.reports:rules:gemnasium-dependency_scanning:
2020-03-13 15:44:24 +05:30
rules:
2021-11-18 22:05:49 +05:30
- if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /gemnasium([^-]|$)/ || $DS_DEFAULT_ANALYZERS !~ /gemnasium([^-]|$)/'
2020-03-13 15:44:24 +05:30
when: never
2021-11-18 22:05:49 +05:30
- changes: *dependency-patterns
2021-09-30 23:02:18 +05:30
.reports:rules:bundler-audit-dependency_scanning:
rules:
2021-11-18 22:05:49 +05:30
- if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /bundler-audit/ || $DS_DEFAULT_ANALYZERS !~ /bundler-audit/'
2021-09-30 23:02:18 +05:30
when: never
2021-11-18 22:05:49 +05:30
- changes: *bundler-patterns
2021-09-30 23:02:18 +05:30
.reports:rules:retire-js-dependency_scanning:
rules:
2021-11-18 22:05:49 +05:30
- if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /retire.js/ || $DS_DEFAULT_ANALYZERS !~ /retire.js/'
2021-09-30 23:02:18 +05:30
when: never
2021-11-18 22:05:49 +05:30
- changes: *nodejs-patterns
2021-09-30 23:02:18 +05:30
.reports:rules:gemnasium-python-dependency_scanning:
rules:
2021-11-18 22:05:49 +05:30
- if: '$DEPENDENCY_SCANNING_DISABLED || $GITLAB_FEATURES !~ /\bdependency_scanning\b/ || $DS_EXCLUDED_ANALYZERS =~ /gemnasium-python/ || $DS_DEFAULT_ANALYZERS !~ /gemnasium-python/'
2021-09-30 23:02:18 +05:30
when: never
2021-11-18 22:05:49 +05:30
- 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
- changes: *nodejs-patterns
2021-06-08 01:23:25 +05:30
.reports:rules:schedule-dast:
2020-03-13 15:44:24 +05:30
rules:
- if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
2020-03-13 15:44:24 +05:30
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
2021-06-08 01:23:25 +05:30
- <<: *if-default-branch-schedule-2-hourly
- <<: *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
- <<: *if-default-branch-schedule-2-hourly
- <<: *if-merge-request
changes: ["Gemfile.lock"]
2021-01-03 14:25:43 +05:30
.reports:rules:license_scanning:
rules:
2021-11-18 22:05:49 +05:30
- if: '$LICENSE_MANAGEMENT_DISABLED || $GITLAB_FEATURES !~ /\blicense_scanning\b/'
2021-01-03 14:25:43 +05:30
when: never
2021-11-18 22:05:49 +05:30
- changes: *code-backstage-qa-patterns
2021-01-03 14:25:43 +05:30
2020-03-13 15:44:24 +05:30
################
# Review rules #
################
2021-11-18 22:05:49 +05:30
.review:rules: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
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
2020-05-24 23:13:21 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *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
2021-04-29 21:17:54 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
2020-05-24 23:13:21 +05:30
- <<: *if-dot-com-gitlab-org-schedule
2020-03-13 15:44:24 +05:30
2021-11-18 22:05:49 +05:30
.review:rules:review-build-cng:
rules:
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
2020-11-24 15:15:51 +05:30
.review:rules:review-deploy:
rules:
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2020-11-24 15:15:51 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
2021-04-29 21:17:54 +05:30
changes: *code-patterns
2020-11-24 15:15:51 +05:30
allow_failure: true
2021-04-29 21:17:54 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
2020-11-24 15:15:51 +05:30
allow_failure: true
.review:rules:review-performance:
2020-04-22 19:07:51 +05:30
rules:
2021-01-29 00:20:46 +05:30
- if: '$DAST_RUN == "true"' # Skip this job when DAST is run
2020-11-24 15:15:51 +05:30
when: never
2020-05-24 23:13:21 +05:30
- <<: *if-not-ee
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
2020-04-22 19:07:51 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
2020-05-24 23:13:21 +05:30
allow_failure: true
2020-04-22 19:07:51 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
allow_failure: true
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-gitlab-org-schedule-child-pipeline
2020-05-24 23:13:21 +05:30
allow_failure: true
2020-04-22 19:07:51 +05:30
2021-09-30 23:02:18 +05:30
.review:rules:review-delete-deployment:
2020-03-13 15:44:24 +05:30
rules:
2020-05-24 23:13:21 +05:30
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2020-03-13 15:44:24 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
2020-05-24 23:13:21 +05:30
.review:rules:review-qa-smoke:
2020-04-22 19:07:51 +05:30
rules:
2020-05-24 23:13:21 +05:30
- <<: *if-not-ee
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
2020-04-22 19:07:51 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
- <<: *if-dot-com-gitlab-org-merge-request
2021-12-11 22:18:48 +05:30
changes: *qa-patterns
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
2020-05-24 23:13:21 +05:30
allow_failure: true
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-schedule-child-pipeline
2021-10-27 15:23:28 +05:30
allow_failure: true
2020-04-22 19:07:51 +05:30
2021-09-30 23:02:18 +05:30
# The rule needs to be duplicated between `on_success` and `on_failure`
# because the jobs `needs` the previous job to complete.
2021-12-11 22:18:48 +05:30
# With `when: always`, and the `review-qa-*` jobs are manual, the `allure-report-qa-*` jobs
# would start running before the qa jobs have started.
2021-09-30 23:02:18 +05:30
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559
2021-09-04 01:27:46 +05:30
.review:rules:review-qa-smoke-report:
rules:
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
when: on_success
- <<: *if-merge-request-labels-run-review-app
when: on_failure
2021-09-04 01:27:46 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
2021-09-30 23:02:18 +05:30
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
when: on_failure
2021-09-04 01:27:46 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
2021-09-30 23:02:18 +05:30
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
when: on_failure
2021-09-04 01:27:46 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
2021-09-30 23:02:18 +05:30
when: on_success
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: on_failure
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-schedule-child-pipeline
2021-10-27 15:23:28 +05:30
when: on_success
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-schedule-child-pipeline
2021-10-27 15:23:28 +05:30
when: on_failure
2021-09-04 01:27:46 +05:30
2021-12-11 22:18:48 +05:30
.review:rules:review-qa-reliable:
rules:
- when: on_success
allow_failure: true
2021-04-29 21:17:54 +05:30
.review:rules:review-qa-all:
2020-03-13 15:44:24 +05:30
rules:
2020-05-24 23:13:21 +05:30
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
2020-03-13 15:44:24 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
2021-04-29 21:17:54 +05:30
changes: *code-patterns
2020-03-13 15:44:24 +05:30
when: manual
2020-05-24 23:13:21 +05:30
allow_failure: true
2021-04-29 21:17:54 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
allow_failure: true
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
2021-10-27 15:23:28 +05:30
allow_failure: true
2020-03-13 15:44:24 +05:30
2021-09-30 23:02:18 +05:30
# The rule needs to be duplicated between `on_success` and `on_failure`
# because the jobs `needs` the previous job to complete.
2021-12-11 22:18:48 +05:30
# With `when: always`, and the `review-qa-*` jobs are manual, the `allure-report-qa-*` jobs
# would start running before the qa jobs have started.
2021-09-30 23:02:18 +05:30
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559
2021-09-04 01:27:46 +05:30
.review:rules:review-qa-all-report:
rules:
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
when: on_success
- <<: *if-merge-request-labels-run-review-app
when: on_failure
2021-09-04 01:27:46 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
when: manual
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
2021-09-30 23:02:18 +05:30
when: on_success
2021-10-27 15:23:28 +05:30
allow_failure: true
2021-09-30 23:02:18 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
2021-10-27 15:23:28 +05:30
when: on_failure
2021-09-30 23:02:18 +05:30
allow_failure: true
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
2021-10-27 15:23:28 +05:30
when: on_success
allow_failure: true
2021-11-18 22:05:49 +05:30
- <<: *if-dot-com-ee-nightly-schedule-child-pipeline
2021-09-30 23:02:18 +05:30
when: on_failure
2021-10-27 15:23:28 +05:30
allow_failure: true
2021-09-04 01:27:46 +05:30
2020-03-13 15:44:24 +05:30
.review:rules:review-cleanup:
rules:
2020-05-24 23:13:21 +05:30
- <<: *if-not-ee
when: never
2020-03-13 15:44:24 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: manual
2020-05-24 23:13:21 +05:30
allow_failure: true
2021-12-11 22:18:48 +05:30
- <<: *if-dot-com-gitlab-org-schedule
2020-05-24 23:13:21 +05:30
allow_failure: true
2020-04-22 19:07:51 +05:30
2020-11-24 15:15:51 +05:30
.review:rules:review-stop:
rules:
- <<: *if-not-ee
when: never
2021-12-11 22:18:48 +05:30
- <<: *if-merge-request-labels-run-review-app
when: manual
allow_failure: true
2020-11-24 15:15:51 +05:30
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
when: manual
allow_failure: true
2020-03-13 15:44:24 +05:30
.review:rules:danger:
rules:
2021-04-29 21:17:54 +05:30
- if: '$CI_MERGE_REQUEST_IID'
2020-03-13 15:44:24 +05:30
2021-09-30 23:02:18 +05:30
.review:rules:danger-local:
rules:
- if: '$CI_MERGE_REQUEST_IID'
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
when: on_success
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
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
when: on_success
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
when: on_success
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
when: on_success
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
when: on_success
2021-11-18 22:05:49 +05:30
.setup:rules:add-jh-folder:
rules:
- <<: *if-not-ee
when: never
- <<: *if-jh
when: never
2021-12-07 22:27:20 +05:30
- <<: *if-security-merge-request
when: never
- <<: *if-merge-request-targeting-stable-branch
when: never
- <<: *if-stable-branch-refs
when: never
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-as-if-jh
- <<: *if-merge-request-labels-run-all-rspec
- changes: *code-backstage-qa-patterns
- changes: *startup-css-patterns
2020-03-13 15:44:24 +05:30
#######################
# Test metadata rules #
#######################
.test-metadata:rules:retrieve-tests-metadata:
rules:
2021-04-17 20:07:23 +05:30
- changes: *code-backstage-patterns
2020-03-13 15:44:24 +05:30
when: on_success
2021-11-18 22:05:49 +05:30
- <<: *if-merge-request-labels-run-all-rspec
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
2021-10-27 15:23:28 +05:30
- <<: *if-dot-com-ee-2-hourly-schedule
2020-05-24 23:13:21 +05:30
- changes:
- ".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:
- <<: *if-default-refs
changes: *workhorse-patterns
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