Skip to content

Update policy setting feature to match design

Alexander Turinske requested to merge 133268-update-feature-to-new-specs into master

What does this MR do and why?

Update policy setting feature to match design

  • default setting on new policy to true
  • default setting on existing policies to false
  • update yaml to match the backend schema
  • update tests

Screenshots or screen recordings

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

Scenario Before After
new policy new_policy_-_b new_policy_-_a
existing policy existing_policy_-_b existing_policy_-_a

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 the feature flag
echo "Feature.enable(:scan_result_policy_settings)" | rails c
  1. Go to a project => Secure -> Policies -> New policy -> Scan Result Policy
  2. Verify the Prevent branch protection modification is checked and the yaml has the following property in it
approval_settings:
  block_unprotecting_branches: true
  1. Verify that changing the status of the checkbox changes the property value
  2. Create a property without the yaml property
  3. Go to the project => Secure -> Policies -> Select newly created policy -> Edit policy
  4. Verify the yaml does not have the property by default and that the checkbox is unchecked

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alexander Turinske

Merge request reports