Merge Button Gets Activated Before Jenkins Pipeline ends
When merging to branches, we have approve strategy. If A creates merge request then B should approve the request, while approving pipeline is triggered and after pipeline finishes it posts status to GitLab and after that merge button gets activated for the user A. The problem is, merge is activated before pipeline starts, I think it is because pipeline waits 5 seconds(in queue) to run on Jenkins side but if we try to merge in less than 5 seconds, merge occurs before pipeline starts. Is there something to control from GitLab side, some timeouts for merge button? GitLab does not wait for the status coming from Jenkins side.
post { failure { updateGitlabCommitStatus name: 'pipeline', state: 'failed' } success { updateGitlabCommitStatus name: 'pipeline', state: 'success' } aborted { updateGitlabCommitStatus name: 'pipeline', state: 'canceled' } }
options {
gitLabConnection('gitlab-connection')
gitlabBuilds(builds: ['pipeline'])
}