Skip to content

Web Hook tests send the wrong `X-Gitlab-Event` event name

GitLab hooks should send the X-Gitlab-Event header with values like 'Push Hook', 'Merge Request Hook', etc. An actual push still does send the 'Push Hook' header. However, testing a web hook with various types sends 'Push Event', 'Merge Request Event', etc. I believe this is a byproduct of the changes from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11728.

This breaks testing web hooks for any integration that looks for a particular header value, like the Jenkins gitlab-plugin. See https://github.com/jenkinsci/gitlab-plugin/issues/608

I used requestb.in to test this. First, I configured a web hook and used the 'Test' function. In requestb.in I got X-Gitlab-Event: Push Event. Then I pushed a new file and in requestb.in I got X-Gitlab-Event: Push Hook. The latter is correct.

Edited by Rémy Coutable