Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernelci.cli: add pagination options and helper #2178

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

gctucker
Copy link
Contributor

@gctucker gctucker commented Nov 8, 2023

Add the --page-length / -l and --page-number / -n options for paginated API data. Provide a kernelci.cli.get_pagination() function to convert these arguments into the offset / limit values used with the API as pagination is easier with relative numbers on the command line. Add unit tests accordingly to test this function.

@gctucker gctucker mentioned this pull request Nov 8, 2023
40 tasks
@gctucker gctucker force-pushed the kci-cli-pagination branch 2 times, most recently from cb81762 to 49a9639 Compare November 8, 2023 14:09
Add the --page-length / -l and --page-number / -n options for
paginated API data.  Provide a kernelci.cli.get_pagination() function
to convert these arguments into the offset / limit values used with
the API as pagination is easier with relative numbers on the command
line.  Add unit tests accordingly to test this function.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
@JenySadadia
Copy link
Collaborator

I think this PR should also include changes to use get_pagination method for getting API objects in _get_api_objs.

@gctucker
Copy link
Contributor Author

If it's not preventing this PR from being merged then I wouldn't spend more time just to shuffle commits around. I don't think it's related, the get_paginated() rework is separate from the command line arguments.

@JenySadadia
Copy link
Collaborator

If it's not preventing this PR from being merged then I wouldn't spend more time just to shuffle commits around. I don't think it's related, the get_paginated() rework is separate from the command line arguments.

Okay. So I believe it will be included in a separate PR.
We can merge this.

Copy link
Collaborator

@JenySadadia JenySadadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@JenySadadia JenySadadia added this pull request to the merge queue Nov 20, 2023
Merged via the queue into kernelci:main with commit d42bf9d Nov 20, 2023
4 checks passed
@gctucker gctucker deleted the kci-cli-pagination branch November 20, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants