Commit 00b69b69 authored by Rémy Coutable's avatar Rémy Coutable

Disallow most failure when CI config are changed

It happened that changing a CI config led to broken jobs but since those
jobs were allowed to fail we didn't realize they were broken before
getting reports from other engineers (and potentially from downstream
projects).

Fixes https://gitlab.com/gitlab-org/gitlab/-/issues/215846.
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent c98dee5b
...@@ -21,7 +21,6 @@ cache-repo: ...@@ -21,7 +21,6 @@ cache-repo:
extends: .cache-repo:rules extends: .cache-repo:rules
image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine image: gcr.io/google.com/cloudsdktool/cloud-sdk:alpine
stage: sync stage: sync
allow_failure: true
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
TAR_FILENAME: /tmp/gitlab-master.tar TAR_FILENAME: /tmp/gitlab-master.tar
......
...@@ -3,7 +3,6 @@ cloud-native-image: ...@@ -3,7 +3,6 @@ cloud-native-image:
image: ruby:2.6-alpine image: ruby:2.6-alpine
dependencies: [] dependencies: []
stage: post-test stage: post-test
allow_failure: true
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
script: script:
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
extends: extends:
- .default-retry - .default-retry
- .docs:rules:review-docs - .docs:rules:review-docs
allow_failure: true
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: review stage: review
dependencies: [] dependencies: []
......
...@@ -288,9 +288,10 @@ qa-frontend-node:10: ...@@ -288,9 +288,10 @@ qa-frontend-node:10:
image: node:dubnium image: node:dubnium
qa-frontend-node:latest: qa-frontend-node:latest:
extends: .qa-frontend-node extends:
- .qa-frontend-node
- .frontend:rules:qa-frontend-node-latest
image: node:latest image: node:latest
allow_failure: true
webpack-dev-server: webpack-dev-server:
extends: extends:
......
...@@ -60,4 +60,3 @@ package-and-qa: ...@@ -60,4 +60,3 @@ package-and-qa:
artifacts: false artifacts: false
- job: gitlab:assets:compile pull-cache - job: gitlab:assets:compile pull-cache
artifacts: false artifacts: false
allow_failure: true
...@@ -14,7 +14,6 @@ code_quality: ...@@ -14,7 +14,6 @@ code_quality:
- .use-docker-in-docker - .use-docker-in-docker
stage: test stage: test
needs: [] needs: []
allow_failure: true
variables: variables:
CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.9" CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/ci-cd/codequality:0.85.9"
script: script:
...@@ -49,7 +48,6 @@ code_quality: ...@@ -49,7 +48,6 @@ code_quality:
# `needs: []` starts the job immediately in the pipeline # `needs: []` starts the job immediately in the pipeline
# https://docs.gitlab.com/ee/ci/yaml/README.html#needs # https://docs.gitlab.com/ee/ci/yaml/README.html#needs
needs: [] needs: []
allow_failure: true
artifacts: artifacts:
paths: paths:
- gl-sast-report.json # GitLab-specific - gl-sast-report.json # GitLab-specific
...@@ -79,10 +77,11 @@ eslint-sast: ...@@ -79,10 +77,11 @@ eslint-sast:
image: image:
name: "$SAST_ANALYZER_IMAGE_PREFIX/eslint:$SAST_ANALYZER_IMAGE_TAG" name: "$SAST_ANALYZER_IMAGE_PREFIX/eslint:$SAST_ANALYZER_IMAGE_TAG"
nodejs-scan-sast: # Temporary disabled as it's constantly failing. See https://gitlab.com/gitlab-org/gitlab/-/issues/213769.
extends: .sast # nodejs-scan-sast:
image: # extends: .sast
name: "$SAST_ANALYZER_IMAGE_PREFIX/nodejs-scan:$SAST_ANALYZER_IMAGE_TAG" # image:
# name: "$SAST_ANALYZER_IMAGE_PREFIX/nodejs-scan:$SAST_ANALYZER_IMAGE_TAG"
secrets-sast: secrets-sast:
extends: .sast extends: .sast
...@@ -101,7 +100,6 @@ dependency_scanning: ...@@ -101,7 +100,6 @@ dependency_scanning:
needs: [] needs: []
variables: variables:
DS_EXCLUDED_PATHS: "qa/qa/ee/fixtures/secure_premade_reports,spec,ee/spec" # GitLab-specific DS_EXCLUDED_PATHS: "qa/qa/ee/fixtures/secure_premade_reports,spec,ee/spec" # GitLab-specific
allow_failure: true
script: script:
- export DS_VERSION=${SP_VERSION:-$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')} - export DS_VERSION=${SP_VERSION:-$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')}
- | - |
...@@ -172,7 +170,6 @@ dast: ...@@ -172,7 +170,6 @@ dast:
# DAST_USERNAME_FIELD: "user[login]" # DAST_USERNAME_FIELD: "user[login]"
# DAST_PASSWORD_FIELD: "user[passowrd]" # DAST_PASSWORD_FIELD: "user[passowrd]"
DAST_VERSION: 1 DAST_VERSION: 1
allow_failure: true
script: script:
- 'export DAST_WEBSITE="${DAST_WEBSITE:-$(cat environment_url.txt)}"' - 'export DAST_WEBSITE="${DAST_WEBSITE:-$(cat environment_url.txt)}"'
# To be done in a later iteration # To be done in a later iteration
......
...@@ -2,7 +2,7 @@ build-qa-image: ...@@ -2,7 +2,7 @@ build-qa-image:
extends: extends:
- .use-kaniko - .use-kaniko
- .default-retry - .default-retry
- .review:rules:mr-and-schedule-auto - .review:rules:build-qa-image
stage: build-images stage: build-images
needs: [] needs: []
script: script:
...@@ -27,12 +27,11 @@ review-cleanup: ...@@ -27,12 +27,11 @@ review-cleanup:
script: script:
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb - ruby -rrubygems scripts/review_apps/automated_cleanup.rb
- gcp_cleanup - gcp_cleanup
allow_failure: true
review-build-cng: review-build-cng:
extends: extends:
- .default-retry - .default-retry
- .review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise - .review:rules:review-build-cng
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: review-prepare stage: review-prepare
before_script: before_script:
...@@ -69,7 +68,6 @@ review-deploy: ...@@ -69,7 +68,6 @@ review-deploy:
stage: review stage: review
dependencies: [] dependencies: []
resource_group: "review/${CI_COMMIT_REF_NAME}" resource_group: "review/${CI_COMMIT_REF_NAME}"
allow_failure: true
before_script: before_script:
- '[[ -d "ee/" ]] || export GITLAB_EDITION="ce"' - '[[ -d "ee/" ]] || export GITLAB_EDITION="ce"'
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION) - export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
...@@ -113,7 +111,7 @@ review-deploy: ...@@ -113,7 +111,7 @@ review-deploy:
review-stop-failed-deployment: review-stop-failed-deployment:
extends: extends:
- .review-stop-base - .review-stop-base
- .review:rules:mr-only-auto - .review:rules:review-stop-failed-deployment
stage: prepare stage: prepare
script: script:
- delete_failed_release - delete_failed_release
...@@ -123,7 +121,6 @@ review-stop: ...@@ -123,7 +121,6 @@ review-stop:
- .review-stop-base - .review-stop-base
- .review:rules:mr-only-manual - .review:rules:mr-only-manual
stage: review stage: review
allow_failure: true
script: script:
- delete_release - delete_release
...@@ -136,7 +133,6 @@ review-stop: ...@@ -136,7 +133,6 @@ review-stop:
# This is needed so that manual jobs with needs don't block the pipeline. # This is needed so that manual jobs with needs don't block the pipeline.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979. # See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
dependencies: ["review-deploy"] dependencies: ["review-deploy"]
allow_failure: true
variables: variables:
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
QA_CAN_TEST_GIT_PROTOCOL_V2: "false" QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
...@@ -165,7 +161,7 @@ review-stop: ...@@ -165,7 +161,7 @@ review-stop:
review-qa-smoke: review-qa-smoke:
extends: extends:
- .review-qa-base - .review-qa-base
- .review:rules:mr-only-auto-if-frontend-manual-otherwise - .review:rules:review-qa-smoke
script: script:
- gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" - gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
...@@ -190,7 +186,6 @@ review-performance: ...@@ -190,7 +186,6 @@ review-performance:
# This is needed so that manual jobs with needs don't block the pipeline. # This is needed so that manual jobs with needs don't block the pipeline.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979. # See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
dependencies: ["review-deploy"] dependencies: ["review-deploy"]
allow_failure: true
before_script: before_script:
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)" - export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
- echo "${CI_ENVIRONMENT_URL}" - echo "${CI_ENVIRONMENT_URL}"
...@@ -213,7 +208,6 @@ parallel-spec-reports: ...@@ -213,7 +208,6 @@ parallel-spec-reports:
image: ruby:2.6-alpine image: ruby:2.6-alpine
stage: post-qa stage: post-qa
dependencies: ["review-qa-all"] dependencies: ["review-qa-all"]
allow_failure: true
variables: variables:
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/" BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
......
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
#################### ####################
# Changes patterns # # Changes patterns #
#################### ####################
.ci-patterns: &ci-patterns
- ".gitlab/ci/**/*"
.yaml-patterns: &yaml-patterns .yaml-patterns: &yaml-patterns
- "**/*.yml" - "**/*.yml"
...@@ -179,7 +182,7 @@ ...@@ -179,7 +182,7 @@
.cache-repo:rules: .cache-repo:rules:
rules: rules:
- <<: *if-cache-credentials-schedule - <<: *if-cache-credentials-schedule
when: on_success allow_failure: true
############# #############
# CNG rules # # CNG rules #
...@@ -188,6 +191,7 @@ ...@@ -188,6 +191,7 @@
rules: rules:
- <<: *if-dot-com-gitlab-org-and-security-tag - <<: *if-dot-com-gitlab-org-and-security-tag
when: manual when: manual
allow_failure: true
###################### ######################
# Dev fixtures rules # # Dev fixtures rules #
...@@ -214,6 +218,7 @@ ...@@ -214,6 +218,7 @@
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *docs-patterns changes: *docs-patterns
when: manual when: manual
allow_failure: true
.docs:rules:docs-lint: .docs:rules:docs-lint:
rules: rules:
...@@ -308,6 +313,15 @@ ...@@ -308,6 +313,15 @@
changes: *frontend-dependency-patterns changes: *frontend-dependency-patterns
when: on_success when: on_success
.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
################ ################
# Memory rules # # Memory rules #
################ ################
...@@ -347,14 +361,18 @@ ...@@ -347,14 +361,18 @@
.qa:rules:package-and-qa: .qa:rules:package-and-qa:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-patterns
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns changes: *qa-patterns
when: on_success allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns changes: *code-patterns
when: manual when: manual
allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
when: on_success allow_failure: true
############### ###############
# Rails rules # # Rails rules #
...@@ -433,6 +451,7 @@ ...@@ -433,6 +451,7 @@
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-patterns changes: *code-backstage-patterns
allow_failure: true
.reports:rules:sast: .reports:rules:sast:
rules: rules:
...@@ -441,6 +460,7 @@ ...@@ -441,6 +460,7 @@
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
allow_failure: true
.reports:rules:dependency_scanning: .reports:rules:dependency_scanning:
rules: rules:
...@@ -449,6 +469,7 @@ ...@@ -449,6 +469,7 @@
# - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255 # - <<: *if-master-refs # To be done in a later iteration: https://gitlab.com/gitlab-org/gitlab/issues/31160#note_278188255
- <<: *if-default-refs - <<: *if-default-refs
changes: *code-backstage-qa-patterns changes: *code-backstage-qa-patterns
allow_failure: true
.reports:rules:dast: .reports:rules:dast:
rules: rules:
...@@ -456,10 +477,11 @@ ...@@ -456,10 +477,11 @@
when: never when: never
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns changes: *frontend-patterns
when: on_success allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true
.reports:schedule-dast: .reports:schedule-dast:
rules: rules:
...@@ -470,59 +492,74 @@ ...@@ -470,59 +492,74 @@
################ ################
# Review rules # # Review rules #
################ ################
.review:rules:mr-and-schedule-auto: .review:rules:build-qa-image:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
when: on_success
.review:rules:review-build-cng:
rules:
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-patterns
- <<: *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
.review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise: .review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-patterns
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns changes: *frontend-patterns
when: on_success allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
when: on_success allow_failure: true
.review:rules:mr-only-auto: .review:rules:review-stop-failed-deployment:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: on_success
.review:rules:mr-only-auto-if-frontend-manual-otherwise: .review:rules:review-qa-smoke:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-patterns
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns changes: *frontend-patterns
when: on_success allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true
.review:rules:mr-only-manual: .review:rules:mr-only-manual:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true
.review:rules:review-cleanup: .review:rules:review-cleanup:
rules: rules:
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
when: manual when: manual
allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
when: on_success allow_failure: true
.review:rules:danger: .review:rules:danger:
rules: rules:
- if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID' - if: '$DANGER_GITLAB_API_TOKEN && $CI_MERGE_REQUEST_IID'
when: on_success
############### ###############
# Setup rules # # Setup rules #
...@@ -538,10 +575,11 @@ ...@@ -538,10 +575,11 @@
.setup:rules:dont-interrupt-me: .setup:rules:dont-interrupt-me:
rules: rules:
- <<: *if-master-or-tag - <<: *if-master-or-tag
when: on_success allow_failure: true
- <<: *if-auto-deploy-branches - <<: *if-auto-deploy-branches
when: on_success allow_failure: true
- when: manual - when: manual
allow_failure: true
.setup:rules:gitlab_git_test: .setup:rules:gitlab_git_test:
rules: rules:
......
...@@ -26,7 +26,6 @@ dont-interrupt-me: ...@@ -26,7 +26,6 @@ dont-interrupt-me:
stage: sync stage: sync
image: alpine:edge image: alpine:edge
interruptible: false interruptible: false
allow_failure: true
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script:
......
...@@ -132,6 +132,7 @@ and included in `rules` definitions via [YAML anchors](../ci/yaml/README.md#anch ...@@ -132,6 +132,7 @@ and included in `rules` definitions via [YAML anchors](../ci/yaml/README.md#anch
| `changes:` patterns | Description | | `changes:` patterns | Description |
|------------------------------|--------------------------------------------------------------------------| |------------------------------|--------------------------------------------------------------------------|
| `ci-patterns` | Only create job for CI config-related changes. |
| `yaml-patterns` | Only create job for YAML-related changes. | | `yaml-patterns` | Only create job for YAML-related changes. |
| `docs-patterns` | Only create job for docs-related changes. | | `docs-patterns` | Only create job for docs-related changes. |
| `frontend-dependency-patterns` | Only create job when frontend dependencies are updated (i.e. `package.json`, and `yarn.lock`). changes. | | `frontend-dependency-patterns` | Only create job when frontend dependencies are updated (i.e. `package.json`, and `yarn.lock`). changes. |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment