Set "Prevent approvals by commit author" option per branch
Problem to solve
We currently offer a feature called "Prevent Approvals by Users Who Add Commits", which allows project administrators to configure the repository settings to prevent approvals for merge requests by users who have added commits to the code. However, this feature is only available at the project level, which means it applies to all branches in the repository.
Depending on the Git flow used by an organization, there could be cases where a long-lived feature branch receives commits by all the eligible approvers of the MR. As a result, no one is able to approve the MR and thus, it cannot be merged.
Currently, two ways around this are:
- In the MR, modify the approval rule so that no approval is required.
- Squash the commits in the source branch of the MR. This effectively makes the commits to be seen as authored by only one of the contributors, allowing the rest to approve the MR.
Proposal
Extend this feature to allow for more granular control at the branch level. This would enable project administrators to configure the "Prevent Approvals by Users Who Add Commits" feature on a per-branch basis, providing more flexibility and customization in managing approvals for different branches in the repository.
A way of implementing this is to set the impacted branches by using regex, similar to protected branches.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.