Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

honor pagination queryparams on requests to /repo/git/refs #33683

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rremer
Copy link
Contributor

@rremer rremer commented Feb 21, 2025

The default behavior of /repo/git/refs is a greedy regex, which for very active repos can return huge responses. Support the limit/page query parameters so clients may choose to limit that output.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 21, 2025
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 21, 2025
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Feb 21, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Feb 22, 2025

Thank you for making the improvement, while I can see some problems in the legacy code. The API was not well-designed, ideally it shouldn't have the unpredictable behavior (return an object or return a list), so adding more patches to it would make the design worse.

So I think I could accept 2 kinds of changes for it, either:

  1. Design a new and clear API, make it only return a list, and respect "page"&"limit" (this PR doesn't respect "page" either, right?)
  2. Only add a "limit" patch to the existing API, and add some TODO/FIXME comments to clarify the design problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants