Make do an array by matthias-pichler · Pull Request #895 · serverlessworkflow/specification · GitHub
Skip to content

Make do an array#895

Merged
cdavernas merged 25 commits into
serverlessworkflow:mainfrom
matthias-pichler:matthias-pichler/invalid-do-switch-894
Jun 13, 2024
Merged

Make do an array#895
cdavernas merged 25 commits into
serverlessworkflow:mainfrom
matthias-pichler:matthias-pichler/invalid-do-switch-894

Conversation

@matthias-pichler

@matthias-pichler matthias-pichler commented Jun 11, 2024

Copy link
Copy Markdown
Collaborator

Please specify parts of this PR update:

  • Specification
  • Schema
  • Examples
  • Extensions
  • Use Cases
  • Community
  • CTK
  • Other

Discussion or Issue link:

Closes #894

What this PR does:

  • I refactored the schema to make do, try, catch.do, do in for, before and after an array of named tasks
  • I refactored the schema to only allowed desired properties
  • I added test to make sure the schema rejects invalid definitions
  • I added tests to check every example in the dsl-reference doc
  • I updated the ctk and examples with the new schema

Additional information:

Now the usage of do both in for Tasks as well as sequential composite tasks lead to the result that for tasks now also matched the schema of the composite sequential task. As discussed earlier this is because additional/unevaluated properties were not restricted. This lead to the error that a for task was also recognized as a do task and hence matched two schemas in oneOf ... I therefore refactored the schema to distinguish between these and no allow additional properties

@matthias-pichler matthias-pichler force-pushed the matthias-pichler/invalid-do-switch-894 branch from 43d0fb2 to a2d5cd2 Compare June 12, 2024 07:03
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
@matthias-pichler matthias-pichler force-pushed the matthias-pichler/invalid-do-switch-894 branch from ab2e14c to ff4fb6e Compare June 12, 2024 07:08
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Comment thread .ci/validation/src/examples.test.ts
Comment thread .ci/validation/src/examples.test.ts
Comment thread .ci/validation/src/index.ts
Comment thread .ci/validation/src/index.ts
Comment thread .ci/validation/src/index.ts
@matthias-pichler matthias-pichler marked this pull request as ready for review June 12, 2024 11:55
@fjtirado

Copy link
Copy Markdown
Collaborator

@matthias-pichler

Copy link
Copy Markdown
Collaborator Author

Comment thread ctk/features/try.feature
Comment thread dsl-reference.md Outdated
Comment thread ctk/features/composite.feature Outdated
Comment thread dsl-reference.md
Comment thread dsl-reference.md Outdated

@ricardozanini ricardozanini left a comment

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.

LGTM. Great work, many thanks! Once we split the task section as pointed by @cdavernas I'll do another round.

Comment thread .ci/validation/src/examples.test.ts
Comment thread ctk/features/data-flow.feature Outdated
Comment thread ctk/features/for.feature Outdated
Comment thread schema/workflow.yaml Outdated
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>
@matthias-pichler matthias-pichler force-pushed the matthias-pichler/invalid-do-switch-894 branch from 603caed to b5c71f1 Compare June 12, 2024 14:30
Comment thread dsl.md Outdated
Signed-off-by: Matthias Pichler <m.pichler@warrify.com>

@cdavernas cdavernas left a comment

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.

Looks great to me! Many thanks ❤️

@cdavernas cdavernas merged commit f574808 into serverlessworkflow:main Jun 13, 2024
@matthias-pichler matthias-pichler deleted the matthias-pichler/invalid-do-switch-894 branch June 13, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid do:switch

5 participants