FE: Implement Basic Warn Mode UI for MR Approval Policies
Background
We are introducing a new "Warn" mode for MR approval policies to allow customers to observe and understand the impact of security policies before enforcing them. This feature will help security teams gradually roll out policies without immediately blocking developers.
Objectives
- Add a new "Warn" action option in the policy editor
- Update the UI to clearly communicate the Warn mode behavior
- Ensure proper YAML generation for the Warn mode
Tasks
1. Policy Editor Updates
-
Add a new "Warn" action option in the policy editor UI -
Implement hover tooltip for the Warn mode option with the text: "Warn mode will generate bot comments for detected violations and generate an approval rule that is Optional." -
Update the UI to show the Warn mode as a distinct option from requiring approvals
2. YAML Generation
-
Ensure the YAML generated for Warn mode sets approvals_required: 0andsend_bot_message: true -
Validate that the generated YAML is correct and doesn't cause validation errors
3. Policy List/Drawer Updates
-
Add visual indication in the policy list/drawer to show which policies are in Warn mode -
Implement an info message or icon to emphasize that Warn mode policies don't require approvers
4. User Experience Improvements
-
Update the UI to clearly differentiate between Warn mode and policies requiring approvals -
Ensure that users cannot mix Warn mode with requiring approvers in the same policy -
Implement proper error handling and user feedback for invalid configurations
5. Documentation and Help Text
-
Add appropriate help text and tooltips throughout the UI to explain the Warn mode behavior -
Prepare documentation updates explaining the new Warn mode feature and its usage -
Create MR to update edit policy: Generates a bot comment => Warn a user with a bot comment
Acceptance Criteria
- Users can select Warn mode as an action in the policy editor
- The generated YAML correctly reflects the Warn mode configuration
- Policies in Warn mode are visually distinct in the policy list/drawer
- Users receive clear feedback about the behavior of Warn mode policies
- The UI prevents mixing Warn mode with approval requirements in the same policy
Notes
- This implementation focuses on the frontend changes only. Backend support for Warn mode should be handled in a separate issue.
- The ability to search/filter MRs with policy violations is out of scope for this issue and will be addressed separately.
Edited by Alexander Turinske