kafka: decouple topic manager tests from Sarama - #5961
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughKafka admin authorization failures now map to a normalized non-fatal error. Admin operations use centralized Sarama error wrapping. Tests expand coverage for admin behavior and topic-manager scenarios. ChangesKafka admin error handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant KafkaAdmin as Kafka admin operation
participant Sarama as Sarama admin API
participant ErrorMapper as wrapSaramaAdminError
participant ErrorPackage as Kafka error package
KafkaAdmin->>Sarama: Execute Kafka admin operation
Sarama-->>KafkaAdmin: Return authorization or general error
KafkaAdmin->>ErrorMapper: Wrap error with operation and resource
ErrorMapper->>ErrorPackage: Classify the error
ErrorPackage-->>KafkaAdmin: Return normalized Kafka admin error
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What problem does this PR solve?
Issue Number: close #5885
Kafka topic manager tests depend on Sarama-specific authorization errors. This couples the behavior tests to the current Kafka client implementation and makes them harder to reuse during the franz-go migration tracked by #5881.
What is changed and how it works?
ErrKafkaAdminAuthorizationFailederror.AdminClientmock and TiCDC-owned errors instead of Sarama types.Check List
Tests
Questions
Will it cause performance regression or break compatibility?
No. The change only normalizes Kafka admin authorization errors at the adapter boundary and preserves the existing topic manager fallback behavior.
Do you need to update user documentation, design documentation or monitoring documentation?
No.
Release note