Skip to content

Add "member_events" group hook to be set via REST API

What does this MR do and why?

Allow member_events to be set via group hook REST API [1][2].

Note:

  • I'm not too sure about the variable ordering convention, so I just put the member_events as the last record after the other *_events
  • Group hook UI is under "ee", so I requested a trial license to test the functionality end-to-end in my local

References:

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
List: before-list List: after-list-false
Edit: before-put-true Edit: after-put-true
Show: before-show Show: after-show
Create: before-post Create: after-post

How to set up and validate locally

  1. Create new access token in http://127.0.0.1:3000/-/user_settings/personal_access_tokens
  2. Create new group hook (considering the group name is flightjs), in http://127.0.0.1:3000/groups/flightjs/-/hooks. Click "Add new webhook"
  3. Fill in the details then click "Add webhook"
  4. Call REST API to test changing / viewing the "Member Events" value:
# Edit
curl -s -XPUT http://127.0.0.1:3000/api/v4/groups/33/hooks/3\?access_token\=your-access-token \
    --header 'Content-Type: application/json' \
    --data '{"member_events":true}'

# List
curl -s http://127.0.0.1:3000/api/v4/groups/33/hooks\?access_token\=your-access-token

# Show
curl -s http://127.0.0.1:3000/api/v4/groups/33/hooks/3\?access_token\=your-access-token

# Create
curl -s http://127.0.0.1:3000/api/v4/groups/33/hooks\?access_token\=your-access-token \
    --header 'Content-Type: application/json' \
    --data '{"url":"https://example.com/post","member_events":true}'

Related to #291169 (closed)

Edited by Ivan Sebastian

Merge request reports