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

thema: Add compat checking cases, improve errors #153

Merged
merged 4 commits into from
May 17, 2023

Conversation

sdboyer
Copy link
Contributor

@sdboyer sdboyer commented May 17, 2023

This PR separates out a clear pattern within the invalidlineages testdata corpus for checking backwards compatibility invariants on schemas. It accomplishes this through negation - defining a series of schemas that violate a particular rule, and expecting that BindLineage throws an error when encountering such a case. This approach is sufficient to establish the rule, because the law of the excluded middle applies in this case - every schema relation is either backwards compatible, xor not, and every syntactic version numbering either adheres to that, xor not.

As indicated by several of these cases being in the ToDo list for TestInvalidLineages, Thema's checkers do not yet catch all of these cases.

The error output is also somewhat improved here, though we are not yet doing a reliably good job of providing line-level feedback in the way that we really ought to according to the principles outlined in #44.

Finally, this also fixes a huge 🤦🏻 - when doing backwards compatibility checking, the parameters being passed to compat.ThemaCompatible() were reversed, resulting in checking if e.g. 0.0 was backwards compatible with 0.1, rather than vice-versa.

cc @joanlopez @mildwonkey

@sdboyer sdboyer added the enhancement New feature or request label May 17, 2023
Copy link
Contributor

@joanlopez joanlopez left a comment

Choose a reason for hiding this comment

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

Looks great!

@sdboyer sdboyer merged commit fe255a5 into main May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants