Rework kernelci.api.API class internals to have only abstract bindings - #2189
Merged
Conversation
gctucker
marked this pull request as draft
November 16, 2023 12:58
gctucker
force-pushed
the
api-rework
branch
2 times, most recently
from
November 17, 2023 10:27
bf9c8e8 to
5e79245
Compare
gctucker
marked this pull request as ready for review
November 17, 2023 10:27
Contributor
|
Could you please rebase this? @gctucker |
gctucker
marked this pull request as draft
November 21, 2023 07:56
Contributor
|
Is this ready for review? |
Contributor
Author
|
Yes, I just made it a draft because #2184 had to be merged first. I'll rebase it, thanks. |
Separate the utility methods from the API abstract class to more clearly define what the bindings are actually implementing. This preliminary rework will also enable creating nested classes for the different parts of the API bindings rather than having one huge class with everything. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Convert the ._get_api_objs() method to Base._get_paginated() as a paginated version of ._get(). Also simplify the code to make it easier to use and maintain. Update kernelci.api.latest accordingly. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
gctucker
marked this pull request as ready for review
November 23, 2023 10:23
JenySadadia
reviewed
Nov 23, 2023
Contributor
Author
|
I'll create the PR with the set of changes that comes after this, it'll make more sense as this one is more a stepping stone in this direction. |
Contributor
|
Tested OK locally. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move the helper methods out of the API() abstract class to make the actual bindings clearer. This will also make it possible to have nested classes for different parts of the API e.g.
api.node.find()andapi.node.find()rather than all the methods in a single ever-growing class.