Skip to content

Create bot comment action

Alexander Turinske requested to merge 438272-add-bot-comment-action into master

What does this MR do and why?

Create bot comment action

  • conditionally render based on feature flag
  • conditionally render based on action type
  • update tests

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.

Screenshot_2024-04-17_at_16.21.45

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. Use the below yaml
type: approval_policy
name: ''
description: ''
enabled: true
rules:
  - type: ''
actions:
  - type: require_approval
    approvals_required: 1
  - type: send_bot_comment
approval_settings:
  block_branch_modification: true
  prevent_pushing_and_force_pushing: true
  1. Navigate back to rule mode
  2. Verify two actions appear: the first is the approver action and the second is the bot comment action
  3. Verify the approver action updates the yaml

Related to #438272

Merge request reports