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
- Run
rails console
and execute code below to enter destination urlgroup = 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)
- 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.
- Remove destination url.
- Again try to produce audit event (step 3).
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Harsimar Sandhu