Skip to content

Commit

Permalink
fix(orchestrator): execute should allow no inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
batzionb committed Nov 21, 2024
1 parent a2abe1c commit 2d4d4f1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 4 deletions.
15 changes: 14 additions & 1 deletion app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ backend:
# Uncomment the following host directive to bind to specific interfaces
# host: 127.0.0.1
csp:
connect-src: ["'self'", 'http:', 'https:']
frame-ancestors: ['http://localhost:3000', 'http://localhost:7007']
script-src: ["'self'", "'unsafe-inline'", "'unsafe-eval'"]
script-src-elem: ["'self'", "'unsafe-inline'", "'unsafe-eval'"]
connect-src: ["'self'", 'http:', 'https:', 'data:']
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
cors:
Expand Down Expand Up @@ -80,3 +83,13 @@ catalog:

dynamicPlugins:
frontend: {}
orchestrator:
sonataFlowService:
baseUrl: http://localhost
port: 8899
autoStart: true
workflowsSource:
gitRepositoryUrl: https://github.com/parodos-dev/backstage-orchestrator-workflows
localPath: /tmp/orchestrator/repository
dataIndexService:
url: http://localhost:8899
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"react-dom": "^18.0.0",
"react-router": "^6.23.0",
"react-router-dom": "^6.23.0",
"tss-react": "^4.9.10"
"tss-react": "^4.9.10",
"@janus-idp/backstage-plugin-orchestrator": "*"
},
"devDependencies": {
"prettier": "3.3.3",
Expand Down
3 changes: 3 additions & 0 deletions packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { UserSettingsPage } from '@backstage/plugin-user-settings';

import { getThemes } from '@redhat-developer/red-hat-developer-hub-theme';

import { OrchestratorPage } from '@janus-idp/backstage-plugin-orchestrator';

import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { Root } from './components/Root';
Expand Down Expand Up @@ -85,6 +87,7 @@ const routes = (
</Route>
<Route path="/create" element={<ScaffolderPage />} />
<Route path="/api-docs" element={<ApiExplorerPage />} />
<Route path="/orchestrator" element={<OrchestratorPage />} />
<Route
path="/catalog-import"
element={
Expand Down
7 changes: 7 additions & 0 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import GroupIcon from '@mui/icons-material/People';
import SearchIcon from '@mui/icons-material/Search';
import { makeStyles } from 'tss-react/mui';

import { OrchestratorIcon } from '@janus-idp/backstage-plugin-orchestrator';

import LogoFull from './LogoFull';
import LogoIcon from './LogoIcon';

Expand Down Expand Up @@ -99,6 +101,11 @@ export const Root = ({
<SidebarDivider />
<SidebarScrollWrapper>
{/* Items in this group will be scrollable if they run out of space */}
<SidebarItem
icon={OrchestratorIcon as IconComponent}
to="orchestrator"
text="Orchestrator"
/>
</SidebarScrollWrapper>
</SidebarGroup>
<SidebarSpace />
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"@janus-idp/backstage-plugin-rbac-backend": "*",
"@manypkg/get-packages": "^1.1.3",
"app": "*",
"winston": "^3.11.0"
"winston": "^3.11.0",
"@janus-idp/backstage-plugin-orchestrator-backend": "*"
},
"devDependencies": {
"prettier": "3.3.3",
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ backend.add(

// permission plugin
backend.add(import('@janus-idp/backstage-plugin-rbac-backend'));
backend.add(import('@janus-idp/backstage-plugin-orchestrator-backend'));

// search plugin
backend.add(import('@backstage/plugin-search-backend/alpha'));
Expand Down
2 changes: 1 addition & 1 deletion plugins/orchestrator-backend/src/service/api/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class V2 {
workflowId: string,
businessKey: string | undefined,
): Promise<ExecuteWorkflowResponseDTO> {
if (Object.keys(executeWorkflowRequestDTO?.inputData).length === 0) {
if (!executeWorkflowRequestDTO?.inputData) {
throw new Error(
`ExecuteWorkflowRequestDTO.inputData is required for executing workflow with id ${workflowId}`,
);
Expand Down

0 comments on commit 2d4d4f1

Please sign in to comment.