Project

General

Profile

action #120841

coordination #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

Added by kraih 3 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2022-11-22
Due date:
% Done:

0%

Estimated time:
Difficulty:
medium

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

Related issues

Related to openQA Project - action #119431: Inform users e.g. in the webUI if not all results are returned size:MBlocked2022-10-26

Related to openQA Project - action #120315: openqa-client does not get complete asset list size:SResolved2022-11-11

Copied to openQA Project - action #121048: Add pagination for GET /api/v1/bugsResolved2022-11-22

History

#1 Updated by kraih 3 months ago

  • Related to action #119431: Inform users e.g. in the webUI if not all results are returned size:M added

#2 Updated by kraih 3 months ago

  • Related to action #120315: openqa-client does not get complete asset list size:S added

#3 Updated by kraih 3 months ago

  • Status changed from Workable to In Progress

#4 Updated by openqa_review 2 months ago

  • Due date set to 2022-12-07

Setting due date based on mean cycle time of SUSE QE Tools

#5 Updated by kraih 2 months 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.

#6 Updated by kraih 2 months 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

#7 Updated by kraih 2 months ago

Mojolicious 9.30 is on the way to factory. https://build.opensuse.org/request/show/1037664

#8 Updated by cdywan 2 months ago

  • Subject changed from Add pagination for GET /api/v1/assets to Add pagination for GET /api/v1/assets size:M

#10 Updated by kraih 2 months 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.

#11 Updated by kraih 2 months ago

#12 Updated by kraih 2 months ago

  • Status changed from In Progress to Feedback

#13 Updated by kraih 2 months 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

#14 Updated by kraih 2 months ago

  • Status changed from Feedback to Resolved

#15 Updated by okurz about 2 months ago

  • Due date deleted (2022-12-07)

Also available in: Atom PDF