Repository navigation
Conversation
- Implement _fetch_paginated helper method in RepoApi class - Update get_change_file_pull_request to use pagination - Update get_pr_commits to use pagination - Add comprehensive unit tests for pagination functionality Fixes issue where PRs with more than 30 files or commits would return incomplete data due to missing pagination handling. Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
Address code review feedback by removing redundant conditional expressions in error handlers. Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Three things worth addressing before this can land.
The branch predates the move to header auth. main now passes auth_settings=['AuthorizationHeaderToken'] on every call and no longer puts the token in the URL, so this would reintroduce credentials in query strings, where they end up in server logs and proxies. That is also most of the conflict.
The termination check can still truncate. limit is hardcoded to 50 and the loop stops when a page returns fewer than 50 items, but Gitea's max page size is configurable and often lower. On a server capped at 30, asking for 50 returns 30, the loop breaks after one page, and the original bug is back. Looping until an empty page avoids the assumption.
Both except branches return all_items, so a failure halfway through pagination yields a silently truncated list. That is the same silent truncation this PR is fixing, just moved.
Happy to open a rebased version with these addressed if that is easier than reviving this one.
Gitea provider's
get_change_file_pull_request()andget_pr_commits()methods only fetched the first page of results (default 30 items), causing incomplete data for PRs with many files or commits.Changes
_fetch_paginated()helper inRepoApiclass - iterates through all pages usingpage/limitparams, returns accumulated results, handles errors gracefully with partial result recoveryget_change_file_pull_request()to use pagination helperget_pr_commits()to use pagination helperExample
Before: PRs with >30 files would silently return truncated results.
After: All pages are fetched automatically:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.