Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow update of AllowForcePush parameter of protected branches #1160

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pdecat
Copy link
Contributor

@pdecat pdecat commented Jun 1, 2021

Allowing the update of AllowForcePush parameter of protected branches was reverted from #1141 as that feature was not explicitly documented.

I submitted an MR to document that feature: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62893

Technically, this simply reverts commit 8fe58c3.

//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/protected_branches.html#allow_force_push # FIXME: not documented yet but this is what is done by the UI
type AllowForcePushOptions struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be merged with RequireCodeOwnerApprovals() into a generic UpdateProtectedBranch() function.

@pdecat
Copy link
Contributor Author

pdecat commented Jun 2, 2021

Turns out the API to update the allow_force_push parameter of protected branches is not implemented.

@pdecat pdecat force-pushed the update_protected_branch_force_push branch 2 times, most recently from 8a58921 to 3c8e98b Compare January 23, 2022 19:51
@pdecat pdecat force-pushed the update_protected_branch_force_push branch from 3c8e98b to 43b4c4d Compare January 23, 2022 19:52
@svanharmelen
Copy link
Member

svanharmelen commented Apr 2, 2022

@pdecat so what is the status of this one? Should it be closed or can we work towards something that we can merge?

Oeps, didn't mean to close the PR! Only wanted to add the above comment...

@svanharmelen svanharmelen reopened this Apr 2, 2022
@pdecat
Copy link
Contributor Author

pdecat commented Apr 2, 2022

@svanharmelen
Copy link
Member

Check, thanks for the update!

@mitar
Copy link
Contributor

mitar commented Jul 18, 2023

I have just tested the API (not this PR) and it works without problems with PATCH API request. I managed to toggle allow_force_push in both directions (false->true, true->false).

@pdecat
Copy link
Contributor Author

pdecat commented Jul 18, 2023

I have just tested the API (not this PR) and it works without problems with PATCH API request. I managed to toggle allow_force_push in both directions (false->true, true->false).

@mitar Which API endpoint did you use?

/api/v4 or the one used by the UI?

@mitar
Copy link
Contributor

mitar commented Jul 18, 2023

/api/v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants