Skip to content

Conversation

@javoire
Copy link
Owner

@javoire javoire commented Jan 21, 2026

Summary

  • Uses --repo flag for gh commands to handle repos with multiple remotes
  • Includes host in repo path for GitHub Enterprise remotes (e.g., ghe.spotify.net/owner/repo)
  • Fetches only open PRs to avoid 502 timeouts on large repos with thousands of PRs
  • Falls back to individual PR lookups for stack branches to detect merged PRs

🤖 Generated with Claude Code

@javoire javoire changed the title fix: include host in repo path for GitHub Enterprise remotes fix: handle multiple remotes and avoid PR fetch timeouts Jan 22, 2026
javoire and others added 5 commits January 23, 2026 11:33
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>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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>
@javoire javoire force-pushed the fix/pr-fetching-multiple-remotes branch from 0a7c7b8 to db91dbd Compare January 23, 2026 16:33
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javoire javoire merged commit 690b314 into main Jan 23, 2026
1 check passed
@javoire javoire deleted the fix/pr-fetching-multiple-remotes branch January 23, 2026 20:36
@javoire
Copy link
Owner Author

javoire commented Jan 23, 2026

🎉 This PR is included in version 1.7.3 🎉

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