jenkins-gitlab-merge-request-builder-plugin icon indicating copy to clipboard operation
jenkins-gitlab-merge-request-builder-plugin copied to clipboard

Add support for Gitlab CI Integration

Open Jotschi opened this issue 9 years ago • 15 comments

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.

Gitlab MR CI intgeration

Build Status

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.

  1. call api/v3/projects/:id/repository/branches
  2. find branch for sha1 ish
  3. determine jenkins job that is responsible for the branch by checking the target branch whitelist against the previously determined branch name

Jotschi avatar Jul 31 '14 18:07 Jotschi

:+1: , this would be amazing.

hawkw avatar Aug 01 '14 18:08 hawkw

@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 avatar Aug 01 '14 18:08 bwrsandman

@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

Jotschi avatar Aug 01 '14 18:08 Jotschi

I will implement this feature when i find the time.

Jotschi avatar Aug 01 '14 18:08 Jotschi

@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 avatar Aug 01 '14 19:08 bwrsandman

@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 avatar Aug 01 '14 20:08 Jotschi

@Jotschi That makes sense, I was looking through the API, I hadn't realized you had to fake the CI.

Thanks

bwrsandman avatar Aug 01 '14 20:08 bwrsandman

+1 I love this

geoffwhittington avatar Aug 27 '14 19:08 geoffwhittington

+1

kamaradclimber avatar Sep 26 '14 12:09 kamaradclimber

+1

angezanetti avatar Mar 03 '15 10:03 angezanetti

:+1: Love to see this feature.

arpitgold avatar Mar 04 '15 04:03 arpitgold

Happy to add this if someone is willing to submit a PR

timols avatar Mar 08 '15 19:03 timols

+1

bhaku avatar Mar 15 '15 22:03 bhaku

+1

jkobus avatar Aug 28 '15 21:08 jkobus

I think this should be replaced by #150

ajohnson-ventera avatar Nov 16 '15 02:11 ajohnson-ventera