Support push options when creating merge request pipelines
Problem to solve
Related to #349362 (closed)
When we skip CI for a rebase (e.g. using skip_ci
parameter in the rebase API) we skip creating a pipeline for branch but a merge request pipeline creation is still attempted. This occurs because we try to create a pipeline for merge request in a separate workflow than the branch pipeline.
flowchart TD
rebase[Rebase the MR with `ci.skip` push option] --> push[Push changes to remote]
push --> receive[PostReceive worker - with push options sent through]
receive --> Git::BranchPushService
Git::BranchPushService -- push options not yet forwarded --> UpdateMergeRequestsWorker --> MergeRequests::RefreshService --> MergeRequests::CreatePipelineService -- no push options --> Ci::CreatePipelineService --> bug[pipeline not skipped]
Git::BranchPushService -- push options already forwarded --> Git::BranchHooksService --> Git::BaseHooksService -- with push options --> Ci::CreatePipelineService --> skipped[pipeline skipped]
What does this MR do and why?
In this MR we are preparing the service objects and workers related to creating merge request pipelines to accept an optional parameter push_options
from UpdateMergeRequestsWoker
all the way down to Ci::CreatePipelineService
.
In the next MR, we are going to pass through the push_options
coming from the push event down to the Git::BranchPushService -> UpdateMergeRequestsWorker
.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Allow merge request pipeline creation to take in input
Git push options in order to support ci.skip
.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.