Account for configured Scan Execution Policies when scan is missing in Merge Request Approval Policies
Why are we doing this work
In the scope of this issue, we would like to modify the logic in Merge Request Approval Policies to account for configured, enabled, and scoped Scan Execution Policies, so when a scan is missing in the target branch but is defined in the Scan Execution Policy, we do not require approval.
In the scope of this issue we would like to implement changes to allow users to use it.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
Verification steps
- Create a (sub-)group
- Enable feature flag unblock_rules_using_execution_policies (group actor)
- Create a scan execution policy enforcing
dependency_scanningfor all branches - Create a MR approval policy requiring approvals for
dependency_scanning. Enable the new setting "Make approvals optional using scan execution policies" - Create a project in the group
- Update README
- Verify that policy rule is not blocking the MR although the scan didn't run (The MR may be created as blocking, make sure to refresh).
- BONUS: Changes to the policy should be also automatically unblocked
- Disable the new policy setting
- Verify that policy rule is blocking the MR
Edited by Martin Cavoj