Skip to content

Allow the ability to reject force pushes to branches with an open pull request #12011

@InExtremaRes

Description

@InExtremaRes

Feature request

Allow the possibility of reject force pushes to every branch that has an open pull request. This is similar to current branch restriction support but for any branch, not only branches specifically selected.

I imagine right now just a checkbox to enable/disable the ability to force push to a branch with an open PR, but I'm sure there may be more sophisticated patterns.

EDIT
Just to clarify and give more context, my rationale for this is that changes in the history of a PR can make the reviewing process harder, since you can no longer trust that previously reviewed commits are still good after the force push. It is possible for an intermediate commit to become buggy even if the head is clean, making bisect and related tools more difficult. Having the possibility to reject force pushes helps to prevent those cases.

Some options that can make this feature more useful is the ability to whitelist users to bypass the restriction, user that ideally could be configured per PR. Also, an option to disable the restriction for specifics PRs may become handy (but is interesting who can do that: Admins? The author? The assigned reviewer?).

Besides, if this feature is enabled, I think merges that modifies the history but triggered from the PR itself should still be allowed (squash & merge, rebase & merge, etc), provided those options are enabled of course.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions