"Only allow merge requests to be merged if the build succeeds" is flakey for external build tools
We integrate Jenkins with Gitlab CE but until Jenkins has recorded that it is making a build, the merge request can be merged. This has led to a couple of merge requests being prematurely merged.
Steps to reproduce
- Enable "Only allow merge requests to be merged if the build succeeds"
- Integrate with a 3rd party build tool like Jenkins
- open merge request
- click merge button before Jenkins starts building
What is the current bug behavior?
The MR can be merged despite never succeeding.
What is the expected correct behavior?
Until the current HEAD of the branch has a successful build, the MR cannot be merged.
I believe this may be WAI, but it's certainly annoying and I'm sure wouldn't require a large change of logic. (Rather than
if FAILED|BUILDING prevent merge, change the check to
if !PASSED prevent merge. Maybe I'm oversimplifying
Results of GitLab environment info
Results of GitLab application Check