Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab auto merge when build succeeds not working

I have a quite simple question. We have setup Gitlab CI and want to allow auto merge as soon as the build succeeds for some of our branches.

Thing is, we see that the build passes, but the merge does not actually happen and the status stays at "to be merged automatically once the build succeeds".

Do you have any idea why?

I attached a screenshot of the bogus behaviour.

Merge succeeded but MR not merged

EDIT: Some additional information that was requested:

  • It looks like no background job is put in the queue where I activate a "automatic merge when build succeeds
  • When a build finishes running, no background jobs is triggered as far as I can see. Nothing new being scheduled, dead or in progress.
  • I also don't see anything crazy or ERROR like in the logs.
  • Two screenshots of my dashboard as a MR with an automated build runs :

Dashboard during MR with auto merge 1 Dashboard during MR with auto merge 2

Thanks, Julien

like image 925
jlengrand Avatar asked Sep 07 '16 09:09

jlengrand


People also ask

How do you automate merge requests?

You can use push options to automatically create a merge-request in GitLab, like so: $ git push -o merge_request. create ... The current branch will be pushed, it will be followed locally, a merge request based on that branch will be created, and the option to "Remove source branch" after merge checked on GitLab.

How do you trigger a pipeline on a merge request?

Push a new commit to the source branch for a merge request. Select Run pipeline from the Pipelines tab in a merge request. This option is only available when merge request pipelines are configured for the pipeline and the source branch has at least one commit.

What is Merge_request_event?

merge_request_event is defined as follows: For pipelines created when a merge request is created or updated. Required to enable merge request pipelines, merged results pipelines, and merge trains. As per your question.


1 Answers

Maybe your merge job is scheduled or dead.

  • Use your admin account and click the Admin Area button.
  • Click Monitoring -> Background Jobs enter image description here

  • Then,click the dashboard and check the if your merge job is in the Scheduled queue or Dead queue. enter image description here

like image 182
X.Jian Avatar answered Oct 26 '22 12:10

X.Jian