-
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
Protobuf use static uid #344
Conversation
MoM:
|
docs/vspec2proto.md
Outdated
## Example | ||
|
||
```bash | ||
./vspec2protobuf.py outputIds_v2.vspec indentity.proto -q ../vehicle_signal_specification/spec/quantities.yaml -u ../vehicle_signal_specification/spec/units.yaml --static-uid --add-optional |
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.
Do you also get warnings like:
WARNING Attribute(s) staticUID in element Major not a core or known extended attribute.
In https://github.com/COVESA/vss-tools/blob/master/docs/vspec2id.md#generate-eg-yaml-file-with-static-uids they include -e staticUID
in examples to avoid warnings
I am thinking if we promote staticUID
to a core_attributes
so that you never get a warning. Thoughts @adobekan
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.
Yes, I do get these warnings too. I thought this would be "normal" since staticUID
is not a core_attributes
. So thanks for the hint of how to avoid the warnings. I will have a look into it.
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.
Short term I think you could just add -e staticUID
in the example. But I am thinking of the long term solution where I see multiple alternatives:
- Promote
staticUID
as an allowed/core attribute for all tools always - Add it in some way as core-attribute for the specific tool, regardless of whether
--static-uid
is used or not - Add it only if
--static-uid
is used
For the last two alternatives we should find a common mechanism that can reused by all tools. I anyway not see it as a topic for this PR.
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.
The documentation now contains an example with the parameter -e staticUID
.
@eriksven |
MoM:
|
Signed-off-by: Sven Erik Jeroschewski <svenerik.jeroschewski@bosch.com>
Signed-off-by: Sven Erik Jeroschewski <svenerik.jeroschewski@bosch.com>
286218f
to
09864f4
Compare
…not have staticUID attribute Signed-off-by: Sven Erik Jeroschewski <svenerik.jeroschewski@bosch.com>
Unfortunately, I am not able to join the meeting today. But I could join one of the next meetings. |
MoM:
|
MoM:
|
* adds option to make fields optional in protobuf generator * adds Documentation for proto generator * makes vss2proto fail when running with staticUID flag but found does not have staticUID attribute Signed-off-by: Sven Erik Jeroschewski <svenerik.jeroschewski@bosch.com>
This PR extends the protobuf generator to use the static-uid which would be created in a previous step with vspec2id generator. The PR also adds the feature to make all fields in the generated protobuf file to optional.
Using the static-uids has some drawbacks but the previously existing approach of using incremental field identifiers has some issue regarding backwards compatibility. Because of that I want to propose the alternative solution of using the static-uids. More details on the advantages and drawbacks of both approaches are available in the new vspec2proto.md Documentation.