-
Notifications
You must be signed in to change notification settings - Fork 56
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
Update static UID fka functionality. #326
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ea5285c
Update upstream (#8)
nwesem 5a15862
Update upstream again (#9)
nwesem c650169
add strict mode for case sensitivity (#10)
nwesem 79b95de
Merge branch 'master' of github.com:COVESA/vss-tools into COVESA-master
nwesem 82d4b67
Merge branch 'COVESA-master'
nwesem 1e2a3a0
sync master (#13)
nwesem 0f8b014
Merge branch 'master' of github.com:adobekan/vss-tools
nwesem b54a97e
patch fka function and update docu
adobekan c4f9c1d
update tests
adobekan 9cc74b4
check semantics while matching
nwesem e5383fd
Patch/fka validation (#16)
adobekan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# vspec2id - vspec static UID generator and validator | ||
|
||
The vspecID.py script is used to generate and validate static UIDs for all nodes in the tree. | ||
The vspec2id.py script is used to generate and validate static UIDs for all nodes in the tree. | ||
They will be used as unique identifiers to transmit data between nodes. The static UIDs are | ||
implemented to replace long strings like `Vehicle.Body.Lights.DirectionIndicator.Right.IsSignaling` | ||
with a 4-byte identifier. | ||
|
@@ -9,8 +9,8 @@ with a 4-byte identifier. | |
|
||
```bash | ||
usage: vspec2id.py [-h] [-I dir] [-e EXTENDED_ATTRIBUTES] [-s] [--abort-on-unknown-attribute] [--abort-on-name-style] [--format format] [--uuid] [--no-expand] [-o overlays] [-u unit_file] | ||
[-vt vspec_types_file] [-ot <types_output_file>] [--json-all-extended-attributes] [--json-pretty] [--yaml-all-extended-attributes] [-v version] [--all-idl-features] | ||
[--gqlfield GQLFIELD GQLFIELD] [--validate-static-uid VALIDATE_STATIC_UID] [--only-validate-no-export] | ||
[-q quantity_file] [-vt vspec_types_file] [-ot <types_output_file>] [--yaml-all-extended-attributes] [-v version] [--all-idl-features] | ||
[--validate-static-uid VALIDATE_STATIC_UID] [--only-validate-no-export] [--strict-mode] | ||
<vspec_file> <output_file> | ||
|
||
Convert vspec to other formats. | ||
|
@@ -27,6 +27,7 @@ IDGEN arguments: | |
Path to validation file. | ||
--only-validate-no-export | ||
For pytests and pipelines you can skip the export of the <output_file> | ||
--strict-mode Strict mode means that the generation of static UIDs is case-sensitive. | ||
``` | ||
|
||
## Example | ||
|
@@ -43,6 +44,9 @@ cd path/to/your/vss-tools | |
Great, you generated your first overlay that will also be used as your validation file as soon as you update your | ||
vehicle signal specification file. | ||
|
||
If needed you can make the static UID generation case-sensitive using the command line argument `--strict-mode`. It | ||
will default to false. | ||
|
||
### Generate e.g. yaml file with static UIDs | ||
|
||
Now if you just want to generate a new e.g. yaml file including your static UIDs, please use the overlay function of | ||
|
@@ -78,11 +82,28 @@ A.B.NewName: | |
type: actuator | ||
allowed: ["YES", "NO"] | ||
description: A.B.NewName's old name is 'OldName'. And its even older name is 'OlderName'. | ||
fka: ['A.B.OldName', 'A.B.OlderName'] | ||
fka: ['A.B.OlderName', 'A.B.OldName'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the order have any significance? |
||
``` | ||
or | ||
``` | ||
A.B.NewName: | ||
datatype: string | ||
type: actuator | ||
allowed: ["YES", "NO"] | ||
description: A.B.NewName's old name is 'OldName'. And its even older name is 'OlderName'. | ||
fka: A.B.OlderName | ||
``` | ||
|
||
As stated if you want to rename the node `A.B.NewName` to `A.NewName` you can also write the `fka` attribute | ||
stating its legacy path. | ||
In order to add fka attribute, one can add fka directly into the vspec file or use overlay feature of vss-tools. | ||
|
||
Example mycustom-overlay-fka.vspec | ||
``` | ||
A.B.NewName: | ||
datatype: string | ||
type: actuator | ||
fka: A.B.OlderName | ||
``` | ||
As stated if you want to rename the node `A.B.NewName` to `A.NewName` you can also write the Formerly Known As `fka` attribute stating its legacy path. For hashing function in previous case `A.B.OlderName` will be used. | ||
|
||
To summarize these are the `BREAKING CHANGES` that affect the hash and `NON-BREAKING CHANGES` that throw | ||
warnings only: | ||
|
@@ -93,14 +114,14 @@ warnings only: | |
| Data type | | Deprecation | | ||
| Type (i.e. node type) | | Deleted Attribute | | ||
| Unit | | Change description | | ||
| Enum values (allowed) | | | | ||
| Enum values (allowed) | | Qualified name (fka) | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a stupid question but what does "fka" means |
||
| Minimum | | | | ||
| Maximum | | | | ||
|
||
Now you should know about all possible changes. To run the validation step, please do: | ||
|
||
```bash | ||
./vspecID.py ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec ../output_id_v2.vspec --validate-static-uid ../output_id_v1.vspec | ||
./vspec2id.py ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec ../output_id_v2.vspec --validate-static-uid ../output_id_v1.vspec | ||
``` | ||
|
||
Depending on what you changed in the vehicle signal specification the corresponding errors will be triggered. | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does case sensitive mean here? That two signals
A.B
andA.b
get different UID so that renamingA.b
toA.B
is considered a name change?