gitlab-ci: Run merge request pipelines automatically only for Marge Bot
authorMichel Dänzer <mdaenzer@redhat.com>
Fri, 3 Apr 2020 09:46:12 +0000 (11:46 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Apr 2020 17:36:15 +0000 (17:36 +0000)
commit4176dfa880d02e6898a9d19d929bfeab8d87388a
treef026e64ba7b57f9baee6b7f5967a753275d204f5
parent42fe600c0c27f2605fa616af4ffce157598d7253
gitlab-ci: Run merge request pipelines automatically only for Marge Bot

MR pipelines not triggered by Marge Bot can still be triggered manually.

Motivation: The main & forked Mesa project CI pipelines combined are
currently generating over 1 TB of egress traffic per week. ~80% of this
is from pre-merge pipelines. Assuming this corresponds to 4 pre-merge
and one post-merge pipeline per MR on average, this change could
potentially eliminate up to ~60% of the overall traffic (by preventing
3 of the 4 pre-merge pipelines from running automatically).

(Of course, this could be subverted if all jobs of the other pipelines
were triggered manually anyway... In most cases, manually triggering
just a few jobs should suffice)

v2:
* $GITLAB_USER_NAME was the wrong variable, $GITLAB_USER_LOGIN should
  do the trick.

Suggested-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4432>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4432>
.gitlab-ci.yml