Extending API for protected branches
What does this MR do?
Creates a new "protected_branches" API which allows performing CRUD actions directly on protected branches, rather than operating on git branches. The API adds the following
- Create/modify wildcard protected branches
- Set the allowed to push/merge setting to "Developers + Masters", "Masters", or "No one"
Are there points in the code the reviewer needs to double check?
This is my first time contributing, so just making sure that the code adheres to the Gitlab guidelines.
Why was this MR needed?
The current method of protecting/unprotecting branches via the API is through the branches API, which does not mirror the internal data model for protected branches, and is lacking several features. This MR adds the functionality given by the UI to the API.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Edited by username-removed-1415304