Skip to content

Edit Branch Rules: Add branch rule

Description

As part of the MVC &8075 (closed) for editing branch rules, we need to implement the ability to create/add a new branch rule.

When creating a new branch rule, the user needs to specify the branch name or pattern.

Scope

Creating a branch rule for a branch name/pattern. In the backend this is actually a ProtectedBranch record.

Branch rules typically are associated with a ProtectedBranch which connects ApprovalMergeRequestRule, {Push,Merge,Unprotect}AccessLevel, and MergeRequest::ExternalStatusCheck.

There is also a case where a branch rule will not have ProtectedBranch record when either

  1. A ApprovalMergeRequestRule is configured for all branches or all protected branches.
  2. A MergeRequest::ExternalStatusCheck is configured for all branches.

These two cases are outside of the scope of this issue

Implementation plan

backend

Mockups & behaviour

Figma

  • From branch rules list and "Add branch rule" is clicked:
  • Create wildcard option should only appear if the user adds an asterik * in the input field
  • Clicking on "Create and continue to edit" navigates the user to "Edit branch rule" page
  • Clicking on "Edit" on "Branch name or pattern"
    • Display "Update branch name or pattern" modal
  • When name is updated, display toast with message "Branch rule updated"
Description Mockup
Branch list image
Create branch rule modal image
Wildcard detected image
Edit branch rule page (toast) image
Update branch name or pattern modal image
Edited by Sean Carroll