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: Automate schema validation in a github workflow job #462

Conversation

linostar
Copy link
Collaborator

@linostar linostar commented Jan 24, 2024

  • Have you signed the CLA?

A new job was added to schema.yaml workflow in order to automate the validation of Rockcraft schema.

ajv-cli tool was used for validation. It is one of the fastest and most comprehensive JsonSchema validation tools. It was used with --strict=false option to allow "format": "uri" in the schema.

ajv-cli was able to detect validation errors similarly to JsonSchema-using IDEs like VS Code and PyCharm.

@linostar linostar force-pushed the ROCKS-968/feat/automate-validation-for-generated-schema branch from 60abecd to be39eee Compare January 24, 2024 16:33
@linostar
Copy link
Collaborator Author

@cjdcordeiro @tigarmo Ready for review.

Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have an example of the execution somewhere?

.github/workflows/schema.yaml Outdated Show resolved Hide resolved
@linostar
Copy link
Collaborator Author

do you have an example of the execution somewhere?

Yes, see here for instance.

Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@tigarmo
Copy link
Collaborator

tigarmo commented Jan 25, 2024

@linostar can you add a commit that breaks that example rockcraft.yaml so we can see what a validation failure looks like?

@linostar
Copy link
Collaborator Author

linostar commented Jan 25, 2024

@linostar can you add a commit that breaks that example rockcraft.yaml so we can see what a validation failure looks like?

Sure! missing_required_test, additional_field_test and invalid_schema_test.

@tigarmo
Copy link
Collaborator

tigarmo commented Jan 25, 2024

@linostar can you add a commit that breaks that example rockcraft.yaml so we can see what a validation failure looks like?

Sure! missing_required_test, additional_field_test and invalid_schema_test.

Looks great! thanks a lot

@tigarmo tigarmo merged commit 773cd8a into canonical:main Jan 25, 2024
12 checks passed
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.

3 participants