Add mode selector for bypass options
What does this MR do and why?
This merge request enhances the security policy bypass feature in GitLab's merge request interface. The main changes include:
New bypass mode selection: Added a new selector component that allows users to choose between two bypass methods - "Exception Bypass" for pre-approved permissions and "Warn Mode" for policies that allow bypassing with proper justification.
Improved user experience: The modal now shows different instructions and next steps depending on which bypass mode is selected, making it clearer what will happen when policies are bypassed.
Code organization: Moved hardcoded text and constants into a separate constants file for better maintainability, and added a new selector component to handle the mode selection interface.
Bug fix: Fixed an issue where duplicate policies could appear in the policy list by ensuring only unique policies are shown.
Enhanced messaging: Added more descriptive text to help users understand their bypass permissions and the consequences of their actions, including audit logging information.
The changes make the security policy bypass process more user-friendly by providing clearer options and explanations while maintaining proper security controls and audit trails.
References
Screenshots or screen recordings
| Description | UI |
|---|---|
| Bypass modes |
How to set up and validate locally
-
Enable feature flags:
Feature.enable(:security_policies_bypass_options_group_roles) Feature.enable(:security_policies_bypass_options_mr_widget) -
Open any MR and check bypass option
-
Set this to empty string and open modal
-
Click bypass and select mode
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #541468 (closed)