go-playground / webhooks

:fishing_pole_and_fish: Webhook receiver for GitHub, Bitbucket, GitLab, Gogs
MIT License
950 stars 238 forks source link

[gitlab] Webhook Event Note Hook not registered #45

Open vncntvandriessche opened 6 years ago

vncntvandriessche commented 6 years ago

Hi

I'm currently using the following dependency:

PROJECT                               CONSTRAINT     VERSION        REVISION  LATEST   PKGS USED
gopkg.in/go-playground/webhooks.v3    v3.11.0        v3.11.0        5580947   v3.11.0  2  

I've noticed some of the events formerly handled by functions registered as: IssuesEvents no longer seem to be properly handled. More specifically: When someone reacts to an issue, it no longer seems to create the same hook from gitlab -> It's become some sort of (NotesEvents?).

I opened this repository at tag: v3.13.0 and started searching for this event type in https://github.com/go-playground/webhooks/blob/v3.13.0/gitlab/gitlab.go#L28-L38 but couldn't find it.

Is it possible I'm missing something?

Seems like gitlab now has this type of hook: notesevent

When I created this application it seems like the notesEvents didn't exist and it was shipped along with the IssuesEvents?

Munsio commented 5 years ago

Hi,

The "Note events" you are searching for is under the CommentEvents. https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#comment-events

So in fact you need to listen on the CommentEvents and then check the payload Object and search for the information you need. In your case and according to the gitlab documentation there should be an issue key in the payload. Here is the code at the specific version: https://github.com/go-playground/webhooks/blob/v3.13.0/gitlab/payload.go#L125