gitlab-org--gitlab-foss/doc/workflow/merge_when_build_succeeds.md

16 lines
1.3 KiB
Markdown
Raw Normal View History

2015-12-02 07:28:21 -05:00
# Merge When Build Succeeds
2015-12-08 08:02:34 -05:00
When reviewing a merge request that looks ready to merge but still has one or more CI builds running, you can set it to be merged automatically when the build succeeds. This way, you don't have to wait for the build to finish and remember to merge the merge request then.
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
![Enable](merge_when_build_succeeds/enable.png)
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
When you hit the "Merge When Build Succeeds" button, the status of the Merge Request will be updated to represent the impending merge. If you cannot wait for the build to succeed and want to build immediately, this option is available in the dropdown menu on the right of the main button.
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
Both team developers and the author of the merge request have the option to cancel the automatic merge when they find a reason it shouldn't be merged after all.
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
![Status](merge_when_build_succeeds/status.png)
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
When the build succeeds, the merge request will automatically be merged. When the build fails, the author gets a chance to retry any failed builds, or to push new commits to fix the failure.
2015-12-02 07:28:21 -05:00
2015-12-08 08:02:34 -05:00
When the builds are retried and succeed on the second try, the merge request will automatically be merged after all. When the merge request is updated with new commits, the automatic merge is automatically canceled to allow the new changes to be reviewed.