Skip to content

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

Open
Tipmethewink wants to merge 1 commit intobenr77:masterfrom
Tipmethewink:paged-issues
Open

Retrieve paginated response from API and allow project specific URLs#22
Tipmethewink wants to merge 1 commit intobenr77:masterfrom
Tipmethewink:paged-issues

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?

@gnugomez
Copy link

@benr77 that's not possible, the maximum number of issues that gitlab will return is 100 you can read about it here

ParameterDescription
pagePage number (default: 1).
per_pageNumber of items to list per page (default: 20, max: 100).

@gnugomez
Copy link

Although it can be a good thing to have as part of the plugin settings

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.

4 participants