Stack should be merged when merge commit is already pushed
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Trace the existing gh stack sync entry point and the logic that determines whether stacked PRs are merged. Compare its base handling with the manually pushed merge-commit scenario described here. Done means all PRs in the stack are recognized as merged and closed when the stack's base contains their changes.
Written by the indexing model from the issue text.
Description
Reproduce step
Let's say you have this stacked PRs.
main <- PR#1 <- PR#2 <- PR#3
Now, you manually create merge commit and push it to the main.
prv_main <- PR#1 <- PR#2 <- PR#3
\---------------------+-------new_main
Current Behavior
PR#1is closed, because it's base ismain, and GitHub automatically closes already merged PRs.PR#2andPR#3are NOT closed, because their bases aren'tmain(they point to previous PR's tip), so they still have diff remaining, and PR isn't closed.
Expected Behavior
- All PRs should be closed.
How to fix this
Stacked PR should check it's mergeability against the whole stack's base (e.g. main in this case).
Basically the whole point of stacked PR is that "your PR is pointing to another PR, but they are treated as pointing to base".
Why this should be fixed
- These PRs are shown as "open PRs" while they are already merged.
- This will help 3rd-party integrations -- e.g. bors manually creates octopus merge commit of PRs and push it to main.
I know that you can manually gh stack sync, but I think this should be done automatically.
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
kovidgoyal/kitty#10516 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
cisagov/vulnrichment#337 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100