Reordering a stack can cause PRs to be incorrectly marked as merged
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with the implementation behind gh stack push, then trace how reordered stack ancestry and existing PR bases are handled. Reproduce the gh stack modify, gh stack push, and gh stack submit sequence from the report; done means push safely synchronizes the remote stack or clearly directs users to submit, without PRs being incorrectly marked as merged.
Written by the indexing model from the issue text.
Description
Problem
After reordering a published stack, I ran:
gh stack modify
gh stack push
gh stack submit
gh stack push updated the branch ancestry without updating the existing PR bases. Some PRs then targeted descendant branches that already contained their commits.
GitHub saw empty diffs and automatically marked those PRs as merged, although their commits were never merged into main. The PRs could not be reopened and had to be recreated with new branch names.
Version
gh stack version 0.0.8
Expected behavior
I expected gh stack push either
- to update the remote stack to match the reordered local stack,
- or to fail and tell me to use
gh stack submitfor this operation.
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 73
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 7
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-stack
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
feature request topic: cli - general
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
feature request topic: auto-merge
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug topic: docs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Similar issues
-
textual definition
Difficulty 1/5 Under an hour Newbie friendliness 90/100
geneontology/go-ontology#32653 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
needs design
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100