Implement the ability to add Merge Request approvals
Description
As part of the MVC for organizing rules based on branches, we need to implement the ability to add MR approvals.
Scope
The scope of this issue includes:
- Render Approval rules component
- Query approval settings by Branch
- Ensure target branch is used instead of making branch selectable via dropdown (hide target branch dropdown)
- Hide approval rules for non-premium users and when MR feature is disabled
Implementation plan
- Create
createApprovalProjectRule
mutation - Create
editApprovalProjectRule
mutation - Create
deleteApprovalProjectRule
mutation
Mockups
- Minimum required approval
- Same as "All eligible users" in current merge request approval but now there is a name for the rule
- Default is 0.
- When there are no merge request approvals setup, display "Merge request approvals - Default"
- Add approval rule dropdown button with two options
- "Add approval rule"
- "Add coverage check"
- Editing done in drawer
- Upon update of approval rule, display toast "Approval rule updated"
- Upon removal of approval rule, display toast "Approval rule removed"
- Same confirmation modal as current production should be displayed when click "Delete" from list view
Description | Mockup |
---|---|
Merge request approvals - Default | |
Edit approval rule - empty | |
Edit approval rule - Filled | |
Coverage check | |
Approval rule updated |
Listing all approvers
Currently in GitLab we display a resolved list of approvers whether they were added by a group or individually. As a repository manager, this step of resolving automatically in the settings view does not reflect the action I intended of setting a group because I would need to second guess whether I added a group correctly or not by reopening the edit modal.
With this opportunity to revisit the setting of merge request approvers, we will display the groups and users. Sometimes this list can equate to hundreds of users and it is useful to check to see all users when you want to ensure certain people are in there. To do that we will display all of the resolved users in a modal sorted by name alphabetically. This might work well as a drawer as well (happy to revisit this during implementation).
List of approvers more than 10 | Modal displaying all of the approvers |
---|---|
Testing
New E2E test for Merge Request approvals on branch level is required - created https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/1379