Update yaml validation for actions
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.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Upload a GitLab Ultimate license
- Enable the feature flag
echo "Feature.enable(:approval_policy_disable_bot_comment)" | rails c
- Navigate to a project => Secure => Policies => New policy => Scan result policy => Yaml mode
- Remove the
require_approvals
action and change thesend_bot_message
action to haveenabled: false
- Navigate to Rule mode
- Verify the
only settings will be applied
alert shows up at the bottom of the page - Navigate to yaml mode => Manually add more than 2 actions => Navigate to rule mode
- Verify rule mode is disabled
- Navigate to yaml mode => Remove the actions section completely => Navigate to rule mode
- Verify the
only settings will be applied
does show up
Related to #438272 (closed)
Edited by Alexander Turinske