From 2a8fee1a512e02f93983499ae24995f9466ec6a8 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 2 Feb 2022 14:33:50 +0000 Subject: [PATCH 01/22] Initial commit of the airbrake-backend plugin Signed-off-by: Karan Shah --- packages/backend/package.json | 11 ++-- plugins/airbrake-backend/.eslintrc.js | 3 ++ plugins/airbrake-backend/README.md | 16 ++++++ plugins/airbrake-backend/package.json | 50 +++++++++++++++++++ plugins/airbrake-backend/src/index.ts | 17 +++++++ plugins/airbrake-backend/src/run.ts | 33 ++++++++++++ .../src/service/router.test.ts | 45 +++++++++++++++++ .../airbrake-backend/src/service/router.ts | 40 +++++++++++++++ .../src/service/standaloneServer.ts | 50 +++++++++++++++++++ plugins/airbrake-backend/src/setupTests.ts | 17 +++++++ yarn.lock | 41 ++++++++++++--- 11 files changed, 312 insertions(+), 11 deletions(-) create mode 100644 plugins/airbrake-backend/.eslintrc.js create mode 100644 plugins/airbrake-backend/README.md create mode 100644 plugins/airbrake-backend/package.json create mode 100644 plugins/airbrake-backend/src/index.ts create mode 100644 plugins/airbrake-backend/src/run.ts create mode 100644 plugins/airbrake-backend/src/service/router.test.ts create mode 100644 plugins/airbrake-backend/src/service/router.ts create mode 100644 plugins/airbrake-backend/src/service/standaloneServer.ts create mode 100644 plugins/airbrake-backend/src/setupTests.ts diff --git a/packages/backend/package.json b/packages/backend/package.json index c9e1c9d7c3..f3e150522c 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -38,8 +38,8 @@ "@backstage/plugin-code-coverage-backend": "^0.1.20", "@backstage/plugin-graphql-backend": "^0.1.12", "@backstage/plugin-jenkins-backend": "^0.1.11", - "@backstage/plugin-kubernetes-backend": "^0.4.5", "@backstage/plugin-kafka-backend": "^0.2.15", + "@backstage/plugin-kubernetes-backend": "^0.4.5", "@backstage/plugin-permission-backend": "^0.4.2-next.0", "@backstage/plugin-permission-common": "^0.4.0", "@backstage/plugin-permission-node": "^0.4.2-next.0", @@ -48,22 +48,23 @@ "@backstage/plugin-scaffolder-backend": "^0.15.23-next.0", "@backstage/plugin-scaffolder-backend-module-rails": "^0.2.5-next.0", "@backstage/plugin-search-backend": "^0.4.1-next.0", - "@backstage/plugin-search-backend-node": "^0.4.5", "@backstage/plugin-search-backend-module-elasticsearch": "^0.0.8", "@backstage/plugin-search-backend-module-pg": "^0.2.4", - "@backstage/plugin-techdocs-backend": "^0.13.1", + "@backstage/plugin-search-backend-node": "^0.4.5", "@backstage/plugin-tech-insights-backend": "^0.2.2", - "@backstage/plugin-tech-insights-node": "^0.2.0", "@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.6", + "@backstage/plugin-tech-insights-node": "^0.2.0", + "@backstage/plugin-techdocs-backend": "^0.13.1", "@backstage/plugin-todo-backend": "^0.1.19", "@gitbeaker/node": "^35.1.0", "@octokit/rest": "^18.5.3", "azure-devops-node-api": "^11.0.1", + "backstage-plugin-airbrake-backend": "^0.0.0", "dockerode": "^3.3.1", "example-app": "file:../app", "express": "^4.17.1", - "express-promise-router": "^4.1.0", "express-prom-bundle": "^6.3.6", + "express-promise-router": "^4.1.0", "knex": "^0.95.1", "pg": "^8.3.0", "pg-connection-string": "^2.3.0", diff --git a/plugins/airbrake-backend/.eslintrc.js b/plugins/airbrake-backend/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/plugins/airbrake-backend/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/plugins/airbrake-backend/README.md b/plugins/airbrake-backend/README.md new file mode 100644 index 0000000000..42369524d6 --- /dev/null +++ b/plugins/airbrake-backend/README.md @@ -0,0 +1,16 @@ +# airbrake-backend + +Welcome to the airbrake-backend backend plugin! + +_This plugin was created through the Backstage CLI_ + +## Getting started + +Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn start` in the root directory, and then navigating to [/airbrake-backend](http://localhost:7007/airbrake-backend). + +Here is an example endpoint: http://localhost:7007/airbrake-backend/health + +You can also serve the plugin in isolation by running `yarn start` in the plugin directory. +This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. + +It is only meant for local development. diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json new file mode 100644 index 0000000000..01cca714b5 --- /dev/null +++ b/plugins/airbrake-backend/package.json @@ -0,0 +1,50 @@ +{ + "name": "backstage-plugin-airbrake-backend", + "version": "0.0.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "private": true, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "scripts": { + "start": "backstage-cli backend:dev", + "build": "backstage-cli backend:build", + "lint": "backstage-cli lint", + "test": "backstage-cli test", + "prepack": "backstage-cli prepack", + "postpack": "backstage-cli postpack", + "clean": "backstage-cli clean" + }, + "dependencies": { + "@backstage/backend-common": "^0.10.5", + "@backstage/config": "^0.1.13", + "@types/express": "*", + "express": "^4.17.1", + "express-promise-router": "^4.1.0", + "winston": "^3.2.1", + "cross-fetch": "^3.0.6", + "yn": "^4.0.0" + }, + "devDependencies": { + "@backstage/cli": "^0.13.1-next.0", + "@types/supertest": "^2.0.8", + "supertest": "^4.0.2", + "msw": "^0.35.0" + }, + "files": [ + "dist" + ], + "jest": { + "coverageThreshold": { + "global": { + "functions": 100, + "lines": 100, + "statements": 100 + } + } + } +} diff --git a/plugins/airbrake-backend/src/index.ts b/plugins/airbrake-backend/src/index.ts new file mode 100644 index 0000000000..ca73cb27ba --- /dev/null +++ b/plugins/airbrake-backend/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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. + */ + +export * from './service/router'; diff --git a/plugins/airbrake-backend/src/run.ts b/plugins/airbrake-backend/src/run.ts new file mode 100644 index 0000000000..0a3ed2b7f0 --- /dev/null +++ b/plugins/airbrake-backend/src/run.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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 { getRootLogger } from '@backstage/backend-common'; +import yn from 'yn'; +import { startStandaloneServer } from './service/standaloneServer'; + +const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007; +const enableCors = yn(process.env.PLUGIN_CORS, { default: false }); +const logger = getRootLogger(); + +startStandaloneServer({ port, enableCors, logger }).catch(err => { + logger.error(err); + process.exit(1); +}); + +process.on('SIGINT', () => { + logger.info('CTRL+C pressed; exiting.'); + process.exit(0); +}); diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts new file mode 100644 index 0000000000..8b77a04348 --- /dev/null +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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 { getVoidLogger } from '@backstage/backend-common'; +import express from 'express'; +import request from 'supertest'; + +import { createRouter } from './router'; + +describe('createRouter', () => { + let app: express.Express; + + beforeAll(async () => { + const router = await createRouter({ + logger: getVoidLogger(), + }); + app = express().use(router); + }); + + beforeEach(() => { + jest.resetAllMocks(); + }); + + describe('GET /health', () => { + it('returns ok', async () => { + const response = await request(app).get('/health'); + + expect(response.status).toEqual(200); + expect(response.body).toEqual({ status: 'ok' }); + }); + }); +}); diff --git a/plugins/airbrake-backend/src/service/router.ts b/plugins/airbrake-backend/src/service/router.ts new file mode 100644 index 0000000000..9ceaa47627 --- /dev/null +++ b/plugins/airbrake-backend/src/service/router.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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 { errorHandler } from '@backstage/backend-common'; +import express from 'express'; +import Router from 'express-promise-router'; +import { Logger } from 'winston'; + +export interface RouterOptions { + logger: Logger; +} + +export async function createRouter( + options: RouterOptions, +): Promise { + const { logger } = options; + + const router = Router(); + router.use(express.json()); + + router.get('/health', (_, response) => { + logger.info('PONG!'); + response.send({ status: 'ok' }); + }); + router.use(errorHandler()); + return router; +} diff --git a/plugins/airbrake-backend/src/service/standaloneServer.ts b/plugins/airbrake-backend/src/service/standaloneServer.ts new file mode 100644 index 0000000000..6287bf9f97 --- /dev/null +++ b/plugins/airbrake-backend/src/service/standaloneServer.ts @@ -0,0 +1,50 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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 { createServiceBuilder } from '@backstage/backend-common'; +import { Server } from 'http'; +import { Logger } from 'winston'; +import { createRouter } from './router'; + +export interface ServerOptions { + port: number; + enableCors: boolean; + logger: Logger; +} + +export async function startStandaloneServer( + options: ServerOptions, +): Promise { + const logger = options.logger.child({ service: 'airbrake-backend-backend' }); + logger.debug('Starting application server...'); + const router = await createRouter({ + logger, + }); + + let service = createServiceBuilder(module) + .setPort(options.port) + .addRouter('/airbrake-backend', router); + if (options.enableCors) { + service = service.enableCors({ origin: 'http://localhost:3000' }); + } + + return await service.start().catch(err => { + logger.error(err); + process.exit(1); + }); +} + +module.hot?.accept(); diff --git a/plugins/airbrake-backend/src/setupTests.ts b/plugins/airbrake-backend/src/setupTests.ts new file mode 100644 index 0000000000..d3232290a7 --- /dev/null +++ b/plugins/airbrake-backend/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * 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. + */ + +export {}; diff --git a/yarn.lock b/yarn.lock index 65307c3d71..a716334c57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9026,7 +9026,7 @@ compare-func@^2.0.0: array-ify "^1.0.0" dot-prop "^5.1.0" -component-emitter@^1.2.1, component-emitter@^1.3.0: +component-emitter@^1.2.0, component-emitter@^1.2.1, component-emitter@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== @@ -9307,7 +9307,7 @@ cookie@0.4.1, cookie@^0.4.1, cookie@~0.4.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== -cookiejar@^2.1.3: +cookiejar@^2.1.0, cookiejar@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== @@ -12344,7 +12344,7 @@ form-data@4.0.0, form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^2.3.2, form-data@^2.5.0: +form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: version "2.5.1" resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== @@ -12392,6 +12392,11 @@ formdata-node@^4.3.1: node-domexception "1.0.0" web-streams-polyfill "4.0.0-beta.1" +formidable@^1.2.0: + version "1.2.6" + resolved "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz#d2a51d60162bbc9b4a055d8457a7c75315d1a168" + integrity sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ== + formidable@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz#4310bc7965d185536f9565184dee74fbb75557ff" @@ -16969,7 +16974,7 @@ meros@1.1.4, meros@^1.1.4: resolved "https://registry.npmjs.org/meros/-/meros-1.1.4.tgz#c17994d3133db8b23807f62bec7f0cb276cfd948" integrity sha512-E9ZXfK9iQfG9s73ars9qvvvbSIkJZF5yOo9j4tcwM5tN8mUKfj/EKN5PzOr3ZH0y5wL7dLAHw3RVEfpQV9Q7VQ== -methods@^1.0.0, methods@^1.1.2, methods@~1.1.2: +methods@^1.0.0, methods@^1.1.1, methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= @@ -17324,7 +17329,7 @@ mime-types@^2.0.8, mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, m dependencies: mime-db "1.51.0" -mime@1.6.0: +mime@1.6.0, mime@^1.4.1: version "1.6.0" resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== @@ -20105,7 +20110,7 @@ qs@6.9.6: resolved "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== -qs@^6.10.1, qs@^6.10.2, qs@^6.9.1, qs@^6.9.4, qs@^6.9.6: +qs@^6.10.1, qs@^6.10.2, qs@^6.5.1, qs@^6.9.1, qs@^6.9.4, qs@^6.9.6: version "6.10.3" resolved "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== @@ -22855,6 +22860,22 @@ sucrase@^3.18.0, sucrase@^3.20.2: pirates "^4.0.1" ts-interface-checker "^0.1.9" +superagent@^3.8.3: + version "3.8.3" + resolved "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128" + integrity sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA== + dependencies: + component-emitter "^1.2.0" + cookiejar "^2.1.0" + debug "^3.1.0" + extend "^3.0.0" + form-data "^2.3.1" + formidable "^1.2.0" + methods "^1.1.1" + mime "^1.4.1" + qs "^6.5.1" + readable-stream "^2.3.5" + superagent@^7.1.0: version "7.1.1" resolved "https://registry.npmjs.org/superagent/-/superagent-7.1.1.tgz#2ab187d38c3078c31c3771c0b751f10163a27136" @@ -22872,6 +22893,14 @@ superagent@^7.1.0: readable-stream "^3.6.0" semver "^7.3.5" +supertest@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/supertest/-/supertest-4.0.2.tgz#c2234dbdd6dc79b6f15b99c8d6577b90e4ce3f36" + integrity sha512-1BAbvrOZsGA3YTCWqbmh14L0YEq0EGICX/nBnfkfVJn7SrxQV1I3pMYjSzG9y/7ZU2V9dWqyqk2POwxlb09duQ== + dependencies: + methods "^1.1.2" + superagent "^3.8.3" + supertest@^6.1.3, supertest@^6.1.6: version "6.2.2" resolved "https://registry.npmjs.org/supertest/-/supertest-6.2.2.tgz#04a5998fd3efaff187cb69f07a169755d655b001" From 58c213f0afcad25f1a045c164e22dabce7c5defe Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 2 Feb 2022 15:21:24 +0000 Subject: [PATCH 02/22] Ignore generated code Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 01cca714b5..7fa5e3d464 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -45,6 +45,11 @@ "lines": 100, "statements": 100 } - } + }, + "coveragePathIgnorePatterns": [ + "standaloneServer.ts", + "index.ts", + "run.ts" + ] } } From 64045884baaddc0e297fe2461270ee85f68d8113 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Thu, 3 Feb 2022 10:54:18 +0000 Subject: [PATCH 03/22] Added: - Config management - path rewrite Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 2 ++ .../src/config/ExtractAirbrakeConfig.ts | 26 +++++++++++++++++++ plugins/airbrake-backend/src/config/index.ts | 18 +++++++++++++ .../src/service/router.test.ts | 13 +++++++++- .../airbrake-backend/src/service/router.ts | 23 ++++++++++++++++ .../src/service/standaloneServer.ts | 9 ++++++- 6 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts create mode 100644 plugins/airbrake-backend/src/config/index.ts diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 7fa5e3d464..3f174caee4 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -25,12 +25,14 @@ "@types/express": "*", "express": "^4.17.1", "express-promise-router": "^4.1.0", + "http-proxy-middleware": "^2.0.0", "winston": "^3.2.1", "cross-fetch": "^3.0.6", "yn": "^4.0.0" }, "devDependencies": { "@backstage/cli": "^0.13.1-next.0", + "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", "supertest": "^4.0.2", "msw": "^0.35.0" diff --git a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts new file mode 100644 index 0000000000..06f5e46e85 --- /dev/null +++ b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2022 The Backstage Authors + * + * 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 { Config } from '@backstage/config'; + +export type AirbrakeConfig = { + apiKey: string; +}; + +export function extractAirbrakeConfig(config: Config): AirbrakeConfig { + return { + apiKey: config.getString('integrations.airbrake.apiKey'), + }; +} diff --git a/plugins/airbrake-backend/src/config/index.ts b/plugins/airbrake-backend/src/config/index.ts new file mode 100644 index 0000000000..6200baca53 --- /dev/null +++ b/plugins/airbrake-backend/src/config/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2022 The Backstage Authors + * + * 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. + */ + +export { extractAirbrakeConfig } from './ExtractAirbrakeConfig'; +export type { AirbrakeConfig } from './ExtractAirbrakeConfig'; diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts index 8b77a04348..ec21a340a3 100644 --- a/plugins/airbrake-backend/src/service/router.test.ts +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -17,15 +17,26 @@ import { getVoidLogger } from '@backstage/backend-common'; import express from 'express'; import request from 'supertest'; - +import { ConfigReader } from '@backstage/config'; import { createRouter } from './router'; +import { extractAirbrakeConfig } from '../config'; describe('createRouter', () => { let app: express.Express; beforeAll(async () => { + const config = new ConfigReader({ + integrations: { + airbrake: { + apiKey: 'fakeApiKey', + }, + }, + }); + const airbrakeConfig = extractAirbrakeConfig(config); + const router = await createRouter({ logger: getVoidLogger(), + airbrakeConfig, }); app = express().use(router); }); diff --git a/plugins/airbrake-backend/src/service/router.ts b/plugins/airbrake-backend/src/service/router.ts index 9ceaa47627..77b115f088 100644 --- a/plugins/airbrake-backend/src/service/router.ts +++ b/plugins/airbrake-backend/src/service/router.ts @@ -18,9 +18,12 @@ import { errorHandler } from '@backstage/backend-common'; import express from 'express'; import Router from 'express-promise-router'; import { Logger } from 'winston'; +import { createProxyMiddleware } from 'http-proxy-middleware'; +import { AirbrakeConfig } from '../config'; export interface RouterOptions { logger: Logger; + airbrakeConfig: AirbrakeConfig; } export async function createRouter( @@ -35,6 +38,26 @@ export async function createRouter( logger.info('PONG!'); response.send({ status: 'ok' }); }); + + router.use( + '/api', + createProxyMiddleware({ + target: 'https://api.airbrake.io/api', + changeOrigin: true, + pathRewrite: path => { + const apiKey = options.airbrakeConfig.apiKey; + + let newPath = path.replace(/.+?(\/api)/, ''); + if (newPath.includes('?')) { + newPath += `&key=${apiKey}`; + } else { + newPath += `?key=${apiKey}`; + } + return newPath; + }, + }), + ); + router.use(errorHandler()); return router; } diff --git a/plugins/airbrake-backend/src/service/standaloneServer.ts b/plugins/airbrake-backend/src/service/standaloneServer.ts index 6287bf9f97..5957dd0b7f 100644 --- a/plugins/airbrake-backend/src/service/standaloneServer.ts +++ b/plugins/airbrake-backend/src/service/standaloneServer.ts @@ -14,10 +14,14 @@ * limitations under the License. */ -import { createServiceBuilder } from '@backstage/backend-common'; +import { + createServiceBuilder, + loadBackendConfig, +} from '@backstage/backend-common'; import { Server } from 'http'; import { Logger } from 'winston'; import { createRouter } from './router'; +import { extractAirbrakeConfig } from '../config'; export interface ServerOptions { port: number; @@ -29,9 +33,12 @@ export async function startStandaloneServer( options: ServerOptions, ): Promise { const logger = options.logger.child({ service: 'airbrake-backend-backend' }); + const config = await loadBackendConfig({ logger, argv: process.argv }); + const airbrakeConfig = extractAirbrakeConfig(config); logger.debug('Starting application server...'); const router = await createRouter({ logger, + airbrakeConfig, }); let service = createServiceBuilder(module) From a3dd1a8b6da0e0f258f27025bd699c612bace159 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Thu, 3 Feb 2022 11:51:47 +0000 Subject: [PATCH 04/22] Add a way to access the Airbrake secret from env Signed-off-by: Karan Shah --- app-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app-config.yaml b/app-config.yaml index b025064c74..1f03105cde 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -193,6 +193,8 @@ integrations: - host: amazonaws.com accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} + airbrake: + apiKey: ${AIRBRAKE_API_KEY} catalog: import: From 9723a4a96a3a6465a8125cb70feee343ea8ac1e5 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Fri, 4 Feb 2022 10:27:01 +0000 Subject: [PATCH 05/22] Write a test for pathRewrite Signed-off-by: Karan Shah --- .../src/service/router.test.ts | 35 ++++++++++++++----- .../airbrake-backend/src/service/router.ts | 29 +++++++++------ 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts index ec21a340a3..f36d36d6f1 100644 --- a/plugins/airbrake-backend/src/service/router.test.ts +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -18,13 +18,20 @@ import { getVoidLogger } from '@backstage/backend-common'; import express from 'express'; import request from 'supertest'; import { ConfigReader } from '@backstage/config'; -import { createRouter } from './router'; -import { extractAirbrakeConfig } from '../config'; +import { + createRouter, + generateAirbrakePathRewrite, + RouterOptions, +} from './router'; +import { AirbrakeConfig, extractAirbrakeConfig } from '../config'; describe('createRouter', () => { let app: express.Express; + let airbrakeConfig: AirbrakeConfig; + + beforeEach(async () => { + jest.resetAllMocks(); - beforeAll(async () => { const config = new ConfigReader({ integrations: { airbrake: { @@ -32,7 +39,7 @@ describe('createRouter', () => { }, }, }); - const airbrakeConfig = extractAirbrakeConfig(config); + airbrakeConfig = extractAirbrakeConfig(config); const router = await createRouter({ logger: getVoidLogger(), @@ -41,10 +48,6 @@ describe('createRouter', () => { app = express().use(router); }); - beforeEach(() => { - jest.resetAllMocks(); - }); - describe('GET /health', () => { it('returns ok', async () => { const response = await request(app).get('/health'); @@ -53,4 +56,20 @@ describe('createRouter', () => { expect(response.body).toEqual({ status: 'ok' }); }); }); + + describe('GET /api', () => { + it('appends the API Key properly', () => { + const options: RouterOptions = { + logger: getVoidLogger(), + airbrakeConfig, + }; + const pathRewrite = generateAirbrakePathRewrite(options) as ( + path: string, + ) => string; + + expect(pathRewrite('/airbrake-backend/api/random/endpoint')).toBe( + '/random/endpoint?key=fakeApiKey', + ); + }); + }); }); diff --git a/plugins/airbrake-backend/src/service/router.ts b/plugins/airbrake-backend/src/service/router.ts index 77b115f088..670a98eb78 100644 --- a/plugins/airbrake-backend/src/service/router.ts +++ b/plugins/airbrake-backend/src/service/router.ts @@ -20,12 +20,29 @@ import Router from 'express-promise-router'; import { Logger } from 'winston'; import { createProxyMiddleware } from 'http-proxy-middleware'; import { AirbrakeConfig } from '../config'; +import { Options } from 'http-proxy-middleware/dist/types'; export interface RouterOptions { logger: Logger; airbrakeConfig: AirbrakeConfig; } +export const generateAirbrakePathRewrite = ( + options: RouterOptions, +): Options['pathRewrite'] => { + const apiKey = options.airbrakeConfig.apiKey; + + return path => { + let newPath = path.replace(/.+?(\/api)/, ''); + if (newPath.includes('?')) { + newPath += `&key=${apiKey}`; + } else { + newPath += `?key=${apiKey}`; + } + return newPath; + }; +}; + export async function createRouter( options: RouterOptions, ): Promise { @@ -44,17 +61,7 @@ export async function createRouter( createProxyMiddleware({ target: 'https://api.airbrake.io/api', changeOrigin: true, - pathRewrite: path => { - const apiKey = options.airbrakeConfig.apiKey; - - let newPath = path.replace(/.+?(\/api)/, ''); - if (newPath.includes('?')) { - newPath += `&key=${apiKey}`; - } else { - newPath += `?key=${apiKey}`; - } - return newPath; - }, + pathRewrite: generateAirbrakePathRewrite(options), }), ); From d5470ec47f5191ce637226cb1390efde70be98a3 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Fri, 4 Feb 2022 14:24:03 +0000 Subject: [PATCH 06/22] Added a test for appending the API key to a URL parameter Signed-off-by: Karan Shah --- .../src/service/router.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts index f36d36d6f1..7fae43fe8c 100644 --- a/plugins/airbrake-backend/src/service/router.test.ts +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -58,7 +58,7 @@ describe('createRouter', () => { }); describe('GET /api', () => { - it('appends the API Key properly', () => { + it('appends the API Key properly with no other url parameters', () => { const options: RouterOptions = { logger: getVoidLogger(), airbrakeConfig, @@ -71,5 +71,21 @@ describe('createRouter', () => { '/random/endpoint?key=fakeApiKey', ); }); + + it('appends the API Key properly despite there being other URL parameters', () => { + const options: RouterOptions = { + logger: getVoidLogger(), + airbrakeConfig, + }; + const pathRewrite = generateAirbrakePathRewrite(options) as ( + path: string, + ) => string; + + expect( + pathRewrite( + '/airbrake-backend/api/random/endpoint?param1=123¶m2=abc', + ), + ).toBe('/random/endpoint?param1=123¶m2=abc&key=fakeApiKey'); + }); }); }); From 761b6ead75ca584ace781d13e4d4545a47b9973c Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Fri, 4 Feb 2022 14:29:16 +0000 Subject: [PATCH 07/22] Added /v4 to tests to better explain what it's trying to do Signed-off-by: Karan Shah --- plugins/airbrake-backend/src/service/router.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts index 7fae43fe8c..d4d86722a8 100644 --- a/plugins/airbrake-backend/src/service/router.test.ts +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -67,8 +67,8 @@ describe('createRouter', () => { path: string, ) => string; - expect(pathRewrite('/airbrake-backend/api/random/endpoint')).toBe( - '/random/endpoint?key=fakeApiKey', + expect(pathRewrite('/airbrake-backend/api/v4/random/endpoint')).toBe( + '/v4/random/endpoint?key=fakeApiKey', ); }); @@ -83,9 +83,9 @@ describe('createRouter', () => { expect( pathRewrite( - '/airbrake-backend/api/random/endpoint?param1=123¶m2=abc', + '/airbrake-backend/api/v4/random/endpoint?param1=123¶m2=abc', ), - ).toBe('/random/endpoint?param1=123¶m2=abc&key=fakeApiKey'); + ).toBe('/v4/random/endpoint?param1=123¶m2=abc&key=fakeApiKey'); }); }); }); From 86458c3ebeb8e3c21e93ee81287156c9f7b5d60a Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Mon, 7 Feb 2022 13:32:51 +0000 Subject: [PATCH 08/22] Added a changeset Signed-off-by: Karan Shah --- .changeset/unlucky-spoons-sort.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/unlucky-spoons-sort.md diff --git a/.changeset/unlucky-spoons-sort.md b/.changeset/unlucky-spoons-sort.md new file mode 100644 index 0000000000..9c0d6cb49b --- /dev/null +++ b/.changeset/unlucky-spoons-sort.md @@ -0,0 +1,5 @@ +--- +'backstage-plugin-airbrake-backend': minor +--- + +Airbrake backend plugin created which proxies all requests to Airbrake's API From a5aebe3e30b0968738c7f0ba845f6e32de3070c5 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Mon, 7 Feb 2022 14:34:57 +0000 Subject: [PATCH 09/22] Updated package name Signed-off-by: Karan Shah --- .changeset/modern-lizards-sniff.md | 5 ++++ .changeset/unlucky-spoons-sort.md | 5 ---- packages/backend/package.json | 2 +- plugins/airbrake-backend/api-report.md | 35 ++++++++++++++++++++++++++ plugins/airbrake-backend/package.json | 2 +- 5 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .changeset/modern-lizards-sniff.md delete mode 100644 .changeset/unlucky-spoons-sort.md create mode 100644 plugins/airbrake-backend/api-report.md diff --git a/.changeset/modern-lizards-sniff.md b/.changeset/modern-lizards-sniff.md new file mode 100644 index 0000000000..cf1994ee7f --- /dev/null +++ b/.changeset/modern-lizards-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-airbrake-backend': minor +--- + +Created the Airbrake backend plugin that proxies requests to the Airbrake API diff --git a/.changeset/unlucky-spoons-sort.md b/.changeset/unlucky-spoons-sort.md deleted file mode 100644 index 9c0d6cb49b..0000000000 --- a/.changeset/unlucky-spoons-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'backstage-plugin-airbrake-backend': minor ---- - -Airbrake backend plugin created which proxies all requests to Airbrake's API diff --git a/packages/backend/package.json b/packages/backend/package.json index 6f3621cc85..b61b7ad81c 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -30,6 +30,7 @@ "@backstage/catalog-model": "^0.9.10", "@backstage/config": "^0.1.13", "@backstage/integration": "^0.7.2", + "@backstage/plugin-airbrake-backend": "^0.0.0", "@backstage/plugin-app-backend": "^0.3.23", "@backstage/plugin-auth-backend": "^0.9.0", "@backstage/plugin-azure-devops-backend": "^0.3.2", @@ -59,7 +60,6 @@ "@gitbeaker/node": "^35.1.0", "@octokit/rest": "^18.5.3", "azure-devops-node-api": "^11.0.1", - "backstage-plugin-airbrake-backend": "^0.0.0", "dockerode": "^3.3.1", "example-app": "file:../app", "express": "^4.17.1", diff --git a/plugins/airbrake-backend/api-report.md b/plugins/airbrake-backend/api-report.md new file mode 100644 index 0000000000..cd56b87f86 --- /dev/null +++ b/plugins/airbrake-backend/api-report.md @@ -0,0 +1,35 @@ +## API Report File for "@backstage/plugin-airbrake-backend" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import express from 'express'; +import { Logger as Logger_2 } from 'winston'; +import { Options } from 'http-proxy-middleware/dist/types'; + +// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export function createRouter(options: RouterOptions): Promise; + +// Warning: (ae-missing-release-tag) "generateAirbrakePathRewrite" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export const generateAirbrakePathRewrite: ( + options: RouterOptions, +) => Options['pathRewrite']; + +// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface RouterOptions { + // Warning: (ae-forgotten-export) The symbol "AirbrakeConfig" needs to be exported by the entry point index.d.ts + // + // (undocumented) + airbrakeConfig: AirbrakeConfig; + // (undocumented) + logger: Logger_2; +} + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 3f174caee4..812ad33654 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -1,5 +1,5 @@ { - "name": "backstage-plugin-airbrake-backend", + "name": "@backstage/plugin-airbrake-backend", "version": "0.0.0", "main": "src/index.ts", "types": "src/index.ts", From c16a3a60a026c5fa505ed3789428074e387d9166 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Mon, 7 Feb 2022 14:49:21 +0000 Subject: [PATCH 10/22] Attempt to fix "Incomplete multi-character sanitization" Signed-off-by: Karan Shah --- plugins/airbrake-backend/src/service/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/airbrake-backend/src/service/router.ts b/plugins/airbrake-backend/src/service/router.ts index 670a98eb78..9dc80ab7e1 100644 --- a/plugins/airbrake-backend/src/service/router.ts +++ b/plugins/airbrake-backend/src/service/router.ts @@ -33,7 +33,7 @@ export const generateAirbrakePathRewrite = ( const apiKey = options.airbrakeConfig.apiKey; return path => { - let newPath = path.replace(/.+?(\/api)/, ''); + let newPath = path.replace(/.+?(\/api)/g, ''); if (newPath.includes('?')) { newPath += `&key=${apiKey}`; } else { From 7dc3a7d32a1d5dd1a0db05a30bc135f3de2579b4 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Tue, 8 Feb 2022 11:23:10 +0000 Subject: [PATCH 11/22] Address comments and suggestions - Added documentation for api-report.md - Reverted the change to ADOPTERS.md Signed-off-by: Karan Shah --- app-config.yaml | 5 ++-- plugins/airbrake-backend/api-report.md | 29 +++++++------------ .../src/config/ExtractAirbrakeConfig.ts | 17 ++++++++++- plugins/airbrake-backend/src/index.ts | 7 +++++ .../airbrake-backend/src/service/router.ts | 26 +++++++++++++++++ 5 files changed, 62 insertions(+), 22 deletions(-) diff --git a/app-config.yaml b/app-config.yaml index 1f03105cde..e49e29c45a 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -193,8 +193,6 @@ integrations: - host: amazonaws.com accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} - airbrake: - apiKey: ${AIRBRAKE_API_KEY} catalog: import: @@ -466,3 +464,6 @@ apacheAirflow: gocd: baseUrl: https://your.gocd.instance.com + +airbrake: + apiKey: ${AIRBRAKE_API_KEY} diff --git a/plugins/airbrake-backend/api-report.md b/plugins/airbrake-backend/api-report.md index cd56b87f86..c888d55e5b 100644 --- a/plugins/airbrake-backend/api-report.md +++ b/plugins/airbrake-backend/api-report.md @@ -3,33 +3,24 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { Config } from '@backstage/config'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; -import { Options } from 'http-proxy-middleware/dist/types'; -// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public +export type AirbrakeConfig = { + apiKey: string; +}; + +// @public export function createRouter(options: RouterOptions): Promise; -// Warning: (ae-missing-release-tag) "generateAirbrakePathRewrite" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export const generateAirbrakePathRewrite: ( - options: RouterOptions, -) => Options['pathRewrite']; +// @public +export function extractAirbrakeConfig(config: Config): AirbrakeConfig; -// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export interface RouterOptions { - // Warning: (ae-forgotten-export) The symbol "AirbrakeConfig" needs to be exported by the entry point index.d.ts - // - // (undocumented) airbrakeConfig: AirbrakeConfig; - // (undocumented) logger: Logger_2; } - -// (No @packageDocumentation comment for this package) ``` diff --git a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts index 06f5e46e85..6d6c814345 100644 --- a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts +++ b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts @@ -15,12 +15,27 @@ */ import { Config } from '@backstage/config'; +/** + * The Airbrake config object + * + * @public + */ export type AirbrakeConfig = { + /** + * The API Key + */ apiKey: string; }; +/** + * Extract the Airbrake config from a config object + * + * @public + * + * @param config - The config object to extract from + */ export function extractAirbrakeConfig(config: Config): AirbrakeConfig { return { - apiKey: config.getString('integrations.airbrake.apiKey'), + apiKey: config.getString('airbrake.apiKey'), }; } diff --git a/plugins/airbrake-backend/src/index.ts b/plugins/airbrake-backend/src/index.ts index ca73cb27ba..f4ec6008c2 100644 --- a/plugins/airbrake-backend/src/index.ts +++ b/plugins/airbrake-backend/src/index.ts @@ -14,4 +14,11 @@ * limitations under the License. */ +/** + * The Airbrake Backend plugin used by \@backstage/plugin-airbrake + * + * @packageDocumentation + */ + export * from './service/router'; +export * from './config'; diff --git a/plugins/airbrake-backend/src/service/router.ts b/plugins/airbrake-backend/src/service/router.ts index 9dc80ab7e1..b870eb5c13 100644 --- a/plugins/airbrake-backend/src/service/router.ts +++ b/plugins/airbrake-backend/src/service/router.ts @@ -22,11 +22,30 @@ import { createProxyMiddleware } from 'http-proxy-middleware'; import { AirbrakeConfig } from '../config'; import { Options } from 'http-proxy-middleware/dist/types'; +/** + * The router options that are needed when creating a router. + * + * @public + */ export interface RouterOptions { + /** + * A logger object + */ logger: Logger; + + /** + * The Airbrake config obtained from {@link extractAirbrakeConfig} + */ airbrakeConfig: AirbrakeConfig; } +/** + * Mainly used internally to generate the path. + * + * @internal + * + * @param options - Router options + */ export const generateAirbrakePathRewrite = ( options: RouterOptions, ): Options['pathRewrite'] => { @@ -43,6 +62,13 @@ export const generateAirbrakePathRewrite = ( }; }; +/** + * Create the Airbrake Router, used for making API calls to the Airbrake API. + * + * @public + * + * @param options - Router options + */ export async function createRouter( options: RouterOptions, ): Promise { From a61c56423f4e0611f87e74ea4ed0933865987aaa Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Tue, 8 Feb 2022 11:27:20 +0000 Subject: [PATCH 12/22] Address comments and suggestions - Updated supertest Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 2 +- yarn.lock | 41 ++++----------------------- 2 files changed, 7 insertions(+), 36 deletions(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 812ad33654..0ad55d192c 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -34,7 +34,7 @@ "@backstage/cli": "^0.13.1-next.0", "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", - "supertest": "^4.0.2", + "supertest": "^6.1.6", "msw": "^0.35.0" }, "files": [ diff --git a/yarn.lock b/yarn.lock index ddfec88ac7..386ba1955c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8903,7 +8903,7 @@ compare-func@^2.0.0: array-ify "^1.0.0" dot-prop "^5.1.0" -component-emitter@^1.2.0, component-emitter@^1.2.1, component-emitter@^1.3.0: +component-emitter@^1.2.1, component-emitter@^1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== @@ -9184,7 +9184,7 @@ cookie@0.4.1, cookie@^0.4.1, cookie@~0.4.1: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== -cookiejar@^2.1.0, cookiejar@^2.1.3: +cookiejar@^2.1.3: version "2.1.3" resolved "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== @@ -12202,7 +12202,7 @@ form-data@4.0.0, form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: +form-data@^2.3.2, form-data@^2.5.0: version "2.5.1" resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== @@ -12250,11 +12250,6 @@ formdata-node@^4.3.1: node-domexception "1.0.0" web-streams-polyfill "4.0.0-beta.1" -formidable@^1.2.0: - version "1.2.6" - resolved "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz#d2a51d60162bbc9b4a055d8457a7c75315d1a168" - integrity sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ== - formidable@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/formidable/-/formidable-2.0.1.tgz#4310bc7965d185536f9565184dee74fbb75557ff" @@ -16812,7 +16807,7 @@ meros@1.1.4, meros@^1.1.4: resolved "https://registry.npmjs.org/meros/-/meros-1.1.4.tgz#c17994d3133db8b23807f62bec7f0cb276cfd948" integrity sha512-E9ZXfK9iQfG9s73ars9qvvvbSIkJZF5yOo9j4tcwM5tN8mUKfj/EKN5PzOr3ZH0y5wL7dLAHw3RVEfpQV9Q7VQ== -methods@^1.0.0, methods@^1.1.1, methods@^1.1.2, methods@~1.1.2: +methods@^1.0.0, methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= @@ -17167,7 +17162,7 @@ mime-types@^2.0.8, mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, m dependencies: mime-db "1.51.0" -mime@1.6.0, mime@^1.4.1: +mime@1.6.0: version "1.6.0" resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== @@ -19948,7 +19943,7 @@ qs@6.9.6: resolved "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== -qs@^6.10.1, qs@^6.10.2, qs@^6.5.1, qs@^6.9.1, qs@^6.9.4, qs@^6.9.6: +qs@^6.10.1, qs@^6.10.2, qs@^6.9.1, qs@^6.9.4, qs@^6.9.6: version "6.10.3" resolved "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e" integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ== @@ -22682,22 +22677,6 @@ sucrase@^3.18.0, sucrase@^3.20.2: pirates "^4.0.1" ts-interface-checker "^0.1.9" -superagent@^3.8.3: - version "3.8.3" - resolved "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128" - integrity sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA== - dependencies: - component-emitter "^1.2.0" - cookiejar "^2.1.0" - debug "^3.1.0" - extend "^3.0.0" - form-data "^2.3.1" - formidable "^1.2.0" - methods "^1.1.1" - mime "^1.4.1" - qs "^6.5.1" - readable-stream "^2.3.5" - superagent@^7.1.0: version "7.1.1" resolved "https://registry.npmjs.org/superagent/-/superagent-7.1.1.tgz#2ab187d38c3078c31c3771c0b751f10163a27136" @@ -22715,14 +22694,6 @@ superagent@^7.1.0: readable-stream "^3.6.0" semver "^7.3.5" -supertest@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/supertest/-/supertest-4.0.2.tgz#c2234dbdd6dc79b6f15b99c8d6577b90e4ce3f36" - integrity sha512-1BAbvrOZsGA3YTCWqbmh14L0YEq0EGICX/nBnfkfVJn7SrxQV1I3pMYjSzG9y/7ZU2V9dWqyqk2POwxlb09duQ== - dependencies: - methods "^1.1.2" - superagent "^3.8.3" - supertest@^6.1.3, supertest@^6.1.6: version "6.2.2" resolved "https://registry.npmjs.org/supertest/-/supertest-6.2.2.tgz#04a5998fd3efaff187cb69f07a169755d655b001" From 49619acc93b96b9eb95fcfae9664fa5ccfcd4d1b Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Tue, 8 Feb 2022 11:29:27 +0000 Subject: [PATCH 13/22] Address comments and suggestions - Revert ADOPTERS.md to whatever is on the main branch Signed-off-by: Karan Shah --- ADOPTERS.md | 184 ++++++++++++++++++++++++++-------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/ADOPTERS.md b/ADOPTERS.md index 58ee92e094..120c828c43 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -1,92 +1,92 @@ -| Organization | Contact | Description of Use | -| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Spotify](https://www.spotify.com) | [@leemills83](https://github.com/leemills83) | Main interface towards all of Spotify's infrastructure and technical documentation. | -| [bol.com](https://www.bol.com) | [@sagacity](https://github.com/sagacity) | Initial work being done to unify platform tooling. | -| [DFDS](https://www.dfds.com) | [@carlsendk](https://github.com/carlsendk) | V2 self-service platform. | -| [Roadie](https://roadie.io) | [@dtuite](https://github.com/dtuite) | Hosted, managed Backstage with easy set-up | -| [Roku](https://www.roku.com) | [@timurista](https://github.com/timurista) | Initial work on Cloud engineering service platform. | -| [SDA SE](https://sda.se) | [@dschwank](https://github.com/dschwank), [@iammnils](https://github.com/iammnils) | Central place for developing and sharing services in our insurance ecosystem. | -| [H-E-B](https://www.heb.com) | [@german-j-rodriguez](https://github.com/german-j-rodriguez) | Initial work on Engineering Portal service platform. | -| [American Airlines](https://www.aa.com) | [@paulpach](https://github.com/paulpach) | Central place for developers to develop and maintain applications | -| [Kiwi.com](https://kiwi.com) | [@aexvir](https://github.com/aexvir) | Replacing the frontend of [The Zoo](https://github.com/kiwicom/the-zoo), their service registry. | -| [Voi](https://www.voiscooters.com/) | [@K-Phoen](https://github.com/K-Phoen) | Developer portal, main gateway to our infrastructure, documentation and internal tooling. | -| [Talkdesk](https://www.talkdesk.com) | [@jaime-talkdesk](https://github.com/jaime-talkdesk) | Initial work for Engineering Portal and Self Provisioning to R&D | -| [Wealthsimple](https://www.wealthsimple.com) | [@andrewthauer](https://github.com/andrewthauer) | Developer portal, service catalog, documentation and tooling | -| [Grab](https://www.grab.com) | [@althafh](https://github.com/althafh) | Initial work as a unified interface for all of Grab's internal tooling | -| [Telenor Sweden](https://www.telenor.se) | [@O5ten](https://github.com/O5ten) | Building a developer portal for scaffolding projects towards our unified build environment and microservice stacks | -| [Fiverr](https://www.fiverr.com) | [@nirga](https://github.com/nirga) | Unifying separate tools that developers are using today (i.e. monitoring, dead letter queues management, etc.) into a single platform. | -| [Zalando SE](https://www.zalando.de) | [@leviferreira](https://github.com/leviferreira) | Building V2 of the Internal Development Portal. | -| [LegalZoom](https://legalzoom.com) | [@backjo](https://github.com/backjo) | Developer portal - hub for all engineering projects and metadata. | -| [Expedia Group](https://www.expediagroup.com) | [Mike Turner](mailto:miturner@expediagroup.com), [Sneha Kumar](mailto:snkumar@expediagroup.com), [@guillermomanzo](https://github.com/guillermomanzo), [Erik Lindgren](https://github.com/lindgren) | EG Common Developer Toolkit | -| [Paddle.com](https://paddle.com) | [Ioannis Georgoulas](https://github.com/geototti21) | Developer portal (Tech Docs, Service Catalog, Internal Tooling), we use vanilla Backstage FE and custom BE implementation in Go | -| [Acast.com](https://acast.com) | [Olle Lundberg](https://github.com/lndbrg) | Developer portal with tech docs, service catalog and a bunch of other internal tooling | -| [Lunar](https://lunar.app) | [Jacob Valdemar](https://github.com/JacobValdemar) | Internal developer portal for service overview and insights, API documentation, technical guides, onboarding guides and RFC's. | -| [Trendyol](https://trendyol.com) | [Gamze Senturk](https://github.com/gmzsenturk), [Mert Can Bilgic](https://github.com/mertcb) | The Developer Portal has been called `Pandora`. Provides an overview of Trendyol tech ecosystem. TechDocs, Catalog, Custom Plugins and Theme. | -| [Peloton](https://www.onepeloton.com/) | [Jim Haughwout](https://github.com/JimHaughwout) | Creating our first developer portal and tech-docs. Exploring Service Catalog, Tech Insights and Cost Insights as well. | -| [TELUS](https://telus.com) | [Seb Barre](https://github.com/sbarre) | The Go-to place to find answers about development and delivery at TELUS. | -| [Brex](https://www.brex.com/) | [Vamsi Chitters](https://github.com/vamsikc) | A centralized UI to understand how a service fits in the whole Brex architecture and manage a team’s engineering dependencies. | -| [Oriflame](https://www.oriflame.com/) | [Oriflame](https://github.com/oriflame) | Internal developer portal for services, single page apps and packages overview, API documentation, technical guides, tech-radar and more. | -| [Booz Allen Hamilton](https://www.boozallen.com/) | [Jason Miller](https://github.com/JasonMiller-BAH) | Developer portal for a full-stack software development ecosystem that accelerates consistent and repeatable Modern Software Development practices for internal innovation and investments. | -| [Netflix](https://www.netflix.com/) | [bleathem](https://github.com/bleathem) | Our Backstage implementation will be the front door to a unified experience connecting our internal platform products across important workflows with integrated knowledge and support. | -| [b.well](https://www.icanbwell.com/) | [Jacob Rosales](https://github.com/jrosales) | Foundation for our engineering portal and cloud insights. | -| [PagerDuty](https://www.pagerduty.com/) | [Mark Shaw](https://github.com/markshawtoronto) | Developer portal, initially focused on software templates and tech-docs. | -| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 | -| [FundApps](https://www.fundapps.co/) | [Elliot Greenwood](https://github.com/egnwd) | Developer Portal - A place for us to keep track of our projects and documentation for all services and processes | -| [DAZN](https://dazn.com/) | [Lou Bichard](https://twitter.com/loujaybee), [Marco Crivellaro](https://github.com/crivetechie), [Alex Hollerith](mailto:alex.hollerith@dazn.com) | Ingesting all of DAZN's repos for the catalog, migrating our internal platform apps (pull request boards, release information, inner source marketplace etc) to Backstage plugins (where applicable). | -| [HelloFresh](https://www.hellofresh.de/) | [@iammuho](https://github.com/iammuho), [@ElenaForester](https://github.com/ElenaForester), [@diegomarangoni](https://github.com/diegomarangoni) | Our developer portal at HelloFresh - Spread across an organisation of 500+ engineers globally. | -| [FactSet](https://www.factset.com/) | [@kuangp](https://github.com/kuangp) | Developer portal to provide discoverability to all internal components, APIs, documentation, and scaffold templates with integrations to our internal infrastructure tools. | -| [Workrise](https://www.workrise.com/) | [Michael Rode](https://github.com/michaelrode) | Developer portal, main gateway to our infrastructure, documentation and internal tooling. | -| [RedVentures](https://www.redventures.com/) | [Chris Diaz](https://github.com/codingdiaz) | Developer portal that brings everything an engineer needs to provide value into a single pane of glass. | -| [MavTek](https://www.mavtek.com/) | [@fgascon](https://github.com/fgascon) | Developer portal focused on standardizing practices, centralizing documentation and streamlining developer practices. | -| [QuintoAndar](https://www.quintoandar.com.br/) | [@quintoandar](https://github.com/quintoandar) | Developer portal, services catalog and centralization of service metrics. | -| [empathy.co](https://empathy.co/) | [@guillermotti](https://github.com/guillermotti) | Developer portal for tech docs, service catalog, plugin discovery and much more. | -| [creditas.com](https://creditas.com/) | [@aureliosaraiva](https://github.com/aureliosaraiva) [@Creditas](https://github.com/creditas) | Centralization of all services, standards, documentation, etc. We started the deployment process. | -| [Prisjakt](https://www.prisjakt.nu) / [PriceSpy](https://pricespy.co.uk) | [@kennylindahl](https://github.com/kennylindahl) | Internal developer portal - Documentation, scaffolding, software catalog, TechRadar, Gitlab org data integration | -| [Powerspike](https://powerspike.tv/) | [@trelore](https://github.com/trelore) | Developer portal for documentation of core libraries and repositories. | -| [2U](https://2u.com) | [Andrew Thal](https://github.com/athal7) | Development team home-base, promoting service discoverability, resource dependencies, and tech radar | -| [Taxfix](https://taxfix.de/) | [Sami Ur Rehman](https://github.com/samiurrehman92) | Developer's portal with software catalog at it's core. Hosts API Specs, Tech Docs, Tech Radar and some custom plugins. | -| [Busuu](https://busuu.com/) | [Adam Tester](https://github.com/adamtester) | Developer portal with service catalog, API docs, Event docs, service templating, and cost insights. | -| [Loadsmart](https://loadsmart.com/) | [Loadsmart](https://github.com/loadsmart) | Improve services visibility and operations for service owners and developers. | -| [Monzo](https://monzo.com/) | [@WillSewell](https://github.com/WillSewell), [@joechrisellis](https://github.com/joechrisellis) | Developer portal showing metadata and docs for over 2000 microservices. We have built a number of plugins such as a UI for our system to measure [software excellence](https://monzo.com/blog/2021/09/15/how-we-measure-software-excellence), and a UI to show deployment and config change events. | -| [Vaimo](https://www.vaimo.com) | [@vaimo-magnus](https://github.com/vaimo-magnus) | Developer Portal for our developers at Vaimo, currently docs and self-service towards our internal PaaS based on k8s. Plans to extend the catalog into Projects, Environments etc | -| [Wayfair](https://www.wayfair.com) | [@fransan](https://github.com/fransan), [@errskipower](https://github.com/errskipower), [@hrrs](https://github.com/hrrs) | Developer portal for service catalog, technical documentation, and APIs. | -| [CircleHD](https://www.circlehd.com) | [@circlehddev](https://github.com/circlehddev) | Developer Portal for internal dev team across the globe | -| [CastDesk](https://castdesk.com) | [@circlehddev](https://github.com/circlehddev) | Developer Portal for internal dev team across the globe | -| [Santagostino](https://santagostino.it) | [@santagostino](https://github.com/santagostino) | Developer portal, gateway to our infrastructure, documentation, service catalog and internal tooling. | -| [Peak](https://peak.ai) | [Luke Beamish](https://github.com/lukebeamish-peak) | Developer portal for all internal engineers to access documentation and tooling. | -| [Gelato](https://gelato.com/) | [Dmitry Makarenko](https://github.com/dmitry-makarenko-gelato) | Developer portal: documentation, service templates, org structure, service catalog, plugins for integration with internal and third-party systems🚀. | -| [GoCardless](https://gocardless.com/) | [James Turley](https://github.com/tragiclifestories) | Developer portal: documentation, service templates, org structure, service catalog, plugins for integration with internal systems. | -| [Box](https://www.box.com) | [@kielosz](https://github.com/kielosz), [@jluk-box](https://github.com/jluk-box), [@ptychu](https://github.com/ptychu), [@alexrybch](https://github.com/alexrybch), [@szubster](https://github.com/szubster) | Developer portal for service catalog, integration with internal systems, new service onboarding. | -| [Bazaarvoice](https://www.bazaarvoice.com) | [@niallmccullagh](https://github.com/niallmccullagh) | Developer portal for service catalog and scaffolds, publishing Github docs and API documentation, visualising our internal tech radar and our product engineering org structure. | -| [Krateo PlatformOps](https://www.krateo.io) | [@projectkerberus](https://github.com/projectkerberus) | A multi-cloud control plane to create, manage and deploy any kind of resource easily and centrally via a Developer Portal that centralizes via a self-service catalog the templating and ownership of services, the available documentation, the overview of the components that compose an entire domain and all the data of the service lifecycle. | -| [Adevinta](https://www.adevinta.com) | [Ray Sinnema](https://github.com/RemonSinnema) | Showcase shared services to our internal customers. | -| [Splunk](https://www.splunk.com) | [@tonytamsf](https://github.com/tonytamsf) | Developer portal as a centralized place to find people, services, documentation, escalation policies and give bravos. This portal is also being used as a centralized search engine for engineering specific documentation. | -| [SoundCloud](https://www.soundcloud.com) | [Julio Zynger](https://github.com/julioz) | Developer portal as a [humane registry](https://martinfowler.com/bliki/HumaneRegistry.html) for the organization: catalog of people, services, documentation, feature toggles, escalation policies, etc. | -| [Volvofinans Bank](https://www.volvofinans.se) | [Johan Hammar](https://github.com/johanhammar) | Developer portal enabling engineers to manage and explore software and documentation. | -| [Palo Alto Networks](https://www.paloaltonetworks.com) | [Jeremy Guarini](https://github.com/jeremyguarini), [Brian Lomeland](https://github.com/bbbmmmlll), [Palo Alto Networks](https://github.com/PaloAltoNetworks) | Developer portal, service catalog, documentation and tooling | -| [Signal Iduna Group](https://www.signal-iduna.de/) | [Jonas Thomsen](https://github.com/JoThomsen) | Developer Portal, documentation, monitoring, service catalog for our insurance ecosystem | -| [Tradeshift](https://www.tradeshift.com/) | [Soren Mathiasen](https://github.com/sorenmat) | Developer Portal: documentation, monitoring, service templates, service catalog for our micro services | -| [Unity](https://unity.com) | [Ted Cordery](https://github.com/TeddyBallGame) | A centralized service catalog with documentation for our service engineers. | -| [PicPay](https://www.picpay.com) | [Luis Baroni](https://github.com/lcsbaroni), [Renata Poluceno](https://github.com/renatapoluceno), [PicPay](https://github.com/picpay) | Developer portal for building services throught templates, service catalog with ownership of services, documentation and metrics providing autonomy and visibility for all. | -| [Epic Games](https://www.epicgames.com) | [Brian Jung](https://github.com/brian-at-epic), [Jeff Goldian](https://github.com/jeffgoldian-Epic) | Developer Portal: Service Catalog, Documentation, Software Templates and more making our internal teams' lives easier! | -| [Globo](https://globo.com) | [Carlos Gusmão](https://github.com/caeugusmao), [Guilherme Vierno](https://github.com/vierno), [Denis Aoki](https://github.com/dnsaoki2), [Maycon Dionisio](https://github.com/MayconDionisio), | Reduce the friction of accessing the information engineers need about Globo's digital services through a coherent and centralized experience. | -| [QBE](https://www.qbe.com/) | [Daniel Steel](https://github.com/danielsteelqbe), [Pete Jespers](https://github.com/petejespersqbe) | Developer portal allowing our global teams to explore and create applications, documentation and cloud infrastructure easily and quickly 🚀 | -| [LogMeIn](https://www.logmein.com) | [Lorenzo Orsatti](https://github.com/lorsatti) | Improve onboarding experience of new developers. Discover faster and painlessly developer documentation, API definitions and team information. Provide useful dev metrics in a central place. Provide easy-to-use templates for new services. | -| [Telstra](https://www.telstra.com.au) | [@kiranpatel11](https://github.com/kiranpatel11), [JasonC](https://github.com/JasonC17) | Primary usage: software catalog and templates
Emerging usage : TechDocs, Explore Ecosystem, TechRadar, etc | -| [Mosaico](https://www.mosaico.com.br/) | [Wédney Yuri](https://github.com/wedneyyuri),[@tino.milton](https://github.com/miltonjacomini) | A centralized service catalog of our documentation for our service engineers. | -| [Mox Bank](https://www.mox.com/) | [Nick Laqua](https://github.com/nick-laqua-dragon), [Gauthier Roebroeck](https://github.com/gauthier-roebroeck-mox) | "Single pane of glass" developer portal for providing a best-in-class developer experience to our product teams and making Mox the best tech environment in Hongkong 🥰🚀 | -| [Keyloop](https://www.keyloop.com/) | [Andre Wanlin](https://github.com/awanlin) | Future-motive Developer Portal to help our teams create technology to make everything about buying and owning a car better. 🚗 | -| [Simply Business](https://sbtech.simplybusiness.co.uk/) | [@addersuk](https://github.com/addersuk), [@LightningStairs](https://github.com/LightningStairs), [@punitcse](https://github.com/punitcse), [@moltenice](https://github.com/moltenice) | Central developer portal to access everything a developer needs such as docs, internal service catalog, and the ability to quickly create a new service from a template. Internally developed Backstage plugins allow us to customise the experience to how we work. | -| [Overwolf](https://www.overwolf.com) | [@tomwolfgang](https://github.com/tomwolfgang) | Dev portal - software catalog, tech-docs, scaffolding | -| [Hotmart](https://www.hotmart.com) | [@fabioviana-hotmart](https://github.com/fabioviana-hotmart) | The main Developers Portal to centralize docs, applications and technical metrics. | -| [EF Education First](https://www.ef.com) | [Daan Boerlage](https://github.com/runebaas), [Rafał Nowosielski](https://github.com/rnowosielski) | Our developer portal - primarily used for cataloging and scaffolding with the ambition to expand with more feature adoptions over time | -| [Power Home Remodeling](https://www.techatpower.com) | [Ben Langfeld](https://github.com/benlangfeld) | Developer portal to our internal services, build on open-source software (including Kubernetes) in our own datacenters. Our Portal allows our team members to navigate inherant complexity and standardise. | -| [Livspace](https://www.livspace.com) | [Praveen Kumar](https://github.com/praveen-livspace) | Developer portal, service catalog, tech docs, API docs and plugins | -| [Just Eat Takeaway](https://www.justeattakeaway.com) | [Kim Wilson](https://github.com/kwilson541) | Our developer portal which centralises applications, reduces cognitive load and provides teams insights. | -| [Hopin](https://hopin.com) | [Vladimir Glafirov](https://github.com/vglafirov), [Chloe Lee](https://github.com/msfuko) | Developer portal to streamline the development practices. Integrated with service catalog, software templates, application monitoring, tech docs and plugins. | -| [HBO Max](https://hbomax.com) | [@mdb](https://github.com/mdb), [@nesta219](https://github.com/nesta219), [@nmische](https://github.com/nmische), [@hbomark](https://github.com/hbomark) | Developer portal hosting service catalog and API documentation, as well as cloud infrastructure details, operational visibility tools, and a custom plugin for browsing notable platform change events, such as deployments and configuration updates. | -| [RCHLO](https://www.riachuelo.com.br) & [MIDWAY](https://www.midway.com.br) | [@marcosborges](https://github.com/marcosborges), [@defaultbr](https://github.com/defaultbr) | Self-Service Platform | -| [HP Inc](https://www.hp.com) | [Damon Kaswell](https://github.com/dekoding) | DevEx engagement hub (dev portal: docs, standards, Q&A) and extensive assets catalog (APIs, services, code, data, etc.) for the pan-HP internal developer community. | -| [VMware](https://www.vmware.com) | [@mpriamo](https://github.com/mpriamo), [@krisapplegate](https://github.com/krisapplegate) | Part of [Tanzu Application Platform](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/index.html) offering; internal developer portal | -| [Ualá](https://www.uala.com.ar/) | [Santiago Bernal](https://github.com/sabernal) | Initial work being done to centralize documentation for all our microservices and APIs, as well as scaffolding new services and tracking code quality | -| [IKEA IT AB](https://www.ingka.com) | [@bjornramberg](https://github.com/bjornramberg), [@supriyachitale](https://github.com/supriyachitale) | Supporting engineers at scale with self serve access and connecting the dots of our engineering platform and services, enabling product teams to move faster and go further, and unleashing innovation, reuse and co-creation across the organisation. | +| Organization | Contact | Description of Use | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Spotify](https://www.spotify.com) | [@leemills83](https://github.com/leemills83) | Main interface towards all of Spotify's infrastructure and technical documentation. | +| [bol.com](https://www.bol.com) | [@sagacity](https://github.com/sagacity) | Initial work being done to unify platform tooling. | +| [DFDS](https://www.dfds.com) | [@carlsendk](https://github.com/carlsendk) | V2 self-service platform. | +| [Roadie](https://roadie.io) | [@dtuite](https://github.com/dtuite) | Hosted, managed Backstage with easy set-up | +| [Roku](https://www.roku.com) | [@timurista](https://github.com/timurista) | Initial work on Cloud engineering service platform. | +| [SDA SE](https://sda.se) | [@dschwank](https://github.com/dschwank), [@iammnils](https://github.com/iammnils) | Central place for developing and sharing services in our insurance ecosystem. | +| [H-E-B](https://www.heb.com) | [@german-j-rodriguez](https://github.com/german-j-rodriguez) | Initial work on Engineering Portal service platform. | +| [American Airlines](https://www.aa.com) | [@paulpach](https://github.com/paulpach) | Central place for developers to develop and maintain applications | +| [Kiwi.com](https://kiwi.com) | [@aexvir](https://github.com/aexvir) | Replacing the frontend of [The Zoo](https://github.com/kiwicom/the-zoo), their service registry. | +| [Voi](https://www.voiscooters.com/) | [@K-Phoen](https://github.com/K-Phoen) | Developer portal, main gateway to our infrastructure, documentation and internal tooling. | +| [Talkdesk](https://www.talkdesk.com) | [@jaime-talkdesk](https://github.com/jaime-talkdesk) | Initial work for Engineering Portal and Self Provisioning to R&D | +| [Wealthsimple](https://www.wealthsimple.com) | [@andrewthauer](https://github.com/andrewthauer) | Developer portal, service catalog, documentation and tooling | +| [Grab](https://www.grab.com) | [@althafh](https://github.com/althafh) | Initial work as a unified interface for all of Grab's internal tooling | +| [Telenor Sweden](https://www.telenor.se) | [@O5ten](https://github.com/O5ten) | Building a developer portal for scaffolding projects towards our unified build environment and microservice stacks | +| [Fiverr](https://www.fiverr.com) | [@nirga](https://github.com/nirga) | Unifying separate tools that developers are using today (i.e. monitoring, dead letter queues management, etc.) into a single platform. | +| [Zalando SE](https://www.zalando.de) | [@leviferreira](https://github.com/leviferreira) | Building V2 of the Internal Development Portal. | +| [LegalZoom](https://legalzoom.com) | [@backjo](https://github.com/backjo) | Developer portal - hub for all engineering projects and metadata. | +| [Expedia Group](https://www.expediagroup.com) | [Mike Turner](mailto:miturner@expediagroup.com), [Sneha Kumar](mailto:snkumar@expediagroup.com), [@guillermomanzo](https://github.com/guillermomanzo), [Erik Lindgren](https://github.com/lindgren) | EG Common Developer Toolkit | +| [Paddle.com](https://paddle.com) | [Ioannis Georgoulas](https://github.com/geototti21) | Developer portal (Tech Docs, Service Catalog, Internal Tooling), we use vanilla Backstage FE and custom BE implementation in Go | +| [Acast.com](https://acast.com) | [Olle Lundberg](https://github.com/lndbrg) | Developer portal with tech docs, service catalog and a bunch of other internal tooling | +| [Lunar](https://lunar.app) | [Jacob Valdemar](https://github.com/JacobValdemar) | Internal developer portal for service overview and insights, API documentation, technical guides, onboarding guides and RFC's. | +| [Trendyol](https://trendyol.com) | [Gamze Senturk](https://github.com/gmzsenturk), [Mert Can Bilgic](https://github.com/mertcb) | The Developer Portal has been called `Pandora`. Provides an overview of Trendyol tech ecosystem. TechDocs, Catalog, Custom Plugins and Theme. | +| [Peloton](https://www.onepeloton.com/) | [Jim Haughwout](https://github.com/JimHaughwout) | Creating our first developer portal and tech-docs. Exploring Service Catalog, Tech Insights and Cost Insights as well. | +| [TELUS](https://telus.com) | [Seb Barre](https://github.com/sbarre) | The Go-to place to find answers about development and delivery at TELUS. | +| [Brex](https://www.brex.com/) | [Vamsi Chitters](https://github.com/vamsikc) | A centralized UI to understand how a service fits in the whole Brex architecture and manage a team’s engineering dependencies. | +| [Oriflame](https://www.oriflame.com/) | [Oriflame](https://github.com/oriflame) | Internal developer portal for services, single page apps and packages overview, API documentation, technical guides, tech-radar and more. | +| [Booz Allen Hamilton](https://www.boozallen.com/) | [Jason Miller](https://github.com/JasonMiller-BAH) | Developer portal for a full-stack software development ecosystem that accelerates consistent and repeatable Modern Software Development practices for internal innovation and investments. | +| [Netflix](https://www.netflix.com/) | [bleathem](https://github.com/bleathem) | Our Backstage implementation will be the front door to a unified experience connecting our internal platform products across important workflows with integrated knowledge and support. | +| [b.well](https://www.icanbwell.com/) | [Jacob Rosales](https://github.com/jrosales) | Foundation for our engineering portal and cloud insights. | +| [PagerDuty](https://www.pagerduty.com/) | [Mark Shaw](https://github.com/markshawtoronto) | Developer portal, initially focused on software templates and tech-docs. | +| [MoonShiner](https://moonshiner.at) | [Fabian Hippmann](https://github.com/FabianHippmann) | Developer portal - helps us keep track of our customer projects, onboard new developers & improve our development process 🌕🚀🧑‍🚀 | +| [FundApps](https://www.fundapps.co/) | [Elliot Greenwood](https://github.com/egnwd) | Developer Portal - A place for us to keep track of our projects and documentation for all services and processes | +| [DAZN](https://dazn.com/) | [Lou Bichard](https://twitter.com/loujaybee), [Marco Crivellaro](https://github.com/crivetechie), [Alex Hollerith](mailto:alex.hollerith@dazn.com) | Ingesting all of DAZN's repos for the catalog, migrating our internal platform apps (pull request boards, release information, inner source marketplace etc) to Backstage plugins (where applicable). | +| [HelloFresh](https://www.hellofresh.de/) | [@iammuho](https://github.com/iammuho), [@ElenaForester](https://github.com/ElenaForester), [@diegomarangoni](https://github.com/diegomarangoni) | Our developer portal at HelloFresh - Spread across an organisation of 500+ engineers globally. | +| [FactSet](https://www.factset.com/) | [@kuangp](https://github.com/kuangp) | Developer portal to provide discoverability to all internal components, APIs, documentation, and scaffold templates with integrations to our internal infrastructure tools. | +| [Workrise](https://www.workrise.com/) | [Michael Rode](https://github.com/michaelrode) | Developer portal, main gateway to our infrastructure, documentation and internal tooling. | +| [RedVentures](https://www.redventures.com/) | [Chris Diaz](https://github.com/codingdiaz) | Developer portal that brings everything an engineer needs to provide value into a single pane of glass. | +| [MavTek](https://www.mavtek.com/) | [@fgascon](https://github.com/fgascon) | Developer portal focused on standardizing practices, centralizing documentation and streamlining developer practices. | +| [QuintoAndar](https://www.quintoandar.com.br/) | [@quintoandar](https://github.com/quintoandar) | Developer portal, services catalog and centralization of service metrics. | +| [empathy.co](https://empathy.co/) | [@guillermotti](https://github.com/guillermotti) | Developer portal for tech docs, service catalog, plugin discovery and much more. | +| [creditas.com](https://creditas.com/) | [@aureliosaraiva](https://github.com/aureliosaraiva) [@Creditas](https://github.com/creditas) | Centralization of all services, standards, documentation, etc. We started the deployment process. | +| [Prisjakt](https://www.prisjakt.nu) / [PriceSpy](https://pricespy.co.uk) | [@kennylindahl](https://github.com/kennylindahl) | Internal developer portal - Documentation, scaffolding, software catalog, TechRadar, Gitlab org data integration | +| [Powerspike](https://powerspike.tv/) | [@trelore](https://github.com/trelore) | Developer portal for documentation of core libraries and repositories. | +| [2U](https://2u.com) | [Andrew Thal](https://github.com/athal7) | Development team home-base, promoting service discoverability, resource dependencies, and tech radar | +| [Taxfix](https://taxfix.de/) | [Sami Ur Rehman](https://github.com/samiurrehman92) | Developer's portal with software catalog at it's core. Hosts API Specs, Tech Docs, Tech Radar and some custom plugins. | +| [Busuu](https://busuu.com/) | [Adam Tester](https://github.com/adamtester) | Developer portal with service catalog, API docs, Event docs, service templating, and cost insights. | +| [Loadsmart](https://loadsmart.com/) | [Loadsmart](https://github.com/loadsmart) | Improve services visibility and operations for service owners and developers. | +| [Monzo](https://monzo.com/) | [@WillSewell](https://github.com/WillSewell), [@joechrisellis](https://github.com/joechrisellis) | Developer portal showing metadata and docs for over 2000 microservices. We have built a number of plugins such as a UI for our system to measure [software excellence](https://monzo.com/blog/2021/09/15/how-we-measure-software-excellence), and a UI to show deployment and config change events. | +| [Vaimo](https://www.vaimo.com) | [@vaimo-magnus](https://github.com/vaimo-magnus) | Developer Portal for our developers at Vaimo, currently docs and self-service towards our internal PaaS based on k8s. Plans to extend the catalog into Projects, Environments etc | +| [Wayfair](https://www.wayfair.com) | [@fransan](https://github.com/fransan), [@errskipower](https://github.com/errskipower), [@hrrs](https://github.com/hrrs) | Developer portal for service catalog, technical documentation, and APIs. | +| [CircleHD](https://www.circlehd.com) | [@circlehddev](https://github.com/circlehddev) | Developer Portal for internal dev team across the globe | +| [CastDesk](https://castdesk.com) | [@circlehddev](https://github.com/circlehddev) | Developer Portal for internal dev team across the globe | +| [Santagostino](https://santagostino.it) | [@santagostino](https://github.com/santagostino) | Developer portal, gateway to our infrastructure, documentation, service catalog and internal tooling. | +| [Peak](https://peak.ai) | [Luke Beamish](https://github.com/lukebeamish-peak) | Developer portal for all internal engineers to access documentation and tooling. | +| [Gelato](https://gelato.com/) | [Dmitry Makarenko](https://github.com/dmitry-makarenko-gelato) | Developer portal: documentation, service templates, org structure, service catalog, plugins for integration with internal and third-party systems🚀. | +| [GoCardless](https://gocardless.com/) | [James Turley](https://github.com/tragiclifestories) | Developer portal: documentation, service templates, org structure, service catalog, plugins for integration with internal systems. | +| [Box](https://www.box.com) | [@kielosz](https://github.com/kielosz), [@jluk-box](https://github.com/jluk-box), [@ptychu](https://github.com/ptychu), [@alexrybch](https://github.com/alexrybch), [@szubster](https://github.com/szubster) | Developer portal for service catalog, integration with internal systems, new service onboarding. | +| [Bazaarvoice](https://www.bazaarvoice.com) | [@niallmccullagh](https://github.com/niallmccullagh) | Developer portal for service catalog and scaffolds, publishing Github docs and API documentation, visualising our internal tech radar and our product engineering org structure. | +| [Krateo PlatformOps](https://www.krateo.io) | [@projectkerberus](https://github.com/projectkerberus) | A multi-cloud control plane to create, manage and deploy any kind of resource easily and centrally via a Developer Portal that centralizes via a self-service catalog the templating and ownership of services, the available documentation, the overview of the components that compose an entire domain and all the data of the service lifecycle. | +| [Adevinta](https://www.adevinta.com) | [Ray Sinnema](https://github.com/RemonSinnema) | Showcase shared services to our internal customers. | +| [Splunk](https://www.splunk.com) | [@tonytamsf](https://github.com/tonytamsf) | Developer portal as a centralized place to find people, services, documentation, escalation policies and give bravos. This portal is also being used as a centralized search engine for engineering specific documentation. | +| [SoundCloud](https://www.soundcloud.com) | [Julio Zynger](https://github.com/julioz) | Developer portal as a [humane registry](https://martinfowler.com/bliki/HumaneRegistry.html) for the organization: catalog of people, services, documentation, feature toggles, escalation policies, etc. | +| [Volvofinans Bank](https://www.volvofinans.se) | [Johan Hammar](https://github.com/johanhammar) | Developer portal enabling engineers to manage and explore software and documentation. | +| [Palo Alto Networks](https://www.paloaltonetworks.com) | [Jeremy Guarini](https://github.com/jeremyguarini), [Brian Lomeland](https://github.com/bbbmmmlll), [Palo Alto Networks](https://github.com/PaloAltoNetworks) | Developer portal, service catalog, documentation and tooling | +| [Signal Iduna Group](https://www.signal-iduna.de/) | [Jonas Thomsen](https://github.com/JoThomsen) | Developer Portal, documentation, monitoring, service catalog for our insurance ecosystem | +| [Tradeshift](https://www.tradeshift.com/) | [Soren Mathiasen](https://github.com/sorenmat) | Developer Portal: documentation, monitoring, service templates, service catalog for our micro services | +| [Unity](https://unity.com) | [Ted Cordery](https://github.com/TeddyBallGame) | A centralized service catalog with documentation for our service engineers. | +| [PicPay](https://www.picpay.com) | [Luis Baroni](https://github.com/lcsbaroni), [Renata Poluceno](https://github.com/renatapoluceno), [PicPay](https://github.com/picpay) | Developer portal for building services throught templates, service catalog with ownership of services, documentation and metrics providing autonomy and visibility for all. | +| [Epic Games](https://www.epicgames.com) | [Brian Jung](https://github.com/brian-at-epic), [Jeff Goldian](https://github.com/jeffgoldian-Epic) | Developer Portal: Service Catalog, Documentation, Software Templates and more making our internal teams' lives easier! | +| [Globo](https://globo.com) | [Carlos Gusmão](https://github.com/caeugusmao), [Guilherme Vierno](https://github.com/vierno), [Denis Aoki](https://github.com/dnsaoki2), [Maycon Dionisio](https://github.com/MayconDionisio), | Reduce the friction of accessing the information engineers need about Globo's digital services through a coherent and centralized experience. | +| [QBE](https://www.qbe.com/) | [Daniel Steel](https://github.com/danielsteelqbe), [Pete Jespers](https://github.com/petejespersqbe) | Developer portal allowing our global teams to explore and create applications, documentation and cloud infrastructure easily and quickly 🚀 | +| [LogMeIn](https://www.logmein.com) | [Lorenzo Orsatti](https://github.com/lorsatti) | Improve onboarding experience of new developers. Discover faster and painlessly developer documentation, API definitions and team information. Provide useful dev metrics in a central place. Provide easy-to-use templates for new services. | +| [Telstra](https://www.telstra.com.au) | [@kiranpatel11](https://github.com/kiranpatel11), [JasonC](https://github.com/JasonC17) | Primary usage: software catalog and templates
Emerging usage : TechDocs, Explore Ecosystem, TechRadar, etc | +| [Mosaico](https://www.mosaico.com.br/) | [Wédney Yuri](https://github.com/wedneyyuri),[@tino.milton](https://github.com/miltonjacomini) | A centralized service catalog of our documentation for our service engineers. | +| [Mox Bank](https://www.mox.com/) | [Nick Laqua](https://github.com/nick-laqua-dragon), [Gauthier Roebroeck](https://github.com/gauthier-roebroeck-mox) | "Single pane of glass" developer portal for providing a best-in-class developer experience to our product teams and making Mox the best tech environment in Hongkong 🥰🚀 | +| [Keyloop](https://www.keyloop.com/) | [Andre Wanlin](https://github.com/awanlin) | Future-motive Developer Portal to help our teams create technology to make everything about buying and owning a car better. 🚗 | +| [Simply Business](https://sbtech.simplybusiness.co.uk/) | [@addersuk](https://github.com/addersuk), [@LightningStairs](https://github.com/LightningStairs), [@punitcse](https://github.com/punitcse), [@moltenice](https://github.com/moltenice) | Central developer portal to access everything a developer needs such as docs, internal service catalog, and the ability to quickly create a new service from a template. Internally developed Backstage plugins allow us to customise the experience to how we work. | +| [Overwolf](https://www.overwolf.com) | [@tomwolfgang](https://github.com/tomwolfgang) | Dev portal - software catalog, tech-docs, scaffolding | +| [Hotmart](https://www.hotmart.com) | [@fabioviana-hotmart](https://github.com/fabioviana-hotmart) | The main Developers Portal to centralize docs, applications and technical metrics. | +| [EF Education First](https://www.ef.com) | [Daan Boerlage](https://github.com/runebaas), [Rafał Nowosielski](https://github.com/rnowosielski) | Our developer portal - primarily used for cataloging and scaffolding with the ambition to expand with more feature adoptions over time | +| [Power Home Remodeling](https://www.techatpower.com) | [Ben Langfeld](https://github.com/benlangfeld) | Developer portal to our internal services, build on open-source software (including Kubernetes) in our own datacenters. Our Portal allows our team members to navigate inherant complexity and standardise. | +| [Livspace](https://www.livspace.com) | [Praveen Kumar](https://github.com/praveen-livspace) | Developer portal, service catalog, tech docs, API docs and plugins | +| [Just Eat Takeaway](https://www.justeattakeaway.com) | [Kim Wilson](https://github.com/kwilson541) | Our developer portal which centralises applications, reduces cognitive load and provides teams insights. | +| [Hopin](https://hopin.com) | [Vladimir Glafirov](https://github.com/vglafirov), [Chloe Lee](https://github.com/msfuko) | Developer portal to streamline the development practices. Integrated with service catalog, software templates, application monitoring, tech docs and plugins. | +| [HBO Max](https://hbomax.com) | [@mdb](https://github.com/mdb), [@nesta219](https://github.com/nesta219), [@nmische](https://github.com/nmische), [@hbomark](https://github.com/hbomark) | Developer portal hosting service catalog and API documentation, as well as cloud infrastructure details, operational visibility tools, and a custom plugin for browsing notable platform change events, such as deployments and configuration updates. | +| [RCHLO](https://www.riachuelo.com.br) & [MIDWAY](https://www.midway.com.br) | [@marcosborges](https://github.com/marcosborges), [@defaultbr](https://github.com/defaultbr) | Self-Service Platform | +| [HP Inc](https://www.hp.com) | [Damon Kaswell](https://github.com/dekoding) | DevEx engagement hub (dev portal: docs, standards, Q&A) and extensive assets catalog (APIs, services, code, data, etc.) for the pan-HP internal developer community. +| [VMware](https://www.vmware.com) | [@mpriamo](https://github.com/mpriamo), [@krisapplegate](https://github.com/krisapplegate) | Part of [Tanzu Application Platform](https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/index.html) offering; internal developer portal | +| [Ualá](https://www.uala.com.ar/) | [Santiago Bernal](https://github.com/sabernal) | Initial work being done to centralize documentation for all our microservices and APIs, as well as scaffolding new services and tracking code quality | +| [IKEA IT AB](https://www.ingka.com) | [@bjornramberg](https://github.com/bjornramberg), [@supriyachitale](https://github.com/supriyachitale) | Supporting engineers at scale with self serve access and connecting the dots of our engineering platform and services, enabling product teams to move faster and go further, and unleashing innovation, reuse and co-creation across the organisation. | From 48bf5cedc51b1cb3837daab8ae6d0edfb837adf2 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Tue, 8 Feb 2022 13:39:30 +0000 Subject: [PATCH 14/22] Change the config changes on the test too Signed-off-by: Karan Shah --- plugins/airbrake-backend/src/service/router.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/airbrake-backend/src/service/router.test.ts b/plugins/airbrake-backend/src/service/router.test.ts index d4d86722a8..60c1f52126 100644 --- a/plugins/airbrake-backend/src/service/router.test.ts +++ b/plugins/airbrake-backend/src/service/router.test.ts @@ -33,10 +33,8 @@ describe('createRouter', () => { jest.resetAllMocks(); const config = new ConfigReader({ - integrations: { - airbrake: { - apiKey: 'fakeApiKey', - }, + airbrake: { + apiKey: 'fakeApiKey', }, }); airbrakeConfig = extractAirbrakeConfig(config); From 15a87dd83278e4667794399b7dc8918118b55a4d Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 9 Feb 2022 11:17:38 +0000 Subject: [PATCH 15/22] Added a config.d.ts Signed-off-by: Karan Shah --- plugins/airbrake-backend/config.d.ts | 25 +++++++++++++++++++ plugins/airbrake-backend/package.json | 3 ++- .../src/config/ExtractAirbrakeConfig.ts | 17 +++---------- plugins/airbrake-backend/src/config/index.ts | 2 +- 4 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 plugins/airbrake-backend/config.d.ts diff --git a/plugins/airbrake-backend/config.d.ts b/plugins/airbrake-backend/config.d.ts new file mode 100644 index 0000000000..8787d2c94e --- /dev/null +++ b/plugins/airbrake-backend/config.d.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2021 The Backstage Authors + * + * 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. + */ + +export interface Config { + /** Configuration options for the Airbrake plugin */ + airbrake?: { + /** + * The API Key to authenticate requests. More details on how to get this here: https://airbrake.io/docs/api/#authentication + */ + apiKey: string; + }; +} diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 0ad55d192c..22589c8f21 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -38,7 +38,8 @@ "msw": "^0.35.0" }, "files": [ - "dist" + "dist", + "config.d.ts" ], "jest": { "coverageThreshold": { diff --git a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts index 6d6c814345..0e3d032190 100644 --- a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts +++ b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts @@ -14,18 +14,7 @@ * limitations under the License. */ import { Config } from '@backstage/config'; - -/** - * The Airbrake config object - * - * @public - */ -export type AirbrakeConfig = { - /** - * The API Key - */ - apiKey: string; -}; +import { AirbrakeConfig } from '.'; /** * Extract the Airbrake config from a config object @@ -34,7 +23,9 @@ export type AirbrakeConfig = { * * @param config - The config object to extract from */ -export function extractAirbrakeConfig(config: Config): AirbrakeConfig { +export function extractAirbrakeConfig( + config: Config, +): AirbrakeConfig['airbrake'] { return { apiKey: config.getString('airbrake.apiKey'), }; diff --git a/plugins/airbrake-backend/src/config/index.ts b/plugins/airbrake-backend/src/config/index.ts index 6200baca53..746d9fcafb 100644 --- a/plugins/airbrake-backend/src/config/index.ts +++ b/plugins/airbrake-backend/src/config/index.ts @@ -15,4 +15,4 @@ */ export { extractAirbrakeConfig } from './ExtractAirbrakeConfig'; -export type { AirbrakeConfig } from './ExtractAirbrakeConfig'; +export type { Config as AirbrakeConfig } from '../../config'; From 54e0073d9f12a4d2e600e90616ecf67294c35f7f Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 9 Feb 2022 11:39:01 +0000 Subject: [PATCH 16/22] Make config required Signed-off-by: Karan Shah --- plugins/airbrake-backend/config.d.ts | 2 +- .../src/config/ExtractAirbrakeConfig.ts | 4 +- plugins/airbrake-backend/src/config/index.ts | 3 +- yarn.lock | 187 +++++++++++++++++- 4 files changed, 188 insertions(+), 8 deletions(-) diff --git a/plugins/airbrake-backend/config.d.ts b/plugins/airbrake-backend/config.d.ts index 8787d2c94e..ab6a7ef537 100644 --- a/plugins/airbrake-backend/config.d.ts +++ b/plugins/airbrake-backend/config.d.ts @@ -16,7 +16,7 @@ export interface Config { /** Configuration options for the Airbrake plugin */ - airbrake?: { + airbrake: { /** * The API Key to authenticate requests. More details on how to get this here: https://airbrake.io/docs/api/#authentication */ diff --git a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts index 0e3d032190..6fc2c5e04c 100644 --- a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts +++ b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts @@ -23,9 +23,7 @@ import { AirbrakeConfig } from '.'; * * @param config - The config object to extract from */ -export function extractAirbrakeConfig( - config: Config, -): AirbrakeConfig['airbrake'] { +export function extractAirbrakeConfig(config: Config): AirbrakeConfig { return { apiKey: config.getString('airbrake.apiKey'), }; diff --git a/plugins/airbrake-backend/src/config/index.ts b/plugins/airbrake-backend/src/config/index.ts index 746d9fcafb..bc87a3c795 100644 --- a/plugins/airbrake-backend/src/config/index.ts +++ b/plugins/airbrake-backend/src/config/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { Config } from '../../config'; export { extractAirbrakeConfig } from './ExtractAirbrakeConfig'; -export type { Config as AirbrakeConfig } from '../../config'; +export type AirbrakeConfig = Config['airbrake']; diff --git a/yarn.lock b/yarn.lock index f6e6d29d57..92a7e80f97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1366,6 +1366,147 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" +"@backstage/backend-common@^0.10.5": + version "0.10.6" + resolved "https://registry.npmjs.org/@backstage/backend-common/-/backend-common-0.10.6.tgz#482c1355518a6421596a3b9678a693eaaa17e8de" + integrity sha512-4AdrR9SrG2C+W9BMawRNoRkUbhLD5tcQEhI6/bxOpV62WSHVu5OQjgZbjCrFG5p+Q0syOVNAxX3MtjcQhkvfwg== + dependencies: + "@backstage/cli-common" "^0.1.6" + "@backstage/config" "^0.1.13" + "@backstage/config-loader" "^0.9.3" + "@backstage/errors" "^0.2.0" + "@backstage/integration" "^0.7.2" + "@backstage/types" "^0.1.1" + "@google-cloud/storage" "^5.8.0" + "@manypkg/get-packages" "^1.1.3" + "@octokit/rest" "^18.5.3" + "@types/cors" "^2.8.6" + "@types/dockerode" "^3.3.0" + "@types/express" "^4.17.6" + "@types/luxon" "^2.0.4" + archiver "^5.0.2" + aws-sdk "^2.840.0" + compression "^1.7.4" + concat-stream "^2.0.0" + cors "^2.8.5" + dockerode "^3.3.1" + express "^4.17.1" + express-promise-router "^4.1.0" + fs-extra "9.1.0" + git-url-parse "^11.6.0" + helmet "^4.0.0" + isomorphic-git "^1.8.0" + jose "^1.27.1" + keyv "^4.0.3" + keyv-memcache "^1.2.5" + knex "^0.95.1" + lodash "^4.17.21" + logform "^2.3.2" + luxon "^2.0.2" + minimatch "^3.0.4" + minimist "^1.2.5" + morgan "^1.10.0" + node-abort-controller "^3.0.1" + node-fetch "^2.6.1" + raw-body "^2.4.1" + selfsigned "^1.10.7" + stoppable "^1.1.0" + tar "^6.1.2" + unzipper "^0.10.11" + winston "^3.2.1" + yn "^4.0.0" + +"@backstage/cli@^0.13.1-next.0": + version "0.13.1" + resolved "https://registry.npmjs.org/@backstage/cli/-/cli-0.13.1.tgz#67959eea81c6d0474aa3e3769c0c80b7b4665c05" + integrity sha512-Zc1kWvRCOoCl/E3/X6J3q0DKc1i14mkSnyA6gKUT0JmoG7H0Lf8ULQQLDr97/wm+dyiYpx/yl8ggkBB0OV9+bw== + dependencies: + "@backstage/cli-common" "^0.1.6" + "@backstage/config" "^0.1.13" + "@backstage/config-loader" "^0.9.3" + "@backstage/errors" "^0.2.0" + "@backstage/types" "^0.1.1" + "@hot-loader/react-dom" "^16.13.0" + "@manypkg/get-packages" "^1.1.3" + "@octokit/request" "^5.4.12" + "@rollup/plugin-commonjs" "^21.0.1" + "@rollup/plugin-json" "^4.1.0" + "@rollup/plugin-node-resolve" "^13.0.0" + "@rollup/plugin-yaml" "^3.1.0" + "@spotify/eslint-config-base" "^12.0.0" + "@spotify/eslint-config-react" "^12.0.0" + "@spotify/eslint-config-typescript" "^12.0.0" + "@sucrase/jest-plugin" "^2.1.1" + "@sucrase/webpack-loader" "^2.0.0" + "@svgr/plugin-jsx" "6.2.x" + "@svgr/plugin-svgo" "6.2.x" + "@svgr/rollup" "5.5.x" + "@svgr/webpack" "5.5.x" + "@types/webpack-env" "^1.15.2" + "@typescript-eslint/eslint-plugin" "^5.9.0" + "@typescript-eslint/parser" "^5.9.0" + "@yarnpkg/lockfile" "^1.1.0" + bfj "^7.0.2" + buffer "^6.0.3" + chalk "^4.0.0" + chokidar "^3.3.1" + commander "^6.1.0" + css-loader "^6.5.1" + diff "^5.0.0" + esbuild "^0.14.10" + esbuild-loader "^2.18.0" + eslint "^8.6.0" + eslint-config-prettier "^8.3.0" + eslint-formatter-friendly "^7.0.0" + eslint-plugin-import "^2.25.4" + eslint-plugin-jest "^25.3.4" + eslint-plugin-jsx-a11y "^6.5.1" + eslint-plugin-monorepo "^0.3.2" + eslint-plugin-react "^7.28.0" + eslint-plugin-react-hooks "^4.3.0" + eslint-webpack-plugin "^2.6.0" + express "^4.17.1" + fork-ts-checker-webpack-plugin "^7.0.0-alpha.8" + fs-extra "9.1.0" + glob "^7.1.7" + handlebars "^4.7.3" + html-webpack-plugin "^5.3.1" + inquirer "^8.2.0" + jest "^26.0.1" + jest-css-modules "^2.1.0" + jest-transform-yaml "^1.0.0" + json-schema "^0.4.0" + lodash "^4.17.21" + mini-css-extract-plugin "^2.4.2" + minimatch "3.0.4" + node-libs-browser "^2.2.1" + ora "^5.3.0" + postcss "^8.1.0" + process "^0.11.10" + react-dev-utils "^12.0.0-next.60" + react-hot-loader "^4.13.0" + recursive-readdir "^2.2.2" + replace-in-file "^6.0.0" + rollup "^2.60.2" + rollup-plugin-dts "^4.0.1" + rollup-plugin-esbuild "^4.7.2" + rollup-plugin-peer-deps-external "^2.2.2" + rollup-plugin-postcss "^4.0.0" + rollup-pluginutils "^2.8.2" + run-script-webpack-plugin "^0.0.11" + semver "^7.3.2" + style-loader "^3.3.1" + sucrase "^3.20.2" + tar "^6.1.2" + terser-webpack-plugin "^5.1.3" + util "^0.12.3" + webpack "^5.66.0" + webpack-dev-server "^4.7.3" + webpack-node-externals "^3.0.0" + yaml "^1.10.0" + yml-loader "^2.1.0" + yn "^4.0.0" + "@backstage/core-components@*", "@backstage/core-components@^0.8.0", "@backstage/core-components@^0.8.7": version "0.8.7" resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.8.7.tgz#c4bb9760d57971882065415e6e715eb750db2392" @@ -8966,7 +9107,7 @@ commander@^6.1.0: resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^7.2.0: +commander@^7.1.0, commander@^7.2.0: version "7.2.0" resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== @@ -12624,6 +12765,11 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= +getopts@2.2.5: + version "2.2.5" + resolved "https://registry.npmjs.org/getopts/-/getopts-2.2.5.tgz#67a0fe471cacb9c687d817cab6450b96dde8313b" + integrity sha512-9jb7AW5p3in+IiJWhQiZmmwkpLaR/ccTWdWQCtZM66HJcHHLegowh4q4tSD7gouUyeNvFWRavfK9GXosQHDpFA== + getopts@2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz#71e5593284807e03e2427449d4f6712a268666f4" @@ -14040,7 +14186,7 @@ is-core-module@^2.1.0, is-core-module@^2.2.0: dependencies: has "^1.0.3" -is-core-module@^2.8.0: +is-core-module@^2.8.0, is-core-module@^2.8.1: version "2.8.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -15726,6 +15872,25 @@ kleur@^4.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== +knex@^0.95.1: + version "0.95.15" + resolved "https://registry.npmjs.org/knex/-/knex-0.95.15.tgz#39d7e7110a6e2ad7de5d673d2dea94143015e0e7" + integrity sha512-Loq6WgHaWlmL2bfZGWPsy4l8xw4pOE+tmLGkPG0auBppxpI0UcK+GYCycJcqz9W54f2LiGewkCVLBm3Wq4ur/w== + dependencies: + colorette "2.0.16" + commander "^7.1.0" + debug "4.3.2" + escalade "^3.1.1" + esm "^3.2.25" + getopts "2.2.5" + interpret "^2.2.0" + lodash "^4.17.21" + pg-connection-string "2.5.0" + rechoir "0.7.0" + resolve-from "^5.0.0" + tarn "^3.0.1" + tildify "2.0.0" + knex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/knex/-/knex-1.0.2.tgz#1b79273f39f587a631c1a5515482c203d5971781" @@ -20669,6 +20834,13 @@ recharts@^1.8.5: recharts-scale "^0.4.2" reduce-css-calc "^1.3.0" +rechoir@0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" + integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== + dependencies: + resolve "^1.9.0" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -21126,6 +21298,15 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +resolve@^1.9.0: + version "1.22.0" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + dependencies: + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.3: version "2.0.0-next.3" resolved "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" @@ -22953,7 +23134,7 @@ tar@^6.0.2, tar@^6.1.0, tar@^6.1.2: mkdirp "^1.0.3" yallist "^4.0.0" -tarn@^3.0.2: +tarn@^3.0.1, tarn@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz#73b6140fbb881b71559c4f8bfde3d9a4b3d27693" integrity sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ== From b02ab44f3b477e9b3b3e7eaf31cd4e94a9d6af0d Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 9 Feb 2022 14:40:38 +0000 Subject: [PATCH 17/22] Update @backstage/cli dependency Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 2 +- yarn.lock | 91 --------------------------- 2 files changed, 1 insertion(+), 92 deletions(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 22589c8f21..e10cd50090 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -31,7 +31,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.13.1-next.0", + "@backstage/cli": "^0.13.2-next.0", "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", "supertest": "^6.1.6", diff --git a/yarn.lock b/yarn.lock index a5cc9933e2..aae5c90071 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1416,97 +1416,6 @@ winston "^3.2.1" yn "^4.0.0" -"@backstage/cli@^0.13.1-next.0": - version "0.13.1" - resolved "https://registry.npmjs.org/@backstage/cli/-/cli-0.13.1.tgz#67959eea81c6d0474aa3e3769c0c80b7b4665c05" - integrity sha512-Zc1kWvRCOoCl/E3/X6J3q0DKc1i14mkSnyA6gKUT0JmoG7H0Lf8ULQQLDr97/wm+dyiYpx/yl8ggkBB0OV9+bw== - dependencies: - "@backstage/cli-common" "^0.1.6" - "@backstage/config" "^0.1.13" - "@backstage/config-loader" "^0.9.3" - "@backstage/errors" "^0.2.0" - "@backstage/types" "^0.1.1" - "@hot-loader/react-dom" "^16.13.0" - "@manypkg/get-packages" "^1.1.3" - "@octokit/request" "^5.4.12" - "@rollup/plugin-commonjs" "^21.0.1" - "@rollup/plugin-json" "^4.1.0" - "@rollup/plugin-node-resolve" "^13.0.0" - "@rollup/plugin-yaml" "^3.1.0" - "@spotify/eslint-config-base" "^12.0.0" - "@spotify/eslint-config-react" "^12.0.0" - "@spotify/eslint-config-typescript" "^12.0.0" - "@sucrase/jest-plugin" "^2.1.1" - "@sucrase/webpack-loader" "^2.0.0" - "@svgr/plugin-jsx" "6.2.x" - "@svgr/plugin-svgo" "6.2.x" - "@svgr/rollup" "5.5.x" - "@svgr/webpack" "5.5.x" - "@types/webpack-env" "^1.15.2" - "@typescript-eslint/eslint-plugin" "^5.9.0" - "@typescript-eslint/parser" "^5.9.0" - "@yarnpkg/lockfile" "^1.1.0" - bfj "^7.0.2" - buffer "^6.0.3" - chalk "^4.0.0" - chokidar "^3.3.1" - commander "^6.1.0" - css-loader "^6.5.1" - diff "^5.0.0" - esbuild "^0.14.10" - esbuild-loader "^2.18.0" - eslint "^8.6.0" - eslint-config-prettier "^8.3.0" - eslint-formatter-friendly "^7.0.0" - eslint-plugin-import "^2.25.4" - eslint-plugin-jest "^25.3.4" - eslint-plugin-jsx-a11y "^6.5.1" - eslint-plugin-monorepo "^0.3.2" - eslint-plugin-react "^7.28.0" - eslint-plugin-react-hooks "^4.3.0" - eslint-webpack-plugin "^2.6.0" - express "^4.17.1" - fork-ts-checker-webpack-plugin "^7.0.0-alpha.8" - fs-extra "9.1.0" - glob "^7.1.7" - handlebars "^4.7.3" - html-webpack-plugin "^5.3.1" - inquirer "^8.2.0" - jest "^26.0.1" - jest-css-modules "^2.1.0" - jest-transform-yaml "^1.0.0" - json-schema "^0.4.0" - lodash "^4.17.21" - mini-css-extract-plugin "^2.4.2" - minimatch "3.0.4" - node-libs-browser "^2.2.1" - ora "^5.3.0" - postcss "^8.1.0" - process "^0.11.10" - react-dev-utils "^12.0.0-next.60" - react-hot-loader "^4.13.0" - recursive-readdir "^2.2.2" - replace-in-file "^6.0.0" - rollup "^2.60.2" - rollup-plugin-dts "^4.0.1" - rollup-plugin-esbuild "^4.7.2" - rollup-plugin-peer-deps-external "^2.2.2" - rollup-plugin-postcss "^4.0.0" - rollup-pluginutils "^2.8.2" - run-script-webpack-plugin "^0.0.11" - semver "^7.3.2" - style-loader "^3.3.1" - sucrase "^3.20.2" - tar "^6.1.2" - terser-webpack-plugin "^5.1.3" - util "^0.12.3" - webpack "^5.66.0" - webpack-dev-server "^4.7.3" - webpack-node-externals "^3.0.0" - yaml "^1.10.0" - yml-loader "^2.1.0" - yn "^4.0.0" - "@backstage/core-components@*", "@backstage/core-components@^0.8.0", "@backstage/core-components@^0.8.7": version "0.8.7" resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.8.7.tgz#c4bb9760d57971882065415e6e715eb750db2392" From b958d198b808a7816feeb10b0eb6e1c6fe0521f3 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 9 Feb 2022 15:01:44 +0000 Subject: [PATCH 18/22] Update @backstage/backend-common dependency Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 2 +- yarn.lock | 96 +-------------------------- 2 files changed, 4 insertions(+), 94 deletions(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index e10cd50090..456423a0b2 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.10.5", + "@backstage/backend-common": "^0.10.7-next.0", "@backstage/config": "^0.1.13", "@types/express": "*", "express": "^4.17.1", diff --git a/yarn.lock b/yarn.lock index aae5c90071..232f883cf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1366,56 +1366,6 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@backstage/backend-common@^0.10.5": - version "0.10.6" - resolved "https://registry.npmjs.org/@backstage/backend-common/-/backend-common-0.10.6.tgz#482c1355518a6421596a3b9678a693eaaa17e8de" - integrity sha512-4AdrR9SrG2C+W9BMawRNoRkUbhLD5tcQEhI6/bxOpV62WSHVu5OQjgZbjCrFG5p+Q0syOVNAxX3MtjcQhkvfwg== - dependencies: - "@backstage/cli-common" "^0.1.6" - "@backstage/config" "^0.1.13" - "@backstage/config-loader" "^0.9.3" - "@backstage/errors" "^0.2.0" - "@backstage/integration" "^0.7.2" - "@backstage/types" "^0.1.1" - "@google-cloud/storage" "^5.8.0" - "@manypkg/get-packages" "^1.1.3" - "@octokit/rest" "^18.5.3" - "@types/cors" "^2.8.6" - "@types/dockerode" "^3.3.0" - "@types/express" "^4.17.6" - "@types/luxon" "^2.0.4" - archiver "^5.0.2" - aws-sdk "^2.840.0" - compression "^1.7.4" - concat-stream "^2.0.0" - cors "^2.8.5" - dockerode "^3.3.1" - express "^4.17.1" - express-promise-router "^4.1.0" - fs-extra "9.1.0" - git-url-parse "^11.6.0" - helmet "^4.0.0" - isomorphic-git "^1.8.0" - jose "^1.27.1" - keyv "^4.0.3" - keyv-memcache "^1.2.5" - knex "^0.95.1" - lodash "^4.17.21" - logform "^2.3.2" - luxon "^2.0.2" - minimatch "^3.0.4" - minimist "^1.2.5" - morgan "^1.10.0" - node-abort-controller "^3.0.1" - node-fetch "^2.6.1" - raw-body "^2.4.1" - selfsigned "^1.10.7" - stoppable "^1.1.0" - tar "^6.1.2" - unzipper "^0.10.11" - winston "^3.2.1" - yn "^4.0.0" - "@backstage/core-components@*", "@backstage/core-components@^0.8.0", "@backstage/core-components@^0.8.7": version "0.8.7" resolved "https://registry.npmjs.org/@backstage/core-components/-/core-components-0.8.7.tgz#c4bb9760d57971882065415e6e715eb750db2392" @@ -9016,7 +8966,7 @@ commander@^6.1.0: resolved "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== -commander@^7.1.0, commander@^7.2.0: +commander@^7.2.0: version "7.2.0" resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== @@ -12674,11 +12624,6 @@ get-value@^2.0.3, get-value@^2.0.6: resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= -getopts@2.2.5: - version "2.2.5" - resolved "https://registry.npmjs.org/getopts/-/getopts-2.2.5.tgz#67a0fe471cacb9c687d817cab6450b96dde8313b" - integrity sha512-9jb7AW5p3in+IiJWhQiZmmwkpLaR/ccTWdWQCtZM66HJcHHLegowh4q4tSD7gouUyeNvFWRavfK9GXosQHDpFA== - getopts@2.3.0: version "2.3.0" resolved "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz#71e5593284807e03e2427449d4f6712a268666f4" @@ -14095,7 +14040,7 @@ is-core-module@^2.1.0, is-core-module@^2.2.0: dependencies: has "^1.0.3" -is-core-module@^2.8.0, is-core-module@^2.8.1: +is-core-module@^2.8.0: version "2.8.1" resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== @@ -15781,25 +15726,6 @@ kleur@^4.0.3: resolved "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz#8c202987d7e577766d039a8cd461934c01cda04d" integrity sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA== -knex@^0.95.1: - version "0.95.15" - resolved "https://registry.npmjs.org/knex/-/knex-0.95.15.tgz#39d7e7110a6e2ad7de5d673d2dea94143015e0e7" - integrity sha512-Loq6WgHaWlmL2bfZGWPsy4l8xw4pOE+tmLGkPG0auBppxpI0UcK+GYCycJcqz9W54f2LiGewkCVLBm3Wq4ur/w== - dependencies: - colorette "2.0.16" - commander "^7.1.0" - debug "4.3.2" - escalade "^3.1.1" - esm "^3.2.25" - getopts "2.2.5" - interpret "^2.2.0" - lodash "^4.17.21" - pg-connection-string "2.5.0" - rechoir "0.7.0" - resolve-from "^5.0.0" - tarn "^3.0.1" - tildify "2.0.0" - knex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/knex/-/knex-1.0.2.tgz#1b79273f39f587a631c1a5515482c203d5971781" @@ -20743,13 +20669,6 @@ recharts@^1.8.5: recharts-scale "^0.4.2" reduce-css-calc "^1.3.0" -rechoir@0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca" - integrity sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q== - dependencies: - resolve "^1.9.0" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -21207,15 +21126,6 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.18 path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^1.9.0: - version "1.22.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - resolve@^2.0.0-next.3: version "2.0.0-next.3" resolved "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" @@ -23043,7 +22953,7 @@ tar@^6.0.2, tar@^6.1.0, tar@^6.1.2: mkdirp "^1.0.3" yallist "^4.0.0" -tarn@^3.0.1, tarn@^3.0.2: +tarn@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz#73b6140fbb881b71559c4f8bfde3d9a4b3d27693" integrity sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ== From dcbd590efc1dc04109a953c50606a9f9e5d92ca5 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Thu, 10 Feb 2022 10:41:21 +0000 Subject: [PATCH 19/22] Try and properly support having config.d.ts away from the root folder Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 3 ++- plugins/airbrake-backend/{ => src/config}/config.d.ts | 0 plugins/airbrake-backend/src/config/index.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) rename plugins/airbrake-backend/{ => src/config}/config.d.ts (100%) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 456423a0b2..fb9bca210f 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -39,8 +39,9 @@ }, "files": [ "dist", - "config.d.ts" + "src/config/config.d.ts" ], + "configSchema": "src/config/config.d.ts", "jest": { "coverageThreshold": { "global": { diff --git a/plugins/airbrake-backend/config.d.ts b/plugins/airbrake-backend/src/config/config.d.ts similarity index 100% rename from plugins/airbrake-backend/config.d.ts rename to plugins/airbrake-backend/src/config/config.d.ts diff --git a/plugins/airbrake-backend/src/config/index.ts b/plugins/airbrake-backend/src/config/index.ts index bc87a3c795..7cad13e15e 100644 --- a/plugins/airbrake-backend/src/config/index.ts +++ b/plugins/airbrake-backend/src/config/index.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Config } from '../../config'; +import { Config } from './config'; export { extractAirbrakeConfig } from './ExtractAirbrakeConfig'; export type AirbrakeConfig = Config['airbrake']; From e5f1efcd96b4d12c30e56f6d5d4fc4557528aa56 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Thu, 10 Feb 2022 11:13:33 +0000 Subject: [PATCH 20/22] Duplicating the Airbrake config section instead of reusing. It looks very tough to get it to work. Signed-off-by: Karan Shah --- plugins/airbrake-backend/api-report.md | 4 ++-- .../airbrake-backend/{src/config => }/config.d.ts | 0 plugins/airbrake-backend/package.json | 4 ++-- .../src/config/ExtractAirbrakeConfig.ts | 13 ++++++++++++- plugins/airbrake-backend/src/config/index.ts | 4 +--- 5 files changed, 17 insertions(+), 8 deletions(-) rename plugins/airbrake-backend/{src/config => }/config.d.ts (100%) diff --git a/plugins/airbrake-backend/api-report.md b/plugins/airbrake-backend/api-report.md index c888d55e5b..b9e9a50e0b 100644 --- a/plugins/airbrake-backend/api-report.md +++ b/plugins/airbrake-backend/api-report.md @@ -8,9 +8,9 @@ import express from 'express'; import { Logger as Logger_2 } from 'winston'; // @public -export type AirbrakeConfig = { +export interface AirbrakeConfig { apiKey: string; -}; +} // @public export function createRouter(options: RouterOptions): Promise; diff --git a/plugins/airbrake-backend/src/config/config.d.ts b/plugins/airbrake-backend/config.d.ts similarity index 100% rename from plugins/airbrake-backend/src/config/config.d.ts rename to plugins/airbrake-backend/config.d.ts diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index fb9bca210f..da025b117c 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -39,9 +39,9 @@ }, "files": [ "dist", - "src/config/config.d.ts" + "config.d.ts" ], - "configSchema": "src/config/config.d.ts", + "configSchema": "config.d.ts", "jest": { "coverageThreshold": { "global": { diff --git a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts index 6fc2c5e04c..ea39a27d11 100644 --- a/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts +++ b/plugins/airbrake-backend/src/config/ExtractAirbrakeConfig.ts @@ -14,7 +14,18 @@ * limitations under the License. */ import { Config } from '@backstage/config'; -import { AirbrakeConfig } from '.'; + +/** + * The configuration needed for the airbrake-backend plugin + * + * @public + */ +export interface AirbrakeConfig { + /** + * The API Key to authenticate requests. More details on how to get this here: https://airbrake.io/docs/api/#authentication + */ + apiKey: string; +} /** * Extract the Airbrake config from a config object diff --git a/plugins/airbrake-backend/src/config/index.ts b/plugins/airbrake-backend/src/config/index.ts index 7cad13e15e..60d60c2761 100644 --- a/plugins/airbrake-backend/src/config/index.ts +++ b/plugins/airbrake-backend/src/config/index.ts @@ -13,7 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Config } from './config'; -export { extractAirbrakeConfig } from './ExtractAirbrakeConfig'; -export type AirbrakeConfig = Config['airbrake']; +export * from './ExtractAirbrakeConfig'; From 8855e652fa803c3e442b6fec8cdd5237260a31a6 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Thu, 10 Feb 2022 14:46:44 +0000 Subject: [PATCH 21/22] Update package.json dependencies to the latest versions of Backstage dependencies Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index da025b117c..09d18079a1 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.10.7-next.0", + "@backstage/backend-common": "^0.10.7", "@backstage/config": "^0.1.13", "@types/express": "*", "express": "^4.17.1", @@ -31,7 +31,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.13.2-next.0", + "@backstage/cli": "^0.13.2", "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", "supertest": "^6.1.6", From f5e370e0c38a57baef9da1d611a24f96feb83081 Mon Sep 17 00:00:00 2001 From: Karan Shah Date: Wed, 16 Feb 2022 14:26:41 +0000 Subject: [PATCH 22/22] Make the Airbrake backend plugin public Signed-off-by: Karan Shah --- plugins/airbrake-backend/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 09d18079a1..0e94e6d998 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -4,7 +4,6 @@ "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", - "private": true, "publishConfig": { "access": "public", "main": "dist/index.cjs.js",