Skip to content

Add warn action type

What does this MR do and why?

Add warn action type

  • allow for warn action type in approval policies
  • the warn action type is unlike the other two actions as it does not have a new action object, but instead will be comprised of similar action yaml as the default action yaml, except the required approvers is 0
  • The warn action can only exist by itself, so if a warn action exists and the user adds a non-warn action, we should clear the warn action and its approvers. Similarly, if another action exists and the user adds a warn action, we should clear the other actions and their approvers
  • update tests

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Scenario Before After
Action selection actions_-_b actions_-_a
Warn action added - consultant image

NOTE: See the above screenshots for the most up-to-date design; this video will only be updated if the behavior changes in the MR POC_small

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(:security_policy_approval_warn_mode)" | rails c
  3. Navigate to a project/group => Secure => Policies => New policy => Merge request approval policy
  4. Verify the user can add the warn action
  5. Verify the warn action removes all other actions
  6. Verify when a user adds a different action, the warn action is removed
  7. Verify the user can navigate to/from yaml mode and the warn action continues to show

Related to #504940 (closed)

Edited by Alexander Turinske

Merge request reports

Loading