-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix: align transitive compatibility checks #953
fix: align transitive compatibility checks #953
Conversation
c32cfaf
to
9f1c54b
Compare
9f1c54b
to
3cce148
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
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.
I think the code its nice, the feature its well tested.
I'm still not fully convinced by the use of mocks, I think they can couple the way of a certain result its computed.
I would much more like a test where you give the input and the real implementation does the logic and you check the outcome, its a type of testing that makes the refactor much less painful since you don't need to change the assertions not being coupled by the names of the functions and the order in which they are called
3cce148
to
d4b7cc0
Compare
bec59e5
to
d98176e
Compare
bd499aa
to
2a7a250
Compare
Rebased and fixed conflicts |
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.
Almost there, except for a couple of changes great great job!
I like much more those tests, I can read them and understand them really well, thanks for the hard work 🚀
2a7a250
to
ae427bf
Compare
This in preparation for the fix for [EC-289]. - Move schema compatibility related code from __init__.py to its own module (schema_compatibility.py) - Refactor logic in: - Schema registering endpoint (`/subjects/<subject-key>/versions`) - Schema compatibility endpoint (`/compatibility/subjects/<subject-key>/versions/latest`)
Make so that the transitive compatibility checks that are done in the schema creation endpoint are also done in the schema validation endpoint. In the creation endpoint (`/subjects/<subject-key>/versions`), if the compatibility mode is transient then the new schema is checked against all schemas. In the validation endpoint (`/compatibility/subjects/<subject-key>/versions/<schema-version>`): - Before this fix, only the latest schema is checked against (even in case of transitive mode) - After this fix, in case of transitive mode then all schema are checked against. Note that in this case the version provided in the POST request (`<schema-version>`) is ignored.
ae427bf
to
5d58f68
Compare
@eliax1996 I should I have address all comments, thanks for your detailed review! |
5d58f68
to
e208a39
Compare
e208a39
to
429e18c
Compare
About this change - What it does
Make so that the transitive compatibility checks that are done in the
schema creation endpoint are also done in the schema validation
endpoint.
In the creation endpoint (
/subjects/<subject-key>/versions
), if thecompatibility mode is transient then the new schema is checked against
all schemas.
In the validation endpoint (
/compatibility/subjects/<subject-key>/versions/<schema-version>
):case of transitive mode)
checked against.
Note that in this case the version provided in the POST request
(
<schema-version>
) is ignored.Also includes some preparation refactorings and some additional tests in separate commits.
Why this way
The refactorings are needed to avoid code duplication.
An alternative solution would be to allow querying the validation endpoint with no version (
/compatibility/subjects/<subject-key>
), and apply the fix only in that case.