Skip to content

Update yaml validation for actions

Alexander Turinske requested to merge 438272-update-empty-action-banner into master

What does this MR do and why?

Update yaml validation for actions

  • limit number to 2
  • prevent duplicate actions
  • update settings banner for send_bot_message
  • show warning alert if there are no require approval actions
  • show danger alert if there are no settings and onlythe disabled bot action
  • update warning alert wording to include bot message

Changelog: added

EE: true

Number Description MR
1 Creates skeleton structure Create bot comment action (!149931 - merged)
2 Allow adding bot comment action in rule mode and add yaml validation Add functionality for bot message action (!150570 - merged)
3 Update behavior around removing the send_bot_message action Update rule mode for bot message action (!151464 - merged)
4 Complete design of bot comment action Add example bot message to action (!151615 - merged)
5 Update yaml validation and alert behavior 👈

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.

alert_logic

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(:approval_policy_disable_bot_comment)" | rails c
  1. Navigate to a project => Secure => Policies => New policy => Scan result policy => Yaml mode
  2. Remove the require_approvals action and change the send_bot_message action to have enabled: false
  3. Navigate to Rule mode
  4. Verify the only settings will be applied alert shows up at the bottom of the page
  5. Navigate to yaml mode => Manually add more than 2 actions => Navigate to rule mode
  6. Verify rule mode is disabled
  7. Navigate to yaml mode => Remove the actions section completely => Navigate to rule mode
  8. Verify the only settings will be applied does show up

Related to #438272 (closed)

Edited by Alexander Turinske

Merge request reports