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

More support for keyset pagination #1144

Open
ericfrederich opened this issue Aug 7, 2020 · 2 comments
Open

More support for keyset pagination #1144

ericfrederich opened this issue Aug 7, 2020 · 2 comments

Comments

@ericfrederich
Copy link
Contributor

Description of the problem, including code/CLI snippet

Initial keyset pagination support was added in commit 0b71ba4, however it is still not:

  • supported from CLI
  • able to be set globally in configuration.
gitlab -o json project list --all --pagination keyset --order-by id

Expected Behavior

Pagination should be able to be set in the following places in order of precedence:

  • cli argument
  • via config file under a particular gitlab id
  • via config under global section

Actual Behavior

Pagination can only be set in config file under a particular gitlab id.

Specifications

  • python-gitlab version: master branch
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 13.2.3
ericfrederich added a commit to ericfrederich/python-gitlab that referenced this issue Aug 7, 2020
Also allow order_by to be set in globally in config

Fixes python-gitlab#1144
ericfrederich added a commit to ericfrederich/python-gitlab that referenced this issue Aug 7, 2020
Also allow order_by to be set in globally in config

Fixes python-gitlab#1144
ericfrederich added a commit to ericfrederich/python-gitlab that referenced this issue Aug 7, 2020
Also allow order_by to be set in globally in config
Fixes python-gitlab#1144
@max-wittig
Copy link
Member

As mentioned before:

  • We cannot set it globally, as some people still rely on X-Total (bad!)
  • We would keep a list of supported keyset endpoint (effort wise not that bad)

Keeping it open for now and let's see what GitLab does. I don't think we should do anything right now or break peoples workflow ☹️

@mitar
Copy link
Contributor

mitar commented Oct 20, 2021

So x-total header is not returned on gitlab.com when results have more than 10k results: https://docs.gitlab.com/ee/user/gitlab_com/index.html#pagination-response-headers

This makes things break in strange ways for code which works for some time, but then results grow to more than 10k and it stops working. I think this library should simply not encourage use of x-total pagination at all, or at least make it so that you have to opt-in if you really know what you are doing.

@ericfrederich See also #961.

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

No branches or pull requests

3 participants