Fix MR approval rules sync when disabling scan result policy
What does this MR do and why?
This change fixes a bug in scan result policy where if the policy is the only policy and when it is disabled, we do an early return. This stops the sync process which is needed to remove approval rules for the policy that is disabled.
Addresses #413077 (closed)
How to set up and validate locally
- Create only 1 scan result policy for a project
- Create MR that violates the policy and check if approval is required
- Disable the policy
- Verify in MR that the approval is not removed
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 Sashi Kumar Kumaresan