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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

171 lines
5.2 KiB
YAML
Raw Normal View History

2023-04-23 21:23:45 +05:30
# ------------------------------------------
# Conditions
# ------------------------------------------
2022-10-11 01:57:18 +05:30
# Specific specs passed
.specific-specs: &specific-specs
if: $QA_TESTS != ""
# No specific specs passed
.all-specs: &all-specs
if: $QA_TESTS == ""
# No specific specs in mr pipeline
.all-specs-mr: &all-specs-mr
2023-04-23 21:23:45 +05:30
if: '($CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached") && $QA_TESTS == ""'
2022-10-11 01:57:18 +05:30
when: manual
# Triggered by change pattern
.app-changes: &app-changes
if: $APP_CHANGE_TRIGGER == "true"
2023-01-13 00:05:48 +05:30
# Run all tests when framework changes present or explicitly enabled full suite execution
.qa-run-all-tests: &qa-run-all-tests
if: $QA_FRAMEWORK_CHANGES == "true" || $QA_RUN_ALL_TESTS == "true"
2022-10-11 01:57:18 +05:30
2022-11-25 23:54:43 +05:30
.default-branch: &default-branch
if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
2023-04-23 21:23:45 +05:30
.if-merge-request: &if-merge-request
if: '$CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached"'
.if-merge-request-labels-run-review-app: &if-merge-request-labels-run-review-app
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-review-app/'
.if-dot-com-ee-schedule-nightly-child-pipeline: &if-dot-com-ee-schedule-nightly-child-pipeline
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_PATH == "gitlab-org/gitlab" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $SCHEDULE_TYPE == "nightly"'
# ------------------------------------------
# Changes patterns
# ------------------------------------------
.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"
- ".gitlab/ci/review-apps/**/*"
- "scripts/review_apps/**/*"
- "scripts/trigger-build.rb"
- "{,ee/,jh/}{bin,config}/**/*.rb"
# ------------------------------------------
# Conditions set
# ------------------------------------------
2022-11-25 23:54:43 +05:30
.qa-manual: &qa-manual
when: manual
allow_failure: true
variables:
QA_TESTS: ""
2023-01-13 00:05:48 +05:30
.never-when-qa-run-all-tests-or-no-specific-specs:
- <<: *qa-run-all-tests
2022-10-11 01:57:18 +05:30
when: never
- <<: *all-specs
when: never
2023-01-13 00:05:48 +05:30
.never-when-specific-specs-always-when-qa-run-all-tests:
- *qa-run-all-tests
2022-10-11 01:57:18 +05:30
- <<: *specific-specs
2022-11-25 23:54:43 +05:30
when: manual
allow_failure: true
variables:
QA_TESTS: ""
2022-10-11 01:57:18 +05:30
2022-11-25 23:54:43 +05:30
# ------------------------------------------
# Prepare
# ------------------------------------------
.rules:dont-interrupt:
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_MERGE_REQUEST_IID
when: manual
allow_failure: true
2023-04-23 21:23:45 +05:30
.review:rules:review-build-cng:
rules:
- when: always
.review:rules:review-delete-deployment:
rules:
- when: on_success
# ------------------------------------------
# Deploy
# ------------------------------------------
.review:rules:review-deploy:
rules:
- when: on_success
.review:rules:trigger-review-stop:
rules:
- when: manual
allow_failure: true
2022-10-11 01:57:18 +05:30
# ------------------------------------------
# Test
# ------------------------------------------
.rules:qa-smoke:
rules:
# always trigger smoke suite if review pipeline got triggered by specific changes in application code
- <<: *app-changes
variables:
2023-01-13 00:05:48 +05:30
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- *qa-run-all-tests
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::Smoke/
2022-11-25 23:54:43 +05:30
- *qa-manual
2022-10-11 01:57:18 +05:30
.rules:qa-blocking:
rules:
- <<: *app-changes
when: never
2023-01-13 00:05:48 +05:30
- !reference [.never-when-qa-run-all-tests-or-no-specific-specs]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
.rules:qa-blocking-parallel:
rules:
# always trigger blocking suite if review pipeline got triggered by specific changes in application code
- <<: *app-changes
variables:
2023-01-13 00:05:48 +05:30
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- !reference [.never-when-specific-specs-always-when-qa-run-all-tests]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
.rules:qa-non-blocking:
rules:
2023-01-13 00:05:48 +05:30
- !reference [.never-when-qa-run-all-tests-or-no-specific-specs]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
.rules:qa-non-blocking-parallel:
rules:
2023-01-13 00:05:48 +05:30
- !reference [.never-when-specific-specs-always-when-qa-run-all-tests]
- *all-specs-mr # set full suite to manual when no specific specs passed in mr
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
2023-04-23 21:23:45 +05:30
.review:rules:review-performance:
rules:
- if: '$DAST_RUN == "true"' # Skip this job when DAST is run
when: never
- <<: *if-merge-request-labels-run-review-app # we explicitly don't allow the job to fail in that case
- <<: *if-merge-request # we explicitly don't allow the job to fail in that case
changes: *ci-review-patterns
- when: on_success
allow_failure: true
# ------------------------------------------
# DAST
# ------------------------------------------
.reports:rules:schedule-dast:
rules:
- if: '$DAST_DISABLED || $GITLAB_FEATURES !~ /\bdast\b/'
when: never
- <<: *if-dot-com-ee-schedule-nightly-child-pipeline
2022-10-11 01:57:18 +05:30
# ------------------------------------------
# Prepare/Report
# ------------------------------------------
2022-11-25 23:54:43 +05:30
.rules:prepare-report:
2022-10-11 01:57:18 +05:30
rules:
2022-11-25 23:54:43 +05:30
- when: always
2023-01-13 00:05:48 +05:30
.rules:main-run:
2022-11-25 23:54:43 +05:30
rules:
2023-01-13 00:05:48 +05:30
- *default-branch