Skip to content

fix: handle existing PRs in st submit gracefully#44

Merged
siner308 merged 2 commits intomainfrom
fix/submit-existing-pr
Mar 19, 2026
Merged

fix: handle existing PRs in st submit gracefully#44
siner308 merged 2 commits intomainfrom
fix/submit-existing-pr

Conversation

@siner308
Copy link
Copy Markdown
Owner

Summary

  • ghPrCreate에서 silent: true 제거하여 PR 생성 실패 시 에러가 보이도록 수정
  • PR 생성 실패 시 ghPrListForBranch로 기존 PR 존재 여부를 확인하는 fallback 추가
  • freshPrs 빌드 시 --author @me 필터에 빠진 tracked 브랜치의 PR을 보충하여 스택 트리가 완전하게 구성되도록 수정 → force push 정상 동작

Problem

st submit에서 이미 PR이 있는 브랜치에 대해:

  1. ghPrList--author @me 필터로 인해 다른 방식으로 생성된 PR을 감지하지 못함
  2. ghPrCreatesilent: true로 실행되어 실패 시 null 반환 → Created: null 출력
  3. 스택 트리에서 해당 브랜치가 누락되어 force push가 실행되지 않음

Test plan

  • tracked 브랜치에 이미 PR이 있는 상태에서 st submit 실행 → 정상 push 확인
  • PR이 없는 브랜치에서 st submit 실행 → PR 생성 정상 동작 확인
  • --dry-run 플래그 동작 확인

🤖 Generated with Claude Code

  Add a new git helper that lists PRs for a specific branch head
  without the --author @me filter, allowing discovery of PRs
  created by other authors or bots.

  Also remove silent mode from ghPrCreate so failures are thrown
  instead of returning null.

  Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
  mailto:noreply@anthropic.com
  Previously, if a PR already existed but wasn't returned by
  ghPrList (--author @me filter), ghPrCreate would silently fail
  and return null, skipping force push for the entire stack.

  Now:

  • Wrap PR creation in try/catch with fallback to ghPrListForBranch
  • Supplement freshPrs with PRs from other authors for tracked
  branches so the stack tree is complete and force push works

  Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
  mailto:noreply@anthropic.com
@siner308 siner308 merged commit 8a22ec9 into main Mar 19, 2026
2 checks passed
@siner308 siner308 deleted the fix/submit-existing-pr branch March 19, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant