ci: Use "when: on_success" in job rules

Instead of "when: always". The latter would result in jobs running even
after a dependency job failed, which would inevitably result in the
dependent job failing as well. See
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628#note_1758824
for an example.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3034>
This commit is contained in:
Michel Dänzer 2023-05-31 14:45:14 +02:00 committed by Marge Bot
parent b413f45bee
commit b809f3dc85

View File

@ -215,7 +215,7 @@ workflow:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^$/' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^$/'
when: never when: never
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME - if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
when: always when: on_success
check-commit-log: check-commit-log:
extends: extends:
@ -547,7 +547,7 @@ can-build-gnome-shell@x86_64:
test-mutter-coverity: test-mutter-coverity:
rules: rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $MUTTER_SCHEDULED_JOB == "coverity"' - if: '$CI_PIPELINE_SOURCE == "schedule" && $MUTTER_SCHEDULED_JOB == "coverity"'
when: always when: on_success
- if: '$CI_COMMIT_BRANCH' - if: '$CI_COMMIT_BRANCH'
when: 'manual' when: 'manual'
extends: extends:
@ -597,11 +597,11 @@ dist-mutter:
changes: changes:
- "**/meson.build" - "**/meson.build"
- meson/* - meson/*
when: always when: on_success
- if: '$GITLAB_USER_LOGIN == "marge-bot"' - if: '$GITLAB_USER_LOGIN == "marge-bot"'
when: always when: on_success
- if: '$CI_MERGE_REQUEST_ASSIGNEES == "marge-bot"' - if: '$CI_MERGE_REQUEST_ASSIGNEES == "marge-bot"'
when: always when: on_success
dist-mutter-tarball: dist-mutter-tarball:
extends: dist-mutter extends: dist-mutter