Skip to content

fix(review): load GitCode PR files as one bounded response - #2463

Merged
bobleer merged 1 commit into
GCWing:mainfrom
guantw:fix/gitcode-files-response-unified
Aug 24, 2026
Merged

fix(review): load GitCode PR files as one bounded response#2463
bobleer merged 1 commit into
GCWing:mainfrom
guantw:fix/gitcode-files-response-unified

Conversation

@guantw

@guantw guantw commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

GitCode returns GET /pulls/{number}/files as a single response that is truncated at 3,000 entries, with no usable pagination and no total-count header (see the GITCODE_PULL_REQUEST_FILES_RESPONSE_LIMIT contract). The previous code split this endpoint into per-page GitHub-style requests that never paginated effectively, silently losing files on larger PRs.

Changes

  • gitcode_review_target_parts / gitcode_review_file_parts: replace the per-page bounded fetch with a single bounded request (4 MB), keep the 1,000-item review-target cap, and apply file-derived change stats to the pull request.
  • Detail page Files section: switch from server-side page parameters to client-side slicing (gitcode_files_pagination + slice_page), and stop claiming an exact total when the response is at the truncation limit.
  • gitcode_file_from_value: prefer old_path, infer status from new_file / deleted_file / renamed_file flags, and parse a nested patch.diff payload.
  • Oversized GitCode files responses now surface an explicit Api error instead of a generic parse failure.
  • Added unit tests for the new mapping, truncation-aware pagination, and error reporting.

Notes

  • file_page_hint is retained in the trait surface but is no longer used by the GitCode path.
  • Verified targets are GitCode-only; GitHub and GitLab flows are unchanged.

GitCode returns pull request files as a single response truncated at 3,000 entries without pagination or a total header. Replace the per-page fetch for review targets, file diffs, and the detail Files section with one bounded request, slice pages client-side, and avoid claiming an exact total when the response is truncated. Also prefer old_path and new_file/deleted_file/renamed_file flags when mapping files, and accept a nested patch.diff payload.
@bobleer
bobleer merged commit 308ce51 into GCWing:main Aug 24, 2026
10 checks passed
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.

2 participants