Merge When Build Succeeds does automatic merge on stage success, not after all stages succeed
Summary
Merge When Build Succeeds does automatic merge on stage success, not after all stages succeed
Steps to reproduce
GitLab Community Edition 8.3.4
Multi stage build with build, test and deploy stages. If a click on the Merge When Build Succeeds button during build stage, the automatic merge will start when all build stage builds are completed. So basically test stage build failures won't cancel the automatic merge.
If i click Merge When Build Succeeds button during test stage, it'll start automatic merge after all test stage steps have completed successfully not after deploy stage.
Expected behavior
I'd expect the automatic merge to start only after all stages have completed successfully. Not exactly sure if this is intentional or not but it's a bit confusing.