Skip to content

Update rule mode for bot message action

What does this MR do and why?

Update rule mode for bot message action

  • disable bot message aciton when removing it
  • hide action in rule mode, but show enabled: false in yaml
  • show bot message action if the action is not in yaml
  • since each type of action is a unique action, update actions by type instead of index

The iteration

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 👈
4 Complete design of bot comment action Add example bot message to action (!151615 - merged)
5 Update yaml validation and alert behavior Update yaml validation for actions (!151697 - merged)

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.

disabled_bot_comment_action

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
  2. Remove the bot message action
  3. Ensure the yaml still shows the action but enabled: false
  4. Verify the bot message action can be added back
  5. Add the bot message action back
  6. Verify there is only one bot message action in the yaml and that it has enabled: true
  7. Navigate to yaml mode and manually delete the bot message action. Navigate back to rule mode
  8. Verify that the bot message action still appears in rule mode

Related to #438272 (closed)

Edited by Alexander Turinske

Merge request reports