Skip to content

Commit

Permalink
fix(orchestrator): clean up the plugin code (#1292)
Browse files Browse the repository at this point in the history
fix(orchestrator): clean up the orchestrator plugin code
  • Loading branch information
caponetto authored Feb 28, 2024
1 parent 77f5f0e commit ad27fb8
Show file tree
Hide file tree
Showing 57 changed files with 42 additions and 9,486 deletions.
1 change: 0 additions & 1 deletion plugins/orchestrator-backend/dev/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export async function startStandaloneServer(
logger.debug('Starting application server...');
const router = await createRouter({
logger: logger,
eventBroker: options.eventBroker,
config: options.config,
discovery: options.discovery,
catalogApi: options.catalogApi,
Expand Down
2 changes: 0 additions & 2 deletions plugins/orchestrator-backend/src/OrchestratorPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';
import { DefaultEventBroker } from '@backstage/plugin-events-backend';

import { createRouter } from './routerWrapper';

Expand All @@ -30,7 +29,6 @@ export const orchestratorPlugin = createBackendPlugin({
}) {
const log = loggerToWinstonLogger(logger);
const router = await createRouter({
eventBroker: new DefaultEventBroker(log),
config: config,
logger: log,
discovery: discovery,
Expand Down
1 change: 0 additions & 1 deletion plugins/orchestrator-backend/src/alpha.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { orchestratorPlugin } from './OrchestratorPlugin';
export { orchestratorModuleEntityProvider } from './module';
export { dynamicPluginInstaller } from './dynamic/alpha';
3 changes: 1 addition & 2 deletions plugins/orchestrator-backend/src/dynamic/alpha.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { BackendDynamicPluginInstaller } from '@backstage/backend-dynamic-feature-service';

import { orchestratorModuleEntityProvider } from '../module';
import { orchestratorPlugin } from '../OrchestratorPlugin';

export const dynamicPluginInstaller: BackendDynamicPluginInstaller = {
kind: 'new',
install: () => [orchestratorPlugin(), orchestratorModuleEntityProvider()],
install: () => [orchestratorPlugin()],
};
13 changes: 0 additions & 13 deletions plugins/orchestrator-backend/src/dynamic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { HostDiscovery } from '@backstage/backend-app-api';
import { BackendDynamicPluginInstaller } from '@backstage/backend-dynamic-feature-service';
import { CatalogClient } from '@backstage/catalog-client';

import { OrchestratorEntityProvider } from '../provider';
import { createRouter } from '../routerWrapper';

export const dynamicPluginInstaller: BackendDynamicPluginInstaller = {
Expand All @@ -20,16 +19,4 @@ export const dynamicPluginInstaller: BackendDynamicPluginInstaller = {
});
},
},
async catalog(builder, env) {
const isIntegrationEnabled = !!env.config.getOptionalBoolean(
'orchestrator.catalog.isEnabled',
);
if (!isIntegrationEnabled) {
env.logger.info('The integration with the Catalog plugin is disabled.');
return;
}
builder.addEntityProvider(
await OrchestratorEntityProvider.fromConfig({ ...env }),
);
},
};
1 change: 0 additions & 1 deletion plugins/orchestrator-backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './dynamic/index';

export { createRouter } from './routerWrapper';
export { OrchestratorEntityProvider } from './provider';

This file was deleted.

1 change: 0 additions & 1 deletion plugins/orchestrator-backend/src/module/index.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion plugins/orchestrator-backend/src/provider/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions plugins/orchestrator-backend/src/routerWrapper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { UrlReader } from '@backstage/backend-common';
import { CatalogApi } from '@backstage/catalog-client';
import { Config } from '@backstage/config';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { EventBroker } from '@backstage/plugin-events-node';

import express from 'express';
import { Logger } from 'winston';
Expand All @@ -12,7 +11,6 @@ import { createBackendRouter } from '../service/router';
import { SonataFlowService } from '../service/SonataFlowService';

export interface RouterArgs {
eventBroker: EventBroker;
config: Config;
logger: Logger;
discovery: DiscoveryApi;
Expand All @@ -29,7 +27,6 @@ export async function createRouter(args: RouterArgs): Promise<express.Router> {
);

const router = await createBackendRouter({
eventBroker: args.eventBroker,
config: args.config,
logger: args.logger,
discovery: args.discovery,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import { createLogger, format, transports } from 'winston';

import mockComposedGreetingWorkflowData from '../../__fixtures__/mockComposedGreetingWorfklow';
import mockGreetingWorkflowData from '../../__fixtures__/mockGreetingWorkflowData';
import mockSpringBootWorkflowData from '../../__fixtures__/mockSpringBootWorkflowData';
import { DataInputSchemaService } from './DataInputSchemaService';

const logger = createLogger({
level: 'info',
format: format.json(),
transports: [
new transports.Console(),
new transports.File({ filename: 'logfile.log' }),
],
});
const service = new DataInputSchemaService(logger, undefined);
const service = new DataInputSchemaService();

describe('workflow input schema response', () => {
it('schema with refs should return multiple steps', () => {
Expand Down
Loading

0 comments on commit ad27fb8

Please sign in to comment.