fix(id): output into two files when structs present - #556
Open
jdacoello wants to merge 1 commit into
Open
Conversation
Signed-off-by: JD Alvarez <8550265+jdacoello@users.noreply.github.com>
sschleemilch
approved these changes
Aug 28, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses an issue introduced by #528
Problem
vspec export idwrites static UIDs (staticUID) for every node in the tree into a single flat, FQN-keyed YAML dict, which is meant to be re-loaded as a normal vspec/overlay file downstream.When
--typeswas supplied, the struct/type tree's nodes were merged into that same dict as the main tree's nodes. Since both the main tree's root (e.g.Vehicle) and the types tree's root (e.g.Types) are separator-less top-level keys, the generated file ended up with two roots. Feeding that file back into any othervss-toolscommand (as--overlays) then failed withMultipleRootsException, since a single vspec file is only allowed to have one root.Root cause
In id.py's
cli(), both trees were exported into the same dict:Other exporters (
json,yaml,csv, binary) already had a--types-outputoption to write type/struct data to a separate file — id.py never wired it up, even though id.md already (incorrectly) documented it as if it existed.Fix
--types-outputtovspec export id, consistent with other exporters.--types-outputis optional: if--typesis used and--types-outputis not given, the tool now derives a default name automatically:structs_<output-filename>written next to--output(e.g.--output out.vspec→structs_out.vspec).-l/--overlays, types output as-t/--types— replacing, not supplementing, the original types file).--types-outputand the new default-naming fallback.Usage change
Testing
--types-outputis explicit and when it's omitted (defaultstructs_naming).id/struct-related test suite passes (157 passed); 2 pre-existing, unrelated protobuf test failures confirmed to exist onmainas well.