- Notifications
You must be signed in to change notification settings - Fork673
Description
Description of the problem, including code/CLI snippet
Breaking out discussion fromthis Pull Request thread into its own issue.
The Save and Update mixins forprotectedbranch
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 sendallowed_to_push attribute
, but the returned attribute ispush_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 thepush_access_levels
attribute that the object has and then calling.save()
appears to do nothing, and the python object has noallowed_to_push
attribute to modify.
It does work for the basic.allow_force_push
protectedbranch attribute, as added and tested in the originalPull Request.
Specifications
- python-gitlab version: unreleased (a867c48)
- API version you are using (v3/v4):
v4
- Gitlab server version (or gitlab.com):
gitlab.com