feat(gitlab): implemented keyset pagination for gitlab #8529#8572
feat(gitlab): implemented keyset pagination for gitlab #8529#8572moulivashisth wants to merge 9 commits intoapache:mainfrom
Conversation
Signed-off-by: VASHISTH Chandramouli <c.vashisth@soprasteria.com>
|
Is |
|
Thanks for bringing this up! I’ve updated the code to gate keyset by server version (≥16.5) and fallback to offset otherwise. Project members endpoints keep their existing offset behavior. This preserves compatibility with CE 11–16.4 while avoiding offset-cap failures on newer instances. |
klesh
left a comment
There was a problem hiding this comment.
LGTM, thanks for your contribution.
|
Thanks for the review. I hit a typecheck error: Fix: Declared and reused a single apiVersion variable sourced from the client. |
|
Hi, you may run the following command to fix the golangci-lint error: |
|
This pull request has been automatically marked as stale because it has not had recent activity for 120 days. It will be closed in 7 days if no further activity occurs. |
|
This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request. |
pr-type/bug-fix,pr-type/feature-development, etc.Summary
Fix GitLab Users collection hitting offset pagination limits by adding keyset pagination.
This PR updates the GitLab
CollectAccountssubtask to avoidmax offseterrors when collecting large user sets:/api/v4/users(
pagination=keyset&order_by=id&sort=asc&per_page=N&id_after=<last_id>) and do not sendpage.(
/projects/:id/members[/all]) which typically remain under offset caps per project./members/allvs/members/for < v13.11).idto advance the keyset cursor safely.gitlab_api_users).Why: Some instances enforce strict offset caps (e.g., 50k), causing
offset pagination is restrictederrors when fetching Users. Keyset pagination removes the offset and enables full retrieval.Risk/Compatibility:
Does this close any open issues?
Closes 8529 ([Bug][GitLab] Pagination not working Again)
Screenshots
N/A
Other Information