Skip to content

Add API support for webhook feature flag events

What does this MR do and why?

This MR adds REST API support for feature flag events for project and group webhooks.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Create a project hook with feature flag events enabled

curl --location --request POST 'http://gdk.test:3000/api/v4/projects/<PROJECT_ID>/hooks?feature_flag_events=true&url=https%3A%2F%2Fexample.com' \
--header 'Authorization: Bearer <PAT>' 

feature_flag_events should be true.

Get a project hook

curl --location --request GET 'http://gdk.test:3000/api/v4/projects/<PROJECT_ID>/hooks/<PROJECT_HOOK_ID>' \
--header 'Authorization: Bearer <PAT>' 

feature_flag_events should be present in the payload.

Set feature flag events on project hook

curl --location --request PUT 'http://gdk.test:3000/api/v4/projects/<PROJECT_ID>/hooks/<PROJECT_HOOK_ID>?feature_flag_events=false' \
--header 'Authorization: Bearer <PAT>' 

Should be able to toggle feature_flag_events.

Create a group hook with feature flag events enabled

curl --location --request POST 'http://gdk.test:3000/api/v4/groups/<GROUP_ID>/hooks?feature_flag_events=true&url=https%3A%2F%2Fexample.com' \
--header 'Authorization: Bearer <PAT>' 

feature_flag_events should be true.

Get a group hook

curl --location --request GET 'http://gdk.test:3000/api/v4/groups/<GROUP_ID>/hooks/<GROUP_HOOK_ID>' \
--header 'Authorization: Bearer <PAT>' 

feature_flag_events should be present in the payload.

Set feature flag events on group hook

curl --location --request PUT 'http://gdk.test:3000/api/v4/groups/<GROUP_ID>/hooks/<GROUP_HOOK_ID>?feature_flag_events=false' \
--header 'Authorization: Bearer <PAT>' 

Should be able to toggle feature_flag_events.

Edited by Luke Duncalfe

Merge request reports

Loading