Add option to allow developer push if there are no branches
requested to merge 374003-add-an-option-to-allow-force-pushes-to-protected-branches-when-there-are-no-branches-in-the into master
What does this MR do and why?
This MR introduces new default branch protection setting "Fully protected after initial push" which allow user with Developer
role to perform one-time push to empty repository
Screenshots or screen recordings
https://www.youtube.com/watch?v=Vbl-C8CQ8Q4
How to set up and validate locally
- Pick a group, we will be using
Commit451
as an example - Open group settings -> repository (
/groups/Commit451/-/settings/repository
) - Set default branch protection level to
Fully protected after initial push
and save it - Ensure that group allows
Developer
to create new projects - Pick or create user, which has is not and admin and has
Developer
permission to this group. - As this user (either by logging in or using impersonation) create new empty project. Ensure that
initialize with README
is unchecked - you need project with no branches - As this user clone repository, create first commit & perform push to this repository. It should complete ok
- Make second commit & push. It should fail, because repository is fully protected now _
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #374003 (closed)
Edited by Illya Klymov