Implement keyset pagination for group-level dependency list page
Why are we doing this work
To be able to utilize performant queries for the group-level dependency list page, we need to use keyset pagination with the new queries. To do so, we need to accept two more parameters and respond with four more properties.
Response properties
The following attributes will be Base64 encoded JSON values. They will contain the information of the first and last records' sorting attributes. For example, if the sorting is done by package_manager
;
hash = { 'package_manager' => 'bundler', 'component_version_id' => 1 }
Base64.encode64(hash.to_json)
-
endCursor
: Base64 encoded JSON text of the last record. -
startCursor
: Base64 encoded JSON text of the first record. -
hasNextPage
: Indicates if there are more records. -
hasPreviousPage
: Indicates if there are more records.
Request parameters
-
after
: This parameter will be used to retrieve the next records. -
before
: This parameter will be used to retrieve the previous records.
Implementation plan
-
backend Implement a new feature flag to switch from existing pagination to keyset pagination -
backend Implement the aforementioned response properties -
backend Accept the aforementioned request parameters and use them with the new queries -
frontend Use before
andafter
request parameters based on FF value
Verification steps
TBD
Edited by Mehmet Emin INAC