Skip to content

Add policy settings into policy drawer

Alexander Turinske requested to merge 429692-policy-drawer-settings into master

What does this MR do and why?

Add policy settings into policy drawer

  • add policy settings at the top of summary
  • hide unknown settings as they would not do anything
  • add tests

Changelog: added

EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Note: The heading levels should be "Policy name" > "Summary" > "Overwrite...", but increasing the level of "Summary" means I need to increase the level of the "policy name" to be greater as well as other section headers in both the scan result policy drawer as well as the scan execution policy drawer, which adds a lot to this MR. Thus, for this iteration, the "Overwrite..." heading level is going to be the same as "Summary". The follow-up MR will adjust all header levels appropriately.

Scenario Settings section yaml drawer
with settings settings yaml drawer
without settings No change N/A no_settings

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Upload a GitLab Ultimate license
  2. Enable a feature flag that adds settings
echo "Feature.enable(:scan_result_policies_block_force_push)" | rails c
  1. Navigate to a project/group => Secure => Policies => New policy => Scan Result Policy
  2. Create a policy with the setting added
  3. Navigate to the project/group => Secure => Policies => Select newly created policy with settings
  4. Verify the drawer shows the settings
  5. Select a policy without settings
  6. Verify the drawer shows the summary without the setting section

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 #429692 (closed)

Merge request reports