ci: disable duplicated pipelines triggered by marge

When Marge rebases, it creates two pipelines, one in the author's account
due to the rebase and another one in the target account due to the merge
request event. Depending on the order they appear, Marge erroneously
check the author's pipeline, and since it doesn't have the rights to
start this pipeline, Marge fails to merge because it timed out (since the
pipeline never got run).

Fix this by disabling the author's pipeline (source of type "push") when
a merge request is open.

We only disable when the pipeline is triggered by marge to not affect
running ci_run_n_monitor.py script

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24730>
This commit is contained in:
Helen Koike
2023-08-16 13:09:17 -03:00
committed by Marge Bot
parent 9a2a0c6fa3
commit 3fe0cec4c1

View File

@@ -1,5 +1,8 @@
workflow: workflow:
rules: rules:
# do not duplicate pipelines on merge pipelines
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" && $GITLAB_USER_LOGIN == "marge-bot"
when: never
# merge pipeline # merge pipeline
- if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
variables: variables: