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

api.main: handle new Node path format in node submission #503

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

hardboprobot
Copy link
Contributor

@hardboprobot hardboprobot commented Mar 19, 2024

When using a /-separated path string for Node paths instead of a list of strings, we can encode whether a Node is a leaf node or an intermediate node in a tree by ending the path string with a trailing slash character ('/') for intermediate nodes.

Implement the appropriate checks and logic in the node submission endpoints. For single nodes, adapt the path string of the parent node. For node trees, normalize the paths for the whole tree, adding trailing slashes when needed for all intermediate nodes.

DEPENDS ON kernelci/kernelci-core#2466, the unit tests will fail until that PR is merged

NOTE These changes require running the DB migration script included.

When using a /-separated path string for Node paths instead of a list of
strings, we can encode whether a Node is a leaf node or an intermediate
node in a tree by ending the path string with a trailing slash
character ('/') for intermediate nodes.

Implement the appropriate checks and logic in the node submission
endpoints. For single nodes, adapt the path string of the parent
node. For node trees, normalize the paths for the whole tree, adding
trailing slashes when needed for all intermediate nodes.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
@hardboprobot hardboprobot added the staging-skip Don't test automatically on staging.kernelci.org label Mar 19, 2024
@hardboprobot hardboprobot self-assigned this Mar 19, 2024
The Node path is now encoded using a regular /-separated path string
instead of a list of strings.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
The Node path is now encoded using a regular /-separated path string
instead of a list of strings.

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Required after:
    api.main: handle new Node path format in node submission

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
@JenySadadia
Copy link
Collaborator

LGTM. I'll mark it approved once we successfully test this on staging with all the related PRs.
Is this tested OK locally? @hardboprobot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
staging-skip Don't test automatically on staging.kernelci.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants