Skip to content

Conversation

fjtirado
Copy link
Collaborator

@fjtirado fjtirado commented Oct 10, 2022

This adds possibility of validating workflow output in a similar way that is already done for workflow input

See issue #611

Signed-off-by: Francisco Javier Tirado Sarti [email protected]

Many thanks for submitting your Pull Request ❤️!

Please specify parts of this PR update:

  • Specification
  • Schema
  • Examples
  • Extensions
  • Roadmap
  • Use Cases
  • Community
  • TCK
  • Other

Discussion or Issue link:

What this PR does / why we need it:

Special notes for reviewers:

Additional information:

@tsurdilo
Copy link
Contributor

tsurdilo commented Oct 10, 2022

Missing update to the schema , see https://github.com/serverlessworkflow/specification/blob/main/schema/workflow.json#L41

Would add that data output schema is done only on wf exec success, not on failure / timeout.

Missing entry in roadmap (any pr that adds/removes functionality in spec repo needs an entry in roadmap)

Would also search older issues / discussions as to why this was previously removed. We had both input and output schemas support i believe in 0.5/6 but then it was decided to be removed, now seems we want to add it back in

@tsurdilo
Copy link
Contributor

tsurdilo commented Oct 10, 2022

There is also question on what happens on failure to validate subflow result as this can be defined in the subflow workflow definition, so this is tied to the error handling still WIP pr. Imo they should be committed at the same time if we decided to go w/ this.

I think there is also little no no examples / explanation as to what happens if this output validation fails as to what should happen with the wf exec, can exec recover from this failure via compensation? Can it be "caught" in last workflow state error handling? Many things to look at imo

@tsurdilo tsurdilo added the change: feature New feature or request. Impacts in a minor version change label Oct 10, 2022
@tsurdilo tsurdilo added this to the v0.9 milestone Oct 10, 2022
@tsurdilo
Copy link
Contributor

related to #673, please do not merge one without the other

Copy link
Contributor

@tsurdilo tsurdilo left a comment

Choose a reason for hiding this comment

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

changes requested according to comments on this pr

@fjtirado
Copy link
Collaborator Author

@tsurdilo I opened this PR because reading @cdavernas I believe this feature was accepted.
In my view, the output validation should be performed only for parent process (not subprocess) and if it fails, it behave as when input validation fails: it throws an exception if the failOnValidation is true.
Since it only applies to parent process, we can consider it is is not part of error handling feature, because it does not really belong to flow execution. Thats why I just change the dataInputShema bits to add dataOuputSchema.

@tsurdilo
Copy link
Contributor

Yeah definitely lets add it, just would be nice to update the little things mentioned. Ty!!

@fjtirado
Copy link
Collaborator Author

@tsurdilo Sure, Ill do, thanks

@fjtirado fjtirado requested review from tsurdilo and removed request for antmendoza, ricardozanini and cdavernas October 11, 2022 14:37
@fjtirado fjtirado force-pushed the dataOutputSchema branch 2 times, most recently from f1fdcbe to 0b01c29 Compare October 11, 2022 14:38
@fjtirado
Copy link
Collaborator Author

@tsurdilo I tried to reflect your concerns into the text.

Copy link
Member

@cdavernas cdavernas left a comment

Choose a reason for hiding this comment

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

Please consider #705 before merging, as requested change might be included in this PR as well.

@fjtirado fjtirado changed the title DataOutputSchema addition outputDataSchema addition Oct 26, 2022
@fjtirado fjtirado mentioned this pull request Oct 26, 2022
@ricardozanini
Copy link
Member

@tsurdilo can you please take a final look so we can merge it? Thank you!

@github-actions github-actions bot removed the Stale PR label Apr 28, 2023
@cdavernas
Copy link
Member

@tsurdilo Can you please review requested changes?

@cdavernas
Copy link
Member

Linked to #705

This was linked to issues May 26, 2023
@ricardozanini
Copy link
Member

@tsurdilo can you please take a final look so we can merge it? Thank you!

@cdavernas cdavernas added impacts SDK 🔧 area: spec Changes in the Specification labels May 30, 2023
@tsurdilo
Copy link
Contributor

tsurdilo commented Jun 9, 2023

@ricardozanini

If its please possible to change the naming convention:
"inputDataSchema"
"outputDataSchema"

back to dataInputSchema, dataOutputSchema

then +1 from me :) I think input/outputDataSchema reads weird, what is a "DataSchema"?

@tsurdilo
Copy link
Contributor

tsurdilo commented Jun 9, 2023

left couple of small change requests for the docs part hope thats ok

Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
@fjtirado
Copy link
Collaborator Author

fjtirado commented Jun 9, 2023

@ricardozanini

If its please possible to change the naming convention: "inputDataSchema" "outputDataSchema"

back to dataInputSchema, dataOutputSchema

then +1 from me :) I think input/outputDataSchema reads weird, what is a "DataSchema"?

@tsurdilo If I recalled correctly this was a comment from @cdavernas , I think the change is to reflect that both data schemas are the same, acting as input or output

@fjtirado fjtirado requested a review from tsurdilo June 9, 2023 16:12
@tsurdilo
Copy link
Contributor

tsurdilo commented Jun 9, 2023

I see, i think both says they are the same, they are both schemas one defines data input and the other data output of the workflow exec

@ricardozanini
Copy link
Member

ricardozanini commented Jun 13, 2023

@tsurdilo @cdavernas @fjtirado I'd rather stay with inputDataSchema and outputDataSchema if you don't mind. @tsurdilo I think all your comments have been handled. Can you take a final look/approve so we can merge this?

@cdavernas
Copy link
Member

@tsurdilo @cdavernas @fjtirado I'd rather stay with inputDataSchema and outputDataSchema if you don't mind.

Works for me either way! I guess it's just a matter of point of view/personal prefs anyways

@ricardozanini
Copy link
Member

@cdavernas I agree. Either works for me too if we can move forward!

@fjtirado
Copy link
Collaborator Author

@tsurdilo Any further request?

@tsurdilo
Copy link
Contributor

tsurdilo commented Jun 21, 2023

@fjtirado hi, no new requests :) Just same one to use dataInputSchema/dataOutputSchema please if possible. Also left a small comment asking for update/correction in readme.md. Thanks.

Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
@ricardozanini
Copy link
Member

@cdavernas any other comments?

@cdavernas
Copy link
Member

@ricardozanin Nope, looking great to me! Thanks @fjtirado

@cdavernas cdavernas merged commit af23db6 into serverlessworkflow:main Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: spec Changes in the Specification change: feature New feature or request. Impacts in a minor version change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename dataInputSchema Support for output data schema
4 participants