Skip to content

Commit

Permalink
feat: move most of the plugins to new backend system
Browse files Browse the repository at this point in the history
  • Loading branch information
drodil committed Mar 26, 2024
1 parent b6fb4ba commit 7ca845b
Show file tree
Hide file tree
Showing 85 changed files with 4,819 additions and 6,268 deletions.
41 changes: 41 additions & 0 deletions .changeset/wise-needles-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
'@roadiehq/plugin-scaffolder-frontend-module-http-request-field': patch
'@roadiehq/scaffolder-backend-module-http-request': patch
'@roadiehq/scaffolder-backend-module-utils': patch
'@roadiehq/scaffolder-backend-module-aws': patch
'@roadiehq/backstage-plugin-github-pull-requests': patch
'@roadiehq/scaffolder-backend-argocd': patch
'@roadiehq/backstage-plugin-security-insights': patch
'@roadiehq/rag-ai-backend-retrieval-augmenter': patch
'@roadiehq/backstage-plugin-github-insights': patch
'@roadiehq/backstage-plugin-argo-cd-backend': patch
'@roadiehq/rag-ai-backend-embeddings-openai': patch
'@roadiehq/rag-ai-backend-embeddings-aws': patch
'@roadiehq/backstage-plugin-aws-lambda': patch
'@roadiehq/backstage-plugin-cloudsmith': patch
'@roadiehq/backstage-plugin-prometheus': patch
'@roadiehq/catalog-backend-module-okta': patch
'@roadiehq/backstage-plugin-buildkite': patch
'@roadiehq/backstage-plugin-travis-ci': patch
'@roadiehq/backstage-plugin-home-markdown': patch
'@roadiehq/catalog-backend-module-aws': patch
'@roadiehq/backstage-plugin-shortcut': patch
'@roadiehq/backstage-plugin-aws-auth': patch
'@roadiehq/backstage-plugin-argo-cd': patch
'@roadiehq/backstage-plugin-bugsnag': patch
'@roadiehq/backstage-plugin-datadog': patch
'@roadiehq/backstage-plugin-iframe': patch
'@roadiehq/rag-ai-storage-pgvector': patch
'@roadiehq/roadie-backstage-entity-validator': patch
'@roadiehq/backstage-plugin-jira': patch
'@roadiehq/backstage-plugin-home-rss': patch
'@roadiehq/backstage-plugin-aws-backend': patch
'@roadiehq/backstage-plugin-aws': patch
'@roadiehq/rag-ai-backend': patch
'@roadiehq/rag-ai-node': patch
'@roadiehq/rag-ai': patch
'backend': patch
'app': patch
---

Convert to support the new backend system
2 changes: 1 addition & 1 deletion backstage.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "1.23.4"
"version": "1.24.2"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"tsc:full": "tsc --skipLibCheck false --incremental false",
"clean": "backstage-cli clean && lerna run clean",
"diff": "lerna run diff --",
"prettier:fix": "prettier --write .",
"test": "yarn backstage-cli repo test --workerIdleMemoryLimit=800M --coverage --runInBand",
"test:all": "lerna run test -- --coverage --runInBand",
"lint": "backstage-cli repo lint --since origin/main",
Expand All @@ -39,7 +40,7 @@
]
},
"devDependencies": {
"@backstage/cli": "^0.25.2",
"@backstage/cli": "^0.26.1",
"@spotify/prettier-config": "^14.0.0",
"@types/webpack": "^5.28.0",
"concurrently": "^7.0.0",
Expand Down
46 changes: 23 additions & 23 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@
},
"bundled": true,
"dependencies": {
"@backstage/app-defaults": "^1.5.0",
"@backstage/catalog-model": "^1.4.4",
"@backstage/app-defaults": "^1.5.2",
"@backstage/catalog-model": "^1.4.5",
"@roadiehq/backstage-plugin-cloudsmith": "^1.0.10",
"@backstage/cli": "^0.25.2",
"@backstage/core-app-api": "^1.12.0",
"@backstage/core-components": "^0.14.0",
"@backstage/core-plugin-api": "^1.9.0",
"@backstage/integration-react": "^1.1.24",
"@backstage/plugin-api-docs": "^0.11.0",
"@backstage/plugin-catalog": "^1.17.0",
"@backstage/plugin-catalog-graph": "^0.4.0",
"@backstage/plugin-catalog-import": "^0.10.6",
"@backstage/plugin-catalog-react": "^1.10.0",
"@backstage/plugin-github-actions": "^0.6.11",
"@backstage/plugin-home": "^0.6.2",
"@backstage/plugin-org": "^0.6.20",
"@backstage/plugin-scaffolder": "^1.18.0",
"@backstage/plugin-scaffolder-react": "^1.8.0",
"@backstage/plugin-search": "^1.4.6",
"@backstage/plugin-tech-radar": "^0.6.13",
"@backstage/plugin-techdocs": "^1.10.0",
"@backstage/plugin-user-settings": "^0.8.1",
"@backstage/test-utils": "^1.5.0",
"@backstage/theme": "^0.5.1",
"@backstage/cli": "^0.26.1",
"@backstage/core-app-api": "^1.12.2",
"@backstage/core-components": "^0.14.2",
"@backstage/core-plugin-api": "^1.9.1",
"@backstage/integration-react": "^1.1.25",
"@backstage/plugin-api-docs": "^0.11.2",
"@backstage/plugin-catalog": "^1.18.1",
"@backstage/plugin-catalog-graph": "^0.4.2",
"@backstage/plugin-catalog-import": "^0.10.8",
"@backstage/plugin-catalog-react": "^1.11.1",
"@backstage/plugin-github-actions": "^0.6.13",
"@backstage/plugin-home": "^0.7.1",
"@backstage/plugin-org": "^0.6.22",
"@backstage/plugin-scaffolder": "^1.19.1",
"@backstage/plugin-scaffolder-react": "^1.8.2",
"@backstage/plugin-search": "^1.4.8",
"@backstage/plugin-tech-radar": "^0.7.1",
"@backstage/plugin-techdocs": "^1.10.2",
"@backstage/plugin-user-settings": "^0.8.3",
"@backstage/test-utils": "^1.5.2",
"@backstage/theme": "^0.5.2",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@roadiehq/backstage-plugin-argo-cd": "^2.6.1",
Expand Down
47 changes: 24 additions & 23 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,53 +20,54 @@
"migrate:create": "knex migrate:make -x ts"
},
"dependencies": {
"@backstage/backend-common": "^0.21.3",
"@backstage/backend-tasks": "^0.5.18",
"@backstage/catalog-client": "^1.6.0",
"@backstage/catalog-model": "^1.4.4",
"@backstage/config": "^1.1.1",
"@backstage/integration": "^1.9.0",
"@backstage/integration-aws-node": "^0.1.9",
"@backstage/plugin-app-backend": "^0.3.61",
"@backstage/plugin-auth-backend": "^0.21.3",
"@backstage/plugin-catalog-backend": "^1.17.3",
"@backstage/plugin-permission-common": "^0.7.12",
"@backstage/plugin-permission-node": "^0.7.24",
"@backstage/plugin-proxy-backend": "^0.4.11",
"@backstage/plugin-scaffolder-backend": "^1.21.3",
"@backstage/plugin-techdocs-backend": "^1.9.6",
"@backstage/backend-common": "^0.21.5",
"@backstage/backend-plugin-api": "^0.6.15",
"@backstage/backend-tasks": "^0.5.20",
"@backstage/catalog-client": "^1.6.2",
"@backstage/catalog-model": "^1.4.5",
"@backstage/config": "^1.2.0",
"@backstage/integration": "^1.9.1",
"@backstage/integration-aws-node": "^0.1.11",
"@backstage/plugin-app-backend": "^0.3.63",
"@backstage/plugin-auth-backend": "^0.22.2",
"@backstage/plugin-catalog-backend": "^1.20.0",
"@backstage/plugin-permission-common": "^0.7.13",
"@backstage/plugin-permission-node": "^0.7.26",
"@backstage/plugin-proxy-backend": "^0.4.13",
"@backstage/plugin-scaffolder-backend": "^1.22.2",
"@backstage/plugin-techdocs-backend": "^1.10.2",
"@gitbeaker/node": "^35.1.0",
"@langchain/community": "^0.0.32",
"@langchain/openai": "^0.0.14",
"@octokit/rest": "^19.0.3",
"@roadiehq/backstage-plugin-argo-cd-backend": "2.14.6",
"@roadiehq/backstage-plugin-aws-auth": "^0.4.21",
"@roadiehq/backstage-plugin-aws-backend": "^1.1.21",
"@roadiehq/catalog-backend-module-aws": "^2.1.6",
"@roadiehq/catalog-backend-module-okta": "^0.9.9",
"@roadiehq/backstage-plugin-aws-backend": "^1.1.21",
"@roadiehq/backstage-plugin-aws-auth": "^0.4.21",
"@roadiehq/rag-ai-backend": "^0.1.0",
"@roadiehq/rag-ai-backend-embeddings-aws": "^0.1.0",
"@roadiehq/rag-ai-backend-embeddings-openai": "^0.1.0",
"@roadiehq/rag-ai-backend-retrieval-augmenter": "^0.1.0",
"@roadiehq/rag-ai-storage-pgvector": "^0.1.0",
"@roadiehq/scaffolder-backend-module-aws": "^2.4.22",
"@roadiehq/scaffolder-backend-module-http-request": "^4.1.9",
"@roadiehq/scaffolder-backend-module-utils": "^1.13.7",
"@roadiehq/scaffolder-backend-module-aws": "^2.4.22",
"better-sqlite3": "^9.0.0",
"luxon": "^3.0.1",
"app": "^1.0.13",
"better-sqlite3": "^9.0.0",
"dockerode": "^3.3.0",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"knex": "^2.4.0",
"luxon": "^3.0.1",
"winston": "^3.2.1"
},
"devDependencies": {
"@types/luxon": "^3.0.0",
"@backstage/cli": "^0.25.2",
"@backstage/cli": "^0.26.1",
"@types/dockerode": "^3.3.0",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5"
"@types/express-serve-static-core": "^4.17.5",
"@types/luxon": "^3.0.0"
},
"files": [
"dist"
Expand Down
22 changes: 11 additions & 11 deletions packages/backend/src/plugins/scaffolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@
* limitations under the License.
*/
import {
ContainerRunner,
DockerContainerRunner,
UrlReader,
ContainerRunner,
} from '@backstage/backend-common';
import { CatalogClient } from '@backstage/catalog-client';
import {
createRouter,
createBuiltinActions,
createRouter,
TemplateAction,
} from '@backstage/plugin-scaffolder-backend';
import { createHttpBackstageAction } from '@roadiehq/scaffolder-backend-module-http-request';
import {
createZipAction,
createWriteFileAction,
createSleepAction,
createAppendFileAction,
createMergeJSONAction,
createJSONataAction,
createJsonJSONataTransformAction,
createMergeAction,
createMergeJSONAction,
createParseFileAction,
createSerializeYamlAction,
createSerializeJsonAction,
createJSONataAction,
createSerializeYamlAction,
createSleepAction,
createWriteFileAction,
createYamlJSONataTransformAction,
createJsonJSONataTransformAction,
createZipAction,
} from '@roadiehq/scaffolder-backend-module-utils';
import {
createAwsS3CpAction,
Expand All @@ -48,15 +48,15 @@ import { Router } from 'express';
import type { PluginEnvironment } from '../types';
import { ScmIntegrations } from '@backstage/integration';
import { Config } from '@backstage/config';
import { DiscoveryApi } from '@backstage/plugin-permission-common';
import { DiscoveryService } from '@backstage/backend-plugin-api';

export const createActions = (options: {
reader: UrlReader;
integrations: ScmIntegrations;
config: Config;
containerRunner: ContainerRunner;
catalogClient: CatalogClient;
discovery: DiscoveryApi;
discovery: DiscoveryService;
}): TemplateAction<any>[] => {
const { reader, integrations, config, catalogClient, discovery } = options;
const defaultActions = createBuiltinActions({
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ import { Config } from '@backstage/config';
import {
PluginCacheManager,
PluginDatabaseManager,
PluginEndpointDiscovery,
TokenManager,
UrlReader,
} from '@backstage/backend-common';
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
import { PluginTaskScheduler } from '@backstage/backend-tasks';
import { DiscoveryService } from '@backstage/backend-plugin-api';

export type PluginEnvironment = {
logger: Logger;
cache: PluginCacheManager;
database: PluginDatabaseManager;
config: Config;
reader: UrlReader;
discovery: PluginEndpointDiscovery;
discovery: DiscoveryService;
tokenManager: TokenManager;
permissions: ServerPermissionClient;
scheduler: PluginTaskScheduler;
Expand Down
9 changes: 5 additions & 4 deletions plugins/backend/backstage-aws-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/backend-common": "^0.21.3",
"@backstage/catalog-client": "^1.6.0",
"@backstage/config": "^1.1.1",
"@backstage/backend-common": "^0.21.5",
"@backstage/backend-plugin-api": "^0.6.15",
"@backstage/catalog-client": "^1.6.2",
"@backstage/config": "^1.2.0",
"@types/express": "^4.17.6",
"@aws-sdk/client-cloudcontrol": "^3.76.0",
"@aws-sdk/credential-providers": "^3.76.0",
Expand All @@ -39,7 +40,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.25.2",
"@backstage/cli": "^0.26.1",
"@types/supertest": "^2.0.8",
"supertest": "^4.0.2",
"aws-sdk-client-mock": "^3.0.1"
Expand Down
1 change: 1 addition & 0 deletions plugins/backend/backstage-aws-backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
*/

export * from './service/router';
export { roadieAwsBackendPlugin as default } from './plugin';
40 changes: 40 additions & 0 deletions plugins/backend/backstage-aws-backend/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2024 Larder Software Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { createRouter } from './service/router';

export const roadieAwsBackendPlugin = createBackendPlugin({
pluginId: 'roadie-aws-backend',
register(reg) {
reg.registerInit({
deps: {
httpRouter: coreServices.httpRouter,
config: coreServices.rootConfig,
logger: coreServices.logger,
},
async init({ config, httpRouter, logger }) {
const router = await createRouter({
config,
logger,
});
httpRouter.use(router);
},
});
},
});
4 changes: 2 additions & 2 deletions plugins/backend/backstage-aws-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import { errorHandler } from '@backstage/backend-common';
import { Config } from '@backstage/config';
import express, { Request } from 'express';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import { CloudControl } from '@aws-sdk/client-cloudcontrol';
import { fromTemporaryCredentials } from '@aws-sdk/credential-providers';
import { Account } from '../types';
import { LoggerService } from '@backstage/backend-plugin-api';

export interface RouterOptions {
logger: Logger;
logger: LoggerService;
config: Config;
}

Expand Down
11 changes: 6 additions & 5 deletions plugins/backend/backstage-plugin-argo-cd-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/backend-common": "^0.21.3",
"@backstage/catalog-client": "^1.6.0",
"@backstage/config": "^1.1.1",
"@backstage/backend-common": "^0.21.5",
"@backstage/backend-plugin-api": "^0.6.15",
"@backstage/catalog-client": "^1.6.2",
"@backstage/config": "^1.2.0",
"@types/express": "^4.17.6",
"cross-fetch": "^3.1.4",
"express": "^4.17.1",
Expand All @@ -38,10 +39,10 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/cli": "^0.25.2",
"jest-mock": "^29.0.0",
"@backstage/cli": "^0.26.1",
"@types/supertest": "^2.0.8",
"jest-fetch-mock": "^3.0.3",
"jest-mock": "^29.0.0",
"supertest": "^4.0.2",
"ts-jest": "^29.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/backend/backstage-plugin-argo-cd-backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from './service/router';
export { ArgoService } from './service/argocd.service';
export * from './lib';
export { roadieArgoCdBackendPlugin as default } from './plugin';
Loading

0 comments on commit 7ca845b

Please sign in to comment.