-
Notifications
You must be signed in to change notification settings - Fork 92
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: Apply schema validation to all topics in local development #2013
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b2da267
feat: Apply schema validation to all topics in local development
untitaker 76f2ded
add missing cfg debug_assertions
untitaker 9480347
Merge branch 'master' into feat/validate-schemas-in-devserver
untitaker 13301a0
bump sentry-kafka-schemas
untitaker 6d484e3
fix clippy
untitaker 4b38eab
changelog
untitaker 66a9f7d
feat(kafka): Cache schemas for validation (#2028)
jjbayer 2b0f28c
Merge branch 'master' into feat/validate-schemas-in-devserver
untitaker 226cd44
bump sentry-kafka-schemas and improve metrics logging
untitaker cb2d0dd
Merge branch 'master' into feat/validate-schemas-in-devserver
untitaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder if it would make sense to hide the
jsonschema
dependency insentry-kafka-schemas
. That is, if we removed this dependency here, andsentry-kafka-schemas
exposed avalidate(topic, message)
function.That way, the library client (Relay) would not have to deal with compiling schemas, and the way that
sentry-kafka-schemas
validates would be completely encapsulated (i.e. you could change the library or even the format it uses for schema definition and validation).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.
See my reply to the local cache comment. For now I would like to avoid that. There's still many unsolved questions around how the workflow in Relay will look like, what performance requirements we have on the entire system, etc.
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.
OK! Definitely not a blocker.
Makes sense, though this could be solved with cargo features. I.e. there could be a
codegen
feature and avalidation
feature, and clients use either-or. My gut feeling is that 90% of clients that want to perform validation will not care about what schema definition language or validation library is used under the hood, hence the idea to hide it inside the library.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'm reconsidering my response now. one of the reasons i was hesitant to change this was because python currently also works the same (it just exposes the raw schema, doesn't prescribe a schema validation library)
but at the same time it would be good to have a vetted recommended library that everybody ought to use (for both python and rust)