FE: Add ability to specify enforcement level based on group/project policy scope

Frontend Description: Enforcement Level Selection for MR Approval Policies

Overview

This frontend component enables users to configure enforcement levels (Warn vs Enforce) for merge request approval policies at the group or project scope level. It provides the interface for selecting warn mode, which allows security teams to test policy impact without blocking merge requests.

What needs to be built

  • Enforcement mode selector (radio buttons or dropdown) with "Warn" and "Enforce" options
  • Integration into the policy editor's actions section to replace or supplement current action selection
  • Visual indicators in policy lists showing which policies are in warn mode
  • Form handling to generate appropriate YAML configuration based on selected enforcement level

Expected behavior

Users can select "Warn" mode to generate bot comments and optional approval rules without blocking merges, or "Enforce" mode for traditional blocking behavior. The interface should clearly communicate the difference between modes and allow easy switching for policy testing and validation workflows.

Technical notes

  • Requires security_policy_approval_warn_mode feature flag
  • Must generate valid YAML with appropriate action configurations (0 approvals + bot messages for warn mode)
  • Should integrate with existing policy editor validation and save workflows
  • Compatible with current MR approval policy schema and UI patterns
Edited by 🤖 GitLab Bot 🤖