Add server-side branch prefix search and cursor pagination for GitHub#110
Add server-side branch prefix search and cursor pagination for GitHub#110HarshMN2345 wants to merge 7 commits into
Conversation
Uses GraphQL refs query with query variable for prefix filtering and cursor-based pagination instead of fetching all branches client-side.
Greptile SummaryThis PR migrates
Confidence Score: 4/5Safe to merge with awareness that the adapter contract change is intentionally staged; no runtime bugs found in the current implementation. The GraphQL implementation is logically correct — null-repository is guarded before any array access, pageInfo.hasNextPage is used directly so no extra round-trip or probe arithmetic is needed, and the getLatestCommit author-null fix is sound. Unresolved concerns from prior review discussion (documentation inconsistency between 'prefix' in the PHPDoc and 'substring' in the test comment, and the silent fallback when an integer $page > 1 is passed) are present in the merged code but do not cause runtime failures in typical usage. src/VCS/Adapter/Git/GitHub.php — specifically the $search parameter documentation and the integer $page silent-fallback behaviour. Important Files Changed
Reviews (5): Last reviewed commit: "Remove client-side prefix filter — trust..." | Re-trigger Greptile |
| * @param int|string|null $page Pass 1 (or null) for the first page. For subsequent pages | ||
| * always pass the opaque cursor string from the previous nextCursor — GitHub uses | ||
| * cursor-based GraphQL pagination and has no concept of integer page offsets. | ||
| * Any integer value other than 1 is treated as page 1. |
There was a problem hiding this comment.
Silent fallback for integer
$page values other than 1 may surprise callers
A caller passing $page = 3 silently gets the first page with no error or warning. Consider throwing an \InvalidArgumentException for integer values > 1, or explicitly marking those values as unsupported.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Uses GraphQL refs query with query variable for prefix filtering and cursor-based pagination instead of fetching all branches client-side.