Skip to content

Support custom payloads for webhooks

Release notes

Problem to solve

GitLab's webhooks currently send specific JSON payloads, which are documented on https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html

This means the receiving endpoints need to understand GitLab's webhook format (at least if they want to do anything interesting). This limits the usability of webhooks because you need to use an app which specifically supports GitLab, or write your own endpoint.

Proposal

Some ideas:

  1. POC Allow user to specify a custom query (as GraphQL) - thread and thread
  2. Support some kind of templating, so you can build payloads that dynamically include values from the default payload.
    • The main question here is what the syntax / template language should be, which probably requires some research.
  3. Support custom request headers (issue for this is: Add ability to specify custom webhook headers (#17290 - closed)).
    • This would allow non-JSON payloads (by adding a Content-Type header for e.g. XML), custom authentication schemes, and other useful things.

For inspiration we can look at Dynatrace's Cloud Automation UI for example, which uses {{...}} syntax to interpolate dynamic values (and also secrets which can be managed centrally there):

image

Intended users

Feature Usage Metrics

Edited by Luke Duncalfe