Migrate jobrunner to cloudevent v2#2867
Conversation
mattmoor
left a comment
There was a problem hiding this comment.
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.
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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
|
||
| // 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.
overrides are only for sources.
There was a problem hiding this comment.
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? |
| } | ||
|
|
||
| func NewTestClient() *TestCloudEventsClient { | ||
| func NewTestClient(reporter source.StatsReporter) *TestCloudEventsClient { |
There was a problem hiding this comment.
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.
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