refactor: Switch to GitHub Search Issues API for PR queries #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace the
/repos/{owner}/{repo}/pullsendpoint with the/search/issuesAPI to enable server-side date range filtering for more efficient PR queries.Changes
API Endpoint Update:
/repos/{owner}/{repo}/pullsto/search/issuesrepo:owner/repo is:pr created:YYYY-MM-DD..YYYY-MM-DDq,sort, andorderinstead ofstate,sort,directionResponse Handling:
{"items": [...]}instead of direct array responseisinstance) for safe dictionary access_make_pr_request_with_retry()return type todict[str, Any] | list[dict]Code Simplification:
reached_boundary = Truesince Search API always returns complete resultsTest Updates:
side_effectto simulate pagination properlyBenefits
✅ Server-side date filtering - GitHub API handles date range filtering, no client-side processing needed
✅ Reduced data transfer - Only relevant PRs returned, not all PRs
✅ Faster queries - More efficient for repositories with many PRs
✅ Simpler code - Removed ~20 lines of client-side filtering logic
✅ All tests passing - 60/60 tests pass
✅ Type safe - Full mypy compliance
Trade-offs
Test Plan
🤖 Generated with Claude Code