Skip to content
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: embed avro schema id #3118

Merged
merged 7 commits into from
Mar 22, 2023
Merged

feat: embed avro schema id #3118

merged 7 commits into from
Mar 22, 2023

Conversation

fracasula
Copy link
Collaborator

@fracasula fracasula commented Mar 20, 2023

Description

Pull request to enable customers (i.e. CARS) to optionally have the schemaID embedded in the message payload.

This is compliant with the way Confluent libraries do it but it would break the workflow of existing customers using the Avro functionality (three at the moment). That is the reason why I decided to have it behind an optional flag (i.e. embedAvroSchemaID bool).

I've added a new TestAvroSchemaRegistry where I'm testing both ways of sending Avro messages. One with the schemaID not embedded (existing customers) and one with the schemaID embedded (for CARS).

Sidenote

This is now live in the customer namespace. It's been tested by them and they are happy with the changes.

Notion Ticket

< Notion Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 75.45% and project coverage change: +0.04 🎉

Comparison is base (7becd87) 52.25% compared to head (046b99b) 52.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3118      +/-   ##
==========================================
+ Coverage   52.25%   52.30%   +0.04%     
==========================================
  Files         318      318              
  Lines       52312    52390      +78     
==========================================
+ Hits        27337    27400      +63     
- Misses      23362    23368       +6     
- Partials     1613     1622       +9     
Impacted Files Coverage Δ
...rvices/streammanager/kafka/client/testutil/util.go 72.72% <0.00%> (+4.20%) ⬆️
services/streammanager/kafka/kafkamanager.go 76.75% <64.28%> (-0.03%) ⬇️
testhelper/destination/kafka/kafka.go 80.70% <86.15%> (ø)

... and 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -329,7 +332,15 @@ func NewProducer(destination *backendconfig.DestinationT, o common.Opts) (*Produ
if err != nil {
return nil, err
}
return &ProducerManager{p: p, timeout: o.Timeout, codecs: codecs}, nil

// @TODO embedAvroSchemaID should come from control plane (i.e. destination config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we add config-based support for this already & let it be overridden through this environment variable for the time being? That way, as soon as control plane is ready with their changes, the only thing we'll need to do is to remove the override.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration needs to be reworked anyway and if I understand correctly the whole thing will be picked up by @saurav-malani. He'll make it proper don't worry 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants