-
Notifications
You must be signed in to change notification settings - Fork 612
Add clarification on including additional context attributes #301
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9fafe98
Add clarification on including additional context attributes
48c45ad
Incorporate Christoph's comment on duplication
188397e
Update the PR per Christoph's comment
9d3b9f1
move the paragraph to the "extension attributes" section
5feac50
Address comments in the meeting--move the section to the end
95bbe59
minor edit to change "MAY" to "can"
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,13 +139,10 @@ of a JSON serialization, the context attributes and the event data might | |
| both appear within the same JSON object. | ||
|
|
||
| ### Extension Attributes | ||
| CloudEvent producers MAY include additional extension attributes within the | ||
| event. This enables event producers, or middleware, to include additional | ||
| metadata that might be used for any purpose in the processing of the | ||
| CloudEvent, such as identifying or correlating event sources. See | ||
| [CloudEvent Attributes Extensions](primer.md#cloudevent-attribute-extensions) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the last sentence, including this link, should remain.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will add it back to the extension section. |
||
| for additional information concerning the use and definition of | ||
| extensions. | ||
| CloudEvents producers MAY include additional context attributes in the event | ||
| that might be used in ancillary actions related to the processing of the event. | ||
| See [CloudEvent Attributes Extensions](primer.md#cloudevent-attribute-extensions) | ||
| for additional information concerning the use and definition of extensions. | ||
|
|
||
| This specification places no restriction on the type or semantics of the | ||
| extension attributes. Each definition of an extensions SHOULD fully | ||
|
|
@@ -161,6 +158,18 @@ for extensions that might be of interest. | |
| Each specification that defines how to serialize a CloudEvent will | ||
| define how extension attributes will appear. | ||
|
|
||
| Here is an example that illustrates the need for additional attributes. | ||
| In many IoT and enterprise use cases, an event could be used in | ||
| a serverless application that performs actions across multiple types of events. | ||
| To support such use cases, the event producer will need to add additional | ||
| identity attributes to the "context attributes" which the event consumers can | ||
| use to correlate this event with the other events. If such identity attributes | ||
| happen to be part of the event "data", the event producer SHOULD also add | ||
| the identity attributes to the "context attributes" so that | ||
| event consumers can easily access this information without needing to decode | ||
| and examine the event data. Such identity attributes can also be used to | ||
| help intermediate gateways determine how to route the events. | ||
|
|
||
| ### eventType | ||
| * Type: `String` | ||
| * Description: Type of occurrence which has happened. Often this | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this first sentence (in particular the "MAY") is important. I'm not sure why this section is being reduced.
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 removed per comment on duplication with what's newly added in previous section
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.
I agree with removing duplicate text but not the normative statements behind them. I would suggest you try to move your new text into this section since they're both about extensions. Then we don't lose any of the normative language but add the clarifications you're looking for.
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.
The normative statements added in the previous generic "context attributes" section applies to extension attributes too since extension attributes are also "context attributes". Putting it into "extension" section adds implicit restriction/assumption that any future attribute will be an extension, which is not right. We can not predict the future and should allow the possibility of some future attribute to be added as standard attribute rather than extension attribute.
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.
@cathyhongzhang there aren't any normative statements in your new text though. By "normative" I mean using RFC2119 keywords.
no it doesn't. Any new attribute added to the spec will not be an extension - it won't be since it's spec-defined. All of the attributes you're talking about in your new text are "extensions" because they are not defined by the spec, which is why it makes more sense to put the text into the "extensions" section. Its location in the spec does not change what identity properties people can add, it just make it more readable to put all extensions text into the same location.
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.
I agree with @duglin - and I'm sorry if my review wasn't clear on that. I prefer to merge your proposed text into the extension section.