Support keyset pagination on internal groups json endpoints
What does this MR do and why?
Support keyset pagination on the following JSON group endpoints:
- /dashboard/groups.json
- /explore/groups.json
This is necessary to fix the missing pagination bug due to the offset pagination constraints
See !225820 (merged) for full implementation with the frontend changes
References
Related to #591712 (closed)
Screenshots or screen recordings
This is from Use keyset pagination on group list pages (!225820 - merged)
How to set up and validate locally
- Set the default page size to
1onconfig/initializers/kaminari_config.rb. Rungdk restartto apply. - Make a CURL request to
curl -i http://localhost:3000/explore/groups.json?pagination=keyset- Extract the cursor:
curl -i http://localhost:3000/explore/groups.json?pagination=keyset | grep -i x-next-page
- Extract the cursor:
- Make another CURL request
curl -i http://localhost:3000/explore/groups.json?pagination=keyset&cursor=...
Alternative:
- Checkout !225820 (merged)
- Set the default page size to
1onconfig/initializers/kaminari_config.rb. Rungdk restartto apply. - Enable
groups_list_keyset_paginationfeature flag. - Go to http://localhost:3000/dashboard/groups
- Validate that the pagination works accodingly.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #591712 (closed)
Edited by Shane Maglangit