Paginate PR changed files: reviews silently omit files beyond the first 30 #32
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/forgejo-auto-pr-review#32
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The review action silently drops changed files after Forgejo's first API page. This caused a false important finding on nixos-config MR #307: the reviewer claimed Vega/phone/router certificates changed without their paired encrypted node-key files, but all three key files are changed in the MR.
Reproduction at MR head
3fe3406f2cb8499d2e39a2485611ce7f78e6a94b:/api/v1/repos/nimmo/nixos-config/pulls/307/fileswith default pagination: 30 files returned.?limit=100&page=1: 33 files returned. The MCP equivalentget_fileswithper_page: 100also returns all 33.secrets/nebula/phone.yaml(changed, +3/-3),secrets/nebula/router.yaml(added, +37/-0), andsecrets/nebula/vega.yaml(changed, +3/-3). Localgit diff --numstat origin/main -- ...independently confirms these changes.Confirmed source cause: reviewer.py calls
api_request(.../pulls/{number}/files)once with no pagination parameters.api_requestreads one response.prepare_diff_batchesiterates only this returned list, even though the full unified diff contains additional sections, so those files never appear in batch evidence or coverage.Expected behavior: collect every changed-file page before preparing batches. Use Forgejo
page/limitsemantics and continue until exhausted (respecting any explicit safety cap with an omission warning). Cross-check the collected count againstpr.changed_files; never silently report complete coverage when collection is incomplete. Preserve renamed/binary-file handling and explicit batch-cap omissions.Acceptance checklist:
changed_filescounts.Related follow-up-context observation: both reviews on MR #307 are formal COMMENT reviews, but metadata says 'Previous automated review: none found'. The action fetches issue comments only, then
human_reply_contextimmediately returns an empty string when no previous automated comment is found. Thus human responses posted before a push can be omitted from re-review context when formal reviews are enabled. This should be investigated alongside existing #19 or as a separate follow-up; it is distinct from the confirmed changed-file pagination defect.No private keys, decrypted secrets or credential values are included in this report.