Skip to content
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

feat: Add validation command #239

Merged

Conversation

gmpinder
Copy link
Member

@gmpinder gmpinder commented Oct 12, 2024

Adds JSON Schema validation for the recipes. This will print out a list of errors encountered when the recipe does not match the schema.

In order to get the schema to validate properly, we had to include the requirement of having source set to local on a locally built module. The validate command will be put under a feature flag until the v0.9 release to prevent breaking user's configs.

@gmpinder gmpinder self-assigned this Oct 12, 2024
@gmpinder gmpinder linked an issue Oct 12, 2024 that may be closed by this pull request
@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch 11 times, most recently from 5366548 to 23050ad Compare October 14, 2024 01:21
@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch 5 times, most recently from 666df3b to d3f95a2 Compare October 21, 2024 03:07
@gmpinder gmpinder marked this pull request as ready for review October 26, 2024 17:50
@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch 6 times, most recently from 0d68cd1 to 48648de Compare October 29, 2024 04:16
@xynydev
Copy link
Member

xynydev commented Oct 29, 2024

Should we implement recipe v2 next, and the announce all the breaking changes at once?
Like:

  • You should now refactor your recipes (which will automatically opt in to recipe validation)
  • But if you don't want to do that, you don't need to (yet?)
    • But if you want to opt in to recipe validation for recipe v1, you still need to add source: local for local modules

If we want a version: key for example, would it be possible to make the presence of version: 1 opt in to recipe validation for v1 recipes? Then to use v2 one would need to specify version: 2, also enabling validation.

@gmpinder
Copy link
Member Author

If we want a version: key for example, would it be possible to make the presence of version: 1 opt in to recipe validation for v1 recipes? Then to use v2 one would need to specify version: 2, also enabling validation.

I think this is a great idea to opt-in! The user shouldn't need to know the schema url to take advantage of validation (though it would be needed if they want the validation in their editors).

@gmpinder
Copy link
Member Author

Should we implement recipe v2 next, and the announce all the breaking changes at once?

Yeah I think that would be a good step. I think getting validate and new/init commands should be the last things before the v0.9 release. I'd also like to fix the whole distrobox issue #160 too, but could use some help with that since I don't use distrobox much.

@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch 2 times, most recently from d07cdd4 to 7fae4d7 Compare October 29, 2024 15:39
@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch 2 times, most recently from b50ebfd to e14c289 Compare October 30, 2024 04:17
@gmpinder gmpinder force-pushed the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch from e14c289 to fd6cab8 Compare October 30, 2024 04:35
@gmpinder gmpinder merged commit 9a3ad0a into main Oct 30, 2024
15 checks passed
@gmpinder gmpinder deleted the 186-feat-incorporate-jsonschema-for-validating-recipe-files branch October 30, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Incorporate jsonschema for validating recipe files
2 participants