Add "Merge when pipeline succeeds and approved" strategy
requested to merge 407352-spike-investigate-automatic-merge-when-ready-succeed-pipeline-and-required-approvals-added into master
What does this MR do and why?
Related to #407352 (closed) and #8128 (closed).
As a result of the related spike, this MR is a draft with proof of concept for new auto-merge strategy: "Merge when approved and pipeline succeeds". The idea is to release this behind a feature flag.
It is similar to "merge when pipeline succeeds", but can also be enabled before approvals are given. When this strategy is enabled and pipeline finishes before the approvals are given, the MR gets merged with the final required approval given.
Screenshots or screen recordings
Various scenarios
Approval is given before pipeline succeeds (same behavior as the current MWPS)
approvals_before_pipeline_succeeds
Approval is given after pipeline succeeds (new behavior that merges the MR)
approvals_after_pipeline_succeeds
Merge is clicked after the approval is given and pipeline succeeds (current behavior without auto-merge)
merge_after_pipeline_and_approvals
:merge_when_approved_and_pipeline_succeeds
disabled (uses MWPS)
With feature flag
Email preview
HTML
plain-text
How to set up and validate locally
- Enable the feature flag
Feature.enable(:merge_when_approved_and_pipeline_succeeds)
- Open an MR which requires approval
- Click "Set to auto-merge"
- Wait until pipeline succeeds
- Approve
- MR gets merged
Todos
-
Documentation page -
Feature flag rollout issue
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.
Edited by Martin Čavoj