Repository navigation
API / gh stack command to trigger the server-side "Rebase stack" #605
hryanjones
started this conversation in
Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
(Claude wrote the below, but I would still like this feature. As mentioned there is a workaround, but it's not ideal.)
Request: an API (e.g.
POST /repos/{owner}/{repo}/stacks/{stack_number}/rebase, async likemerge-async, or a GraphQL mutation) that does what the merge box's Rebase stack button does.Why: our PRs are mostly opened and maintained by automation. It can create stacks (
POST /repos/{owner}/{repo}/stacks) but can't bring an out-of-date stack back to linear without someone clicking the button. When nobody does, merging the bottom PR leaves the next PR on its old base. We had one stuck that way until a branch-cleanup job deleted the base the next morning.Workaround today: rebase locally from the bottom up (
git rebase --onto <parent's new tip> <parent's old tip>per branch) andpush --force-with-lease. On a 3-PR test stack this cleared the Rebase stack prompt, and squash-merging the bottom PR then retargeted and rebased the rest within seconds. But it needs force-push rights for the automation and a local clone. GitHub also took ~37s to pick up one rebased head, and in that window the PR showed its stale head as mergeable.A server-side rebase via the API (or
gh stack rebase --remote) would remove all of that.All reactions