gitlab4j-api
gitlab4j-api copied to clipboard
is it possible to have auto merge option when creating an MR ?
I would like to be able to create an MR with the option "auto merge", but I couldn't find anything in the API. Would it be possible to add it to the API?
I think this can be done. You need to create a AcceptMergeRequestParams and set withMergeWhenPipelineSucceeds(true) and then on the MergeRequestApi instance, call acceptMergeRequest(project, mr, param)
A real world example: https://github.com/unblu/ucascade/blob/7e8f23adf3246c2f0ce510d81903b3aeea78797f/src/main/java/service/GitLabService.java#L372,383 (with all sort of tricks like retries and pause to make it work in reality)