action #120841
closedcoordination #80142: [saga][epic] Scale out: Redundant/load-balancing deployments of openQA, easy containers, containers on kubernetes
coordination #92854: [epic] limit overload of openQA webUI by heavy requests
action #97190: Limit size of initial requests everywhere, e.g. /, /tests, etc., over webUI and API
action #119428: Ensure users can get all the data for limited queries, e.g. with pagination
Add pagination for GET /api/v1/assets size:M
Description
Motivation¶
Proper pagination as planned in #119428 is a much better solution to the problem described in #119431. So we use the API endpoint GET /api/v1/assets
, which has recently become a problem in #120315, to work out the specifics for how we want pagination to look like in the API. Later this can be replicated for all other API endpoints with limits.
Acceptance criteria¶
- AC1: API endpoint
GET /api/v1/assets
has pagination
Suggestions¶
- Take inspiration from GitHub and GitLab regarding query parameters and
Link
headers - Once this has been implemented add more tickets linked to #119428 for other API endpoints
Updated by kraih about 2 years ago
- Related to action #119431: Inform users e.g. in the webUI if not all results are returned size:M added
Updated by kraih about 2 years ago
- Related to action #120315: openqa-client does not get complete asset list size:S added
Updated by openqa_review about 2 years ago
- Due date set to 2022-12-07
Setting due date based on mean cycle time of SUSE QE Tools
Updated by kraih almost 2 years ago
For the request i will use query parameters like /api/v1/assets?limit=10&offset=10
and responses Link
headers like:
Link: <https://openqa.opensuse.org/api/v1/assets?limit=10&offset=10>; rel="prev",
<https://openqa.opensuse.org/api/v1/assets?limit=10&offset=30>; rel="next"
The presence of each will indicate that next and previous pages exist. If they are missing then the relation does not exist.
Updated by kraih almost 2 years ago
Since parsing Link
headers is rather tricky, i've added the feature upstream to Mojolicious and it will be available with the 9.30 release. https://github.com/mojolicious/mojo/commit/e2e6415c62e75ea0ee6156ae3897f32698ba7a2f
Updated by kraih almost 2 years ago
Mojolicious 9.30 is on the way to factory. https://build.opensuse.org/request/show/1037664
Updated by livdywan almost 2 years ago
- Subject changed from Add pagination for GET /api/v1/assets to Add pagination for GET /api/v1/assets size:M
Updated by kraih almost 2 years ago
Updated by kraih almost 2 years ago
PR has been approved, but not merged yet, to give other distributions some time to package Mojolicious 9.30. In the meantime i will work out next steps and create more tickets.
Updated by kraih almost 2 years ago
- Copied to action #121048: Add pagination for GET /api/v1/bugs added
Updated by kraih almost 2 years ago
- Status changed from In Progress to Feedback
Updated by kraih almost 2 years ago
If you got here from a related ticket, the pagination Link
header generation code has become a helper in #121048. Making it easier to replicate the code for other API endpoints. https://github.com/os-autoinst/openQA/pull/4934