Skip to content

Protected Branches API doesn't support updating code_owner_approval_required on existing protected branch #869

@MikeWillCook

Description

@MikeWillCook

The standard GitLab API supports PATCH'ing an existing protected branch to set the code_owner_approval_required flag. Otherwise the current gitlab4j appears to require unprotecting then protecting the branch with the new setting (which would leave the branch unprotected for some window of time, which you don't want).

For example, curling the API directly you could do something like this:

curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/protected_branches/feature-branch?code_owner_approval_required=true"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions