osbuild: compare Go against JSON#2529
Open
supakeen wants to merge 1 commit into
Open
Conversation
New test that parses the Go implementation of the `osbuild` stages using the `ast` module (this was quite a bit of work, but surprisingly straightforward even if verbose). Ensures types in the JSON files match types in the Go files, including any type aliases. Outputs informational bits about missing properties on the Go side or osbuild side. Outputs information about stages that in osbuild that do not have any Go counterpart. Does *not* properly validate `anyOf`/`enum`/etc. But this basic validation is already helpful and followups are very possible. By default looks in `/usr/lib/osbuild`; if no stages can be found the test is skipped. Custom directory can be passed through `TEST_OSBUILD_STAGES_DIR`. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
supakeen
force-pushed
the
read-osbuild-stage-schemas
branch
from
July 19, 2026 06:31
f69744f to
5e94b00
Compare
Contributor
|
A commit title like 'osbuild: Verify stage metadata JSON' might be better. Just looking at the title I wasn't sure what was going on until I read the description :) |
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.
New test that parses the Go implementation of the
osbuildstages using theastmodule (this was quite a bit of work, but surprisingly straightforward even if verbose).Ensures types in the JSON files match types in the Go files, including any type aliases.
Outputs informational bits about missing properties on the Go side or osbuild side. Outputs information about stages that in osbuild that do not have any Go counterpart.
Does not properly validate
anyOf/enum/etc. But this basic validation is already helpful and followups are very possible.By default looks in
/usr/lib/osbuild; if no stages can be found the test is skipped. Custom directory can be passed throughTEST_OSBUILD_STAGES_DIR.Example (verbose) output: