Skip to content

Add more options to branch.protect() function #1355

@anderslindho

Description

@anderslindho

The branch.protect() function currently supports two arguments:

developers_can_push: bool
developers_can_merge: bool

per https://python-gitlab.readthedocs.io/en/stable/gl_objects/branches.html

Since gitlab allows for more granularity than this, I would propose adding the arguments:

maintainers_can_push: bool
maintainers_can_merge: bool

The documentation appears to support this by specifying a higher access level (60): https://docs.gitlab.com/ce/api/protected_branches.html#protected-branches-api

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions