Add an "Allowed to Delete" permission for protected branches.
Description
Ever since wildcard protected branches were implemented, we've been using them to enforce certain naming standards for our branches. For instance:
-
*
(Master only push/merge) -
release/*
(Master only push/merge) -
hotfixes/*
(Master/Dev push/merge) -
feature/*
(Master/Dev push/merge)
However, because of this, all of our branches are now protected, which means they may only be deleted via the GitLab web interface. Our developers push and fill out merge requests for dozens of branches a week. Since they're protected, they can't be automatically deleted when the merge request is accepted, which creates a bit of tedious work in order to clean up these branches.
Our most pertinent need is the ability to allow masters to delete these types of protected branches. Specifically, we'd like to be able to delete them after they are merged into an upstream branch via a merge request.
Proposal
For protected branches, in addition to "Allowed to Merge" and "Allowed to Push" settings, include an "Allowed to Delete" setting.
Links / references
Documentation blurb
Overview
Use cases
Consider a wildcard protected branch like this:
A common pattern for us is to push a branch like hotfixes/issue123
and then create a merge request for hotfixes/issue123 -> hotfix
. When we accept the merge request, we are unable to automatically delete the hotfixes/issue123
branch, because it is protected. If there were an "Allowed to Delete" setting in addition to "Allowed to Merge" and "Allowed to Push", we would set it so that only masters can delete the branches once they've been created. This would allow masters to delete these branches without manually doing it via GitLab's branch deletion interface as described here. Ideally, this would also give a master the ability to use the feature that deletes the branch automatically after they approve the merge request.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml