Skip to content

Event type information in MR approval rule audit event streaming

What does this MR do and why?

Adds event type information in streaming audit events when merge approval rule is created or updated. I have also updated audit changes concern, and now it has option to use Auditor class instead of AuditEventService.

Note: currently creation/deletion of approval rule and only update on number of required approvals and add/remove approvers produces audit events.

How to set up and validate locally

  1. Setup external destination using https://docs.gitlab.com/ee/administration/audit_event_streaming.html#use-the-gitlab-ui or https://docs.gitlab.com/ee/administration/audit_event_streaming.html#use-the-api .
  2. Go to Project -> Settings -> General -> Expand Merge request approvals.
  3. Create Merge request approval rule.
  4. Check streamed payload and headers contain event type approval_rule_created and audit event is also visible under admin {{gdk_host_url}}/admin/audit_logs.
  5. Edit Merge request approval rule.
  6. Check streamed payload and headers contain event type approval_rule_updated and audit event is also visible under admin {{gdk_host_url}}/admin/audit_logs.
  7. Delete Merge request approval rule.
  8. Check streamed payload and headers contain event type approval_rule_deleted and audit event is also visible under admin {{gdk_host_url}}/admin/audit_logs.

MR acceptance checklist

Related to #363092 (closed)

Edited by Harsimar Sandhu

Merge request reports