Skip to content

FE: Add warning about required approvals

Why are we doing this work

  • users want to know how their changes to the settings affects the policy

From &9696 (comment 1506117258):

@mcavoj @sashi_kumar Thank you for the discussion, I think what @g.hickman propose for now makes sense. I only want to add a warning/error in the following case. Let me know what you all think.

'required approval == 0' and some overwrite settings are enabled 'required approval == 0' and NO overwrite settings are enabled
Show a warning a the bottom of the policy create page above the "Create policy" button Show an error a the bottom of the policy create page and disable the the "Create policy" button
Screenshot_2023-08-09_at_14.23.18 Screenshot_2023-08-09_at_14.23.10

Relevant links

Non-functional requirements

  • Documentation:
  • Feature flag:
  • Performance:
  • Testing:

Implementation plan

Verification steps

  1. Upload a GitLab Ultimate license
  2. Navigate to a project/group => Secure => Policies => New policy => Scan Result Policy
  3. Remove the action section (e.g. remove the actions: object from the yaml)
  4. Ensure some of the settings are checked
  5. Verify there is a warning above the buttons at the bottom saying the following
  • Title: Only override settings will take effect
  • Description: You didn't choose any approvers, when the condition met in a MR, only the override project apprval settings will take effect. There will be no required approvers
  1. Uncheck all of the settings
  2. Verify there is an error above the buttons at the bottom saying the following
  • Title: Can't create a policy completely empty action`
  • Description: There is no overwriting approval settings nor required approval set up, you can't create a policy which does nothing.
  1. Verify the Configure with merge request button is disabled
Edited by Alexander Turinske