Skip to content

branch: a rework head on an open, mergeable pull request should keep its base, not be refused for a rebase #24

Description

@lenamonj

What happened

A maintainer of NVIDIA/k8s-device-plugin reviewed #2002 and asked for two changes. Per step 10 the rework is a second commit on the branch, so the reviewer's "changes since your last review" shows exactly the answer to the asks. The pull request is mergeable with no conflicts and the seventeen upstream commits since the branch point touch nothing under api/, cmd/ or internal/.

housebroken branch refused the head anyway:

REFUSED: HEAD is not on top of upstream/main - rebase before filing

Why

scripts/branch-check.sh line 79 blocks whenever the base ref is not an ancestor of HEAD. That is the right rule for a first filing. For a rework it forces a rebase and a force-push, which makes the reviewer's compare link a two-dot diff carrying every upstream change since the branch point, and it rewrites the commit the maintainer already reviewed.

Rule

A rework on an open pull request keeps its base. The gate rebases only when one of three things is true: the pull request reports conflicts (mergeable is CONFLICTING), the maintainer asked for a rebase, or the head is being rewritten anyway (a signing or squash force-push). Otherwise "not on top of base" is a CHECK line naming how far behind the head is, not a refusal.

Suggested shape: housebroken branch <clone> --rework <PR> reads the pull request's mergeable state through gh and downgrades the block to a CHECK when it is MERGEABLE, keeping the refusal for a first filing and for a conflicting head.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions