Make actions optional for scan result policies
What does this MR do and why?
This MR updates make actions
optional for scan_result_policy
, as long approval_settings
is provided
This change will allow the creation of policies without requiring approvals when we only want to override project approval settings.
Screenshots or screen recordings
Policy without actions
Error message when neither approval_settings
or actions
is provided.
How to set up and validate locally
- Create a new project
- Go to Secure > Policies.
- Click on New Policy.
- Select Scan result policy.
- Change to yaml mode and copy the yaml content below:
type: scan_result_policy
name: test policy without actions
description: ''
enabled: true
rules:
- type: scan_finding
branches: []
scanners:
- container_scanning
vulnerabilities_allowed: 0
severity_levels:
- high
vulnerability_states: []
approval_settings:
prevent_approval_by_author: true
- Verify the policy can be saved, loaded in the table and the policy drawer
- Edit the policy and remove the
approval_settings
- Verify that a policy without the
approval_settings
andactions
can not be saved
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 Marcos Rocha