Add an `--admin` bypass flag to `gh stack merge`, matching `gh pr merge --admin`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Start at the gh stack merge CLI entry point and compare its merge flow with gh pr merge --admin. Trace the underlying async stack merge API and determine how a bypass parameter and ineligible-user error are represented. Done means an admin can merge the stack atomically with the bypass, while an ineligible user receives the corresponding failure reason.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Human summary
I'd like to bypass merge requirements on a stack from the CLI. This is the CLI-version of #315, I'm fine closing this and just following the conversation there.
What's missing
gh stack merge has no way to bypass merge requirements. The help text states this outright:
Only basic pull request state is checked before merging (open and not a draft); GitHub evaluates branch protection and repository rules when the merge runs, so any such failure is reported back to you. Bypassing merge requirements is not supported for stacks.
There is no --admin flag, and no equivalent. A repo admin who is allowed to merge any individual pull request with gh pr merge --admin has no way to do the same for a stack.
Extension version: v0.1.0.
Why this matters
The reason to use gh stack merge instead of merging the PRs by hand is the all-or-nothing guarantee — the whole stack lands, or none of it does. An admin who needs to bypass a requirement loses that guarantee entirely, because the only way forward is to stop using gh stack merge.
Current workaround
Merge each PR individually, bottom to top:
gh pr merge <bottom> --squash --admin
# wait for GitHub to retarget the next PR's base to the trunk
gh pr merge <next> --squash --admin
# ... repeat to the top of the stack
This is worse in several ways:
- It is not atomic. If any step fails — a conflict surfacing after the PR below it lands, a check that only starts once the base changes, a dropped connection — the stack is left partially merged, with some commits on the trunk and the rest stranded.
- Retargeting is asynchronous, so each step needs a wait-and-poll for the next PR's base to become the trunk before the next
--adminmerge can run. That is fragile to script and easy to get wrong by hand. - A partially merged stack is awkward to recover from. Merged members stay pinned to the stack, so the stack cannot simply be dissolved to free what is left.
The ask
Add an --admin flag (or an equivalently named bypass flag) to gh stack merge, matching gh pr merge --admin: when the authenticated user is eligible to bypass the rules on the base branch, merge the stack atomically with the bypass applied, rather than refusing. If the user is not eligible, fail with that reason, the same way gh pr merge --admin does today.
This presumably needs the underlying async stack merge API to accept a bypass parameter as well, not just the CLI.
Related
#315 asks for the "bypass rules and merge" control in the stacked-PR merge box on github.com, and treats gh pr merge <n> --admin as the available CLI fallback. This issue is about that fallback not being good enough for a stack: the per-PR command exists, but gh stack merge — the command that gives the atomicity — has no bypass at all.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 73
- Merge medio
- 1g 8h
- PR unite (30g)
- 7
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-stack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
feature request topic: cli - general
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
feature request topic: auto-merge
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug topic: docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Tutte le issue di github/gh-stack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Broadcast Documentation Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
kovidgoyal/kitty#10516 ·
-
CVE-2024-24786 CPE mismatch Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
cisagov/vulnrichment#337 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100