Skip to content

Migrate inmemorychannel to use v2 cloudevents bindings#2813

Merged
knative-prow-robot merged 13 commits into
knative:masterfrom
nlopezgi:issue2664
Apr 7, 2020
Merged

Migrate inmemorychannel to use v2 cloudevents bindings#2813
knative-prow-robot merged 13 commits into
knative:masterfrom
nlopezgi:issue2664

Conversation

@nlopezgi
Copy link
Copy Markdown
Contributor

@nlopezgi nlopezgi commented Mar 23, 2020

Signed-off-by: Nicolas Lopez ngiraldo@google.com

Fixes #2664

Proposed Changes

  • InMemoryChannel has a new message_dispatcher.go that uses the bindings API

ptal @slinkydeveloper

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 23, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 23, 2020
@slinkydeveloper
Copy link
Copy Markdown
Contributor

/assign

Comment thread pkg/kncloudevents/good_client.go Outdated
@n3wscott
Copy link
Copy Markdown
Contributor

This might help you: cloudevents/sdk-go#418

@nlopezgi
Copy link
Copy Markdown
Contributor Author

This might help you: cloudevents/sdk-go#418

Thanks for the pointer!

@nlopezgi
Copy link
Copy Markdown
Contributor Author

this is ready for review ptal @slinkydeveloper

@nlopezgi nlopezgi changed the title [WIP]: migrate inmemorychannel to use v2 cloudevents bindings Migrate inmemorychannel to use v2 cloudevents bindings Mar 24, 2020
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 24, 2020
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 24, 2020
@slinkydeveloper
Copy link
Copy Markdown
Contributor

Cool! Now let's see if tests like it

Comment thread pkg/inmemorychannel/message_dispatcher.go Outdated
@nlopezgi
Copy link
Copy Markdown
Contributor Author

not sure why the unit tests failed, they pass locally on my env, will wait for integration tests to see if those pass or fail.

@nlopezgi
Copy link
Copy Markdown
Contributor Author

Looks like integration tests failed as well. Will debug and ping back once I have them passing.

logger *zap.Logger
type InMemoryMessageDispatcher struct {
handler *swappable.MessageHandler
httpBindingsReceiver *kncloudevents.HttpMessageReceiver
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice nice nice

@n3wscott
Copy link
Copy Markdown
Contributor

try locally with --race it might be that something is assuming it can bind to a port and it is true if the tests are not run at the same time?

@nlopezgi nlopezgi force-pushed the issue2664 branch 2 times, most recently from 6cf3b0f to f5f975a Compare March 24, 2020 23:36
@nlopezgi
Copy link
Copy Markdown
Contributor Author

Looks like the integration tests are not liking the new inmemorychannel message_dispatcher. I tried to debug but could not find anything off (particularly from comparing my changes vs the ones in channel/message_receiver.go vs channel/event_receiver.go that jumps out as the cause of the issues. Error logs point to the inmemyrchannel-controller being unable to properly create triggers.
Please let me know if anyone has ideas as to how to debug this.

wrt unit tests I dont know why they are failing either, the strangest bit is the test result does not match what I get in my local dev env. I also tried running tests with --race but did not get any different results locally.

Comment thread pkg/inmemorychannel/message_dispatcher.go Outdated
Comment thread pkg/inmemorychannel/message_dispatcher.go
@slinkydeveloper
Copy link
Copy Markdown
Contributor

I'm trying to run the tests by myself today and check if i can find the problem hidden somewhere

@slinkydeveloper
Copy link
Copy Markdown
Contributor

slinkydeveloper commented Apr 6, 2020

@nlopezgi
Copy link
Copy Markdown
Contributor Author

nlopezgi commented Apr 6, 2020

This should be ready to go once #2917 is in

@slinkydeveloper
Copy link
Copy Markdown
Contributor

/reopen

@knative-prow-robot
Copy link
Copy Markdown
Contributor

@slinkydeveloper: Reopened this PR.

Details

In response to this:

/reopen

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.

@slinkydeveloper
Copy link
Copy Markdown
Contributor

#2917 done!

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/inmemorychannel/message_dispatcher.go Do not exist 18.8%

@knative-prow-robot
Copy link
Copy Markdown
Contributor

knative-prow-robot commented Apr 7, 2020

@nlopezgi: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-go-coverage 25f765c link /test pull-knative-eventing-go-coverage

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@nlopezgi
Copy link
Copy Markdown
Contributor Author

nlopezgi commented Apr 7, 2020

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 7, 2020
@nlopezgi
Copy link
Copy Markdown
Contributor Author

nlopezgi commented Apr 7, 2020

This is now ready for review @n3wscott @slinkydeveloper integration tests and unit tests are all passing.

@slinkydeveloper
Copy link
Copy Markdown
Contributor

@nlopezgi you need to cover a little bit more pkg/inmemorychannel/message_dispatcher.go to make the coverage check happy

Copy link
Copy Markdown
Contributor

@slinkydeveloper slinkydeveloper left a comment

Choose a reason for hiding this comment

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

/lgtm let's get this in

@n3wscott
Copy link
Copy Markdown
Contributor

n3wscott commented Apr 7, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 7, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: n3wscott, nlopezgi, slinkydeveloper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 7, 2020
@knative-prow-robot knative-prow-robot merged commit ca7609c into knative:master Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use new cloudevents/bindings in In Memory Channel dispatcher

8 participants