Per branch merge request approvals
GitLab supports branch protection settings that vary by branch. Different people should have permissions to merge to master in contrast to merging into a release branch. Similarly different approval settings are also needed. Merging changes into a feature branch shouldn't need any approvals. Merging into a release branch from master should only need a second release manager to approve because the commits are coming from a trusted source. GitLab should provide merge request approval settings that vary by branch.
Use case from customer:
Per branch permissions is a great feature and I look forward to it! It does help address some of my problems, but, as you said, not the merge request approvals part. I guess my biggest problem with merge approvals is that it applies to all merge requests for all branches of the project. I really only want to require approvals for our dev branch because that is where we’re having continual problems with broken code being checked in. Our master and patch branches are already locked down to a small handful of people with push/merge permissions so requiring approvals there doesn’t make sense for my teams. On the page I linked below (Drew: blog post linked above) I did see others asking for per-branch approvals, but not sure whether there is wide-spread demand for something like this. I realize that all feature requests can’t be done; some don’t make sense and there isn’t time for others. Hopefully it will be discussed again on your side if it hasn’t been already.
Add a project level setting: Only require approvals, passing pipelines, and resolved discussions for protected branches – this would essentially be a bypass option saying only enforce these on protected branches.
Allow different approvers for different branches. Example based on
master- the maintainers are the only people allowed merge, automatically assign code owners to merge requests, require pipelines to pass
release*– the release managers are the only people allowed to merge, ignore code owners since the code has already been merged
Links / references
- Feedback as comments: https://about.gitlab.com/2015/07/29/feature-highlight-merge-request-approvals/
- Zendesk: https://gitlab.zendesk.com/agent/tickets/19387
- Related to #179 (closed)