Skip to content

Upgrading to CloudEvents 1.0#2157

Closed
matzew wants to merge 3 commits into
knative:masterfrom
matzew:CE_V10
Closed

Upgrading to CloudEvents 1.0#2157
matzew wants to merge 3 commits into
knative:masterfrom
matzew:CE_V10

Conversation

@matzew
Copy link
Copy Markdown
Member

@matzew matzew commented Nov 7, 2019

Proposed Changes

  • going 1.0

Release Note

usage of CloudEvents 1.0 in Knative Eventing 

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

matzew commented Nov 7, 2019

/assign @nachocano

mind taking a look, dude ?

@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Nov 7, 2019
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew

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 Nov 7, 2019
@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/channel/fanout/fanout_handler.go 84.6% 76.9% -7.7

@matzew
Copy link
Copy Markdown
Member Author

matzew commented Nov 7, 2019

hrm... integratation test ...

Comment thread pkg/broker/ttl.go Outdated

const (
// V03TTLAttribute is the name of the CloudEvents 0.3 extension attribute used to store the
// V1TTLAttribute is the name of the CloudEvents 0.3 extension attribute used to store the
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.

nit: 0.3 -> 1.0?

event.SetSource("/mycontext")
event.SetID("A234-1234-1234")
event.SetExtension("comExampleExtension", "value")
event.SetExtension("comexampleextension", "value")
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.

just jotting this down here, but 0.3 used to default encoding, and now you have to manually set it, might want to add that in here as well?

event := cloudevents.NewEvent(cloudevents.VersionV02)
event := cloudevents.NewEvent(cloudevents.VersionV1)
event.SetID(uuid.New().String())
event.SetType(common.GCEventType)
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.

These should also set the encoding?

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Nov 7, 2019

I do wonder if these are failing because the encoding is not set?

@nachocano
Copy link
Copy Markdown
Contributor

sorry for the delay @matzew ... thanks for doing this!
Couple of questions:

  • are we always outputting V1 events now? If that is the case, we will need to update the examples in knative/docs as a follow up. Or we are outputting the same input version?
  • can you check that sending in v0.3 still works? maybe from some of the existing eventing-contrib sources?

@matzew
Copy link
Copy Markdown
Member Author

matzew commented Nov 8, 2019

I was going to update the docs, yes!

and let me test w/ 0.3

thanks for the pointers, @nachocano ! 🤗

@devguyio
Copy link
Copy Markdown
Contributor

devguyio commented Nov 8, 2019

I would recommend that we deprecate 0.3 properly, so make sure both work, then deprecate 0.3 and then remove it.

@matzew
Copy link
Copy Markdown
Member Author

matzew commented Nov 8, 2019 via email

@adrcunha adrcunha removed their request for review November 15, 2019 20:08
delete(originalV3.Extensions, ttlKey)
event.Context = originalV3
delete(originalV1.Extensions, ttlKey)
event.Context = originalV1
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.

Is there are reason why we bump all events to V1? Can't broker/trigger be just pass through?

@n3wscott
Copy link
Copy Markdown
Contributor

/retest

@knative-prow-robot
Copy link
Copy Markdown
Contributor

@matzew: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-knative-eventing-integration-tests b9206a5 link /test pull-knative-eventing-integration-tests

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.


// Remove the TTL attribute that is used by the Broker.
originalV3 := event.Context.AsV03()
originalV1 := event.Context.AsV1()
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.

Please revert this file as this has been now fixed correctly.
/hold

Comment thread pkg/broker/ttl.go

const (
// V03TTLAttribute is the name of the CloudEvents 0.3 extension attribute used to store the
// V1TTLAttribute is the name of the CloudEvents 1.0 extension attribute used to store the
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.

Revert this file too. This has been now fixed correctly. refer to #2244

@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 Dec 3, 2019
@matzew
Copy link
Copy Markdown
Member Author

matzew commented Dec 10, 2019

/close

@knative-prow-robot
Copy link
Copy Markdown
Contributor

@matzew: Closed this PR.

Details

In response to this:

/close

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
Copy link
Copy Markdown
Member Author

matzew commented Dec 10, 2019

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. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

9 participants