Description
Description of the problem, including code/CLI snippet
Breaking out discussion from this Pull Request thread into its own issue.
The Save and Update mixins for protectedbranch
doesn't really work for most of it's attributes, as the PATCH/POST api use different values from those return by the API.
The PATCH api requires to send allowed_to_push attribute
, but the returned attribute is push_access_levels
, as documented in the API and examples: https://docs.gitlab.com/ee/api/protected_branches.html#example-update-a-push_access_level-record
Expected Behavior
To be able to update the `allowed_to_push' GitLab protected branch state.
Actual Behavior
Using the python-gitlab library to modify the push_access_levels
attribute that the object has and then calling .save()
appears to do nothing, and the python object has no allowed_to_push
attribute to modify.
It does work for the basic .allow_force_push
protectedbranch attribute, as added and tested in the original Pull Request.
Specifications
- python-gitlab version: unreleased (a867c48)
- API version you are using (v3/v4):
v4
- Gitlab server version (or gitlab.com):
gitlab.com