Disable default branch for MR policy if default branch is unprotected

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Background

Following up on feedback from the customer, the user tries to create a project-level policy and selects default branch, the default branch is not a protected branch, and user got an error which is not clear what has happened

Screenshot 2024-03-05 at 16.17.32.png

Solution

  1. Project level: Disable the dropdown selection
  1. Group level:Show a clear error message and add (protect) to dropdown selection

Frame 1.png

2.png

Edited by 🤖 GitLab Bot 🤖