-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support unchanged status on schemas #344
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
251f13b
Handling unchanged status for schema
AlexisSouquiere 219963c
Fixing tests
AlexisSouquiere 0b7374a
Fixing repositories
AlexisSouquiere 0976934
Fixing checkstyle issues
AlexisSouquiere 61a084d
Light refactoring
AlexisSouquiere 6f8987b
Check all the subject versions for unchanged schema
AlexisSouquiere b503449
Fix checkstyle
AlexisSouquiere 08ddc10
Complete integration test for avro references
AlexisSouquiere 8b8f79e
Add schema with references in docker demo. Fix NPE on unknown referen…
loicgreffier c4be16b
Simplify references validation
loicgreffier 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Schema | ||
metadata: | ||
name: abc.header-value | ||
spec: | ||
schema: | | ||
{ | ||
"namespace": "io.github.michelin.ns4kafka.avro", | ||
"type": "record", | ||
"name": "KafkaHeader", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"type": "long" | ||
} | ||
] | ||
} | ||
--- | ||
apiVersion: v1 | ||
kind: Schema | ||
metadata: | ||
name: abc.person-value | ||
spec: | ||
schema: | | ||
{ | ||
"namespace": "io.github.michelin.ns4kafka.avro", | ||
"type": "record", | ||
"name": "KafkaPerson", | ||
"fields": [ | ||
{ | ||
"name": "header", | ||
"type": "io.github.michelin.ns4kafka.avro.KafkaHeader" | ||
}, | ||
{ | ||
"name": "firstName", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "lastName", | ||
"type": "string" | ||
} | ||
] | ||
} | ||
references: | ||
- name: io.github.michelin.ns4kafka.avro.KafkaHeader | ||
subject: abc.header-value | ||
version: 1 |
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
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
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
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 think this:
could be now simplified to this:
Since we now use the canonical string to compute the status, we do not need the schema registry response for the final HTTP response, what do you think ? I'm gonna try this out
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.
In case of reapplying a schema v1 that already has been deployed, the schema registry will return the ID of the schema v1 without any change (unchanged status). In this case, Ns4Kafka will return "changed"
The previous implementation will return "unchanged" as expected, except in dry-run mode that will return "changed" 😅
The "newSchema" parameter needs to be different from all schemas version to be considered "changed", not only the latest one