Skip to content

BE: Support new policy action type `send_bot_message`

Why are we doing this work

Policy bot comment may be overwhelming for some users and we would like to give users option to disable it. By default, it should be enabled when users create new policies and it should stay enabled by default for older policies that do not have this new action specified in the YML.

Relevant links

Non-functional requirements

  • Documentation: Update documentation to mention the new action type
  • Feature flag: Implement the new behavior behind a feature flag
  • Testing: Unit tests should be enough to cover the feature

Implementation plan

Verification steps

  1. Create a scan result policy with the send_bot_message action disabled:
actions:
  - type: send_bot_message
    enabled: false
  1. Create MR in the project with a violation
  2. Ensure there's no bot comment
  3. Update the policy and change it to enabled: true
  4. Create another MR and ensure the bot message is created
  5. Update the policy and remove the send_bot_message action
  6. Create another MR and ensure the bot message is created
Edited by Alan (Maciej) Paruszewski