Skip to content

paginate Gitea repository list #64

@bradrydzewski

Description

@bradrydzewski

Gitea implemented pagination for the repository list which results in only 10 repositories being returned. We have mechanisms in place for handling pagination. Here is a note from our Discourse forum:

Pagination would need to be added to the code here:
https://github.com/drone/go-scm/blob/master/scm/driver/gitea/repo.go#L42

For reference you can see how we do this with GitHub:
https://github.com/drone/go-scm/blob/master/scm/river/github/repo.go#L85

Some additional code may be required to extract the pagination data from the response (i.e. current page, next page, last page, results per page). However, if Gitea uses the same approach as GitHub (example below) than this would not require any additional code.

Link: <https://api.github.com/user/repos?page=3&per_page=100>; rel="next",
 <https://api.github.com/user/repos?page=50&per_page=100>; rel="last"

Source: https://discourse.drone.io/t/drone-only-shows-10-repositories-from-gitea/6922/16

Metadata

Metadata

Assignees

No one assigned

    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