Prevent from creating invalid scan_finding Approval Rules
What does this MR do and why?
This MR fixes a problem where MR Approval Rules (policies from Scan Result Policy) were required when Scan Result Policy was created with list of protected branches that do not exist in database.
How to set up and validate locally
- Create new project
- Create Scan Result Policy for this project (Security & Compliance -> Policies -> Create new -> Scan Result Policy) with
branches
filled with non-existing branch that is not configured in project's protected branches section and merge it. - Create MR in this project
- You should not see that approval is required
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.
Related to #385929 (closed)