Skip to content

Added "Developers can merge" setting to protected branches

What does this MR do?

Adds a "Developers can merge" checkbox to protected branches much like the "Developers can push" checkbox.

Are there points in the code the reviewer needs to double check?

Depends on gitlab-shell!60 (closed)

To circumvent the push access check within the git hook, I assign a temporary environment variable when the merge is processed. I am unsure whether this could potentially be flaky.

This is the first time I touch anything ruby, or rails for that matter, so be wary of rookie mistakes.

Why was this MR needed?

For our team we would like that nobody ever commits directly to protected branches, instead they create a merge request. However in order to accept a merge request you need to be able to push to the protected branch. In a small-ish team like ours, anyone can review and accept merge requests, so having everyone be Master doesn't make much sense, and could potentially allow people to push directly to protected branches by accident.

With this setting, pushing to protected branches is still disallowed for developers (unless the branch allows developers to push), however they do have the ability to accept merge requests.

What are the relevant issue numbers?!

Closes #17229 (closed), closes #967 (closed), closes #823 (closed) and closes #1374 (closed)

Screenshots (if relevant)

Screen_Shot_2016-05-20_at_02.10.46

Merge request reports