-
Notifications
You must be signed in to change notification settings - Fork 51
Not all valid VSS paths supported by databroker #674
Comments
Just to clarify. This bug is specific to the Currently, all paths are considered valid by the databroker backend, so it is actually possible to access these paths just fine when using the For a gRPC request where the path is neatly contained in it's own field, it's possible to allow any valid string as path without causing issues. For json, as long as the path is correctly escaped, it also works just fine. A better approach would (probably) be to do validation at the point of adding new entries to the backend (and not for every request). But it will most likely lead to issues to allow any character in a path when adding new entries (as is done now). In other contexts, such as other text based protocols where the path is delimited by reserved characters, it will be more problematic. Or more relevant for databroker, when parsing paths as part of the Escape sequences can be introduced to allow paths that contain "reserved" characters for a particular parser, but that adds complexity (if at all possible given the protocol). So it would probably be a lot easier to just specify what characters a valid path can contain.
So, what exactly is a valid VSS name then, if not what the VSS recommendation says? PS I.e. or
Especially as they are not "Vehicle" signals. |
For the last part: This would collide with VSS itself because it allows only one super node like Vehicle. So it would be Vehicle.Kuksa. |
I didn't know that. Where is this specified? |
I do not think/find specification but once tried adding some nodes Camera.xxx.xxx with the guys from a hackathon and at least vss tools complained and said there can only be one primary node to a tree. And for a tree this makes sense if you think of the shape :) @erikbosch maybe you can provide more insights? |
Maybe it's just a recommendation 😄 |
Looking at it another way (especially, if we know that everything coming from a valid VSS model supplied to databroker will live under the Then we don't need to add any funky underscores to convey that they are special (which might break clients that expects paths to only contain certain characters, and can still clash if we allow underscores generally). These attributes are not part of any VSS model and they will not be processed by the vss-tools for example. They only depend on the interface used to interact with databroker supporting them. |
Yeah looking at tit that way - it makes sense. But from a VSS perspective there should be only one tree. Another way would be not putting it in as datapoints but as separate atributes in the proto file like another thing added to the API instead using datapoints. For example adding
and a |
Kinda like this 😄 |
Ah yes, true. @SebastianSchildt would that suit your use case if we extend it or something like this? |
Let me check this one by one: VSS itself only requires "point seperated" paths and did not give any other hard guidlines. It accepts even path starting with numbers , or @erikbosch accepts your famous The recommendations are then followed by the standard catalogue, they are all deemed "useful" and reasonable, but for example it has rules like "all booleans should start with For reference (although really not much is written there) check: https://covesa.github.io/vehicle_signal_specification/rule_set/basics/#addressing-nodes So I think databroker should be "as relaxed as possible", with the possible exception of not allowing whitespaces (because as @argerus points out, whitespaces are effectively the delimiters in in our tokens). I agree that any of those checks should be done at a central place (so i.e. when adding paths) Wrt to the "multi-root" discussion |
Yes, whitespace ( And asterisks ( And VISSv2 has support for ( We also had a discussion around supporting negated paths in the access tokens (which would make a leading ( |
But as we don't have any limitations in the backend now, deciding to not add any validation would not really change anything. These issues would only present themselves if anyone at some point tried to add some weird path to the model. So I think it's rather a question of which is best:
|
@rafaeling The let's exclude during addEntry everything that has `` (whitespace) or |
In VSS documentation as of today there is mentioned here and there that the VSS standard catalog is a tree, but it is not described that you only can have a single tree within a *.vspec file. In VSS-tools converting *.vspec-files to JSON you will get an error if you have multiple roots, but that could theoretically be seen as a limitation as there are no strict rules defined. I will add an issue to VSS project to clarify the "single root policy". But even if VSS-tools only support a single tree at a time, there would not be a problem for KUKSA to handle multiple trees in parallel, possibly be reading multiple *.json files. Concerning node names VSS is very liberal at the moment just saying that "The VSS specification must adhere to YAML syntax." which could give problems. A vspec/yaml file like below is AFAIK legal Yaml, but would give head ache in downstream implementations.
I have already created an PR in COVESA/vehicle_signal_specification#651 proposing to elevate recommendations to rules, so that downstream tools does not need to support blanks or other odd characters in names |
PR that fixes this issue: #678 |
Fixed in #678 |
Consider the following VSS tree (you can test this by hacking PR in #673 or by loading a generated VSS.json as
--metadata
with such pathsone will notice that direct access, e.g.
getValue Vehicle._kuksa.databroker.GitVersion
orgetMetadata getValue Vehicle._kuksa.databroker.GitVersion
is not possible leading to an errorWhile at the same time it is possible to get the data using wildcards
This is definitely not consistent, so: Bug.
The root cause seem seems to be a check here https://github.com/eclipse/kuksa.val/blame/master/kuksa_databroker/databroker/src/glob.rs#L75 which restricts VSS paths to [A-Z][a-zA-Z0-9]*
This is in line with with VSS "recommendations", i.e. see here https://github.com/COVESA/vss-tools/blob/51bf94e3e07cf9501a373a3978fcd3fa636b510f/vspec/model/vsstree.py#L163
But it disallows valid VSS names. As databroker is also to be used with "non-standard", non COVESA models, I fell we should not restrict it. It is fine if vss-tools warn, that you are not following a style guide, but as a "servant" for VSS during runtime in databroker we should strive to support all valid VSS models.
Any (other) opinions/input here? @erikbosch @argerus ?
The text was updated successfully, but these errors were encountered: