karapace icon indicating copy to clipboard operation
karapace copied to clipboard

feat: enable users to disable validation only on specific topics

Open eliax1996 opened this issue 1 year ago • 6 comments

This PR enables users to avoid validation only on specific topics. It is necessary because, prior to this commit it was possible to create messages with incorrect or missing subjects. By fixing the validation of subject flows that were previously functioning (but shouldn't have been) now no longer work due to the added validation.

With this PR, users can migrate their flows one by one while adding new validated flows, rather than opting out of validation completely if they wish to retain the functionality of old flows without refactoring them.

eliax1996 avatar Nov 09 '23 11:11 eliax1996

Thank you so much, @eliax1996! We are now struggling from disability of publishing new schemes for existing topics.

GSokol avatar Nov 09 '23 16:11 GSokol

@GSokol glad to know that this would help. I will create a new optional release in Aiven as soon as it is merged.

eliax1996 avatar Nov 09 '23 18:11 eliax1996

Also it's good to have a config setting, to disable schema validation by default. But it could be done in a separate PR to make this thing in faster.

GSokol avatar Nov 15 '23 09:11 GSokol

@GSokol this is already implemented (and merged and available in Aiven), if you look there is a config called name_strategy_validation that if set to false disable the validation. This PR is just to enable the users to explicitly disable the validation only on a specific subset of topics since using the validation brings more order to the topics (otherwise it's basically like Kafka vanilla where you can write anything in a topic)

In that way, users who didn't follow a validation strategy in the past can now start using it without losing or having to rewrite the existing flows but they can enforce the validation on the new ones

eliax1996 avatar Nov 15 '23 10:11 eliax1996

@eliax1996, name_strategy_validation is only used in the REST API logic.

GSokol avatar Nov 16 '23 08:11 GSokol

Hi @GSokol, you wrote that

name_strategy_validation is only used in the REST API logic.

and it made me curious about your expectations regarding this feature. This PR adds ability to disable validation per topic, but also this configuration affects only REST API logic. I hope this still matches your expectations.

tvainika avatar Nov 23 '23 07:11 tvainika