Skip to content

Enqueue audit streaming only for groups with streaming destinations

What does this MR do and why?

Add a guard clause before the job is enqueued to avoid enqueuing essentially pointless jobs.

Related to #357276 (closed)

How to set up and validate locally

  1. Run rails console and execute code below to enter destination url
       group = Group.find 1 #replace with your group id here
       destination_url = 'https://hsandhu.requestcatcher.com/events'
       AuditEvents::ExternalAuditEventDestination.create(namespace_id: group.id, destination_url: destination_url)
  2. Check audit streaming is working by producing streamable audit event, for eg: add/remove status check from project -> settings -> general -> expand merge requests -> status checks.
  3. Remove destination url.
  4. Again try to produce audit event (step 3).
  5. Check audit event was stored in database but was not enqueued

MR acceptance checklist

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

Edited by Harsimar Sandhu

Merge request reports

Loading