Project

General

Profile

Actions

action #120841

closed

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 about 2 years ago. Updated almost 2 years ago.

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

0%

Estimated time:

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 3 (1 open2 closed)

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

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

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

Actions
Actions #1

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
Actions #2

Updated by kraih about 2 years ago

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

Updated by kraih about 2 years ago

  • Status changed from Workable to In Progress
Actions #4

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

Actions #5

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.

Actions #6

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

Actions #7

Updated by kraih almost 2 years ago

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

Actions #8

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
Actions #10

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.

Actions #11

Updated by kraih almost 2 years ago

Actions #12

Updated by kraih almost 2 years ago

  • Status changed from In Progress to Feedback
Actions #13

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

Actions #14

Updated by kraih almost 2 years ago

  • Status changed from Feedback to Resolved
Actions #15

Updated by okurz almost 2 years ago

  • Due date deleted (2022-12-07)
Actions

Also available in: Atom PDF