Skip to content

feat: batch GitHub PR queries into single GraphQL call (Refs: beans-mjg6)#147

Merged
hmans merged 1 commit into
mainfrom
beans/wooden-reindeer-vt23
Mar 18, 2026
Merged

feat: batch GitHub PR queries into single GraphQL call (Refs: beans-mjg6)#147
hmans merged 1 commit into
mainfrom
beans/wooden-reindeer-vt23

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Mar 18, 2026

Summary

  • Replaces per-worktree gh CLI invocations with a single gh api graphql call that fetches PR data for all branches at once using GraphQL aliases
  • Reduces GitHub API usage from 2-3 subprocess spawns per worktree per tick to 1 total, avoiding rate limit issues
  • Adds FindPRs batch method to the forge.Provider interface and ParseOwnerRepo helper for extracting owner/repo from git remote URLs

Test plan

  • All existing unit tests pass
  • All 52 e2e tests pass
  • Full build succeeds
  • Manual verification: open Beans UI with multiple worktrees and confirm sidebar PR status icons update correctly

…jg6)

- Add FindPRs batch method to forge.Provider interface
- Implement on GitHub using gh api graphql with aliased fields per branch
- Add ParseOwnerRepo helper for extracting owner/repo from git remote URL
- Replace parallel per-worktree populatePR goroutines with populatePRsBatch
- Update Worktrees query and WorktreesChanged subscription to use batching
- Add unit tests for ParseOwnerRepo, graphQLCheckToStatusCheck, graphQLPRToForge
@hmans hmans merged commit ece06cf into main Mar 18, 2026
1 check passed
@hmans hmans deleted the beans/wooden-reindeer-vt23 branch March 18, 2026 09:19
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