Uh oh!
There was an error while loading. Please reload this page.
Implement approval for merge requests - #817
Conversation
omehegan
commented
Jul 30, 2018
@padyx thanks for submitting this! I'm happy with the help text that makes clear that this will only be supported in GitLab EE. Regarding the API v3 vs v4 question, I think you should figure out what version of GitLab introduced the API we are using, and then add that as a requirement in the help text. E.g. 'EE v9.0 or newer only.' @dblessing can you or someone else from GitLab comment about the HTTP result codes that should be expected/are possible here, and also the |
omehegan
commented
Aug 16, 2018
@dblessing ping! |
dblessing
commented
Sep 17, 2018
API v4 was introduced in 9.0. v3 was removed in 11.0. That doesn't mean all features of v4 existed in 9.0, though. Those HTTP codes look to be comprehensive for the endpoints you're using. |
padyx
commented
Sep 26, 2018
Thanks for the input @dblessing I've used Combined that v4 API is available from GitLab EE 9.0 and newer, and that the API v3 does not support approvals at all , I should be able to use the two properties. I'll adapt the PR to use the two properties for better handling in advance, instead of only trying to interpret the response codes after the attempt to approve. @omehegan Do you have any preference how to handle the unsupported methods on the V3GitLabApiProxy? If I remove them, RESTEasy throws a RuntimeException in the tests since the methods in the GitLabApiProxy have no annotations.
|
omehegan
commented
Nov 13, 2018
@padyx TBH I'm not informed enough to have a preference :) If you want to move ahead and just use your own judgment, that's fine with me. |
4356b20 to
2e32ab3Compare2e32ab3 to
ecfa747Comparepadyx
commented
Dec 9, 2018
I've attempted to implement the other version using the canApprove/hasApproved flags .
For now, I've cleaned up the remaining FIXMEs in the PR and added the info that approvals are available in EE 9.0 and up (since that is when API v4 was introduced). |
omehegan
commented
Dec 27, 2018
I've uploaded a snapshot with this patch to 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. I will work on testing it myself. If anyone else is willing to try it, please do. |
erbrecht
commented
Jan 22, 2020
I've installed the snapshot version you linked, and all is working with jenkins 2.190.1 and GitLab Enterprise Edition 12.6.4-ee. It approved my merge request as the integration user I configured. I'll gladly do some more testing if you let me know what specifically to look for. I'm really hoping to get this into our production system. |
erbrecht
commented
Jan 29, 2020
padyx
commented
Jan 30, 2020
Alceatraz
commented
Jul 13, 2022
Any update about this? In plugin 1.5.35 still no "Approve GitLab merge request on success" |
padyx
commented
Jul 13, 2022
It's been a while and I don't use Jenkins at my current position so I'm no longer pushing this actively. But I'd still be willing to get this back into a mergeable shape, if a maintainer can tell me what is missing to get that done. @omehegan Is anything missing apart from obvious conflicts that I'd need to fix? Otherwise, I'd propose to close this. |
benjaminver
commented
Jun 6, 2024
Would be helpful! |
This PR adds a new post-build action to the plugin: The ability to approve / unapprove a merge request depending on the build result (resolves issue #95). It offers a configuration option whether unstable builds should be approved anyway (default: no).
Note: The GitLab approval feature is not available in the self-hosted Community Edition (only Enterprise Edition Starter, or above). The approval feature is available for all public repositories on GitLab.com or in the Bronze tier, or above.
The basic implementation works, but there are several points in need of discussion in this PR before it is ready for merging:
My experimentation yielded these results so far, the last two
The result body contains two very useful attributes, but these aren't mentioned in the API docs - so I'm unsure about relying on them since I don't know if they are available since 8.9:
user_has_approvedanduser_can_approve.I'd appreciate your input.
Acceptance criteria so far:
Fixes#95