Skip to content

Fix YAML to RULE mode - Filter out rule types

- requested to merge 391829-update-yaml-check into master

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 then New Policies Button then Select Policy in the Scan Result card
  • Click New Policy button
  • On the Scan Result Policy card click Select 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
Screen_Shot_2023-02-16_at_4.46.43_AM Screen_Shot_2023-02-16_at_5.15.49_AM Screen_Shot_2023-02-16_at_4.46.43_AM Screen_Shot_2023-02-16_at_5.09.51_AM
Screen_Shot_2023-02-16_at_5.06.01_AM Screen_Shot_2023-02-16_at_5.16.37_AM Screen_Shot_2023-02-16_at_5.06.01_AM Screen_Shot_2023-02-16_at_5.06.07_AM

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.

Related to #391829 (closed)

Edited by -

Merge request reports