FE: Add ability to enable MR Approval Policy in Warn Mode
Why are we doing this work
Add frontend interface to allow users to enable "Warn Mode" for Merge Request Approval Policies. This mode lets security teams test policy impact by generating warnings instead of blocking merge requests.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
-
UI option to toggle between "Enforce" and "Warn" modes when creating/editing MR approval policies in editor_component.vue -
policy enforcement section
-
-
Add policy enforcement banner -
Update policy editor to show warn mode selection -
When selecting enforcement, the action switches to normal -
When selecting warn, the action switches to warn text
-
-
Ensure warn mode generates appropriate YAML configuration (0 approvals required + bot message enabled)
Technical notes
- Uses existing
security_policy_approval_warn_modefeature flag - Should work with both visual editor and YAML editing modes
- Maintains compatibility with existing policy configurations
Verification steps
- When warn mode is enabled: policy violations generate bot comments but don't block merges
- When warn mode is disabled: policy violations require approvals as usual
- Users can easily switch between modes
Edited by Alexander Turinske
