Skip to content

Add merged merge request delete audit event

What does this MR do and why?

Add merged merge request delete audit event

This commit adds audit event for merged merge request deletion with message including approvers, committers and merged by user details

I have also refactored and moved event generation for merge requests into a separate service.

How to set up and validate locally

  1. Setup streaming destination https://docs.gitlab.com/ee/administration/audit_event_streaming.html#add-a-new-streaming-destination
  2. Create two merge requests and merge one of them
  3. Now delete both merge requests, you can use API DELETE /api/v4/projects/:project_id/merge_requests/:merge_request_iid to do so
  4. Check audit events streamed on the destination
  5. for merged merge request deletion in streaming payload there should be additional details where list of committer ids and approver ids and merged by id and label titles are present and the event name in headers should be merged_merge_request_deleted
  6. for non merged merge request deletion the event name should be delete_merge_request

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #408288 (closed)

Edited by Harsimar Sandhu

Merge request reports