Skip to content

Add functionality for bot message action

What does this MR do and why?

Add functionality for bot message action

What does this MR not do

  • If there's no action with type: send_bot_message, it should be displayed the same way as with enabled: true
  • When the action is removed, the YAML should be updated to the following:
    actions:
      - type: send_bot_message
        enabled: false
  • Showing example bot message
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 👈
3 Update behavior around removing the send_bot_message action TBD
3 Complete design of bot comment action TBD

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.

add_action_selector

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 => Scroll to actions
  2. Verify the send_bot_message action is already in the yaml and the action shows up in rule mode
  3. Verify two actions appear: the first is the approver action and the second is the bot comment action
  4. Verify the approver action updates the yaml
  5. Remove an action
  6. Verify the yaml is updated
  7. Remove both actions
  8. Verify the action key is removed
  9. Add an action back
  10. Verify the selector shows both action types
  11. Add the other one back
  12. Verify the selector shows the only remaining type
  13. Verify the selector disappears when both are added

Related to #438272 (closed)

Edited by Alexander Turinske

Merge request reports