2

I have a buildbot server and Gitlab. I could not figure out, to trigger builds whenever a merge request is opened on Gitlab. The purpose should be, that buildbot writes a comment back to the merge request whenever a build succeeds or fails (where as the build is done on the merge request + the upstream branch).

Any hints how to trigger that?

Thanks!

Tobi
  • 540
  • 7
  • 18

3 Answers3

1

You could implement a service like the one for GitLab CI. This actually posts back to the merge-request whether GitLab CI passed or failed the test-suite.

Razer
  • 7,843
  • 16
  • 55
  • 103
  • ho would you plug such a service in? I can't really see any code that reacts to actions... Sorry, my Ruby knowledge is very limited. – Tobi Nov 19 '13 at 16:28
  • 1
    I'm also not a ruby dev. I guess this service delegates its action to another hook. Maybe look at the implementation for the hip chat service which maybe is more intuitive: https://github.com/gitlabhq/gitlabhq/commit/483f9854e43d2a3fc6cf48ec7228ddef62b93375 – Razer Nov 20 '13 at 07:28
  • thanks for that link, that explains more how the stuff works. When I get it right, the execute_service thingy is only called whenever you push something. But the creation for a merge request is not a push action. I am thinking about extending the merge_controller (https://github.com/gitlabhq/gitlabhq/blob/master/app/controllers/projects/merge_requests_controller.rb) for doing something whenever a merge request is created. – Tobi Nov 20 '13 at 13:20
  • Link is now a 404. – corvus_192 Feb 22 '18 at 12:07
1

The Gitlab team actually merged some stuff in to make it possible to fire web hooks whenever a merge request is opened or updated: see https://github.com/gitlabhq/gitlabhq/pull/5881 and https://github.com/gitlabhq/gitlabhq/issues/1137

Tobi
  • 540
  • 7
  • 18
0

I implemented one and am contributing it back to the buildbot project, see https://github.com/buildbot/buildbot/pull/1820

It uses webhooks and posts comments back to the merge request to show build status.

Dan Kegel
  • 559
  • 5
  • 11