Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Jenkins approve Merge Requests #95

Open
klausbayrhammer opened this issue Jul 17, 2015 · 20 comments · May be fixed by #817
Open

Make Jenkins approve Merge Requests #95

klausbayrhammer opened this issue Jul 17, 2015 · 20 comments · May be fixed by #817

Comments

@klausbayrhammer
Copy link

Gitlab EE v 7.12.0 introduced the feature 'Project setting: approve merge request by N users before accept'. We'd like to configure that there are 2 approvals required in order to merge a MR. One of the approvals should be done by the jenkins build which builds the MR. As far as I can see a merge-request-triggered jenkins build adds a comment to the MR - it would be cool if the jenkins build would approve the merge-request.

@capricube
Copy link

+1 i'd also like to use jenkins as an approver

@MartinNowak
Copy link
Contributor

Or maybe use the 👎 👍 voting to trigger a merge, that would also be availabe for the Gitlab CE.

@carleytanoue-disney
Copy link

+1 for jenkins as an approver!

@brentjohnson
Copy link

+1 (Unless there is a less hacky way to enforce "No merging unless you pass unit tests")

@kflorence
Copy link

+1

@omehegan
Copy link
Member

@dblessing what would Jenkins have to send back in order to give a +1 to a merge request?

@omehegan
Copy link
Member

#110 added support for Jenkins accepting MR.
#72 added support for Jenkins voting on an MR.

Seems like these together should be enough for this issue. Any comments?

@dblessing
Copy link

As of GitLab 8.5.0, the "Merge when build succeeds" feature will work with
this plugin. Is that enough or do you want total autonomous control for
Jenkins to merge?
On Thu, Feb 25, 2016 at 6:33 PM Owen Mehegan notifications@github.com
wrote:

#110 #110 added support
for Jenkins accepting MR.
#72 #72 added support
for Jenkins voting on an MR.

Seems like these together should be enough for this issue. Any comments?


Reply to this email directly or view it on GitHub
#95 (comment)
.

@omehegan
Copy link
Member

It isn't clear to me what exactly people are asking for, or whether it is already supported by the plugin. I thought that the "Accept merge request on successful build" feature is it, and the author of that code said it was working in his setup. So now I don't understand what is changing on the GitLab side in 8.5.0 :)

@coder-hugo
Copy link
Contributor

The author requested to add the functionality to approve a MR instead of accepting it by the Jenkins. Approving MRs is a feature of the GitLab EE (You can configure that a MR requires a given number of approvals before it can be accepted). But AFAIK there is no API provided by GitLab for approving MRs. At least I haven't found any documentation for this.
@dblessing: do you know if there is an API for this or if it's planned to implement an API for this.

@kalibyrn
Copy link

I noticed this was closed. Has this been completed, dropped, or is it duplicated in some way? One of our projects is requesting that merges cannot be accepted until a successful build and this request would fit the bill nicely.

Would this be doable via the functionality of this pull request? #72

@omehegan
Copy link
Member

@kalibyrn from what we can tell, "approve MR" is a feature of GitLab EE only. As far as we know, there is no API on the GitLab side that we could use to send this approval from Jenkins. So the plugin currently supports things like "voting" (+1), commenting, and actually accepting/merging MRs. If you want this other functionality, we don't see a way to provide it currently.

@borgiani
Copy link

@omehegan it seems that they have an API for that now: https://docs.gitlab.com/ee/api/merge_requests.html#approve-merge-request
Any chance we can see this issue reopened? :)

@omehegan
Copy link
Member

omehegan commented Jun 9, 2017

@borgiani my concern about this is that it's a GitLab Enterprise-only feature. Supporting this would be a first for the plugin, because we would need some UI to warn users that it only works with Enterprise, and I'm sure we would still get erroneous bug reports about it. But I will reopen it as a feature request.

@sven-ke
Copy link

sven-ke commented Sep 22, 2017

+1 for this feature! even though it's only for gitlab EE it would be very helpfull

@borisovano
Copy link

+1

@padyx
Copy link
Contributor

padyx commented Jul 26, 2018

I've got an initial working implementation for this and would be willing to open a MR for this, if @omehegan thinks this would be something that would fit into the plugin.
The API response codes are barely documented for this feature, and the response body differs from the API doc too, so I still got to work on that.

@omehegan
Copy link
Member

@padyx yeah I am interested, at this point we do have at least one other EE-only tie-in. Please open a PR, and if you need support from GitLab to answer questions about the API or something, we can ask them for it.

@padyx padyx linked a pull request Jul 27, 2018 that will close this issue
11 tasks
@omehegan
Copy link
Member

I have uploaded a build of the plugin which includes this PR (from #817). If you are interested in this feature, please install http://repo.jenkins-ci.org/snapshots/org/jenkins-ci/plugins/gitlab-plugin/1.5.12-SNAPSHOT/gitlab-plugin-1.5.12-20181227.052257-3.hpi and provide any feedback you can.

@erbrecht
Copy link

erbrecht commented Nov 2, 2019

I just installed this plugin and I was looking for this feature. I've got 1.5.13 installed but I don't have the option to approve a merge request. @omehegan is this still only available in the snapshot you posted? It would be awesome if this could get released officially. I'm able to do any testing you might need. Is it worth installing the older version, or could is it possible to get this feature added to a newer snapshot version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.