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:
- [1] #291169 (closed)
- [2] https://docs.gitlab.com/ee/api/groups.html#add-group-hook
- [3] !90310 (merged)
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: | List: |
Edit: | Edit: |
Show: | Show: |
Create: | Create: |
How to set up and validate locally
- Create new access token in
http://127.0.0.1:3000/-/user_settings/personal_access_tokens
- Create new group hook (considering the group name is
flightjs
), inhttp://127.0.0.1:3000/groups/flightjs/-/hooks
. Click "Add new webhook" - Fill in the details then click "Add webhook"
- 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