I can confirm that the issue is related to the feature in project config displayed above by @yanceywang (Thanks by the way, you spared me a lot of trouble after two hours of trying different calls).
I think this is a bug, we should be able to setup automated merge after build is successful even if that config is checked
@ezzarghili So you met this problem too right? Any idea on how to solve this problem? My workaround is to forward merge request to another server in the last step of my pipeline, and delay 1s to use gitlab api to merge.. 😟
@yanceywang at this point I just unchecked the feature in the project we have a handful developers in this project so we can live with it for now
a second option (to avoid having a second server) is to create a build project in gitlab itself trigger it at the last step see [Build Triggers API](gitlab https://docs.gitlab.com/ce/ci/triggers/)
also you can create a branch in the same project named (for instance) trigger and push to it at the end of the build then create a build stage for it
@yanceywang@ezzarghili Thank you for the updates. Currently, for your configuration (only allow MRs to be merged when the build succeeds enabled), you will only be able to call the merge_requests/:mr_id/merge endpoint once the build has succeeded. Regardless of the value of the merge_when_build_succeeds parameter, if the build is still ongoing you'll get the 405 error.
Is your proposal to be allowed to set the MR to merge_when_build_succeeds via an update call to the merge request whilst the build is ongoing?
@grzesiek Do you think that it should be possible to update the merge_when_build_succeeds flag via an update call for the Merge Request in this case, rather than the via the merge endpoint?
@markglenfletcher Not sure what would be best. We already have PUT /projects/:id/merge_requests/:merge_request_id/cancel_merge_when_build_succeeds, maybe we should have separate set_merge_when_build_succeeds?
@grzesiek Thank you for your reply. This merge_when_build_succeeds param is really confusing。Since there is a feature
As I know, when only allow MRs to be merged when the build succeeds enabled, this feature is still work, so why there is no corresponding API for this?
GitLab is moving all development for both GitLab Community Edition
and Enterprise Edition into a single codebase. The current
gitlab-ce repository will become a read-only mirror, without any
proprietary code. All development is moved to the current
gitlab-ee repository, which we will rename to just gitlab in the
coming weeks. As part of this migration, issues will be moved to the
current gitlab-ee project.
If you have any questions about all of this, please ask them in our
dedicated FAQ issue.
Using "gitlab" and "gitlab-ce" would be confusing, so we decided to
rename gitlab-ce to gitlab-foss to make the purpose of this FOSS
repository more clear
I created a merge requests for CE, and this got closed. What do I
need to do?
Everything in the ee/ directory is proprietary. Everything else is
free and open source software. If your merge request does not change
anything in the ee/ directory, the process of contributing changes
is the same as when using the gitlab-ce repository.
Will you accept merge requests on the gitlab-ce/gitlab-foss project
after it has been renamed?
No. Merge requests submitted to this project will be closed automatically.
Will I still be able to view old issues and merge requests in
gitlab-ce/gitlab-foss?
Yes.
How will this affect users of GitLab CE using Omnibus?
No changes will be necessary, as the packages built remain the same.
How will this affect users of GitLab CE that build from source?
Once the project has been renamed, you will need to change your Git
remotes to use this new URL. GitLab will take care of redirecting Git
operations so there is no hard deadline, but we recommend doing this
as soon as the projects have been renamed.
Where can I see a timeline of the remaining steps?