mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-25 16:18:32 +02:00
Backport #39419 by @perfectra1n `GET /repos/{owner}/{repo}/issues/{index}/comments` ignores `page` and `limit` and always returns every comment. The Gitea downloader pages it and stops only on a short page, so migrating from Gitea or Forgejo loops forever on any issue with at least `MAX_RESPONSE_ITEMS` comments, without an error. Paging is kept in case the endpoint gets paginated (https://github.com/go-gitea/gitea/issues/6132, https://github.com/go-gitea/gitea/issues/18082). The loop now stops when a page is longer than the limit or starts with an already seen comment. Prior art: Forgejo fixed its copy in https://codeberg.org/forgejo/forgejo/pulls/9274 (report: https://codeberg.org/Codeberg/Community/issues/1542). --- AI-assisted: drafted with Claude Code (claude-opus-5-5), reviewed by me. Please let me know if you have any suggestions or comments, I ran into this issue myself when I was trying to migrate repositories from Forgejo -> Gitea. Co-authored-by: Jon Fuller <jonfuller2012@gmail.com> Co-authored-by: silverwind <me@silverwind.io>