-
Notifications
You must be signed in to change notification settings - Fork 119
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
Knative error extensions #2374
Knative error extensions #2374
Conversation
Welcome @egorlepa! It looks like this is your first PR to knative-sandbox/eventing-kafka-broker 🎉 |
Hi @egorlepa. Thanks for your PR. I'm waiting for a knative-sandbox member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Codecov Report
@@ Coverage Diff @@
## main #2374 +/- ##
============================================
+ Coverage 62.31% 62.42% +0.10%
- Complexity 708 714 +6
============================================
Files 146 146
Lines 10100 10132 +32
Branches 225 229 +4
============================================
+ Hits 6294 6325 +31
- Misses 3373 3376 +3
+ Partials 433 431 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@egorlepa thanks for putting this PR together, I looks nice! I will review this tomorrow. Glad to see your contribution here 🎉 |
@matzew ok, cool. i'll fix e2es tomorrow |
.onSuccess(v -> onDeadLetterSinkSuccess(recordContext, finalProm)) | ||
.onFailure(ex -> onDeadLetterSinkFailure(recordContext, ex, finalProm)); | ||
// enhance event with extension attributes prior to forwarding to the dead letter sink | ||
ConsumerRecordContext transformedRecordContext = errorTransform(recordContext, response); |
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'd prefer using final
as much as possible, to express objects are not mutable.
See other classes for examples. That would be really my only "nit" comment on the code 😄
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.
ok, no problem. i mainly use golang and kotlin nowadays, almost forgot how to talk in java :) kotlin has nice val/var for this purpose
@egorlepa it would be nice if we had a little e2e test for this in here: https://github.com/knative-sandbox/eventing-kafka-broker/tree/main/test/e2e_new |
/test unit-tests_eventing-kafka-broker_main |
/test unit-tests_eventing-kafka-broker_main |
test/e2e_new/dls_extenisons_test.go
Outdated
@@ -0,0 +1,169 @@ | |||
//go:build e2e | |||
// +build e2e |
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.
dls_extenisons_test.go
: there is a little typo in extensions
/retest |
test/e2e_new/dls_extensions_test.go
Outdated
fmt.Println("dead letter sink is not addressable", err) | ||
} | ||
fmt.Println("dead letter sink address: ", dlsAddress.Path) | ||
return cetest.HasExtension("knativeerrordest", dlsAddress.Path) |
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.
we need to include the scheme, etc
return cetest.HasExtension("knativeerrordest", dlsAddress.Path) | |
return cetest.HasExtension("knativeerrordest", dlsAddress.String()) |
test/e2e_new/dls_extensions_test.go
Outdated
)) | ||
f.Setup("trigger is ready", trigger.IsReady(triggerName)) | ||
|
||
f.Setup("install source", eventshub.Install( |
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.
f.Setup("install source", eventshub.Install( | |
f.Requirement("install source", eventshub.Install( |
This will make sure that we send the event only after the Broker is ready because every step at the same phase (for example, Setup
) will run in parallel.
test/e2e_new/dls_extensions_test.go
Outdated
)) | ||
f.Setup("trigger is ready", trigger.IsReady(triggerName)) | ||
|
||
f.Setup("install source", eventshub.Install( |
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.
f.Setup("install source", eventshub.Install( | |
f.Requirement("install source", eventshub.Install( |
Same reasoning.
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
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.
/lgtm
/approve
/retest |
/retest-required |
/test reconciler-tests_eventing-kafka-broker_main |
/test reconciler-tests-namespaced-broker_eventing-kafka-broker_main |
/test integration-tests-namespaced-broker_eventing-kafka-broker_main |
/test integration-tests_eventing-kafka-broker_main |
/test reconciler-tests_eventing-kafka-broker_main |
/test reconciler-tests-namespaced-broker_eventing-kafka-broker_main |
/test integration-tests-namespaced-broker_eventing-kafka-broker_main |
/retest |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: egorlepa, matzew The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-1.6 |
/cherry-pick release-1.5 |
@matzew: new pull request created: #2547 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@matzew: #2374 failed to apply on top of branch "release-1.5":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
* enhancing failed events with knativeerror* extensions before sending to dls * enhancing failed events with knativeerror* extensions before sending to dls * fix star import * final vars & e2e draft * e2es * upgrade reconciler-test package, fix e2es * fix e2es * fix e2es * fix e2es * fix e2es * fix eventshub.SendMultipleEvents call * fix time import * More import fixes Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Populating response from ResponseFailureException Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fixing tests Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
* Knative error extensions (knative-extensions#2374) * enhancing failed events with knativeerror* extensions before sending to dls * enhancing failed events with knativeerror* extensions before sending to dls * fix star import * final vars & e2e draft * e2es * upgrade reconciler-test package, fix e2es * fix e2es * fix e2es * fix e2es * fix e2es * fix eventshub.SendMultipleEvents call * fix time import * More import fixes Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Populating response from ResponseFailureException Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fixing tests Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com> * Remove due to incorrect deps Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: egorlepa <76429849+egorlepa@users.noreply.github.com>
* enhancing failed events with knativeerror* extensions before sending to dls * enhancing failed events with knativeerror* extensions before sending to dls * fix star import * final vars & e2e draft * e2es * upgrade reconciler-test package, fix e2es * fix e2es * fix e2es * fix e2es * fix e2es * fix eventshub.SendMultipleEvents call * fix time import * More import fixes Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Populating response from ResponseFailureException Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fixing tests Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
* Knative error extensions (knative-extensions#2374) * enhancing failed events with knativeerror* extensions before sending to dls * enhancing failed events with knativeerror* extensions before sending to dls * fix star import * final vars & e2e draft * e2es * upgrade reconciler-test package, fix e2es * fix e2es * fix e2es * fix e2es * fix e2es * fix eventshub.SendMultipleEvents call * fix time import * More import fixes Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Populating response from ResponseFailureException Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> * Fixing tests Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com> * Remove due to incorrect deps Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Signed-off-by: Matthias Wessendorf <mwessend@redhat.com> Co-authored-by: egorlepa <76429849+egorlepa@users.noreply.github.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
Fixes #2340
Release Note