-
Notifications
You must be signed in to change notification settings - Fork 600
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
Migrate jobrunner to cloudevent v2 #2867
Conversation
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.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
const () | ||
|
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.
Format Go code:
const () |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lionelvillard 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 |
pkg/kncloudevents/v2/cloudevents.go
Outdated
@@ -63,14 +64,14 @@ var _ cloudevents.Client = (*client)(nil) | |||
func (c *client) Send(ctx context.Context, out event.Event) error { | |||
c.applyOverrides(ctx, &out) | |||
err := c.ceClient.Send(ctx, out) | |||
return c.reportCount(ctx, out, err) | |||
return c.reporter.ReportCount(ctx, out, err) | |||
} | |||
|
|||
// Request implements client.Request | |||
func (c *client) Request(ctx context.Context, out event.Event) (*event.Event, error) { | |||
c.applyOverrides(ctx, &out) |
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.
overrides are only for sources.
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.
not sure what to do here. Can you expand?
/hold The cloudevents client created in adapter/v2 is for Adapters only. Please do not move it out of that area. |
right. That make me think that the jobrunner should also move under adapter then. |
jobrunner is a pretty bad name for this. It is not a generic component, it really only services pingsource so maybe you should call it |
748bc17
to
a6e0993
Compare
@n3wscott can the hold be removed? |
@@ -71,10 +84,13 @@ func (c *TestCloudEventsClient) Sent() []cloudevents.Event { | |||
return r | |||
} | |||
|
|||
func NewTestClient() *TestCloudEventsClient { | |||
func NewTestClient(reporter source.StatsReporter) *TestCloudEventsClient { |
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.
there is no reason to test that the test cloudevents client uses the test stats reporter.
reporter := &mockReporter{} | ||
ce := kncetesting.NewTestClient() | ||
reporter := &MockStatsReporter{} | ||
ce := adaptertesting.NewTestClient(reporter) |
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.
It is now the job of the adapter to test that metrics are collected or not, not the job runner.
/unhold |
/assign |
The following is the coverage report on the affected files.
|
/lgtm |
Proposed Changes
Release Note
Docs