Skip to content

Prevent masters of pushing code to protected branches without MR

Parent: gitlab-org/gitlab-ee#179

Description including problem, use cases, benefits, and/or goals

To be able to make the MR flow more flexible or more stringent, people would like to be able to restrict pushes to either devs, masters or neither. Similarly, merging should be made more flexible depending on the use case.

Proposal

  1. Add an option to the protected branches Permission needed to push, with as options: No one can push directly, Developer and Master.
  2. Add an option to the protected branches Permission needed to merge, with as options: Master, Developer.
  3. The options default to Master and Master

This would replace the current and proposed checkboxes.

mu_

Links / references

Original issue

This is a feature request opened in behalf of a customer.

We have Master branches that are protected and can only be pushed to by people in the Master role. From a process perspective most changes get to the master branch via a Merge Request and a code review is done on the merge request. However, a person with Master permissions can push directly to master without going through the code review. How can we ensure that all changes in master got there via a merge request? Or is there a way to audit/report on this situation and we can do our own follow up?

Merge Requests