Fix YAML to RULE mode - Filter out rule types
What does this MR do and why?
Fixes switching between YAML mode to RULE mode
Differences in to look out for in screenshots:
- Screenshots of YAML mode are the same
- The bug was toggling back to RULE mode, where it would be disabled with a blue banner above.
- The fix was to only run validations that were valid for security scans by filtering out license scans for those validations.
- We also filter out a empty config from security scan policy validations
How to set up and validate locally
-
In a rails console enable Feature.enable(:license_scanning_policies)
-
As a EE user Navigate to http://gdk.test:3000/<group>/<project>/-/security/policies
-
Or via the nav on the left Security & Compliance -> Policies
thenNew Policies
Button thenSelect Policy
in the Scan Result card -
Click New Policy
button -
On the Scan Result Policy
card clickSelect policy
-
Add a security scan rule
without changing any values -
Toggle between RULE mode and YAML mode -
Refresh the page -
Add a license scan rule
without changing any values -
Toggle between RULE mode and YAML mode -
Add some values to each rule type -
Toggle between RULE mode and YAML mode
Describe in detail what your merge request does and why.
Screenshots or screen recordings
Before | After |
---|---|
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Numbered steps to set up and validate the change are strongly suggested.
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 #391829 (closed)
Edited by -