-
Notifications
You must be signed in to change notification settings - Fork 285
Kafka response #3114
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
base: main
Are you sure you want to change the base?
Kafka response #3114
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (50.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3114 +/- ##
==========================================
+ Coverage 79.68% 80.03% +0.34%
==========================================
Files 1149 1203 +54
Lines 21194 24046 +2852
Branches 4083 4873 +790
==========================================
+ Hits 16889 19245 +2356
- Misses 3604 4079 +475
- Partials 701 722 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hi @itsarijitray please ping me over Slack when you'd like me to review. |
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.
Pull Request Overview
This PR adds Kafka response emulation functionality to track HTTP requests/responses for the Kafka destination action. The change introduces error handling, HTTP response emulation, and comprehensive Kafka error code mappings to provide better observability and error reporting.
- Adds HTTP response emulation capability to the request client
- Implements comprehensive Kafka error handling with proper HTTP status code mappings
- Updates Kafka send operations to use request client for tracking and error handling
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/destination-actions/src/destinations/kafka/utils.ts | Adds request client parameter to sendData function and implements HTTP response emulation for successful/failed Kafka operations |
packages/destination-actions/src/destinations/kafka/send/index.ts | Updates perform functions to pass request client to sendData and return the result |
packages/destination-actions/src/destinations/kafka/errors.ts | Adds comprehensive Kafka error code mapping and error handling functionality |
packages/core/src/request-client.ts | Adds emulateHttpResponse option to RequestOptions for HTTP response emulation |
packages/core/src/tests/create-request-client.test.ts | Adds test coverage for the new HTTP response emulation feature |
Comments suppressed due to low confidence (2)
packages/destination-actions/src/destinations/kafka/errors.ts:229
- The
settings.brokers
parameter is passed twice tohandleKafkaError
- once as theurl
parameter and again as thedefaultMessage
parameter. The second parameter should be a meaningful error message string, not the brokers array.
kafkaStatus: 'NOT_ENOUGH_REPLICAS_AFTER_APPEND',
packages/destination-actions/src/destinations/kafka/errors.ts:239
- The
settings.brokers
parameter is passed twice tohandleKafkaError
- once as theurl
parameter and again as thedefaultMessage
parameter. The second parameter should be a meaningful error message string, not the brokers array.
kafkaStatus: 'INVALID_REQUIRED_ACKS',
* @param defaultMessage - Default error message if no specific mapping found | ||
* @returns IntegrationError or RetryableError based on error type | ||
*/ | ||
export async function handleKafkaError( |
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.
The large KafkaErrorMap (lines 14-1107) is not being used in the handleKafkaError function. The function only checks if the error is retriable or not, but doesn't utilize the comprehensive error mapping that was defined. Consider either using the error map to provide more specific error handling or removing the unused mapping.
Copilot uses AI. Check for mistakes.
A summary of your pull request, including the what change you're making and why.
Testing
Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.