Skip to content
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

Add a new property to the listen task to determine what it should return #1068

Closed
fjtirado opened this issue Jan 14, 2025 · 2 comments · Fixed by #1070
Closed

Add a new property to the listen task to determine what it should return #1068

fjtirado opened this issue Jan 14, 2025 · 2 comments · Fixed by #1070
Assignees
Labels
area: examples area: spec Changes in the Specification change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change type: feature
Milestone

Comments

@fjtirado
Copy link
Collaborator

fjtirado commented Jan 14, 2025

What would you like to be added?

Depending on the scenario, users might want to keep CloudEvent attributes in the workflow model or just the CloudEvent data

Proposal(s):

After discussing alternatives, we agree that a new property called return should be added to Listen task. Possible values are: data (default), envelope (whole cloud event), raw (for future use on binary events)

Alternative(s):

Include always the whole CloudEvent and, if user only wants data, include the proper expression in output

Additional info:

No response

Community Notes

  • Please vote by adding a 👍 reaction to the feature to help us prioritize.
  • If you are interested to work on this feature, please leave a comment.
@JBBianchi
Copy link
Member

Maybe I'm missing something, and sorry if I do, but I would assume one would want the whole event, and if one wants only the data property, they can select it using output.as. Is it really necessary to introduce a new concept altogether ?

@fjtirado
Copy link
Collaborator Author

fjtirado commented Jan 14, 2025

Maybe I'm missing something, and sorry if I do, but I would assume one would want the whole event, and if one wants only the data property, they can select it using output.as. Is it really necessary to introduce a new concept altogether ?

Sure, I found always including the whole cloud event (which includes id and specversion, which are hardly meaningful) will pollute the workflow model. I feel the most frequent use case is users not being interested on any of the CE attributes, just the data and therefore, we will forcing them to write output.as: .data most of the time, which is pretty verbose. I base that assumption on the fact that I have not seen a workflow definition for 0.8 which uses the flag to include the whole CE (it is true that these deinitions lacks correlation support at all, which is the scenarion in which you probably want to keep some of the CloudEvent attributes, For those cases, you have to use the new keyword plus probably an output or context filter to store them in the proper place)

@cdavernas cdavernas self-assigned this Jan 14, 2025
@cdavernas cdavernas added change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change area: spec Changes in the Specification area: examples labels Jan 14, 2025
@cdavernas cdavernas added this to the v1.0.0 milestone Jan 14, 2025
@cdavernas cdavernas changed the title Listen task. Specify a way to indicate if the output should be CloudEventData or the whole event Add a new property to the listen task to determine what it should return Jan 14, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Progress Tracker Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples area: spec Changes in the Specification change: documentation Improvements or additions to documentation. It won't impact a version change. change: feature New feature or request. Impacts in a minor version change type: feature
Projects
Status: Done
3 participants