jenkins-gitlab-merge-request-builder-plugin
jenkins-gitlab-merge-request-builder-plugin copied to clipboard
Add support for Gitlab CI Integration
It would be nice to add a gitlab ci compatible service provider in order to allow gitlab to fetch the build status of a merge request build and show it clearly highlighted within the MR view in gitlab.
So far only https://github.com/DABSquared/gitlab-plugin provides this feature.
It would also be very useful when the service provider could handle multiple merge request builder jobs.
Example: The service provider should return / redirect to the correct jenkins job url even if there are multiple jobs for which each might handle different target branches using the whitelist feature.
Unfortunately only the sha1 hash of the commit is provided by gitlab. Afaik the only solution is that the service provider must check what branch is matching that ish.
- call api/v3/projects/:id/repository/branches
- find branch for sha1 ish
- determine jenkins job that is responsible for the branch by checking the target branch whitelist against the previously determined branch name
:+1: , this would be amazing.
@Jotschi What format of json/http request is needed to set the build status icon? I can't seem to find it in the gitlab api docs.
@bwrsandman The status icon is just a url that points to the gitlab ci service. Normally this would point to jenkins. Something like this: http://jenkins/projects/name/status.png?ref=dev
I will implement this feature when i find the time.
@Jotschi Ok, and how do you set that url in Gitlab CE? Via a request? Or do you have to fake a Gitlab CI server?
@bwrsandman You have to fake the gitlab ci server. When using the gitlab-plugin you have to set the url for the gitlab ci service manually.
@Jotschi That makes sense, I was looking through the API, I hadn't realized you had to fake the CI.
Thanks
+1 I love this
+1
+1
:+1: Love to see this feature.
Happy to add this if someone is willing to submit a PR
+1
+1
I think this should be replaced by #150