Add webhook trigger for system-initiated approval resets
What does this MR do and why?
Add webhook trigger for system-initiated approval resets
This introduces a new webhook trigger for when merge requests are reset by the system. Typically this occurs when merge requests are configured to reset approvals on new pushes.
The new webhook payload includes a system field which will be true.
It also includes a system_action field which can provide more details
about the system action that triggered the reset, such as
'approvals_reset_on_push'.
References
Resolves #553070 (closed)
Screenshots or screen recordings
| Before | After | 
|---|---|
How to set up and validate locally
- Setup project with webhook following this guide: https://docs.gitlab.com/development/webhooks/#qaing-changes.
- Add a CODEOWNERS file and require codeowners approval on main.
- Set the required approval for MRs to 1.
- Set the project to reset all approvals on push.
- Create a MR with changes on the file specific in CODEOWNERS file.
- Approve the MR.
- Update the file in the same MR.
- After the approvals are reset, check the webhook site if you received a webhook with actionasunapproved,systemastrueandsystem_actionasapprovals_reset_on_push.
- Change the project setting to reset codeowners approvals.
- Approve the same MR as codeowner.
- Update the file in the same MR.
- After the approvals are reset, check the webhook site if you received a webhook with actionasunapproved,systemastrueandsystem_actionascode_owner_approvals_reset_on_push`.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited  by Patrick Bajao