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

Retrieve paginated response from API and allow project specific URLs #22

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

Conversation

Tipmethewink
Copy link

Retrieves all the pages of issues if a paginated response is returned.
Also allows a project specific URL to be used for the GitLab URL.

@JonnyDeates
Copy link
Contributor

I hope this gets merged in, this is really useful. I just realized the implication. I am currently on a project and thought it would pull all the issues, not just the first page capped at 20.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use-case for changing this URL please?

} else {
return response.json as Promise<T>;
}
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just going to keep retrieving page after page of results? What happens if there are thousands of results?

Is is not better to specify the max number of results in the main filter query?

@Tipmethewink
Copy link
Author

Tipmethewink commented May 23, 2024 via email

@benr77
Copy link
Owner

benr77 commented May 23, 2024

I didn't mean limit the number of pages, I meant tell Gitlab to send the number you want in a single page of results. So if you know you have e.g. 500 issues and you do want them all, then set a per_page=500 parameter on the filter. However, I've just checked the Gitlab docs and per_page has a maximum value of 100, so not sure this helps here.

If we allow thousands of results to be downloaded, memory and performance are going to become a problem. How can we set an upper limit?

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.

3 participants