-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix(orchestrator): execute should allow no inputs #73
base: main
Are you sure you want to change the base?
Conversation
@@ -163,12 +163,11 @@ export class V2 { | |||
workflowId: string, | |||
businessKey: string | undefined, | |||
): Promise<ExecuteWorkflowResponseDTO> { | |||
if (Object.keys(executeWorkflowRequestDTO?.inputData).length === 0) { | |||
if (!executeWorkflowRequestDTO?.inputData) { |
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.
inputData is a required field in the spec. You need to fix the spec too
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.
if it's required why are we checking this?
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.
maybe we don't need this check?
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.
Revisisted it
I think the inputData should be optional, so I changed the spec for it to be optional
Actually useful, a workflow without parameters can be run without need to pass a body:
curl -X POST http://localhost:7007/api/orchestrator/v2/workflows/hello_world/execute
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Changed Packages
|
Changed Packages
|
Changed Packages
|
The bug is that execute fails also if field inputData is passed but is empty.
This causes workflows without required inputs to fail.
Changing inputData field to be optional
This resolves the bug in a cleaner way than janus-idp/backstage-plugins#2550
Resolves FLPATH-1880