Skip to content

fix(gh-nudge): fetch all open PRs instead of capping at 10#180

Merged
jaeyeom merged 1 commit into
mainfrom
fix/gh-nudge-pr-limit
Jun 10, 2026
Merged

fix(gh-nudge): fetch all open PRs instead of capping at 10#180
jaeyeom merged 1 commit into
mainfrom
fix/gh-nudge-pr-limit

Conversation

@jaeyeom

@jaeyeom jaeyeom commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

gh-nudge (and gh-merge, which shares the same fetch path) only ever processed 10 pull requests. The root cause was in GetPendingPullRequests (devtools/gh-nudge/internal/github/github.go), which used:

gh pr status -q ".createdBy"

gh pr status is hardcoded to return at most 10 PRs and exposes no --limit flag, so any user with more than 10 open PRs silently lost the rest.

Fix

Switch to gh pr list --author "@me" --limit 100 --json ..., which:

  • Preserves the "open PRs created by the current user, in this repo" semantics.
  • Returns the same JSON array shape, so the parser is unchanged.
  • Supports an explicit limit, set via a new pullRequestListLimit = 100 constant (gh's own default is only 30).

GetMergeablePullRequests (used by gh-merge) is fixed transitively since it calls GetPendingPullRequests.

Testing

  • make format, make lint (0 issues), make test — all pass.
  • Existing TestGetPendingPullRequests cases only feed mock JSON output and don't assert command args for this function, so they remain valid unchanged.

GetPendingPullRequests used `gh pr status -q ".createdBy"`, but
`gh pr status` is hardcoded to return at most 10 PRs and exposes no
--limit flag, so users with more than 10 open PRs lost the rest
silently. Both gh-nudge and gh-merge share this fetch path.

Switch to `gh pr list --author "@me" --limit 100`, which preserves the
"open PRs created by me" semantics and the same JSON array shape while
supporting an explicit limit.
@jaeyeom jaeyeom self-assigned this Jun 10, 2026
@jaeyeom jaeyeom merged commit 4bc67b6 into main Jun 10, 2026
7 of 8 checks passed
@jaeyeom jaeyeom deleted the fix/gh-nudge-pr-limit branch June 10, 2026 05:48
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