-
Notifications
You must be signed in to change notification settings - Fork 44
feat!: Rework schema compatibility #342
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
base: main
Are you sure you want to change the base?
Conversation
|
I'm afraid I cannot approve this PR :-/
How can one be sure what has been written with a given schema ? Anything that the schema accepts could be in the file. I cannot make assumptions that parts of the schema were never used. If you strongly believe that it is better and it won't cause problems to the other users then feel free to merge it! |
|
I'll remove the partial compatibility and do some more testing to compare the new version with the old version (I'll see if I can get a fuzzer to run). |
|
I unfortunately couldn't get a fuzzer to work, the recursive branchy code makes it hard for the fuzzer to select new paths. I took a look at
So the new behaviour allows slightly more, but is also more honest about the compatibility. What do you think based on this table? |
e1cf3bb to
4cf0087
Compare
|
The CI checks didn't run for this PR for some reason. |
|
Ah, that was made stable in 1.88. So shall we bump the MSRV or shall I rewrite it with a match statement? Also the CI not running was me messing with target branch |
|
Let's bump! |
41f11f4 to
521c723
Compare
|
Version bumped and new lints fixed (some lints are gated behind the |
521c723 to
61b9a7c
Compare
61b9a7c to
6d70a2a
Compare
86b4128 to
6a37335
Compare
This new implementation is (in my opinion) simpler than the previous iteration and easier to modify when needed. I've introduced the concept of partial and full compatibility. Partial compatibility means that there incompatiblities but that depends on whats written, for example an enum `[A, B, C]` is partially compatible with the enum `[A, B]` but depends on what the writer has written. Users wishing to be absolutely sure, can treat `Compatibility::Partial` as an error, others can use it to slowly upgrade from an old schema.
6d70a2a to
59189d6
Compare
1cc27de to
b51892b
Compare
|
Rebased on main, and test added for resolving Decimals with different inner types. |
I think this is better overall, but I can understand if you would want to revert the
Compatibility::Partialand keep exactly to old behavior.This new implementation is (in my opinion) simpler than the previous iteration and easier to modify when needed.
I've introduced the concept of partial and full compatibility. Partial compatibility means that there incompatibilities but that depends on whats written, for example an enum
[A, B, C]is partially compatible with the enum[A, B]but depends on what the writer has written.Users wishing to be absolutely sure, can treat
Compatibility::Partialas an error, others can use it to slowly upgrade from an old schema.Depends on #339, should be rebased after that's merged