Skip to content

Migrate jobrunner to cloudevent v2#2867

Merged
knative-prow-robot merged 7 commits into
knative:masterfrom
lionelvillard:mt-ping-cev2
Apr 1, 2020
Merged

Migrate jobrunner to cloudevent v2#2867
knative-prow-robot merged 7 commits into
knative:masterfrom
lionelvillard:mt-ping-cev2

Conversation

@lionelvillard
Copy link
Copy Markdown
Contributor

Proposed Changes

  • JobRunner now uses the CloudEvent V2 API
  • Reorganize a bit knCloudEvent

Release Note


Docs

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 30, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 30, 2020
Copy link
Copy Markdown
Member

@mattmoor mattmoor left a 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)

Comment on lines +26 to +27
const ()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Format Go code:

Suggested change
const ()

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[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

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 Mar 30, 2020
Comment thread pkg/kncloudevents/v2/cloudevents_test.go
Comment thread pkg/kncloudevents/v2/metrics/metrics.go
Comment thread pkg/adapter/v2/main.go Outdated
Comment thread pkg/kncloudevents/v2/cloudevents.go

// Request implements client.Request
func (c *client) Request(ctx context.Context, out event.Event) (*event.Event, error) {
c.applyOverrides(ctx, &out)
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.

overrides are only for sources.

Copy link
Copy Markdown
Contributor Author

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?

@n3wscott
Copy link
Copy Markdown
Contributor

/hold

The cloudevents client created in adapter/v2 is for Adapters only. Please do not move it out of that area.

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 30, 2020
@lionelvillard
Copy link
Copy Markdown
Contributor Author

right. That make me think that the jobrunner should also move under adapter then.

@n3wscott
Copy link
Copy Markdown
Contributor

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 mtpingsourceadapter or something

@lionelvillard
Copy link
Copy Markdown
Contributor Author

@n3wscott can the hold be removed?

}

func NewTestClient() *TestCloudEventsClient {
func NewTestClient(reporter source.StatsReporter) *TestCloudEventsClient {
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.

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)
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.

It is now the job of the adapter to test that metrics are collected or not, not the job runner.

@n3wscott
Copy link
Copy Markdown
Contributor

/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 Mar 31, 2020
@slinkydeveloper
Copy link
Copy Markdown
Contributor

/assign

Comment thread pkg/reconciler/pingsource/jobrunner/runner.go Outdated
Comment thread pkg/adapter/v2/metrics/metrics_test.go Outdated
@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/adapter/v2/cloudevents.go 68.4% 85.0% 16.6
pkg/adapter/v2/metrics/metrics.go Do not exist 57.9%
pkg/reconciler/pingsource/jobrunner/runner.go 92.3% 90.9% -1.4

@slinkydeveloper
Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 1, 2020
@knative-prow-robot knative-prow-robot merged commit 6386f24 into knative:master Apr 1, 2020
@lionelvillard lionelvillard deleted the mt-ping-cev2 branch August 28, 2020 15:43
@lionelvillard lionelvillard restored the mt-ping-cev2 branch September 3, 2020 15:43
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants