Skip to content

Conversation

@javoire
Copy link
Owner

@javoire javoire commented Jan 22, 2026

Summary

  • Skip branches with merged PRs in detectSyncIssues to avoid false "needs rebase" warnings
  • Mirrors how stack sync already handles merged PRs

🤖 Generated with Claude Code

javoire and others added 3 commits January 21, 2026 17:46
ParseRepoFromURL now returns HOST/OWNER/REPO for non-github.com hosts
(e.g., ghe.spotify.net/owner/repo) so the gh CLI knows which host to use.
Previously it only returned OWNER/REPO which defaulted to github.com.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GetAllPRs was fetching all PRs (open, closed, merged) which caused
502 Bad Gateway errors on repos with thousands of PRs.

- Changed to fetch only open PRs (--state open)
- Added fallback to check individual branch PRs for stack branches
  not in the open PR cache, ensuring merged PR detection still works
- Removed merged PR filtering (no longer needed with targeted fetches)
- Added verbose output showing fetched PRs for debugging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests were failing because GetPRForBranch is now called for branches
not in the PR cache (to detect merged PRs). Added mock expectations
for these calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javoire javoire force-pushed the fix/skip-merged-in-status branch from e1949fb to a8c7ae9 Compare January 22, 2026 21:57
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javoire javoire force-pushed the fix/skip-merged-in-status branch from a8c7ae9 to bb028a5 Compare January 22, 2026 22:01
javoire and others added 2 commits January 22, 2026 17:04
When there are no stack branches, code returns early before calling
GetWorktreeBranches, GetRemoteBranchesSet, etc. Updated test to
reflect the actual code path.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a branch's PR is merged, status was incorrectly reporting
"needs rebase" because the branch is behind master. Merged branches
don't need any action - skip them in sync issue detection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javoire javoire force-pushed the fix/skip-merged-in-status branch from bb028a5 to dc056da Compare January 22, 2026 22:04
@javoire javoire force-pushed the fix/pr-fetching-multiple-remotes branch from 0a7c7b8 to db91dbd Compare January 23, 2026 16:33
Base automatically changed from fix/pr-fetching-multiple-remotes to main January 23, 2026 20:36
@javoire javoire merged commit e19b5f6 into main Jan 23, 2026
1 check passed
@javoire javoire deleted the fix/skip-merged-in-status branch January 23, 2026 20:39
javoire pushed a commit that referenced this pull request Jan 23, 2026
…01-23)

### Bug Fixes

* don't suggest rebase for merged PRs in status ([#46](#46)) ([e19b5f6](e19b5f6))
@javoire
Copy link
Owner Author

javoire commented Jan 23, 2026

🎉 This PR is included in version 1.7.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants