Avoid duplicate pipelines in merge requests
Problem to solve
When only:merge_requests
is used in CI configuration, pushes to a MR create two pipelines: a "normal" one, and a a "merge request" one.
Target audience
?
Further details
Well, maybe only:branches
is needed in addition to only:merge_requests
. What I mean is that one may want different jobs run for pushes and for merge requests, but with the former a subset of the latter. In this situation, one does not want two pipelines being created in a merge request, one suffices. This may be unavoidable (or with difficulty) when creating a MR, since the push pipeline was already created, but for later pushes it should be easy to detect that a MR exists.
This was already discussed in #15310 (closed), but it seems it was postponed... and I don't want it to be forgotten.
Proposal
A way to avoid creating a "branch" pipeline when pushing to a branch, if a "merge request" pipeline is created.
Maybe the easiest is a project setting, similar to auto-cancel pipelines.
What does success look like, and how can we measure that?
Fewer unneeded pipelines created, less resource waste, shorter queueing times.