submit marks existing draft PRs ready for review without --open, firing review requests
- 主要語言
- Go
- 星號
- 1.5k
- 分支
- 70
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 7
描述
## Environment
- gh 2.96.0 (2026-07-02), gh-stack **v0.0.4**, git 2.46.1, macOS 26.6
## Summary
`gh stack submit --auto` marked two already-open draft PRs as ready for review, which fired review requests to five CODEOWNERS. I did not pass `--open`.
The help text is explicit that this should not happen:
> New PRs are created as drafts by default. Use `--open` to mark them as ready for review.
## Repro
```
gh stack submit --auto # creates PR A and PR B as drafts
gh pr view A --json isDraft # => true, as documented
# ... make no change to the branches ...
gh stack submit --auto # second run, still no --open
gh pr view A --json isDraft # => false
```
Second run's output, which gives no indication it changed draft state:
```
Checking stack state...
Pushing to origin...
PR #A for branch-a is up to date
PR #B for branch-b is up to date
✓ Stack updated on GitHub with 2 PRs
✓ Pushed and synced 2 branches
```
The PR timeline confirms it:
```
ready_for_review by=
review_requested by= x5
```
Those timestamps match the second `submit` to the second. I made no other change in between, and did not touch the web UI.
## Why it matters
Marking a PR ready is not a local operation. It notifies every CODEOWNER, and on a repo with required reviewers it moves the PR into other people's queues. Doing it on an update pass, from a flag whose documented meaning is "use auto-generated titles without prompting", is surprising in a way that cannot be undone: `gh pr ready --undo` restores draft state but the notifications have already gone out.
It also makes `submit` unusable as an idempotent "sync my stack" command, which is what its output implies it is when everything is already up to date.
## Expected
`submit` should only change draft state when `--open` is passed. If the current behaviour is deliberate for update passes, the help text should say so, and the output should name the change instead of printing `is up to date`.
貢獻指南
研究方向
首先執行報告中的兩遍 `gh stack submit --auto` 重現,並檢查 `submit` 命令的更新路徑,尤其是處理現有 pull request 的位置。將該路徑與 `--open` 的行為進行比較,並使用 `gh pr view A --json isDraft` 進行驗證;完成標準是:除非傳入 `--open`,否則重複提交不會改變現有 draft,且測試涵蓋此回歸問題。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- github, go
- 領域
- api, cli
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100