eclipse / kuksa.val

kuksa.val
Apache License 2.0
93 stars 51 forks source link

Reintroduce autocompletion in Python command line client for GRPC #411

Closed SebastianSchildt closed 1 year ago

SebastianSchildt commented 1 year ago

kuksa_(viss)_client used to support tab-automcompletion for VSS Paths in the VISS (websocket) side. This does not work in GRPC side.

For usability reasons (as the cmdline client really is about exploring/debugging) we should add this feature for GRPC connections.

It can probably not be a direct port of the VISS side, because that makes use of the KUKSA VISS getMetadata call (which basically gives you verbatim excerpts from the VSS json tree)

romainletendart commented 1 year ago

I don't know how this should work with the unified API. Since the switch to that new API, here is what the client gets back from databroker when querying a wildcard:

Test Client> getMetaData *
{
    "error": {
        "code": 404,
        "reason": "not_found",
        "message": "Path '*' not found"
    },
    "errors": [
        {
            "path": "*",
            "error": {
                "code": 404,
                "reason": "not_found",
                "message": "Path '*' not found"
            }
        }
    ]
}

I think wildcards are only supported with the query syntax of the former databroker API. @argerus any thoughts?

SebastianSchildt commented 1 year ago

Do we have a specific way to query the childs of a node? Like a Metadata Field we can query?

lukasmittag commented 1 year ago

One option could be to use the newest vss release json file. Would then not be backwards compatible though. Or another file which could be given through cmd line argument.

SebastianSchildt commented 1 year ago

I think the only "good way" is, when this is done via API, e.g. requesting the children of any Node.

I do however not think that also adding the (functionlity-wise overlapping) sdv API is the solutions, and I think kuksa.val.v1 can not yet do it, it would at least need something liuke StringArray children in Metadata. Which is only one but may or may not be the best way to do it

lukasmittag commented 1 year ago

Is there a reason why not handling it like in sdv API?

argerus commented 1 year ago

I think it would make sense to add a List( "wildcard pattern", [fields] ) to the kuksa.val.v1 API that would return all matching VSS entries. The syntax of "wildcard pattern" should be the same as what the authorization scope uses.

SebastianSchildt commented 1 year ago

That makes sense to me, but thinking of authorization, would it returns everything where you possess a read scope? Would you "see" the existence of a Child if you have no access?

And what would we expect this to return. An array of all metadata?

rafaeling commented 1 year ago

Here is the draft PR for autocompletion: https://github.com/eclipse/kuksa.val/pull/605

SebastianSchildt commented 1 year ago

Done in #653