Skip to content

Missing Pagination Handling in Gitea Provider API Wrappers #2138

@nnhattruong30

Description

@nnhattruong30

Git provider

Other

System Info

Gitea: 1.23.6
Docker image: codiumai/pr-agent:0.31-gitea_app

Bug details

Description

Some Python API wrapper methods in the Gitea provider do not handle pagination correctly. As a result, when fetching data related to a pull request, only the first page of results is returned (default limit: 30 items), causing incomplete data retrieval for PRs with more items.

This impacts pull requests that contain more than 30 files or commits.

Affected Endpoints

The following API wrappers are affected:

  • get_change_file_pull_request(): repos/{owner}/{repo}/pulls/{pr_number}/files
  • get_pr_commits(): /repos/{owner}/{repo}/pulls/{pr_number}/commits

Current Behavior

Only the first page of results is fetched.
Pagination parameters (e.g. page, limit) are not iterated.
PRs with more than 30 files or commits return incomplete data.

Expected Behavior

All pages should be fetched until no more results are returned.
The full list of files and commits for a pull request should be available, regardless of size.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions