Add scan result policy deprecated warning
What does this MR do and why?
This MR updates the deprecation properties method to consider the policy type.
With this change, the scan_result_policies
will also be displayed with the deprecation warning icon.
Related to #458995 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
How to set up and validate locally
- Create a new project
- Go to Secure > Policies
- Click on New policy
- Select Merge request approval policy
- Change to .yaml mode
- Copy the yaml below:
type: approval_policy
name: 'policy with deprecated policy type'
description: ''
enabled: true
actions:
- type: require_approval
approvals_required: 1
role_approvers:
- developer
rules:
- type: license_finding
branches: []
match_on_inclusion_license: true
license_types:
- Mozilla Public License 1.0
license_states:
- detected
-
Click on Configure with a merge request
-
Merge the new MR to add the policy
-
After merging the policy, in the security policy project, go to Repository
-
Click on gitlab/security-policies
-
click on policy.yml
-
Edit the policy to
---
scan_result_policy:
- name: policy with deprecated policy type
description: ''
enabled: true
actions:
- type: require_approval
approvals_required: 1
role_approvers:
- developer
rules:
- type: license_finding
branches: []
match_on_inclusion_license: true
license_types:
- Mozilla Public License 1.0
license_states:
- newly_detected
- Create a merge request and merge the policy
- Go back to the project created on step 1
- Go to Secure > Policies and check if the invalid policy has a deprecation warning icon
Edited by Marcos Rocha