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

Add support for new list pagination #815

Closed
klmitch opened this issue Mar 30, 2020 · 9 comments
Closed

Add support for new list pagination #815

klmitch opened this issue Mar 30, 2020 · 9 comments

Comments

@klmitch
Copy link
Contributor

klmitch commented Mar 30, 2020

gitlab is experimenting with a new means of performing pagination that promises to be more efficient for them; they're calling it "Keyset-based pagination", and it uses the existing "per_page" query parameter and a new "pagination" parameter (set to the string "keyset"). It's intended to be used in conjunction with the Link header, which may specify some additional query parameters (their example includes "order_by", "sort", and "id_after"). It would be nice if go-gitlab could support this, so that go applications utilizing it could try out this new form of pagination.

(As of right now, it appears to only be implemented on the projects endpoint, with "order_by=id". My read from discussions with them regarding this feature is that they intend to implement it across the board over the long term, though.)

@svanharmelen
Copy link
Member

I'm not sure if I want to add support for this now already. And if we do, I'm not yet sure how we should support both the old and new solutions concurrently. Guess I need to have a closer look to find out and form an opinion...

Of course if you have specific ideas and/or am willing to create a PR, I'm always open to look at that or discuss it.

@klmitch
Copy link
Contributor Author

klmitch commented Mar 31, 2020

Yeah, my purpose in opening this issue was to make sure to document it so everyone interested can begin to think about what it should look like.

@k-mckinney
Copy link
Contributor

I noticed today on the documentation for the repository tree API that this endpoint has deprecated support for the page pagination in favor of keyset pagination, and it will be unsupported as of Gitlab 15.0.

@Shocktrooper
Copy link
Contributor

As of right now all I can find in terms of deprecation of the old pagination for supported endpoints in go-gitlab is what @k-mckinney mentioned in the above thread. With knowledge at least this endpoint we should completely transition this over before 15.0 and notify maintainers of downstream projects if we can. @timofurrer I looked and didn't see anything using this endpoint in the terraform provider. If you could do a once over when you have time it would be appreciated.

@mitar
Copy link
Contributor

mitar commented May 17, 2022

Could we just add Pagination and Cursor fields to ListOptions for now? So that people can use it if they want. We can add any sugar on top later on.

@timofurrer
Copy link
Contributor

I looked and didn't see anything using this endpoint in the terraform provider. If you could do a once over when you have time it would be appreciated.

@Shocktrooper Yes, we are not using this API right now.

@pwlandoll
Copy link
Contributor

#1827 has been merged, is that functionality sufficient to close this issue?

@klmitch
Copy link
Contributor Author

klmitch commented Nov 15, 2023

After looking over the example included in the PR that you referenced, it does seem to me that this would address my concern. Do you have an ETA on when a release will be cut with this functionality? (Feel free to close the issue, I'm just leaving it open in the hopes that you'll answer my question :)

@svanharmelen
Copy link
Member

Its already part of v0.94.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants