Skip to content

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

  1. Setup project with webhook following this guide: https://docs.gitlab.com/development/webhooks/#qaing-changes.
  2. Add a CODEOWNERS file and require codeowners approval on main.
  3. Set the required approval for MRs to 1.
  4. Set the project to reset all approvals on push.
  5. Create a MR with changes on the file specific in CODEOWNERS file.
  6. Approve the MR.
  7. Update the file in the same MR.
  8. After the approvals are reset, check the webhook site if you received a webhook with action as unapproved, system as true and system_action as approvals_reset_on_push.
  9. Change the project setting to reset codeowners approvals.
  10. Approve the same MR as codeowner.
  11. Update the file in the same MR.
  12. After the approvals are reset, check the webhook site if you received a webhook with action as unapproved, 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

Merge request reports

Loading