8000 Cannot update/patch protected branch allowed_to_push/push_access_levels state · Issue #2850 · python-gitlab/python-gitlab · GitHub
[go: up one dir, main page]

Skip to co 10000 ntent
Cannot update/patch protected branch allowed_to_push/push_access_levels state #2850
Closed as not planned
@nickbroon

Description

@nickbroon

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0