Conditionally handle AuthorizationsChangedEvent when policies exists
What does this MR do and why?
This MR adds a dispatch?
check to Security::ScanResultPolicies::AddApproversToRulesWorker
to conditionally handle events only when they are performed for projects with Security Policies licensed and enabled.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a new project
- Create a new MR in this project
- Add a new user to this project (Manage -> Members)
- At the same time, observe logs for sidekiq to see if
::Security::ScanResultPolicies::AddApproversToRulesWorker
was executed; it should not. - Create Merge Request Approval Policy for this project (Secure -> Policies -> Create new -> Merge Request Approval Policy),
- Add another user to this project (Manage -> Members)
- At the same time, observe logs for sidekiq to see if
::Security::ScanResultPolicies::AddApproversToRulesWorker
was executed; it should execute.
Related to #448725 (closed)