-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add a pre-commit for validating zarf schema #379
Conversation
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.
Lgtm, just tested and it rejected as expected.
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.
We will need to look into this some more. This only checks the zarf.yaml
for init packages and isn't fully verifying that the generated schema actually is correct. Would it be simpler to just run zarf tools config-schema > zarf.schema.json
in a pre-commit step?
It's not quite this simple, but yes, it should be along these lines. |
I would like to merge this PR, as what it is doing is still valuable, just without closing #216. |
Though, it would be better to have the hook check all |
Cool, then yeah, I'd like to merge this, just without closing #216 |
If we're going to do something like that I would rather do it in an automated pipeline instead of a pre-commit hook.
|
It doesn't need to "be built", it could be |
The pre-commit hooks don't have to be run locally, though once we turn on verification of them in the pipeline it will be a lot easier to run them locally then get the feedback loop on what still needs to be fixed from the pipeline. My vision for the pipeline is that it will run |
Doing so will require certain CLI tools to be installed on the developer's machine, such as |
ab81956
to
a7c18ef
Compare
* add pre-commit for validating zarf schema * pre-commit hook to make sure zarf schema is current
Description
Add a pre-commit hook that will validate that the ZarfInitConfig
./zarf.yaml
confirms to the schema defined at./zarf.schema.json
. This will help prevent issues where developers update the init config without updating the schema.Related Issue(s)
Fixes #216