Webhook for pipeline status of merge requests filed against repo

Hello,

I’m currently writing a gitlab bot to automatically label merge requests when pipelines fail/succeed. I’m currently using the pipeline webhook for this, but it seems like that isn’t meant for this use case since pipelines are run against the fork and not the main repo (and I only want the webhook to be setup for the main repo, not forks), or at least I’m not getting a notification for MRs filed against my main repo from forks. Is there another way to get notified of status changes in the pipeline of any MR of a repo?

Thanks!

Hi,

can you share some config and code you’ve done already? Maybe it becomes more clear where you are currently leaning against.

From a more general thought - if events do not work, do it with a scheduler and keep the old state, comparing to the new one. Basically a state machine approach and not real time but more safe.

Cheers,
Michael

Hello,

thanks for the reply :slight_smile:

As for config: I’ve enabled all webhooks for my project. For this particular problem, I had expected that the Pipeline Hook event would also be emitted for merge requests that are made from forks of my project (but apparently it’s only the case for MRs made from my own project, where the webhook is set). Not sure if sharing code helps here, since this is probably just me expecting too much from the Webhook.

I guess I’ll probably go with polling for changes as you’ve suggested, fortunately Gitlab’s API is pretty easy to use :slight_smile:

Thanks!

Hi,

maybe it is just a missing feature too - if you think so, please do not hesitate to create a new issue and describe your use in all detail with given configurations then :slight_smile:

I’ve been implementing a REST API with event streams in the past (both backend and client sample code), and sometimes this was not as reliable as querying the state and doing local comparisons myself. That’s why I added the thought with the state machine as this could make things more reliable for you, with the price of more scripting involved of course :sunglasses:

Cheers,
Michael