Skip to content

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

  1. Create new project
  2. 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.
  3. Create MR in this project
  4. 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.

Related to #385929 (closed)

Merge request reports

Loading