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

fix(orchestrator): execute should allow no inputs #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

batzionb
Copy link
Contributor

@batzionb batzionb commented Nov 25, 2024

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

@@ -163,12 +163,11 @@ export class V2 {
workflowId: string,
businessKey: string | undefined,
): Promise<ExecuteWorkflowResponseDTO> {
if (Object.keys(executeWorkflowRequestDTO?.inputData).length === 0) {
if (!executeWorkflowRequestDTO?.inputData) {

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Nov 26, 2024

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-orchestrator-backend
  • @red-hat-developer-hub/backstage-plugin-orchestrator-common

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend none v4.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common none v1.24.1

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Nov 26, 2024

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-orchestrator-backend
  • @red-hat-developer-hub/backstage-plugin-orchestrator-common

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend none v4.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common none v1.24.1

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Nov 26, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend patch v4.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common patch v1.24.1

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Nov 26, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend patch v4.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common patch v1.24.1

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Nov 26, 2024

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-backend workspaces/orchestrator/plugins/orchestrator-backend patch v4.1.1
@red-hat-developer-hub/backstage-plugin-orchestrator-common workspaces/orchestrator/plugins/orchestrator-common patch v1.24.1

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.

2 participants