From 07df44c389c7c8ee360f5f58b7295a5d238b0040 Mon Sep 17 00:00:00 2001 From: Fabian Chong Date: Fri, 9 Oct 2020 15:49:45 +0800 Subject: [PATCH 01/55] use backstage version in backend plugin scaffold --- .../cli/templates/default-backend-plugin/package.json.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli/templates/default-backend-plugin/package.json.hbs b/packages/cli/templates/default-backend-plugin/package.json.hbs index 40e612609a..822ce584a5 100644 --- a/packages/cli/templates/default-backend-plugin/package.json.hbs +++ b/packages/cli/templates/default-backend-plugin/package.json.hbs @@ -23,8 +23,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^{{version}}", - "@backstage/config": "^{{version}}", + "@backstage/backend-common": "^{{backstageVersion}}", + "@backstage/config": "^{{backstageVersion}}", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^3.0.3", @@ -33,7 +33,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^{{version}}", + "@backstage/cli": "^{{backstageVersion}}", "@types/supertest": "^2.0.8", "supertest": "^4.0.2", "msw": "^0.20.5" From 7de1004f03435f50bd635bd7bc354d92fccbcdd2 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 10 Oct 2020 17:26:27 +0200 Subject: [PATCH 02/55] e2e-test: converted into a CLI --- .changeset/fuzzy-falcons-happen.md | 5 ++ .github/workflows/e2e-win.yml | 2 +- .github/workflows/e2e.yml | 2 +- packages/e2e-test/README.md | 2 +- .../e2e-test/{src/index.js => bin/e2e-test} | 7 ++- packages/e2e-test/package.json | 7 ++- packages/e2e-test/src/commands/index.ts | 22 +++++++ .../src/{e2e-test.ts => commands/run.ts} | 20 +------ packages/e2e-test/src/index.ts | 58 +++++++++++++++++++ .../e2e-test/src/{ => lib}/helpers.test.ts | 0 packages/e2e-test/src/{ => lib}/helpers.ts | 4 +- 11 files changed, 104 insertions(+), 25 deletions(-) create mode 100644 .changeset/fuzzy-falcons-happen.md rename packages/e2e-test/{src/index.js => bin/e2e-test} (85%) mode change 100644 => 100755 create mode 100644 packages/e2e-test/src/commands/index.ts rename packages/e2e-test/src/{e2e-test.ts => commands/run.ts} (94%) create mode 100644 packages/e2e-test/src/index.ts rename packages/e2e-test/src/{ => lib}/helpers.test.ts (100%) rename packages/e2e-test/src/{ => lib}/helpers.ts (97%) diff --git a/.changeset/fuzzy-falcons-happen.md b/.changeset/fuzzy-falcons-happen.md new file mode 100644 index 0000000000..461ac195d9 --- /dev/null +++ b/.changeset/fuzzy-falcons-happen.md @@ -0,0 +1,5 @@ +--- +'e2e-test': minor +--- + +Converted into a CLI, use `yarn e2e-test run` to run diff --git a/.github/workflows/e2e-win.yml b/.github/workflows/e2e-win.yml index c48d779962..570d857c48 100644 --- a/.github/workflows/e2e-win.yml +++ b/.github/workflows/e2e-win.yml @@ -40,4 +40,4 @@ jobs: - name: yarn build run: yarn build --ignore example-app --ignore example-backend --ignore @techdocs/cli - name: run E2E test - run: yarn workspace e2e-test start + run: yarn e2e-test run diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e280bf59a3..62be0a6cea 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -70,7 +70,7 @@ jobs: - name: run E2E test run: | sudo sysctl fs.inotify.max_user_watches=524288 - yarn workspace e2e-test start + yarn e2e-test run env: POSTGRES_HOST: localhost POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} diff --git a/packages/e2e-test/README.md b/packages/e2e-test/README.md index 6cf50283c5..e3706b6131 100644 --- a/packages/e2e-test/README.md +++ b/packages/e2e-test/README.md @@ -14,7 +14,7 @@ yarn tsc yarn build ``` -Once those tasks have completed, you can now run the test using `yarn start` inside this package. +Once those tasks have completed, you can now run the test using `yarn e2e-test run`. If you make changes to other packages you will need to rerun `yarn tsc && yarn build`. Changes to this package do not require a rebuild. diff --git a/packages/e2e-test/src/index.js b/packages/e2e-test/bin/e2e-test old mode 100644 new mode 100755 similarity index 85% rename from packages/e2e-test/src/index.js rename to packages/e2e-test/bin/e2e-test index 525f20cdd1..d6d449fe31 --- a/packages/e2e-test/src/index.js +++ b/packages/e2e-test/bin/e2e-test @@ -1,3 +1,4 @@ +#!/usr/bin/env node /* * Copyright 2020 Spotify AB * @@ -14,13 +15,15 @@ * limitations under the License. */ +const path = require('path'); + require('ts-node').register({ transpileOnly: true, /* eslint-disable-next-line no-restricted-syntax */ - project: require('path').resolve(__dirname, '../../../tsconfig.json'), + project: path.resolve(__dirname, '../../../tsconfig.json'), compilerOptions: { module: 'CommonJS', }, }); -require('./e2e-test'); +require('../src'); diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index 8dcfd98ab5..c746fc7dbc 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -13,17 +13,22 @@ "backstage" ], "license": "Apache-2.0", - "main": "src/index.js", + "main": "src/index.ts", "scripts": { "start": "node .", "lint": "backstage-cli lint", "test": "backstage-cli test", "test:e2e": "yarn start" }, + "bin": { + "e2e-test": "bin/e2e-test" + }, "devDependencies": { "@backstage/cli-common": "^0.1.1-alpha.24", "@types/fs-extra": "^9.0.1", "@types/node": "^13.7.2", + "chalk": "^4.0.0", + "commander": "^6.1.0", "fs-extra": "^9.0.0", "handlebars": "^4.7.3", "node-fetch": "^2.6.0", diff --git a/packages/e2e-test/src/commands/index.ts b/packages/e2e-test/src/commands/index.ts new file mode 100644 index 0000000000..78ff3343f1 --- /dev/null +++ b/packages/e2e-test/src/commands/index.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2020 Spotify AB + * + * 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 { CommanderStatic } from 'commander'; +import { run } from './run'; + +export function registerCommands(program: CommanderStatic) { + program.command('run').description('Run e2e tests').action(run); +} diff --git a/packages/e2e-test/src/e2e-test.ts b/packages/e2e-test/src/commands/run.ts similarity index 94% rename from packages/e2e-test/src/e2e-test.ts rename to packages/e2e-test/src/commands/run.ts index 2ead11c429..2a0f641014 100644 --- a/packages/e2e-test/src/e2e-test.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -24,16 +24,15 @@ import Browser from 'zombie'; import { spawnPiped, runPlain, - handleError, waitForPageWithText, waitFor, waitForExit, print, -} from './helpers'; +} from '../lib/helpers'; import pgtools from 'pgtools'; import { findPaths } from '@backstage/cli-common'; -/* eslint-disable-next-line no-restricted-syntax */ +// eslint-disable-next-line no-restricted-syntax const paths = findPaths(__dirname); const templatePackagePaths = [ @@ -42,7 +41,7 @@ const templatePackagePaths = [ 'packages/create-app/templates/default-app/packages/backend/package.json.hbs', ]; -async function main() { +export async function run() { const rootDir = await fs.mkdtemp(resolvePath(os.tmpdir(), 'backstage-e2e-')); print(`CLI E2E test root: ${rootDir}\n`); @@ -413,16 +412,3 @@ async function testBackendStart(appDir: string, isPostgres: boolean) { print('Backend startup test finished successfully'); } } - -process.on('unhandledRejection', (error: Error) => { - // Try to avoid exiting if the unhandled error is coming from jsdom, i.e. zombie. - // Those are typically errors on the page that should be benign, at least in the - // context of this test. We have other ways of asserting that the page is being - // rendered correctly. - if (error?.stack?.includes('node_modules/jsdom/lib')) { - console.log(`Ignored error inside jsdom, ${error}`); - } else { - handleError(error); - } -}); -main().catch(handleError); diff --git a/packages/e2e-test/src/index.ts b/packages/e2e-test/src/index.ts new file mode 100644 index 0000000000..2266439973 --- /dev/null +++ b/packages/e2e-test/src/index.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2020 Spotify AB + * + * 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 program from 'commander'; +import chalk from 'chalk'; +import { registerCommands } from './commands'; +import { version } from '../package.json'; +import { exitWithError } from './lib/helpers'; + +async function main(argv: string[]) { + program.name('e2e-test').version(version); + + registerCommands(program); + + program.on('command:*', () => { + console.log(); + console.log(chalk.red(`Invalid command: ${program.args.join(' ')}`)); + console.log(); + program.outputHelp(); + process.exit(1); + }); + + program.parse(argv); +} + +process.on('unhandledRejection', (rejection: unknown) => { + // Try to avoid exiting if the unhandled error is coming from jsdom, i.e. zombie. + // Those are typically errors on the page that should be benign, at least in the + // context of this test. We have other ways of asserting that the page is being + // rendered correctly. + if ( + rejection instanceof Error && + rejection?.stack?.includes('node_modules/jsdom/lib') + ) { + console.log(`Ignored error inside jsdom, ${rejection?.stack ?? rejection}`); + } else { + if (rejection instanceof Error) { + exitWithError(rejection); + } else { + exitWithError(new Error(`Unknown rejection: '${rejection}'`)); + } + } +}); + +main(process.argv).catch(exitWithError); diff --git a/packages/e2e-test/src/helpers.test.ts b/packages/e2e-test/src/lib/helpers.test.ts similarity index 100% rename from packages/e2e-test/src/helpers.test.ts rename to packages/e2e-test/src/lib/helpers.test.ts diff --git a/packages/e2e-test/src/helpers.ts b/packages/e2e-test/src/lib/helpers.ts similarity index 97% rename from packages/e2e-test/src/helpers.ts rename to packages/e2e-test/src/lib/helpers.ts index b59de75860..aded184f5c 100644 --- a/packages/e2e-test/src/helpers.ts +++ b/packages/e2e-test/src/lib/helpers.ts @@ -42,7 +42,7 @@ export function spawnPiped(cmd: string[], options?: SpawnOptions) { shell: true, ...options, }); - child.on('error', handleError); + child.on('error', exitWithError); const logPrefix = cmd.map(s => s.replace(/.+\//, '')).join(' '); child.stdout?.on( @@ -75,7 +75,7 @@ export async function runPlain(cmd: string[], options?: SpawnOptions) { } } -export function handleError(err: Error & { code?: unknown }) { +export function exitWithError(err: Error & { code?: unknown }) { process.stdout.write(`${err.name}: ${err.stack || err.message}\n`); if (typeof err.code === 'number') { From 8afce088ac0a39a2b19ff7ef31b28af52e15c13c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 10 Oct 2020 17:41:03 +0200 Subject: [PATCH 03/55] Use APP_ENV to determine what config to load, falling back to NODE_ENV --- .changeset/old-eagles-admire.md | 6 ++++++ CHANGELOG.md | 4 ++++ docs/conf/writing.md | 7 ++++--- docs/getting-started/deployment-other.md | 2 +- packages/backend-common/src/config.ts | 2 +- packages/cli/src/commands/app/build.ts | 2 +- packages/cli/src/commands/app/serve.ts | 2 +- packages/cli/src/commands/backend/dev.ts | 2 +- packages/cli/src/commands/config/print.ts | 3 ++- packages/cli/src/commands/index.ts | 2 +- packages/cli/src/commands/plugin/export.ts | 2 +- packages/cli/src/commands/plugin/serve.ts | 2 +- packages/config-loader/src/lib/resolver.ts | 2 +- 13 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .changeset/old-eagles-admire.md diff --git a/.changeset/old-eagles-admire.md b/.changeset/old-eagles-admire.md new file mode 100644 index 0000000000..0729b6439d --- /dev/null +++ b/.changeset/old-eagles-admire.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-common': minor +'@backstage/cli': minor +--- + +Use APP_ENV before NODE_ENV for determining what config to load diff --git a/CHANGELOG.md b/CHANGELOG.md index 487b94a39d..0bcce2966f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ If you encounter issues while upgrading to a newer version, don't hesitate to re > Collect changes for the next release below +### @backstage/cli + +- The recommended way to set the configuration environment is now to use `APP_ENV` instead of `NODE_ENV`. + ### Backend (example-backend, or backends created with @backstage/create-app) - A plugin database manager has been created, and plugins can now accept that interface as an argument during initialisation. Notably, the `auth` plugin has a [`createRouter` signature change](./plugins/auth-backend/src/service/router.ts). See [packages/backend/src/index.ts](./packages/backend/src/index.ts) on how to set it up. [#2697](https://github.com/spotify/backstage/pull/2697) diff --git a/docs/conf/writing.md b/docs/conf/writing.md index 5564e780bb..bb4d0beb75 100644 --- a/docs/conf/writing.md +++ b/docs/conf/writing.md @@ -65,9 +65,10 @@ All `app-config.yaml` files inside the monorepo root and package root are considered, as are files with additional `local` and environment affixes such as `development`, for example `app-config.local.yaml`, `app-config.production.yaml`, and `app-config.development.local.yaml`. Which -environment config files are loaded is determined by the `NODE_ENV` environment -variable. Local configuration files are always loaded, but are meant for local -development overrides and should typically be `.gitignore`'d. +environment config files are loaded is determined by the `APP_ENV` environment +variable, or `NODE_ENV` if it is not set. Local configuration files are always +loaded, but are meant for local development overrides and should typically be +`.gitignore`'d. All loaded configuration files are merged together using the following rules: diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md index ab5833b634..509bbdc978 100644 --- a/docs/getting-started/deployment-other.md +++ b/docs/getting-started/deployment-other.md @@ -13,7 +13,7 @@ Run the following commands if you have Docker environment ```bash $ yarn install $ yarn docker-build -$ docker run --rm -it -p 7000:7000 -e NODE_ENV=development example-backend:latest +$ docker run --rm -it -p 7000:7000 -e APP_ENV=production -e NODE_ENV=development example-backend:latest ``` Then open http://localhost/ on your browser. diff --git a/packages/backend-common/src/config.ts b/packages/backend-common/src/config.ts index 7432b204dd..490070f80a 100644 --- a/packages/backend-common/src/config.ts +++ b/packages/backend-common/src/config.ts @@ -24,7 +24,7 @@ export async function loadBackendConfig() { /* eslint-disable-next-line no-restricted-syntax */ const paths = findPaths(__dirname); const configs = await loadConfig({ - env: process.env.NODE_ENV ?? 'development', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development', rootPaths: [paths.targetRoot, paths.targetDir], shouldReadSecrets: true, }); diff --git a/packages/cli/src/commands/app/build.ts b/packages/cli/src/commands/app/build.ts index 5d499cbc2d..9713acd233 100644 --- a/packages/cli/src/commands/app/build.ts +++ b/packages/cli/src/commands/app/build.ts @@ -22,7 +22,7 @@ import { buildBundle } from '../../lib/bundler'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: process.env.NODE_ENV ?? 'production', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'production', rootPaths: [paths.targetRoot, paths.targetDir], }); await buildBundle({ diff --git a/packages/cli/src/commands/app/serve.ts b/packages/cli/src/commands/app/serve.ts index c748d12a75..031214c264 100644 --- a/packages/cli/src/commands/app/serve.ts +++ b/packages/cli/src/commands/app/serve.ts @@ -22,7 +22,7 @@ import { serveBundle } from '../../lib/bundler'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: process.env.NODE_ENV ?? 'development', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development', rootPaths: [paths.targetRoot, paths.targetDir], }); const waitForExit = await serveBundle({ diff --git a/packages/cli/src/commands/backend/dev.ts b/packages/cli/src/commands/backend/dev.ts index 8b2ff9285a..ca76f19da3 100644 --- a/packages/cli/src/commands/backend/dev.ts +++ b/packages/cli/src/commands/backend/dev.ts @@ -22,7 +22,7 @@ import { serveBackend } from '../../lib/bundler/backend'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: process.env.NODE_ENV ?? 'development', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development', rootPaths: [paths.targetRoot, paths.targetDir], }); diff --git a/packages/cli/src/commands/config/print.ts b/packages/cli/src/commands/config/print.ts index bb626f520f..526f4d70b1 100644 --- a/packages/cli/src/commands/config/print.ts +++ b/packages/cli/src/commands/config/print.ts @@ -22,7 +22,8 @@ import { stringify as stringifyYaml } from 'yaml'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: cmd.env ?? process.env.NODE_ENV ?? 'development', + env: + cmd.env ?? process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development', shouldReadSecrets: cmd.withSecrets ?? false, rootPaths: [paths.targetRoot, paths.targetDir], }); diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index fea250cd55..e5017b829a 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -133,7 +133,7 @@ export function registerCommands(program: CommanderStatic) { .option('--with-secrets', 'Include secrets in the printed configuration') .option( '--env ', - 'The environment to print configuration for [NODE_ENV or development]', + 'The environment to print configuration for [APP_ENV or NODE_ENV or development]', ) .option( '--format ', diff --git a/packages/cli/src/commands/plugin/export.ts b/packages/cli/src/commands/plugin/export.ts index 8cbbe5b3ee..4fe9cb3c03 100644 --- a/packages/cli/src/commands/plugin/export.ts +++ b/packages/cli/src/commands/plugin/export.ts @@ -22,7 +22,7 @@ import { buildBundle } from '../../lib/bundler'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: process.env.NODE_ENV ?? 'production', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'production', rootPaths: [paths.targetRoot, paths.targetDir], }); await buildBundle({ diff --git a/packages/cli/src/commands/plugin/serve.ts b/packages/cli/src/commands/plugin/serve.ts index 8a04df8837..bae63f2fda 100644 --- a/packages/cli/src/commands/plugin/serve.ts +++ b/packages/cli/src/commands/plugin/serve.ts @@ -22,7 +22,7 @@ import { serveBundle } from '../../lib/bundler'; export default async (cmd: Command) => { const appConfigs = await loadConfig({ - env: process.env.NODE_ENV ?? 'development', + env: process.env.APP_ENV ?? process.env.NODE_ENV ?? 'development', rootPaths: [paths.targetRoot, paths.targetDir], }); const waitForExit = await serveBundle({ diff --git a/packages/config-loader/src/lib/resolver.ts b/packages/config-loader/src/lib/resolver.ts index 44f0f6ea9e..3856598331 100644 --- a/packages/config-loader/src/lib/resolver.ts +++ b/packages/config-loader/src/lib/resolver.ts @@ -28,7 +28,7 @@ type ResolveOptions = { * Resolves all configuration files that should be loaded in the given environment. * * For each root directory, search for the default app-config.yaml, along with suffixed - * NODE_ENV and local variants, e.g. app-config.production.yaml or app-config.development.local.yaml + * APP_ENV and local variants, e.g. app-config.production.yaml or app-config.development.local.yaml * * The priority order of config loaded through suffixes is `env > local > none`, meaning that * for example app-config.development.yaml has higher priority than `app-config.local.yaml`. From 8be7ddb11d3cef9303ff7bd1d8bc5f56f560df13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Oct 2020 04:21:22 +0000 Subject: [PATCH 04/55] chore(deps): bump jest from 26.4.2 to 26.5.3 Bumps [jest](https://github.com/facebook/jest) from 26.4.2 to 26.5.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v26.4.2...v26.5.3) Signed-off-by: dependabot[bot] --- yarn.lock | 692 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 365 insertions(+), 327 deletions(-) diff --git a/yarn.lock b/yarn.lock index 34d0287c42..7dbc7f964a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2253,93 +2253,93 @@ resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/console/-/console-26.3.0.tgz#ed04063efb280c88ba87388b6f16427c0a85c856" - integrity sha512-/5Pn6sJev0nPUcAdpJHMVIsA8sKizL2ZkcKPE5+dJrCccks7tcM7c9wbgHudBJbxXLoTbqsHkG1Dofoem4F09w== +"@jest/console@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/console/-/console-26.5.2.tgz#94fc4865b1abed7c352b5e21e6c57be4b95604a6" + integrity sha512-lJELzKINpF1v74DXHbCRIkQ/+nUV1M+ntj+X1J8LxCgpmJZjfLmhFejiMSbjjD66fayxl5Z06tbs3HMyuik6rw== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^26.3.0" - jest-util "^26.3.0" + jest-message-util "^26.5.2" + jest-util "^26.5.2" slash "^3.0.0" -"@jest/core@^26.4.2": - version "26.4.2" - resolved "https://registry.npmjs.org/@jest/core/-/core-26.4.2.tgz#85d0894f31ac29b5bab07aa86806d03dd3d33edc" - integrity sha512-sDva7YkeNprxJfepOctzS8cAk9TOekldh+5FhVuXS40+94SHbiicRO1VV2tSoRtgIo+POs/Cdyf8p76vPTd6dg== +"@jest/core@^26.5.3": + version "26.5.3" + resolved "https://registry.npmjs.org/@jest/core/-/core-26.5.3.tgz#712ed4adb64c3bda256a3f400ff1d3eb2a031f13" + integrity sha512-CiU0UKFF1V7KzYTVEtFbFmGLdb2g4aTtY0WlyUfLgj/RtoTnJFhh50xKKr7OYkdmBUlGFSa2mD1TU3UZ6OLd4g== dependencies: - "@jest/console" "^26.3.0" - "@jest/reporters" "^26.4.1" - "@jest/test-result" "^26.3.0" - "@jest/transform" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/console" "^26.5.2" + "@jest/reporters" "^26.5.3" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^26.3.0" - jest-config "^26.4.2" - jest-haste-map "^26.3.0" - jest-message-util "^26.3.0" + jest-changed-files "^26.5.2" + jest-config "^26.5.3" + jest-haste-map "^26.5.2" + jest-message-util "^26.5.2" jest-regex-util "^26.0.0" - jest-resolve "^26.4.0" - jest-resolve-dependencies "^26.4.2" - jest-runner "^26.4.2" - jest-runtime "^26.4.2" - jest-snapshot "^26.4.2" - jest-util "^26.3.0" - jest-validate "^26.4.2" - jest-watcher "^26.3.0" + jest-resolve "^26.5.2" + jest-resolve-dependencies "^26.5.3" + jest-runner "^26.5.3" + jest-runtime "^26.5.3" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" + jest-watcher "^26.5.2" micromatch "^4.0.2" p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/environment/-/environment-26.3.0.tgz#e6953ab711ae3e44754a025f838bde1a7fd236a0" - integrity sha512-EW+MFEo0DGHahf83RAaiqQx688qpXgl99wdb8Fy67ybyzHwR1a58LHcO376xQJHfmoXTu89M09dH3J509cx2AA== +"@jest/environment@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-26.5.2.tgz#eba3cfc698f6e03739628f699c28e8a07f5e65fe" + integrity sha512-YjhCD/Zhkz0/1vdlS/QN6QmuUdDkpgBdK4SdiVg4Y19e29g4VQYN5Xg8+YuHjdoWGY7wJHMxc79uDTeTOy9Ngw== dependencies: - "@jest/fake-timers" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" - jest-mock "^26.3.0" + jest-mock "^26.5.2" -"@jest/fake-timers@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.3.0.tgz#f515d4667a6770f60ae06ae050f4e001126c666a" - integrity sha512-ZL9ytUiRwVP8ujfRepffokBvD2KbxbqMhrXSBhSdAhISCw3gOkuntisiSFv+A6HN0n0fF4cxzICEKZENLmW+1A== +"@jest/fake-timers@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.5.2.tgz#1291ac81680ceb0dc7daa1f92c059307eea6400a" + integrity sha512-09Hn5Oraqt36V1akxQeWMVL0fR9c6PnEhpgLaYvREXZJAh2H2Y+QLCsl0g7uMoJeoWJAuz4tozk1prbR1Fc1sw== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" "@sinonjs/fake-timers" "^6.0.1" "@types/node" "*" - jest-message-util "^26.3.0" - jest-mock "^26.3.0" - jest-util "^26.3.0" + jest-message-util "^26.5.2" + jest-mock "^26.5.2" + jest-util "^26.5.2" -"@jest/globals@^26.4.2": - version "26.4.2" - resolved "https://registry.npmjs.org/@jest/globals/-/globals-26.4.2.tgz#73c2a862ac691d998889a241beb3dc9cada40d4a" - integrity sha512-Ot5ouAlehhHLRhc+sDz2/9bmNv9p5ZWZ9LE1pXGGTCXBasmi5jnYjlgYcYt03FBwLmZXCZ7GrL29c33/XRQiow== +"@jest/globals@^26.5.3": + version "26.5.3" + resolved "https://registry.npmjs.org/@jest/globals/-/globals-26.5.3.tgz#90769b40e0af3fa0b28f6d8c5bbe3712467243fd" + integrity sha512-7QztI0JC2CuB+Wx1VdnOUNeIGm8+PIaqngYsZXQCkH2QV0GFqzAYc9BZfU0nuqA6cbYrWh5wkuMzyii3P7deug== dependencies: - "@jest/environment" "^26.3.0" - "@jest/types" "^26.3.0" - expect "^26.4.2" + "@jest/environment" "^26.5.2" + "@jest/types" "^26.5.2" + expect "^26.5.3" -"@jest/reporters@^26.4.1": - version "26.4.1" - resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-26.4.1.tgz#3b4d6faf28650f3965f8b97bc3d114077fb71795" - integrity sha512-aROTkCLU8++yiRGVxLsuDmZsQEKO6LprlrxtAuzvtpbIFl3eIjgIf3EUxDKgomkS25R9ZzwGEdB5weCcBZlrpQ== +"@jest/reporters@^26.5.3": + version "26.5.3" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-26.5.3.tgz#e810e9c2b670f33f1c09e9975749260ca12f1c17" + integrity sha512-X+vR0CpfMQzYcYmMFKNY9n4jklcb14Kffffp7+H/MqitWnb0440bW2L76NGWKAa+bnXhNoZr+lCVtdtPmfJVOQ== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^26.3.0" - "@jest/test-result" "^26.3.0" - "@jest/transform" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/console" "^26.5.2" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -2350,63 +2350,63 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^26.3.0" - jest-resolve "^26.4.0" - jest-util "^26.3.0" - jest-worker "^26.3.0" + jest-haste-map "^26.5.2" + jest-resolve "^26.5.2" + jest-util "^26.5.2" + jest-worker "^26.5.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^5.0.1" + v8-to-istanbul "^6.0.1" optionalDependencies: node-notifier "^8.0.0" -"@jest/source-map@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-26.3.0.tgz#0e646e519883c14c551f7b5ae4ff5f1bfe4fc3d9" - integrity sha512-hWX5IHmMDWe1kyrKl7IhFwqOuAreIwHhbe44+XH2ZRHjrKIh0LO5eLQ/vxHFeAfRwJapmxuqlGAEYLadDq6ZGQ== +"@jest/source-map@^26.5.0": + version "26.5.0" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-26.5.0.tgz#98792457c85bdd902365cd2847b58fff05d96367" + integrity sha512-jWAw9ZwYHJMe9eZq/WrsHlwF8E3hM9gynlcDpOyCb9bR8wEd9ZNBZCi7/jZyzHxC7t3thZ10gO2IDhu0bPKS5g== dependencies: callsites "^3.0.0" graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-26.3.0.tgz#46cde01fa10c0aaeb7431bf71e4a20d885bc7fdb" - integrity sha512-a8rbLqzW/q7HWheFVMtghXV79Xk+GWwOK1FrtimpI5n1la2SY0qHri3/b0/1F0Ve0/yJmV8pEhxDfVwiUBGtgg== +"@jest/test-result@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-26.5.2.tgz#cc1a44cfd4db2ecee3fb0bc4e9fe087aa54b5230" + integrity sha512-E/Zp6LURJEGSCWpoMGmCFuuEI1OWuI3hmZwmULV0GsgJBh7u0rwqioxhRU95euUuviqBDN8ruX/vP/4bwYolXw== dependencies: - "@jest/console" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/console" "^26.5.2" + "@jest/types" "^26.5.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^26.4.2": - version "26.4.2" - resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.4.2.tgz#58a3760a61eec758a2ce6080201424580d97cbba" - integrity sha512-83DRD8N3M0tOhz9h0bn6Kl6dSp+US6DazuVF8J9m21WAp5x7CqSMaNycMP0aemC/SH/pDQQddbsfHRTBXVUgog== +"@jest/test-sequencer@^26.5.3": + version "26.5.3" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.5.3.tgz#9ae0ab9bc37d5171b28424029192e50229814f8d" + integrity sha512-Wqzb7aQ13L3T47xHdpUqYMOpiqz6Dx2QDDghp5AV/eUDXR7JieY+E1s233TQlNyl+PqtqgjVokmyjzX/HA51BA== dependencies: - "@jest/test-result" "^26.3.0" + "@jest/test-result" "^26.5.2" graceful-fs "^4.2.4" - jest-haste-map "^26.3.0" - jest-runner "^26.4.2" - jest-runtime "^26.4.2" + jest-haste-map "^26.5.2" + jest-runner "^26.5.3" + jest-runtime "^26.5.3" -"@jest/transform@^26.3.0": - version "26.3.0" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-26.3.0.tgz#c393e0e01459da8a8bfc6d2a7c2ece1a13e8ba55" - integrity sha512-Isj6NB68QorGoFWvcOjlUhpkT56PqNIsXKR7XfvoDlCANn/IANlh8DrKAA2l2JKC3yWSMH5wS0GwuQM20w3b2A== +"@jest/transform@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-26.5.2.tgz#6a0033a1d24316a1c75184d010d864f2c681bef5" + integrity sha512-AUNjvexh+APhhmS8S+KboPz+D3pCxPvEAGduffaAJYxIFxGi/ytZQkrqcKDUU0ERBAo5R7087fyOYr2oms1seg== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^26.3.0" + jest-haste-map "^26.5.2" jest-regex-util "^26.0.0" - jest-util "^26.3.0" + jest-util "^26.5.2" micromatch "^4.0.2" pirates "^4.0.1" slash "^3.0.0" @@ -2434,6 +2434,17 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" +"@jest/types@^26.5.2": + version "26.5.2" + resolved "https://registry.npmjs.org/@jest/types/-/types-26.5.2.tgz#44c24f30c8ee6c7f492ead9ec3f3c62a5289756d" + integrity sha512-QDs5d0gYiyetI8q+2xWdkixVQMklReZr4ltw7GFDtb4fuJIBCE6mzj2LnitGqCuAlLap6wPyb8fpoHgwZz5fdg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^15.0.0" + chalk "^4.0.0" + "@jsdevtools/ono@^7.1.3": version "7.1.3" resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" @@ -4671,6 +4682,13 @@ dependencies: "@babel/types" "^7.3.0" +"@types/babel__traverse@^7.0.4": + version "7.0.15" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.15.tgz#db9e4238931eb69ef8aab0ad6523d4d4caa39d03" + integrity sha512-Pzh9O3sTK8V6I1olsXpCfj2k/ygO2q1X0vhhnDrEQyYLHZesWz+zMZMVcwXLCYf0U36EtmyYaFGPfXlTtDHe3A== + dependencies: + "@babel/types" "^7.3.0" + "@types/body-parser@*", "@types/body-parser@1.19.0", "@types/body-parser@^1.19.0": version "1.19.0" resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz#0685b3c47eb3006ffed117cdd55164b61f80538f" @@ -5561,10 +5579,10 @@ resolved "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9" integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA== -"@types/stack-utils@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" - integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== +"@types/stack-utils@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" + integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== "@types/start-server-webpack-plugin@^2.2.0": version "2.2.0" @@ -6940,16 +6958,16 @@ babel-helper-to-multiple-sequence-expressions@^0.5.0: resolved "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" integrity sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA== -babel-jest@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-26.3.0.tgz#10d0ca4b529ca3e7d1417855ef7d7bd6fc0c3463" - integrity sha512-sxPnQGEyHAOPF8NcUsD0g7hDCnvLL2XyblRBcgrzTWBB/mAIpWow3n1bEL+VghnnZfreLhFSBsFluRoK2tRK4g== +babel-jest@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-26.5.2.tgz#164f367a35946c6cf54eaccde8762dec50422250" + integrity sha512-U3KvymF3SczA3vOL/cgiUFOznfMET+XDIXiWnoJV45siAp2pLMG8i2+/MGZlAC3f/F6Q40LR4M4qDrWZ9wkK8A== dependencies: - "@jest/transform" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" "@types/babel__core" "^7.1.7" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^26.3.0" + babel-preset-jest "^26.5.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -7004,10 +7022,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^26.2.0: - version "26.2.0" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.2.0.tgz#bdd0011df0d3d513e5e95f76bd53b51147aca2dd" - integrity sha512-B/hVMRv8Nh1sQ1a3EY8I0n4Y1Wty3NrR5ebOyVT302op+DOAau+xNEImGMsUWOC3++ZlMooCytKz+NgN8aKGbA== +babel-plugin-jest-hoist@^26.5.0: + version "26.5.0" + resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz#3916b3a28129c29528de91e5784a44680db46385" + integrity sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -7232,12 +7250,12 @@ babel-preset-fbjs@^3.3.0: "@babel/plugin-transform-template-literals" "^7.0.0" babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" -babel-preset-jest@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.3.0.tgz#ed6344506225c065fd8a0b53e191986f74890776" - integrity sha512-5WPdf7nyYi2/eRxCbVrE1kKCWxgWY4RsPEbdJWFm7QsesFGqjdkyLeu1zRkwM1cxK6EPIlNd6d2AxLk7J+t4pw== +babel-preset-jest@^26.5.0: + version "26.5.0" + resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz#f1b166045cd21437d1188d29f7fba470d5bdb0e7" + integrity sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA== dependencies: - babel-plugin-jest-hoist "^26.2.0" + babel-plugin-jest-hoist "^26.5.0" babel-preset-current-node-syntax "^0.1.3" "babel-preset-minify@^0.5.0 || 0.6.0-alpha.5": @@ -9919,10 +9937,10 @@ diff-sequences@^25.2.6: resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz#5f467c00edd35352b7bca46d7927d60e687a76dd" integrity sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg== -diff-sequences@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.3.0.tgz#62a59b1b29ab7fd27cef2a33ae52abe73042d0a2" - integrity sha512-5j5vdRcw3CNctePNYN0Wy2e/JbWT6cAYnXv5OuqPhDpyCGc0uLu2TK0zOCJWNB9kOIfYMSpIulRaDgIi4HJ6Ig== +diff-sequences@^26.5.0: + version "26.5.0" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.5.0.tgz#ef766cf09d43ed40406611f11c6d8d9dd8b2fefd" + integrity sha512-ZXx86srb/iYy6jG71k++wBN9P9J05UNQ5hQHQd9MtMPvcqXPx/vKU69jfHV637D00Q2gSgPk2D+jSx3l1lDW/Q== diff@^4.0.1, diff@^4.0.2: version "4.0.2" @@ -11017,16 +11035,16 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/expect/-/expect-26.4.2.tgz#36db120928a5a2d7d9736643032de32f24e1b2a1" - integrity sha512-IlJ3X52Z0lDHm7gjEp+m76uX46ldH5VpqmU0006vqDju/285twh7zaWMRhs67VpQhBwjjMchk+p5aA0VkERCAA== +expect@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/expect/-/expect-26.5.3.tgz#89d9795036f7358b0a9a5243238eb8086482d741" + integrity sha512-kkpOhGRWGOr+TEFUnYAjfGvv35bfP+OlPtqPIJpOCR9DVtv8QV+p8zG0Edqafh80fsjeE+7RBcVUq1xApnYglw== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" ansi-styles "^4.0.0" jest-get-type "^26.3.0" - jest-matcher-utils "^26.4.2" - jest-message-util "^26.3.0" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" jest-regex-util "^26.0.0" express-prom-bundle@^6.1.0: @@ -14026,57 +14044,57 @@ jenkins@^0.28.0: dependencies: papi "^0.29.0" -jest-changed-files@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.3.0.tgz#68fb2a7eb125f50839dab1f5a17db3607fe195b1" - integrity sha512-1C4R4nijgPltX6fugKxM4oQ18zimS7LqQ+zTTY8lMCMFPrxqBFb7KJH0Z2fRQJvw2Slbaipsqq7s1mgX5Iot+g== +jest-changed-files@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.5.2.tgz#330232c6a5c09a7f040a5870e8f0a9c6abcdbed5" + integrity sha512-qSmssmiIdvM5BWVtyK/nqVpN3spR5YyvkvPqz1x3BR1bwIxsWmU/MGwLoCrPNLbkG2ASAKfvmJpOduEApBPh2w== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" execa "^4.0.0" throat "^5.0.0" -jest-cli@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-26.4.2.tgz#24afc6e4dfc25cde4c7ec4226fb7db5f157c21da" - integrity sha512-zb+lGd/SfrPvoRSC/0LWdaWCnscXc1mGYW//NP4/tmBvRPT3VntZ2jtKUONsRi59zc5JqmsSajA9ewJKFYp8Cw== +jest-cli@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-26.5.3.tgz#f936b98f247b76b7bc89c7af50af82c88e356a80" + integrity sha512-HkbSvtugpSXBf2660v9FrNVUgxvPkssN8CRGj9gPM8PLhnaa6zziFiCEKQAkQS4uRzseww45o0TR+l6KeRYV9A== dependencies: - "@jest/core" "^26.4.2" - "@jest/test-result" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/core" "^26.5.3" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" is-ci "^2.0.0" - jest-config "^26.4.2" - jest-util "^26.3.0" - jest-validate "^26.4.2" + jest-config "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" prompts "^2.0.1" - yargs "^15.3.1" + yargs "^15.4.1" -jest-config@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-26.4.2.tgz#da0cbb7dc2c131ffe831f0f7f2a36256e6086558" - integrity sha512-QBf7YGLuToiM8PmTnJEdRxyYy3mHWLh24LJZKVdXZ2PNdizSe1B/E8bVm+HYcjbEzGuVXDv/di+EzdO/6Gq80A== +jest-config@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-26.5.3.tgz#baf51c9be078c2c755c8f8a51ec0f06c762c1d3f" + integrity sha512-NVhZiIuN0GQM6b6as4CI5FSCyXKxdrx5ACMCcv/7Pf+TeCajJhJc+6dwgdAVPyerUFB9pRBIz3bE7clSrRge/w== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^26.4.2" - "@jest/types" "^26.3.0" - babel-jest "^26.3.0" + "@jest/test-sequencer" "^26.5.3" + "@jest/types" "^26.5.2" + babel-jest "^26.5.2" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" - jest-environment-jsdom "^26.3.0" - jest-environment-node "^26.3.0" + jest-environment-jsdom "^26.5.2" + jest-environment-node "^26.5.2" jest-get-type "^26.3.0" - jest-jasmine2 "^26.4.2" + jest-jasmine2 "^26.5.3" jest-regex-util "^26.0.0" - jest-resolve "^26.4.0" - jest-util "^26.3.0" - jest-validate "^26.4.2" + jest-resolve "^26.5.2" + jest-util "^26.5.2" + jest-validate "^26.5.3" micromatch "^4.0.2" - pretty-format "^26.4.2" + pretty-format "^26.5.2" jest-css-modules@^2.1.0: version "2.1.0" @@ -14095,15 +14113,15 @@ jest-diff@^25.1.0, jest-diff@^25.2.1: jest-get-type "^25.2.6" pretty-format "^25.5.0" -jest-diff@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-26.4.2.tgz#a1b7b303bcc534aabdb3bd4a7caf594ac059f5aa" - integrity sha512-6T1XQY8U28WH0Z5rGpQ+VqZSZz8EN8rZcBtfvXaOkbwxIEeRre6qnuZQlbY1AJ4MKDxQF8EkrCvK+hL/VkyYLQ== +jest-diff@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-26.5.2.tgz#8e26cb32dc598e8b8a1b9deff55316f8313c8053" + integrity sha512-HCSWDUGwsov5oTlGzrRM+UPJI/Dpqi9jzeV0fdRNi3Ch5bnoXhnyJMmVg2juv9081zLIy3HGPI5mcuGgXM2xRA== dependencies: chalk "^4.0.0" - diff-sequences "^26.3.0" + diff-sequences "^26.5.0" jest-get-type "^26.3.0" - pretty-format "^26.4.2" + pretty-format "^26.5.2" jest-docblock@^26.0.0: version "26.0.0" @@ -14112,41 +14130,41 @@ jest-docblock@^26.0.0: dependencies: detect-newline "^3.0.0" -jest-each@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-each/-/jest-each-26.4.2.tgz#bb14f7f4304f2bb2e2b81f783f989449b8b6ffae" - integrity sha512-p15rt8r8cUcRY0Mvo1fpkOGYm7iI8S6ySxgIdfh3oOIv+gHwrHTy5VWCGOecWUhDsit4Nz8avJWdT07WLpbwDA== +jest-each@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-26.5.2.tgz#35e68d6906a7f826d3ca5803cfe91d17a5a34c31" + integrity sha512-w7D9FNe0m2D3yZ0Drj9CLkyF/mGhmBSULMQTypzAKR746xXnjUrK8GUJdlLTWUF6dd0ks3MtvGP7/xNFr9Aphg== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" chalk "^4.0.0" jest-get-type "^26.3.0" - jest-util "^26.3.0" - pretty-format "^26.4.2" + jest-util "^26.5.2" + pretty-format "^26.5.2" -jest-environment-jsdom@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.3.0.tgz#3b749ba0f3a78e92ba2c9ce519e16e5dd515220c" - integrity sha512-zra8He2btIMJkAzvLaiZ9QwEPGEetbxqmjEBQwhH3CA+Hhhu0jSiEJxnJMbX28TGUvPLxBt/zyaTLrOPF4yMJA== +jest-environment-jsdom@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.5.2.tgz#5feab05b828fd3e4b96bee5e0493464ddd2bb4bc" + integrity sha512-fWZPx0bluJaTQ36+PmRpvUtUlUFlGGBNyGX1SN3dLUHHMcQ4WseNEzcGGKOw4U5towXgxI4qDoI3vwR18H0RTw== dependencies: - "@jest/environment" "^26.3.0" - "@jest/fake-timers" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" - jest-mock "^26.3.0" - jest-util "^26.3.0" - jsdom "^16.2.2" + jest-mock "^26.5.2" + jest-util "^26.5.2" + jsdom "^16.4.0" -jest-environment-node@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.3.0.tgz#56c6cfb506d1597f94ee8d717072bda7228df849" - integrity sha512-c9BvYoo+FGcMj5FunbBgtBnbR5qk3uky8PKyRVpSfe2/8+LrNQMiXX53z6q2kY+j15SkjQCOSL/6LHnCPLVHNw== +jest-environment-node@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.5.2.tgz#275a0f01b5e47447056f1541a15ed4da14acca03" + integrity sha512-YHjnDsf/GKFCYMGF1V+6HF7jhY1fcLfLNBDjhAOvFGvt6d8vXvNdJGVM7uTZ2VO/TuIyEFhPGaXMX5j3h7fsrA== dependencies: - "@jest/environment" "^26.3.0" - "@jest/fake-timers" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" - jest-mock "^26.3.0" - jest-util "^26.3.0" + jest-mock "^26.5.2" + jest-util "^26.5.2" jest-esm-transformer@^1.0.0: version "1.0.0" @@ -14174,58 +14192,58 @@ jest-get-type@^26.3.0: resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz#e97dc3c3f53c2b406ca7afaed4493b1d099199e0" integrity sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig== -jest-haste-map@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.3.0.tgz#c51a3b40100d53ab777bfdad382d2e7a00e5c726" - integrity sha512-DHWBpTJgJhLLGwE5Z1ZaqLTYqeODQIZpby0zMBsCU9iRFHYyhklYqP4EiG73j5dkbaAdSZhgB938mL51Q5LeZA== +jest-haste-map@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.5.2.tgz#a15008abfc502c18aa56e4919ed8c96304ceb23d" + integrity sha512-lJIAVJN3gtO3k4xy+7i2Xjtwh8CfPcH08WYjZpe9xzveDaqGw9fVNCpkYu6M525wKFVkLmyi7ku+DxCAP1lyMA== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.4" jest-regex-util "^26.0.0" - jest-serializer "^26.3.0" - jest-util "^26.3.0" - jest-worker "^26.3.0" + jest-serializer "^26.5.0" + jest-util "^26.5.2" + jest-worker "^26.5.0" micromatch "^4.0.2" sane "^4.0.3" walker "^1.0.7" optionalDependencies: fsevents "^2.1.2" -jest-jasmine2@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.4.2.tgz#18a9d5bec30904267ac5e9797570932aec1e2257" - integrity sha512-z7H4EpCldHN1J8fNgsja58QftxBSL+JcwZmaXIvV9WKIM+x49F4GLHu/+BQh2kzRKHAgaN/E82od+8rTOBPyPA== +jest-jasmine2@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.5.3.tgz#baad2114ce32d16aff25aeb877d18bb4e332dc4c" + integrity sha512-nFlZOpnGlNc7y/+UkkeHnvbOM+rLz4wB1AimgI9QhtnqSZte0wYjbAm8hf7TCwXlXgDwZxAXo6z0a2Wzn9FoOg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^26.3.0" - "@jest/source-map" "^26.3.0" - "@jest/test-result" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/environment" "^26.5.2" + "@jest/source-map" "^26.5.0" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^26.4.2" + expect "^26.5.3" is-generator-fn "^2.0.0" - jest-each "^26.4.2" - jest-matcher-utils "^26.4.2" - jest-message-util "^26.3.0" - jest-runtime "^26.4.2" - jest-snapshot "^26.4.2" - jest-util "^26.3.0" - pretty-format "^26.4.2" + jest-each "^26.5.2" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" + jest-runtime "^26.5.3" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + pretty-format "^26.5.2" throat "^5.0.0" -jest-leak-detector@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.4.2.tgz#c73e2fa8757bf905f6f66fb9e0070b70fa0f573f" - integrity sha512-akzGcxwxtE+9ZJZRW+M2o+nTNnmQZxrHJxX/HjgDaU5+PLmY1qnQPnMjgADPGCRPhB+Yawe1iij0REe+k/aHoA== +jest-leak-detector@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.5.2.tgz#83fcf9a4a6ef157549552cb4f32ca1d6221eea69" + integrity sha512-h7ia3dLzBFItmYERaLPEtEKxy3YlcbcRSjj0XRNJgBEyODuu+3DM2o62kvIFvs3PsaYoIIv+e+nLRI61Dj1CNw== dependencies: jest-get-type "^26.3.0" - pretty-format "^26.4.2" + pretty-format "^26.5.2" jest-matcher-utils@^25.1.0: version "25.1.0" @@ -14237,36 +14255,36 @@ jest-matcher-utils@^25.1.0: jest-get-type "^25.1.0" pretty-format "^25.1.0" -jest-matcher-utils@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.4.2.tgz#fa81f3693f7cb67e5fc1537317525ef3b85f4b06" - integrity sha512-KcbNqWfWUG24R7tu9WcAOKKdiXiXCbMvQYT6iodZ9k1f7065k0keUOW6XpJMMvah+hTfqkhJhRXmA3r3zMAg0Q== +jest-matcher-utils@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" + integrity sha512-W9GO9KBIC4gIArsNqDUKsLnhivaqf8MSs6ujO/JDcPIQrmY+aasewweXVET8KdrJ6ADQaUne5UzysvF/RR7JYA== dependencies: chalk "^4.0.0" - jest-diff "^26.4.2" + jest-diff "^26.5.2" jest-get-type "^26.3.0" - pretty-format "^26.4.2" + pretty-format "^26.5.2" -jest-message-util@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.3.0.tgz#3bdb538af27bb417f2d4d16557606fd082d5841a" - integrity sha512-xIavRYqr4/otGOiLxLZGj3ieMmjcNE73Ui+LdSW/Y790j5acqCsAdDiLIbzHCZMpN07JOENRWX5DcU+OQ+TjTA== +jest-message-util@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.5.2.tgz#6c4c4c46dcfbabb47cd1ba2f6351559729bc11bb" + integrity sha512-Ocp9UYZ5Jl15C5PNsoDiGEk14A4NG0zZKknpWdZGoMzJuGAkVt10e97tnEVMYpk7LnQHZOfuK2j/izLBMcuCZw== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/types" "^26.3.0" - "@types/stack-utils" "^1.0.1" + "@jest/types" "^26.5.2" + "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.2" slash "^3.0.0" stack-utils "^2.0.2" -jest-mock@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-26.3.0.tgz#ee62207c3c5ebe5f35b760e1267fee19a1cfdeba" - integrity sha512-PeaRrg8Dc6mnS35gOo/CbZovoDPKAeB1FICZiuagAgGvbWdNNyjQjkOaGUa/3N3JtpQ/Mh9P4A2D4Fv51NnP8Q== +jest-mock@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-26.5.2.tgz#c9302e8ef807f2bfc749ee52e65ad11166a1b6a1" + integrity sha512-9SiU4b5PtO51v0MtJwVRqeGEroH66Bnwtq4ARdNP7jNXbpT7+ByeWNAk4NeT/uHfNSVDXEXgQo1XRuwEqS6Rdw== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -14279,154 +14297,155 @@ jest-regex-util@^26.0.0: resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz#d25e7184b36e39fd466c3bc41be0971e821fee28" integrity sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A== -jest-resolve-dependencies@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.4.2.tgz#739bdb027c14befb2fe5aabbd03f7bab355f1dc5" - integrity sha512-ADHaOwqEcVc71uTfySzSowA/RdxUpCxhxa2FNLiin9vWLB1uLPad3we+JSSROq5+SrL9iYPdZZF8bdKM7XABTQ== +jest-resolve-dependencies@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.5.3.tgz#11483f91e534bdcd257ab21e8622799e59701aba" + integrity sha512-+KMDeke/BFK+mIQ2IYSyBz010h7zQaVt4Xie6cLqUGChorx66vVeQVv4ErNoMwInnyYHi1Ud73tDS01UbXbfLQ== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" jest-regex-util "^26.0.0" - jest-snapshot "^26.4.2" + jest-snapshot "^26.5.3" -jest-resolve@^26.4.0: - version "26.4.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.4.0.tgz#6dc0af7fb93e65b73fec0368ca2b76f3eb59a6d7" - integrity sha512-bn/JoZTEXRSlEx3+SfgZcJAVuTMOksYq9xe9O6s4Ekg84aKBObEaVXKOEilULRqviSLAYJldnoWV9c07kwtiCg== +jest-resolve@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.5.2.tgz#0d719144f61944a428657b755a0e5c6af4fc8602" + integrity sha512-XsPxojXGRA0CoDD7Vis59ucz2p3cQFU5C+19tz3tLEAlhYKkK77IL0cjYjikY9wXnOaBeEdm1rOgSJjbZWpcZg== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" chalk "^4.0.0" graceful-fs "^4.2.4" jest-pnp-resolver "^1.2.2" - jest-util "^26.3.0" + jest-util "^26.5.2" read-pkg-up "^7.0.1" resolve "^1.17.0" slash "^3.0.0" -jest-runner@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-26.4.2.tgz#c3ec5482c8edd31973bd3935df5a449a45b5b853" - integrity sha512-FgjDHeVknDjw1gRAYaoUoShe1K3XUuFMkIaXbdhEys+1O4bEJS8Avmn4lBwoMfL8O5oFTdWYKcf3tEJyyYyk8g== +jest-runner@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-26.5.3.tgz#800787459ea59c68e7505952933e33981dc3db38" + integrity sha512-qproP0Pq7IIule+263W57k2+8kWCszVJTC9TJWGUz0xJBr+gNiniGXlG8rotd0XxwonD5UiJloYoSO5vbUr5FQ== dependencies: - "@jest/console" "^26.3.0" - "@jest/environment" "^26.3.0" - "@jest/test-result" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/console" "^26.5.2" + "@jest/environment" "^26.5.2" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.7.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-config "^26.4.2" + jest-config "^26.5.3" jest-docblock "^26.0.0" - jest-haste-map "^26.3.0" - jest-leak-detector "^26.4.2" - jest-message-util "^26.3.0" - jest-resolve "^26.4.0" - jest-runtime "^26.4.2" - jest-util "^26.3.0" - jest-worker "^26.3.0" + jest-haste-map "^26.5.2" + jest-leak-detector "^26.5.2" + jest-message-util "^26.5.2" + jest-resolve "^26.5.2" + jest-runtime "^26.5.3" + jest-util "^26.5.2" + jest-worker "^26.5.0" source-map-support "^0.5.6" throat "^5.0.0" -jest-runtime@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.4.2.tgz#94ce17890353c92e4206580c73a8f0c024c33c42" - integrity sha512-4Pe7Uk5a80FnbHwSOk7ojNCJvz3Ks2CNQWT5Z7MJo4tX0jb3V/LThKvD9tKPNVNyeMH98J/nzGlcwc00R2dSHQ== +jest-runtime@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.5.3.tgz#5882ae91fd88304310f069549e6bf82f3f198bea" + integrity sha512-IDjalmn2s/Tc4GvUwhPHZ0iaXCdMRq5p6taW9P8RpU+FpG01O3+H8z+p3rDCQ9mbyyyviDgxy/LHPLzrIOKBkQ== dependencies: - "@jest/console" "^26.3.0" - "@jest/environment" "^26.3.0" - "@jest/fake-timers" "^26.3.0" - "@jest/globals" "^26.4.2" - "@jest/source-map" "^26.3.0" - "@jest/test-result" "^26.3.0" - "@jest/transform" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/console" "^26.5.2" + "@jest/environment" "^26.5.2" + "@jest/fake-timers" "^26.5.2" + "@jest/globals" "^26.5.3" + "@jest/source-map" "^26.5.0" + "@jest/test-result" "^26.5.2" + "@jest/transform" "^26.5.2" + "@jest/types" "^26.5.2" "@types/yargs" "^15.0.0" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-config "^26.4.2" - jest-haste-map "^26.3.0" - jest-message-util "^26.3.0" - jest-mock "^26.3.0" + jest-config "^26.5.3" + jest-haste-map "^26.5.2" + jest-message-util "^26.5.2" + jest-mock "^26.5.2" jest-regex-util "^26.0.0" - jest-resolve "^26.4.0" - jest-snapshot "^26.4.2" - jest-util "^26.3.0" - jest-validate "^26.4.2" + jest-resolve "^26.5.2" + jest-snapshot "^26.5.3" + jest-util "^26.5.2" + jest-validate "^26.5.3" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^15.3.1" + yargs "^15.4.1" -jest-serializer@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.3.0.tgz#1c9d5e1b74d6e5f7e7f9627080fa205d976c33ef" - integrity sha512-IDRBQBLPlKa4flg77fqg0n/pH87tcRKwe8zxOVTWISxGpPHYkRZ1dXKyh04JOja7gppc60+soKVZ791mruVdow== +jest-serializer@^26.5.0: + version "26.5.0" + resolved "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.5.0.tgz#f5425cc4c5f6b4b355f854b5f0f23ec6b962bc13" + integrity sha512-+h3Gf5CDRlSLdgTv7y0vPIAoLgX/SI7T4v6hy+TEXMgYbv+ztzbg5PSN6mUXAT/hXYHvZRWm+MaObVfqkhCGxA== dependencies: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.4.2.tgz#87d3ac2f2bd87ea8003602fbebd8fcb9e94104f6" - integrity sha512-N6Uub8FccKlf5SBFnL2Ri/xofbaA68Cc3MGjP/NuwgnsvWh+9hLIR/DhrxbSiKXMY9vUW5dI6EW1eHaDHqe9sg== +jest-snapshot@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.5.3.tgz#f6b4b4b845f85d4b0dadd7cf119c55d0c1688601" + integrity sha512-ZgAk0Wm0JJ75WS4lGaeRfa0zIgpL0KD595+XmtwlIEMe8j4FaYHyZhP1LNOO+8fXq7HJ3hll54+sFV9X4+CGVw== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" + "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.0.0" chalk "^4.0.0" - expect "^26.4.2" + expect "^26.5.3" graceful-fs "^4.2.4" - jest-diff "^26.4.2" + jest-diff "^26.5.2" jest-get-type "^26.3.0" - jest-haste-map "^26.3.0" - jest-matcher-utils "^26.4.2" - jest-message-util "^26.3.0" - jest-resolve "^26.4.0" + jest-haste-map "^26.5.2" + jest-matcher-utils "^26.5.2" + jest-message-util "^26.5.2" + jest-resolve "^26.5.2" natural-compare "^1.4.0" - pretty-format "^26.4.2" + pretty-format "^26.5.2" semver "^7.3.2" -jest-util@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-26.3.0.tgz#a8974b191df30e2bf523ebbfdbaeb8efca535b3e" - integrity sha512-4zpn6bwV0+AMFN0IYhH/wnzIQzRaYVrz1A8sYnRnj4UXDXbOVtWmlaZkO9mipFqZ13okIfN87aDoJWB7VH6hcw== +jest-util@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-26.5.2.tgz#8403f75677902cc52a1b2140f568e91f8ed4f4d7" + integrity sha512-WTL675bK+GSSAYgS8z9FWdCT2nccO1yTIplNLPlP0OD8tUk/H5IrWKMMRudIQQ0qp8bb4k+1Qa8CxGKq9qnYdg== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" is-ci "^2.0.0" micromatch "^4.0.2" -jest-validate@^26.4.2: - version "26.4.2" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-26.4.2.tgz#e871b0dfe97747133014dcf6445ee8018398f39c" - integrity sha512-blft+xDX7XXghfhY0mrsBCYhX365n8K5wNDC4XAcNKqqjEzsRUSXP44m6PL0QJEW2crxQFLLztVnJ4j7oPlQrQ== +jest-validate@^26.5.3: + version "26.5.3" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-26.5.3.tgz#eefd5a5c87059550548c5ad8d6589746c66929e3" + integrity sha512-LX07qKeAtY+lsU0o3IvfDdN5KH9OulEGOMN1sFo6PnEf5/qjS1LZIwNk9blcBeW94pQUI9dLN9FlDYDWI5tyaA== dependencies: - "@jest/types" "^26.3.0" + "@jest/types" "^26.5.2" camelcase "^6.0.0" chalk "^4.0.0" jest-get-type "^26.3.0" leven "^3.1.0" - pretty-format "^26.4.2" + pretty-format "^26.5.2" -jest-watcher@^26.3.0: - version "26.3.0" - resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.3.0.tgz#f8ef3068ddb8af160ef868400318dc4a898eed08" - integrity sha512-XnLdKmyCGJ3VoF6G/p5ohbJ04q/vv5aH9ENI+i6BL0uu9WWB6Z7Z2lhQQk0d2AVZcRGp1yW+/TsoToMhBFPRdQ== +jest-watcher@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.5.2.tgz#2957f4461007e0769d74b537379ecf6b7c696916" + integrity sha512-i3m1NtWzF+FXfJ3ljLBB/WQEp4uaNhX7QcQUWMokcifFTUQBDFyUMEwk0JkJ1kopHbx7Een3KX0Q7+9koGM/Pw== dependencies: - "@jest/test-result" "^26.3.0" - "@jest/types" "^26.3.0" + "@jest/test-result" "^26.5.2" + "@jest/types" "^26.5.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^26.3.0" + jest-util "^26.5.2" string-length "^4.0.1" -jest-worker@^26.2.1, jest-worker@^26.3.0: +jest-worker@^26.2.1: version "26.3.0" resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" integrity sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw== @@ -14435,14 +14454,23 @@ jest-worker@^26.2.1, jest-worker@^26.3.0: merge-stream "^2.0.0" supports-color "^7.0.0" -jest@^26.0.1: - version "26.4.2" - resolved "https://registry.npmjs.org/jest/-/jest-26.4.2.tgz#7e8bfb348ec33f5459adeaffc1a25d5752d9d312" - integrity sha512-LLCjPrUh98Ik8CzW8LLVnSCfLaiY+wbK53U7VxnFSX7Q+kWC4noVeDvGWIFw0Amfq1lq2VfGm7YHWSLBV62MJw== +jest-worker@^26.5.0: + version "26.5.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-26.5.0.tgz#87deee86dbbc5f98d9919e0dadf2c40e3152fa30" + integrity sha512-kTw66Dn4ZX7WpjZ7T/SUDgRhapFRKWmisVAF0Rv4Fu8SLFD7eLbqpLvbxVqYhSgaWa7I+bW7pHnbyfNsH6stug== dependencies: - "@jest/core" "^26.4.2" + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + +jest@^26.0.1: + version "26.5.3" + resolved "https://registry.npmjs.org/jest/-/jest-26.5.3.tgz#5e7a322d16f558dc565ca97639e85993ef5affe6" + integrity sha512-uJi3FuVSLmkZrWvaDyaVTZGLL8WcfynbRnFXyAHuEtYiSZ+ijDDIMOw1ytmftK+y/+OdAtsG9QrtbF7WIBmOyA== + dependencies: + "@jest/core" "^26.5.3" import-local "^3.0.2" - jest-cli "^26.4.2" + jest-cli "^26.5.3" jose@^1.27.1: version "1.27.1" @@ -14528,10 +14556,10 @@ jsdom@11.12.0: ws "^5.2.0" xml-name-validator "^3.0.0" -jsdom@^16.2.2: - version "16.2.2" - resolved "https://registry.npmjs.org/jsdom/-/jsdom-16.2.2.tgz#76f2f7541646beb46a938f5dc476b88705bedf2b" - integrity sha512-pDFQbcYtKBHxRaP55zGXCJWgFHkDAYbKcsXEK/3Icu9nKYZkutUXfLBwbD+09XDutkYSHcgfQLZ0qvpAAm9mvg== +jsdom@^16.4.0: + version "16.4.0" + resolved "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz#36005bde2d136f73eee1a830c6d45e55408edddb" + integrity sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w== dependencies: abab "^2.0.3" acorn "^7.1.1" @@ -14553,7 +14581,7 @@ jsdom@^16.2.2: tough-cookie "^3.0.1" w3c-hr-time "^1.0.2" w3c-xmlserializer "^2.0.0" - webidl-conversions "^6.0.0" + webidl-conversions "^6.1.0" whatwg-encoding "^1.0.5" whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" @@ -18531,6 +18559,16 @@ pretty-format@^26.4.2: ansi-styles "^4.0.0" react-is "^16.12.0" +pretty-format@^26.5.2: + version "26.5.2" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-26.5.2.tgz#5d896acfdaa09210683d34b6dc0e6e21423cd3e1" + integrity sha512-VizyV669eqESlkOikKJI8Ryxl/kPpbdLwNdPs2GrbQs18MpySB5S0Yo0N7zkg2xTRiFq4CFw8ct5Vg4a0xP0og== + dependencies: + "@jest/types" "^26.5.2" + ansi-regex "^5.0.0" + ansi-styles "^4.0.0" + react-is "^16.12.0" + pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" @@ -23077,10 +23115,10 @@ v8-compile-cache@^2.0.3: resolved "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== -v8-to-istanbul@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-5.0.1.tgz#0608f5b49a481458625edb058488607f25498ba5" - integrity sha512-mbDNjuDajqYe3TXFk5qxcQy8L1msXNE37WTlLoqqpBfRsimbNcrlhQlDPntmECEcUvdC+AQ8CyMMf6EUx1r74Q== +v8-to-istanbul@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-6.0.1.tgz#7ef0e32faa10f841fe4c1b0f8de96ed067c0be1e" + integrity sha512-PzM1WlqquhBvsV+Gco6WSFeg1AGdD53ccMRkFeyHRE/KRZaVacPOmQYP3EeVgDBtKD2BJ8kgynBQ5OtKiHCH+w== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -23302,7 +23340,7 @@ webidl-conversions@^5.0.0: resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff" integrity sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA== -webidl-conversions@^6.0.0: +webidl-conversions@^6.1.0: version "6.1.0" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== From f858177780316e82b27a2e8c5db5435c2e21a94e Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:25 +0200 Subject: [PATCH 05/55] feat: add basic Helm charts for deploying backstage --- contrib/chart/backstage/Chart.lock | 6 + contrib/chart/backstage/Chart.yaml | 30 ++ contrib/chart/backstage/README.md | 1 + .../backstage/files/create-backend-dbs.sql | 11 + .../chart/backstage/templates/_helpers.tpl | 279 ++++++++++++++++++ .../templates/backend-deployment.yaml | 71 +++++ .../backstage/templates/backend-secret.yaml | 20 ++ .../templates/backstage-app-config.yaml | 27 ++ .../templates/backstage-auth-config.yaml | 19 ++ .../templates/frontend-deployment.yaml | 51 ++++ .../chart/backstage/templates/ingress.yaml | 37 +++ .../templates/lighthouse-config.yaml | 10 + .../templates/lighthouse-deployment.yaml | 72 +++++ .../templates/postgresql-ca-config.yaml | 21 ++ .../templates/postgresql-certs-secret.yaml | 16 + .../templates/postgresql-initdb-secret.yaml | 14 + .../templates/postgresql-password-secret.yaml | 30 ++ .../templates/tests/test-app-connection.yaml | 23 ++ .../templates/tests/test-postgresql.yaml | 33 +++ contrib/chart/backstage/values.yaml | 240 +++++++++++++++ 20 files changed, 1011 insertions(+) create mode 100644 contrib/chart/backstage/Chart.lock create mode 100644 contrib/chart/backstage/Chart.yaml create mode 100644 contrib/chart/backstage/README.md create mode 100644 contrib/chart/backstage/files/create-backend-dbs.sql create mode 100644 contrib/chart/backstage/templates/_helpers.tpl create mode 100644 contrib/chart/backstage/templates/backend-deployment.yaml create mode 100644 contrib/chart/backstage/templates/backend-secret.yaml create mode 100644 contrib/chart/backstage/templates/backstage-app-config.yaml create mode 100644 contrib/chart/backstage/templates/backstage-auth-config.yaml create mode 100644 contrib/chart/backstage/templates/frontend-deployment.yaml create mode 100644 contrib/chart/backstage/templates/ingress.yaml create mode 100644 contrib/chart/backstage/templates/lighthouse-config.yaml create mode 100644 contrib/chart/backstage/templates/lighthouse-deployment.yaml create mode 100644 contrib/chart/backstage/templates/postgresql-ca-config.yaml create mode 100644 contrib/chart/backstage/templates/postgresql-certs-secret.yaml create mode 100644 contrib/chart/backstage/templates/postgresql-initdb-secret.yaml create mode 100644 contrib/chart/backstage/templates/postgresql-password-secret.yaml create mode 100644 contrib/chart/backstage/templates/tests/test-app-connection.yaml create mode 100644 contrib/chart/backstage/templates/tests/test-postgresql.yaml create mode 100644 contrib/chart/backstage/values.yaml diff --git a/contrib/chart/backstage/Chart.lock b/contrib/chart/backstage/Chart.lock new file mode 100644 index 0000000000..e390bf21ba --- /dev/null +++ b/contrib/chart/backstage/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 9.4.1 +digest: sha256:f949ec0fe7d146610ce2ee78fbfb4e52d235883a797968b0a1e61aa88ada2786 +generated: "2020-09-25T08:59:54.255582519+02:00" diff --git a/contrib/chart/backstage/Chart.yaml b/contrib/chart/backstage/Chart.yaml new file mode 100644 index 0000000000..92b5e3e309 --- /dev/null +++ b/contrib/chart/backstage/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +name: backstage +description: A Helm chart for Spotify Backstage +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: v0.1.1-alpha.23 + +sources: + - https://github.com/spotify/backstage + - https://github.com/spotify/lighthouse-audit-service + +dependencies: + - name: postgresql + condition: postgresql.enabled + version: 9.4.1 + repository: https://charts.bitnami.com/bitnami + +maintainers: + - name: Martina Iglesias Fernandez + email: martina@roadie.io + url: https://roadie.io + - name: David Tuite + email: david@roadie.io + url: https://roadie.io diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md new file mode 100644 index 0000000000..bb2ff84411 --- /dev/null +++ b/contrib/chart/backstage/README.md @@ -0,0 +1 @@ +# TO DO diff --git a/contrib/chart/backstage/files/create-backend-dbs.sql b/contrib/chart/backstage/files/create-backend-dbs.sql new file mode 100644 index 0000000000..e8124dbd22 --- /dev/null +++ b/contrib/chart/backstage/files/create-backend-dbs.sql @@ -0,0 +1,11 @@ +{{ $backendDb := .Values.appConfig.backend.database.connection.database }} +{{ $lighthouseDb := .Values.lighthouse.database.connection.database }} +{{ $user := .Values.global.postgresql.postgresqlUsername }} + +create database {{ $backendDb }}; +grant all privileges on database {{ $backendDb }} to {{ $user }}; + +{{ if not (eq $backendDb $lighthouseDb) }} +create database {{ $lighthouseDb }}; +grant all privileges on database {{ $lighthouseDb }} to {{ $user }}; +{{ end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/_helpers.tpl b/contrib/chart/backstage/templates/_helpers.tpl new file mode 100644 index 0000000000..9f3b1cfbdc --- /dev/null +++ b/contrib/chart/backstage/templates/_helpers.tpl @@ -0,0 +1,279 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "backstage.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "backstage.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "backstage.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common App labels +*/}} +{{- define "backstage.app.labels" -}} +app.kubernetes.io/name: {{ include "backstage.name" . }}-app +helm.sh/chart: {{ include "backstage.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Common Backend labels +*/}} +{{- define "backstage.backend.labels" -}} +app.kubernetes.io/name: {{ include "backstage.name" . }}-backend +helm.sh/chart: {{ include "backstage.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Name for postgresql dependency +See https://github.com/helm/helm/issues/3920#issuecomment-686913512 +*/}} +{{- define "backstage.postgresql.fullname" -}} +{{ printf "%s-%s" .Release.Name .Values.postgresql.nameOverride }} +{{- end -}} + + +{{/* +Create the name of the service account to use for the app +*/}} +{{- define "backstage.app.serviceAccountName" -}} +{{- if .Values.app.serviceAccount.create -}} + {{ default "default" .Values.app.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.app.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create the name of the service account to use for the backend +*/}} +{{- define "backstage.backend.serviceAccountName" -}} +{{- if .Values.backend.serviceAccount.create -}} + {{ default default .Values.backend.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.backend.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Path to the CA certificate file in the backend +*/}} +{{- define "backstage.backend.postgresCaFilename" -}} +{{ include "backstage.backend.postgresCaDir" . }}/{{- required "The name for the CA certificate file for postgresql is required" .Values.global.postgresql.caFilename }} +{{- end -}} +{{/* + +{{/* +Directory path to the CA certificate file in the backend +*/}} +{{- define "backstage.backend.postgresCaDir" -}} +{{- if .Values.appConfig.backend.database.connection.ssl.ca -}} + {{ .Values.appConfig.backend.database.connection.ssl.ca }} +{{- else -}} +/etc/postgresql +{{- end -}} +{{- end -}} +{{/* + +Path to the CA certificate file in lighthouse +*/}} +{{- define "backstage.lighthouse.postgresCaFilename" -}} +{{ include "backstage.lighthouse.postgresCaDir" . }}/{{- required "The name for the CA certificate file for postgresql is required" .Values.global.postgresql.caFilename }} +{{- end -}} + +{{/* +Directory path to the CA certificate file in lighthouse +*/}} +{{- define "backstage.lighthouse.postgresCaDir" -}} +{{- if .Values.lighthouse.database.pathToDatabaseCa -}} + {{ .Values.lighthouse.database.pathToDatabaseCa }} +{{- else -}} +/etc/postgresql +{{- end -}} +{{- end -}} +{{/* + +{{/* +Generate ca for postgresql +*/}} +{{- define "backstage.postgresql.generateCA" -}} +{{- $ca := .ca | default (genCA (include "backstage.postgresql.fullname" .) 365) -}} +{{- $_ := set . "ca" $ca -}} +{{- $ca.Cert -}} +{{- end -}} + +{{/* +Generate certificates for postgresql +*/}} +{{- define "generateCerts" -}} +{{- $postgresName := (include "backstage.postgresql.fullname" .) }} +{{- $altNames := list $postgresName ( printf "%s.%s" $postgresName .Release.Namespace ) ( printf "%s.%s.svc" ( $postgresName ) .Release.Namespace ) -}} +{{- $ca := .ca | default (genCA (include "backstage.postgresql.fullname" .) 365) -}} +{{- $_ := set . "ca" $ca -}} +{{- $cert := genSignedCert ( $postgresName ) nil $altNames 365 $ca -}} +tls.crt: {{ $cert.Cert | b64enc }} +tls.key: {{ $cert.Key | b64enc }} +{{- end -}} + +{{/* +Generate a password for the postgres user used for the connections from the backend and lighthouse +*/}} +{{- define "postgresql.generateUserPassword" -}} +{{- $pgPassword := .pgPassword | default ( randAlphaNum 12 ) -}} +{{- $_ := set . "pgPassword" $pgPassword -}} +{{ $pgPassword}} +{{- end -}} + +{{/* +Name of the backend service +*/}} +{{- define "backend.serviceName" -}} +{{ include "backstage.fullname" . }}-backend +{{- end -}} + +{{/* +Name of the frontend service +*/}} +{{- define "frontend.serviceName" -}} +{{ include "backstage.fullname" . }}-frontend +{{- end -}} + +{{/* +Name of the lighthouse backend service +*/}} +{{- define "lighthouse.serviceName" -}} +{{ include "backstage.fullname" . }}-lighthouse +{{- end -}} + +{{/* +Name of the postgresql service +*/}} +{{- define "postgresql.serviceName" -}} +{{- include "backstage.postgresql.fullname" . }} +{{- end -}} + +{{/* +Postgres host for lighthouse +*/}} +{{- define "lighthouse.postgresql.host" -}} +{{- if .Values.postgresql.enabled }} +{{- include "postgresql.serviceName" . }} +{{- else -}} +{{- required "A valid .Values.lighthouse.database.connection.host is required when postgresql is not enabled" .Values.lighthouse.database.connection.host -}} +{{- end -}} +{{- end -}} + +{{/* +Postgres host for the backend +*/}} +{{- define "backend.postgresql.host" -}} +{{- if .Values.postgresql.enabled }} +{{- include "postgresql.serviceName" . }} +{{- else -}} +{{- required "A valid .Values.appConfig.backend.database.connection.host is required when postgresql is not enabled" .Values.appConfig.backend.database.connection.host -}} +{{- end -}} +{{- end -}} + +{{/* +Postgres port for the backend +*/}} +{{- define "backend.postgresql.port" -}} +{{- if .Values.postgresql.enabled }} +{{- .Values.postgresql.service.port }} +{{- else if .Values.appConfig.backend.database.connection.port -}} +{{- .Values.appConfig.backend.database.connection.port }} +{{ else }} +5432 +{{- end -}} +{{- end -}} + +{{/* +Postgres port for lighthouse +*/}} +{{- define "lighthouse.postgresql.port" -}} +{{- if .Values.postgresql.enabled }} +{{- .Values.postgresql.service.port }} +{{- else if .Values.lighthouse.database.connection.port -}} +{{- .Values.lighthouse.database.connection.port }} +{{- else -}} +5432 +{{- end -}} +{{- end -}} + +{{/* +Postgres user for backend +*/}} +{{- define "backend.postgresql.user" -}} +{{- if .Values.postgresql.enabled }} +{{- .Values.global.postgresql.postgresqlUsername }} +{{- else -}} +{{- required "A valid .Values.appConfig.backend.database.connection.user is required when postgresql is not enabled" .Values.appConfig.backend.database.connection.user -}} +{{- end -}} +{{- end -}} + +{{/* +Postgres user for lighthouse +*/}} +{{- define "lighthouse.postgresql.user" -}} +{{- if .Values.postgresql.enabled }} +{{- .Values.global.postgresql.postgresqlUsername }} +{{- else -}} +{{- required "A valid .Values.lighthouse.database.connection.user is required when postgresql is not enabled" .Values.lighthouse.database.connection.user -}} +{{- end -}} +{{- end -}} + +{{/* +Postgres password secret for backend +*/}} +{{- define "backend.postgresql.passwordSecret" -}} +{{- if .Values.postgresql.enabled }} +{{- template "backstage.postgresql.fullname" . }} +{{- else -}} +{{ $secretName := (printf "%s-backend-postgres" (include "backstage.fullname" . )) }} +{{- required "A valid .Values.appConfig.backend.database.connection.password is required when postgresql is not enabled" $secretName -}} +{{- end -}} +{{- end -}} + +{{/* +Postgres password for lighthouse +*/}} +{{- define "lighthouse.postgresql.passwordSecret" -}} +{{- if .Values.postgresql.enabled }} +{{- template "backstage.postgresql.fullname" . }} +{{- else -}} +{{ $secretName := (printf "%s-lighthouse-postgres" (include "backstage.fullname" . )) }} +{{- required "A valid .Values.lighthouse.database.connection.password is required when postgresql is not enabled" $secretName -}} +{{- end -}} +{{- end -}} diff --git a/contrib/chart/backstage/templates/backend-deployment.yaml b/contrib/chart/backstage/templates/backend-deployment.yaml new file mode 100644 index 0000000000..67177d7923 --- /dev/null +++ b/contrib/chart/backstage/templates/backend-deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "backstage.fullname" . }}-backend + +spec: + replicas: {{ .Values.backend.replicaCount }} + + selector: + matchLabels: + app: backstage + component: backend + + template: + metadata: + annotations: + ad.datadoghq.com/backstage.logs: '[{"source":"backstage","service":"backend"}]' + labels: + app: backstage + component: backend + + spec: + containers: + - name: {{ .Chart.Name }}-backend + image: {{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }} + imagePullPolicy: {{ .Values.backend.image.pullPolicy }} + ports: + - containerPort: {{ .Values.backend.containerPort }} + resources: + {{- toYaml .Values.backend.resources | nindent 12 }} + + envFrom: + - configMapRef: + name: {{ include "backstage.fullname" . }}-app + - configMapRef: + name: {{ include "backstage.fullname" . }}-auth + - secretRef: + name: {{ include "backstage.fullname" . }}-backend + env: + - name: APP_CONFIG_backend_postgresPassword + valueFrom: + secretKeyRef: + name: {{ include "backend.postgresql.passwordSecret" .}} + key: postgresql-password + volumeMounts: + - name: postgres-ca + mountPath: {{ include "backstage.backend.postgresCaDir" . }} + + volumes: + - name: postgres-ca + configMap: + name: {{ include "backstage.fullname" . }}-postgres-ca + +{{- if .Values.backend.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "backend.serviceName" . }} + +spec: + ports: + - port: 80 + targetPort: {{ .Values.backend.containerPort }} + + selector: + app: backstage + component: backend + + type: ClusterIP +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/backend-secret.yaml b/contrib/chart/backstage/templates/backend-secret.yaml new file mode 100644 index 0000000000..3acb220d81 --- /dev/null +++ b/contrib/chart/backstage/templates/backend-secret.yaml @@ -0,0 +1,20 @@ +{{- if .Values.backend.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "backstage.fullname" . }}-backend +type: Opaque +stringData: + AUTH_GOOGLE_CLIENT_SECRET: {{ .Values.auth.google.clientSecret }} + AUTH_GITHUB_CLIENT_SECRET: {{ .Values.auth.github.clientSecret }} + AUTH_GITLAB_CLIENT_SECRET: {{ .Values.auth.gitlab.clientSecret }} + AUTH_OKTA_CLIENT_SECRET: {{ .Values.auth.okta.clientSecret }} + AUTH_OAUTH2_CLIENT_SECRET: {{ .Values.auth.oauth2.clientSecret }} + AUTH_AUTH0_CLIENT_SECRET: {{ .Values.auth.auth0.clientSecret }} + AUTH_MICROSOFT_CLIENT_SECRET: {{ .Values.auth.microsoft.clientSecret }} + SENTRY_TOKEN: {{ .Values.auth.sentryToken }} + ROLLBAR_ACCOUNT_TOKEN: {{ .Values.auth.rollbarAccountToken }} + CIRCLECI_AUTH_TOKEN: {{ .Values.auth.circleciAuthToken }} + GITHUB_ACCESS_TOKEN: {{ .Values.auth.githubAccessToken }} + GITLAB_ACCESS_TOKEN: {{ .Values.auth.gitlabAccessToken }} +{{- end }} diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml new file mode 100644 index 0000000000..be937cee13 --- /dev/null +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . }}-app +data: + APP_CONFIG_app_baseUrl: {{ .Values.appConfig.app.baseUrl | quote | quote }} + APP_CONFIG_app_title: {{ .Values.appConfig.app.title | quote | quote }} + APP_CONFIG_backend_baseUrl: {{ .Values.appConfig.backend.baseUrl | quote | quote }} + APP_CONFIG_backend_lighthouseHostname: {{ include "lighthouse.serviceName" . | quote | quote }} + APP_CONFIG_backend_listen: {{ .Values.appConfig.backend.listen | quote | quote }} + APP_CONFIG_backend_cors_origin: {{ .Values.appConfig.backend.cors.origin | quote | quote }} + APP_CONFIG_backend_database_client: {{ .Values.appConfig.backend.database.client | quote | quote }} + APP_CONFIG_backend_database_connection_port: {{ include "backend.postgresql.port" . | quote }} + APP_CONFIG_backend_database_connection_host: {{ include "backend.postgresql.host" . | quote | quote }} + APP_CONFIG_backend_database_connection_user: {{ include "backend.postgresql.user" . | quote | quote }} + APP_CONFIG_backend_database_connection_database: {{ .Values.appConfig.backend.database.connection.database | quote | quote }} + APP_CONFIG_backend_database_connection_ssl_rejectUnauthorized: {{ .Values.appConfig.backend.database.connection.ssl.rejectUnauthorized | quote }} + APP_CONFIG_backend_database_connection_ssl_ca: {{ include "backstage.backend.postgresCaFilename" . | quote | quote }} + APP_CONFIG_sentry_organization: {{ .Values.appConfig.sentry.organization | quote | quote }} + APP_CONFIG_techdocs_storageUrl: {{ .Values.appConfig.techdocs.storageUrl | quote | quote }} + APP_CONFIG_techdocs_requestUrl: {{ .Values.appConfig.techdocs.requestUrl | quote | quote }} + APP_CONFIG_auth_providers_github_development_appOrigin: {{ .Values.appConfig.auth.providers.github.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_google_development_appOrigin: {{ .Values.appConfig.auth.providers.google.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_gitlab_development_appOrigin: {{ .Values.appConfig.auth.providers.gitlab.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_okta_development_appOrigin: {{ .Values.appConfig.auth.providers.okta.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_oauth2_development_appOrigin: {{ .Values.appConfig.auth.providers.oauth2.development.appOrigin | quote | quote }} + APP_CONFIG_lighthouse_baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote | quote }} diff --git a/contrib/chart/backstage/templates/backstage-auth-config.yaml b/contrib/chart/backstage/templates/backstage-auth-config.yaml new file mode 100644 index 0000000000..5a2023bf3e --- /dev/null +++ b/contrib/chart/backstage/templates/backstage-auth-config.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . }}-auth +data: + AUTH_GOOGLE_CLIENT_ID: {{ .Values.auth.google.clientId }} + AUTH_GITHUB_CLIENT_ID: {{ .Values.auth.github.clientId }} + AUTH_GITLAB_CLIENT_ID: {{ .Values.auth.gitlab.clientId }} + # This should not be prefixed with AUTH_. This could be a typo in the Backstage app config. + GITLAB_BASE_URL: {{ .Values.auth.gitlab.baseUrl }} + AUTH_OKTA_CLIENT_ID: {{ .Values.auth.okta.clientId }} + AUTH_OKTA_AUDIENCE: {{ .Values.auth.okta.audience }} + AUTH_OAUTH2_CLIENT_ID: {{ .Values.auth.oauth2.clientId }} + AUTH_OAUTH2_AUTH_URL: {{ .Values.auth.oauth2.authUrl }} + AUTH_OAUTH2_TOKEN_URL: {{ .Values.auth.oauth2.tokenUrl }} + AUTH_AUTH0_CLIENT_ID: {{ .Values.auth.auth0.clientId }} + AUTH_AUTH0_DOMAIN: {{ .Values.auth.auth0.domain }} + AUTH_MICROSOFT_CLIENT_ID: {{ .Values.auth.microsoft.clientId }} + AUTH_MICROSOFT_TENANT_ID: {{ .Values.auth.microsoft.tenantId }} diff --git a/contrib/chart/backstage/templates/frontend-deployment.yaml b/contrib/chart/backstage/templates/frontend-deployment.yaml new file mode 100644 index 0000000000..b494738758 --- /dev/null +++ b/contrib/chart/backstage/templates/frontend-deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "backstage.fullname" . }}-frontend + +spec: + replicas: {{ .Values.frontend.replicaCount }} + + selector: + matchLabels: + app: backstage + component: frontend + + template: + metadata: + annotations: + ad.datadoghq.com/backstage.logs: '[{"source":"backstage","service":"frontend"}]' + labels: + app: backstage + component: frontend + + spec: + containers: + - name: {{ .Chart.Name }}-frontend + image: {{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }} + imagePullPolicy: {{ .Values.frontend.image.pullPolicy }} + ports: + - containerPort: {{ .Values.frontend.containerPort }} + resources: + {{- toYaml .Values.backend.resources | nindent 12 }} + envFrom: + - configMapRef: + name: {{ include "backstage.fullname" . }}-app +{{- if .Values.frontend.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "frontend.serviceName" . }} + +spec: + ports: + - port: 80 + targetPort: {{ .Values.frontend.containerPort }} + + selector: + app: backstage + component: frontend + + type: ClusterIP +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml new file mode 100644 index 0000000000..6996bb5d8d --- /dev/null +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: {{ include "backstage.fullname" . }}-ingress-backend + {{- with .Values.ingress.annotations }} + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - http: + paths: + - backend: + serviceName: {{ include "backend.serviceName" . }} + servicePort: 80 + path: /api(/|$)(.*) +--- +# Having rewrite rules in an ingress with a '/' path results in an error when loading the +# site "Unexpected token: <". That's why we need two ingress resources +# See https://stackoverflow.com/questions/59931177/gke-install-nginx-ingress-with-static-ip-and-fanout +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: {{ include "backstage.fullname" . }}-ingress-frontend + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - http: + paths: + - backend: + serviceName: {{ include "frontend.serviceName" . }} + servicePort: 80 + path: / diff --git a/contrib/chart/backstage/templates/lighthouse-config.yaml b/contrib/chart/backstage/templates/lighthouse-config.yaml new file mode 100644 index 0000000000..fdf4bd8b06 --- /dev/null +++ b/contrib/chart/backstage/templates/lighthouse-config.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . -}}-lighthouse +data: + PGDATABASE: {{ .Values.lighthouse.database.connection.database | quote }} + PGUSER: {{ include "lighthouse.postgresql.user" . | quote }} + PGPORT: {{ include "lighthouse.postgresql.port" . | quote }} + PGHOST: {{ include "lighthouse.postgresql.host" . | quote }} + PGPATH_TO_CA: {{ include "backstage.lighthouse.postgresCaFilename" . | quote }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/lighthouse-deployment.yaml b/contrib/chart/backstage/templates/lighthouse-deployment.yaml new file mode 100644 index 0000000000..b727f5d242 --- /dev/null +++ b/contrib/chart/backstage/templates/lighthouse-deployment.yaml @@ -0,0 +1,72 @@ +{{- if .Values.lighthouse.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "backstage.fullname" . }}-lighthouse + +spec: + replicas: {{ .Values.lighthouse.replicaCount }} + + selector: + matchLabels: + app: backstage + component: lighthouse-audit-service + + template: + metadata: + annotations: + ad.datadoghq.com/backstage.logs: '[{"source":"backstage","service":"lighthouse"}]' + labels: + app: backstage + component: lighthouse-audit-service + + spec: + containers: + - name: lighthouse-audit-service + image: {{ .Values.lighthouse.image.repository }}:{{ .Values.lighthouse.image.tag }} + imagePullPolicy: {{ .Values.lighthouse.image.pullPolicy }} + ports: + - containerPort: {{ .Values.lighthouse.containerPort }} + resources: + {{- toYaml .Values.lighthouse.resources | nindent 12 }} + + envFrom: + - configMapRef: + name: backstage-lighthouse + + env: + - name: LAS_PORT + value: {{ .Values.lighthouse.containerPort | quote }} + - name: LAS_CORS + value: "true" + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ include "lighthouse.postgresql.passwordSecret" . }} + key: postgresql-password + + volumeMounts: + - name: postgres-ca + mountPath: {{ include "backstage.lighthouse.postgresCaDir" . }} + + volumes: + - name: postgres-ca + configMap: + name: {{ include "backstage.fullname" . }}-postgres-ca +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lighthouse.serviceName" . }} + +spec: + ports: + - port: 80 + targetPort: {{ .Values.lighthouse.containerPort }} + + selector: + app: backstage + component: lighthouse-audit-service + + type: ClusterIP +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/postgresql-ca-config.yaml b/contrib/chart/backstage/templates/postgresql-ca-config.yaml new file mode 100644 index 0000000000..2631989f4e --- /dev/null +++ b/contrib/chart/backstage/templates/postgresql-ca-config.yaml @@ -0,0 +1,21 @@ +{{- if .Values.postgresql.enabled }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . }}-postgres-ca + labels: + app: {{ include "backstage.postgresql.fullname" . }} + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": "pre-install" + "helm.sh/hook-delete-policy": "before-hook-creation" +data: + {{ .Values.global.postgresql.caFilename }}: | +{{ include "backstage.postgresql.generateCA" . | indent 4}} +{{- else }} +{{- $caConfig := printf "%s-postgres-ca" (include "backstage.fullname" .) }} +{{- if not ( lookup "v1" "ConfigMap" .Release.Namespace $caConfig ) }} +{{- fail (printf "\n\nPlease create the '%s' configmap with the CA certificate for your existing postgresql: kubectl create configmap %s --from-file=ca.crt" $caConfig $caConfig) }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/postgresql-certs-secret.yaml b/contrib/chart/backstage/templates/postgresql-certs-secret.yaml new file mode 100644 index 0000000000..c6845caa7e --- /dev/null +++ b/contrib/chart/backstage/templates/postgresql-certs-secret.yaml @@ -0,0 +1,16 @@ +{{- if .Values.postgresql.enabled }} +--- +apiVersion: v1 +kind: Secret +type: kubernetes.io/tls +metadata: + name: {{ required ".Values.postgresql.tls.certificatesSecret is required" .Values.postgresql.tls.certificatesSecret }} + labels: + app: {{ include "backstage.postgresql.fullname" . }} + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": "pre-install" + "helm.sh/hook-delete-policy": "before-hook-creation" +data: +{{ include "generateCerts" . | indent 2 }} +{{- end }} diff --git a/contrib/chart/backstage/templates/postgresql-initdb-secret.yaml b/contrib/chart/backstage/templates/postgresql-initdb-secret.yaml new file mode 100644 index 0000000000..d1c446f79f --- /dev/null +++ b/contrib/chart/backstage/templates/postgresql-initdb-secret.yaml @@ -0,0 +1,14 @@ +{{- if .Values.postgresql.enabled }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ required ".Values.postgresql.initdbScriptsSecret is required" .Values.postgresql.initdbScriptsSecret }} + annotations: + "helm.sh/hook": "pre-install" + "helm.sh/hook-delete-policy": "before-hook-creation" +type: Opaque +data: + create-backend-dbs.sql: | + {{ tpl (.Files.Get "files/create-backend-dbs.sql") . | b64enc }} +{{- end }} + diff --git a/contrib/chart/backstage/templates/postgresql-password-secret.yaml b/contrib/chart/backstage/templates/postgresql-password-secret.yaml new file mode 100644 index 0000000000..7e72888607 --- /dev/null +++ b/contrib/chart/backstage/templates/postgresql-password-secret.yaml @@ -0,0 +1,30 @@ +{{- if not .Values.postgresql.enabled }} +--- +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ include "backend.postgresql.passwordSecret" . }} + labels: + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": "pre-install" + "helm.sh/hook-delete-policy": "before-hook-creation" +data: + postgresql-password: {{ .Values.appConfig.backend.database.connection.password }} +{{- end }} +{{- if not .Values.postgresql.enabled }} +--- +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ include "lighthouse.postgresql.passwordSecret" . }} + labels: + release: {{ .Release.Name }} + annotations: + "helm.sh/hook": "pre-install" + "helm.sh/hook-delete-policy": "before-hook-creation" +data: + postgresql-password: {{ .Values.lighthouse.database.connection.password }} +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/templates/tests/test-app-connection.yaml b/contrib/chart/backstage/templates/tests/test-app-connection.yaml new file mode 100644 index 0000000000..93f51f3f09 --- /dev/null +++ b/contrib/chart/backstage/templates/tests/test-app-connection.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: v1 +kind: Pod +metadata: + name: {{ include "backstage.fullname" . -}}-test-app-connection + annotations: + "helm.sh/hook": test +spec: + containers: + - name: test-app + image: busybox + command: + - /bin/sh + - -ecx + - | + echo -e "===== Testing the connection with the frontend...\n" + wget -q -O - {{ printf "%s.%s" (include "frontend.serviceName" .) .Release.Namespace | quote }} + echo -e "\n\n===== Testing the connection with the backend...\n" + wget -q -O - {{ printf "http://%s.%s/catalog/entities" (include "backend.serviceName" .) .Release.Namespace | quote }} + echo -e "\n\n===== Testing the connection with the lighthouse plugin...\n" + wget -q -O - {{ printf "%s.%s/v1/audits" (include "lighthouse.serviceName" .) .Release.Namespace | quote }} + echo -e "\n" + restartPolicy: Never \ No newline at end of file diff --git a/contrib/chart/backstage/templates/tests/test-postgresql.yaml b/contrib/chart/backstage/templates/tests/test-postgresql.yaml new file mode 100644 index 0000000000..8eec1db452 --- /dev/null +++ b/contrib/chart/backstage/templates/tests/test-postgresql.yaml @@ -0,0 +1,33 @@ +{{- if .Values.postgresql.enabled}} +--- +apiVersion: v1 +kind: Pod +metadata: + name: {{ include "backstage.name" . -}}-test-postgres + annotations: + "helm.sh/hook": test +spec: + containers: + - name: postgresql-client + image: bitnami/postgresql + env: + - name: PG_HOST + value: {{ include "postgresql.serviceName" . | quote }} + - name: PG_PORT + value: {{ .Values.postgresql.service.port | quote }} + - name: PG_USER + value: {{ .Values.global.postgresql.postgresqlUsername | quote }} + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ include "backend.postgresql.passwordSecret" .}} + key: postgresql-password + - name: PG_DBNAME + value: {{ .Values.appConfig.backend.database.connection.database }} + command: + - /bin/bash + - -ecx + - | + psql --host=$PG_HOST --port=$PG_PORT --username=$PG_USER --dbname=$PG_DBNAME --no-password + restartPolicy: Never +{{- end }} \ No newline at end of file diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml new file mode 100644 index 0000000000..5e22b9ac8a --- /dev/null +++ b/contrib/chart/backstage/values.yaml @@ -0,0 +1,240 @@ +# Default values for backstage. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +frontend: + enabled: true + replicaCount: 1 + image: + repository: roadiehq/backstage-k8s-demo-frontend + tag: latest + pullPolicy: IfNotPresent + containerPort: 80 + resources: + requests: + memory: 128Mi + limits: + memory: 256Mi + +backend: + enabled: true + replicaCount: 1 + image: + repository: roadiehq/backstage-k8s-demo-backend + tag: latest + pullPolicy: IfNotPresent + containerPort: 7000 + resources: + requests: + memory: 512Mi + limits: + memory: 1024Mi + +lighthouse: + enabled: true + replicaCount: 1 + image: + repository: roadiehq/lighthouse-audit-service + tag: latest + pullPolicy: IfNotPresent + containerPort: 3003 + resources: + requests: + memory: 128Mi + limits: + memory: 256Mi + database: + connection: + port: + host: + user: + password: + database: lighthouse_audit_service + pathToDatabaseCa: + +nameOverride: "" +fullnameOverride: "" + +ingress: + annotations: + kubernetes.io/ingress.class: nginx + +global: + postgresql: + postgresqlUsername: backend-user + caFilename: ca.crt + +postgresql: + enabled: true + nameOverride: postgresql + tls: + enabled: true + certificatesSecret: backstage-postgresql-certs + certFilename: tls.crt + certKeyFilename: tls.key + volumePermissions: + enabled: true + initdbScriptsSecret: backstage-postgresql-initdb + +appConfig: + app: + baseUrl: https://demo.example.com + title: Backstage + backend: + baseUrl: /api + listen: 0.0.0.0:7000 + cors: + origin: https://demo.example.com + database: + client: pg + connection: + database: backend + host: + user: + port: + password: + ssl: + rejectUnauthorized: false + ca: + sentry: + organization: spotify + techdocs: + storageUrl: https://backend.example.com/techdocs/static/docs + requestUrl: https://backend.example.com/techdocs/docs + lighthouse: + baseUrl: https://lighthouse.example.com + rollbar: + organization: roadie + + # Auth config has recently moved into the app config file in upstream Backstage. However, + # most of this config simply mandates that items like the client id and client secret should + # be picked up from the environment variables named below. Those environment variables are + # set in this helm controlled environment by the 'auth' configuration below this section. + # Thus, the only key in this config which directly controls an app config is the + # auth.providers.github.development.appOrigin property. + auth: + providers: + google: + development: + appOrigin: "http://localhost:3000/" + secure: false + clientId: + $secret: + env: AUTH_GOOGLE_CLIENT_ID + clientSecret: + $secret: + env: AUTH_GOOGLE_CLIENT_SECRET + github: + development: + appOrigin: "http://localhost:3000/" + secure: false + clientId: + $secret: + env: AUTH_GITHUB_CLIENT_ID + clientSecret: + $secret: + env: AUTH_GITHUB_CLIENT_SECRET + enterpriseInstanceUrl: + $secret: + env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL + gitlab: + development: + appOrigin: "http://localhost:3000/" + secure: false + clientId: + $secret: + env: AUTH_GITLAB_CLIENT_ID + clientSecret: + $secret: + env: AUTH_GITLAB_CLIENT_SECRET + audience: + $secret: + env: GITLAB_BASE_URL + okta: + development: + appOrigin: "http://localhost:3000/" + secure: false + clientId: + $secret: + env: AUTH_OKTA_CLIENT_ID + clientSecret: + $secret: + env: AUTH_OKTA_CLIENT_SECRET + audience: + $secret: + env: AUTH_OKTA_AUDIENCE + oauth2: + development: + appOrigin: "http://localhost:3000/" + secure: false + clientId: + $secret: + env: AUTH_OAUTH2_CLIENT_ID + clientSecret: + $secret: + env: AUTH_OAUTH2_CLIENT_SECRET + authorizationURL: + $secret: + env: AUTH_OAUTH2_AUTH_URL + tokenURL: + $secret: + env: AUTH_OAUTH2_TOKEN_URL + auth0: + development: + clientId: + $secret: + env: AUTH_AUTH0_CLIENT_ID + clientSecret: + $secret: + env: AUTH_AUTH0_CLIENT_SECRET + domain: + $secret: + env: AUTH_AUTH0_DOMAIN + microsoft: + development: + clientId: + $secret: + env: AUTH_MICROSOFT_CLIENT_ID + clientSecret: + $secret: + env: AUTH_MICROSOFT_CLIENT_SECRET + tenantId: + $secret: + env: AUTH_MICROSOFT_TENANT_ID + +auth: + google: + clientId: a + clientSecret: a + github: + clientId: c + clientSecret: c + gitlab: + clientId: b + clientSecret: b + baseUrl: b + okta: + clientId: b + clientSecret: b + audience: b + oauth2: + clientId: b + clientSecret: b + authUrl: b + tokenUrl: b + auth0: + clientId: b + clientSecret: b + domain: b + microsoft: + clientId: f + clientSecret: f + tenantId: f + sentryToken: e + rollbarAccountToken: f + # This is a 'Personal Access Token' + circleciAuthToken: r + # Used by the scaffolder to create GitHub repos. Must have 'repo' scope. + githubAccessToken: g + gitlabAccessToken: g + From 04057888d16f831464fea1f6df7fa25a3cc17b63 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:26 +0200 Subject: [PATCH 06/55] Fix prettier error in values.yaml --- contrib/chart/backstage/values.yaml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 5e22b9ac8a..64cf5e91be 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -52,8 +52,8 @@ lighthouse: database: lighthouse_audit_service pathToDatabaseCa: -nameOverride: "" -fullnameOverride: "" +nameOverride: '' +fullnameOverride: '' ingress: annotations: @@ -116,7 +116,7 @@ appConfig: providers: google: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -126,7 +126,7 @@ appConfig: env: AUTH_GOOGLE_CLIENT_SECRET github: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -134,12 +134,12 @@ appConfig: clientSecret: $secret: env: AUTH_GITHUB_CLIENT_SECRET - enterpriseInstanceUrl: + enterpriseInstanceUrl: $secret: env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL gitlab: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -152,7 +152,7 @@ appConfig: env: GITLAB_BASE_URL okta: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -165,7 +165,7 @@ appConfig: env: AUTH_OKTA_AUDIENCE oauth2: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -237,4 +237,3 @@ auth: # Used by the scaffolder to create GitHub repos. Must have 'repo' scope. githubAccessToken: g gitlabAccessToken: g - From 14fa4bc899b924a71be6d8da2f17df99007f4ef6 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:27 +0200 Subject: [PATCH 07/55] Add app-config.local.yaml and demo data --- .../backstage/files/app-config.local.yaml.tpl | 72 +++++++++++++++++++ .../chart/backstage/templates/_helpers.tpl | 7 ++ .../templates/backend-deployment.yaml | 14 ++-- .../templates/backstage-app-config.yaml | 26 +++---- .../templates/backstage-auth-config.yaml | 19 ----- .../templates/frontend-deployment.yaml | 14 +++- .../templates/lighthouse-deployment.yaml | 4 +- 7 files changed, 111 insertions(+), 45 deletions(-) create mode 100644 contrib/chart/backstage/files/app-config.local.yaml.tpl delete mode 100644 contrib/chart/backstage/templates/backstage-auth-config.yaml diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.local.yaml.tpl new file mode 100644 index 0000000000..7fdfeb79a8 --- /dev/null +++ b/contrib/chart/backstage/files/app-config.local.yaml.tpl @@ -0,0 +1,72 @@ +backend: + lighthouseHostname: {{ include "lighthouse.serviceName" . | quote }} + listen: {{ .Values.appConfig.backend.listen | quote }} + cors: + origin: {{ .Values.appConfig.backend.cors.origin | quote }} + database: + client: {{ .Values.appConfig.backend.database.client | quote }} + connection: + host: {{ include "backend.postgresql.host" . | quote }} + port: {{ include "backend.postgresql.port" . | quote }} + user: {{ include "backend.postgresql.user" . | quote }} + database: {{ .Values.appConfig.backend.database.connection.database | quote }} + ssl: + rejectUnauthorized: {{ .Values.appConfig.backend.database.connection.ssl.rejectUnauthorized | quote }} + ca: {{ include "backstage.backend.postgresCaFilename" . | quote }} + +catalog: + locations: + # Backstage example components + - type: github + target: https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/all-components.yaml + # Example component for github-actions + - type: github + target: https://github.com/spotify/backstage/blob/master/plugins/github-actions/examples/sample.yaml + # Example component for techdocs + - type: github + target: https://github.com/spotify/backstage/blob/master/plugins/techdocs-backend/examples/documented-component/documented-component.yaml + # Backstage example APIs + - type: github + target: https://github.com/spotify/backstage/blob/master/packages/catalog-model/examples/all-apis.yaml + # Backstage example templates + - type: github + target: https://github.com/spotify/backstage/blob/master/plugins/scaffolder-backend/sample-templates/all-templates.yaml + +sentry: + organization: {{ .Values.appConfig.sentry.organization | quote }} + +auth: + providers: + github: + development: + clientId: {{ .Values.auth.github.clientId }} + appOrigin: {{ .Values.appConfig.auth.providers.github.development.appOrigin | quote }} + google: + development: + clientId: {{ .Values.auth.google.clientId }} + appOrigin: {{ .Values.appConfig.auth.providers.google.development.appOrigin | quote }} + gitlab: + development: + clientId: {{ .Values.auth.gitlab.clientId }} + appOrigin: {{ .Values.appConfig.auth.providers.gitlab.development.appOrigin | quote }} + audience: {{ .Values.auth.gitlab.baseUrl }} + okta: + development: + clientId: {{ .Values.auth.okta.clientId }} + audience: {{ .Values.auth.okta.audience }} + appOrigin: {{ .Values.appConfig.auth.providers.okta.development.appOrigin | quote }} + oauth2: + development: + clientId: {{ .Values.auth.oauth2.clientId }} + tokenUrl: {{ .Values.auth.oauth2.tokenUrl }} + appOrigin: {{ .Values.appConfig.auth.providers.oauth2.development.appOrigin | quote }} + auth0: + development: + clientId: {{ .Values.auth.auth0.clientId }} + microsoft: + development: + clientId: {{ .Values.auth.microsoft.clientId }} + tenantId: {{ .Values.auth.microsoft.tenantId }} + +lighthouse: + baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote }} diff --git a/contrib/chart/backstage/templates/_helpers.tpl b/contrib/chart/backstage/templates/_helpers.tpl index 9f3b1cfbdc..ec54c91d1b 100644 --- a/contrib/chart/backstage/templates/_helpers.tpl +++ b/contrib/chart/backstage/templates/_helpers.tpl @@ -277,3 +277,10 @@ Postgres password for lighthouse {{- required "A valid .Values.lighthouse.database.connection.password is required when postgresql is not enabled" $secretName -}} {{- end -}} {{- end -}} + +{{/* +app-config file name +*/}} +{{- define "backstage.appConfigFilename" -}} +{{- "app-config.local.yaml" -}} +{{- end -}} diff --git a/contrib/chart/backstage/templates/backend-deployment.yaml b/contrib/chart/backstage/templates/backend-deployment.yaml index 67177d7923..9c6e8da67c 100644 --- a/contrib/chart/backstage/templates/backend-deployment.yaml +++ b/contrib/chart/backstage/templates/backend-deployment.yaml @@ -30,12 +30,10 @@ spec: {{- toYaml .Values.backend.resources | nindent 12 }} envFrom: - - configMapRef: - name: {{ include "backstage.fullname" . }}-app - - configMapRef: - name: {{ include "backstage.fullname" . }}-auth - secretRef: name: {{ include "backstage.fullname" . }}-backend + - configMapRef: + name: {{ include "backstage.fullname" . }}-app-env env: - name: APP_CONFIG_backend_postgresPassword valueFrom: @@ -45,11 +43,17 @@ spec: volumeMounts: - name: postgres-ca mountPath: {{ include "backstage.backend.postgresCaDir" . }} + - name: app-config + mountPath: {{ printf "/usr/src/app/%s" (include "backstage.appConfigFilename" .) }} + subPath: {{ include "backstage.appConfigFilename" . }} volumes: - name: postgres-ca configMap: name: {{ include "backstage.fullname" . }}-postgres-ca + - name: app-config + configMap: + name: {{ include "backstage.fullname" . }}-app-config {{- if .Values.backend.enabled }} --- @@ -68,4 +72,4 @@ spec: component: backend type: ClusterIP -{{- end }} \ No newline at end of file +{{- end }} diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml index be937cee13..a75fc8108d 100644 --- a/contrib/chart/backstage/templates/backstage-app-config.yaml +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -1,27 +1,19 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "backstage.fullname" . }}-app + name: {{ include "backstage.fullname" . }}-app-config +data: +{{ include "backstage.appConfigFilename" . | indent 2 }}: | +{{ tpl (.Files.Get "files/app-config.local.yaml.tpl") . | indent 4 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . }}-app-env data: APP_CONFIG_app_baseUrl: {{ .Values.appConfig.app.baseUrl | quote | quote }} APP_CONFIG_app_title: {{ .Values.appConfig.app.title | quote | quote }} APP_CONFIG_backend_baseUrl: {{ .Values.appConfig.backend.baseUrl | quote | quote }} - APP_CONFIG_backend_lighthouseHostname: {{ include "lighthouse.serviceName" . | quote | quote }} - APP_CONFIG_backend_listen: {{ .Values.appConfig.backend.listen | quote | quote }} - APP_CONFIG_backend_cors_origin: {{ .Values.appConfig.backend.cors.origin | quote | quote }} - APP_CONFIG_backend_database_client: {{ .Values.appConfig.backend.database.client | quote | quote }} - APP_CONFIG_backend_database_connection_port: {{ include "backend.postgresql.port" . | quote }} - APP_CONFIG_backend_database_connection_host: {{ include "backend.postgresql.host" . | quote | quote }} - APP_CONFIG_backend_database_connection_user: {{ include "backend.postgresql.user" . | quote | quote }} - APP_CONFIG_backend_database_connection_database: {{ .Values.appConfig.backend.database.connection.database | quote | quote }} - APP_CONFIG_backend_database_connection_ssl_rejectUnauthorized: {{ .Values.appConfig.backend.database.connection.ssl.rejectUnauthorized | quote }} - APP_CONFIG_backend_database_connection_ssl_ca: {{ include "backstage.backend.postgresCaFilename" . | quote | quote }} - APP_CONFIG_sentry_organization: {{ .Values.appConfig.sentry.organization | quote | quote }} APP_CONFIG_techdocs_storageUrl: {{ .Values.appConfig.techdocs.storageUrl | quote | quote }} APP_CONFIG_techdocs_requestUrl: {{ .Values.appConfig.techdocs.requestUrl | quote | quote }} - APP_CONFIG_auth_providers_github_development_appOrigin: {{ .Values.appConfig.auth.providers.github.development.appOrigin | quote | quote }} - APP_CONFIG_auth_providers_google_development_appOrigin: {{ .Values.appConfig.auth.providers.google.development.appOrigin | quote | quote }} - APP_CONFIG_auth_providers_gitlab_development_appOrigin: {{ .Values.appConfig.auth.providers.gitlab.development.appOrigin | quote | quote }} - APP_CONFIG_auth_providers_okta_development_appOrigin: {{ .Values.appConfig.auth.providers.okta.development.appOrigin | quote | quote }} - APP_CONFIG_auth_providers_oauth2_development_appOrigin: {{ .Values.appConfig.auth.providers.oauth2.development.appOrigin | quote | quote }} APP_CONFIG_lighthouse_baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote | quote }} diff --git a/contrib/chart/backstage/templates/backstage-auth-config.yaml b/contrib/chart/backstage/templates/backstage-auth-config.yaml deleted file mode 100644 index 5a2023bf3e..0000000000 --- a/contrib/chart/backstage/templates/backstage-auth-config.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "backstage.fullname" . }}-auth -data: - AUTH_GOOGLE_CLIENT_ID: {{ .Values.auth.google.clientId }} - AUTH_GITHUB_CLIENT_ID: {{ .Values.auth.github.clientId }} - AUTH_GITLAB_CLIENT_ID: {{ .Values.auth.gitlab.clientId }} - # This should not be prefixed with AUTH_. This could be a typo in the Backstage app config. - GITLAB_BASE_URL: {{ .Values.auth.gitlab.baseUrl }} - AUTH_OKTA_CLIENT_ID: {{ .Values.auth.okta.clientId }} - AUTH_OKTA_AUDIENCE: {{ .Values.auth.okta.audience }} - AUTH_OAUTH2_CLIENT_ID: {{ .Values.auth.oauth2.clientId }} - AUTH_OAUTH2_AUTH_URL: {{ .Values.auth.oauth2.authUrl }} - AUTH_OAUTH2_TOKEN_URL: {{ .Values.auth.oauth2.tokenUrl }} - AUTH_AUTH0_CLIENT_ID: {{ .Values.auth.auth0.clientId }} - AUTH_AUTH0_DOMAIN: {{ .Values.auth.auth0.domain }} - AUTH_MICROSOFT_CLIENT_ID: {{ .Values.auth.microsoft.clientId }} - AUTH_MICROSOFT_TENANT_ID: {{ .Values.auth.microsoft.tenantId }} diff --git a/contrib/chart/backstage/templates/frontend-deployment.yaml b/contrib/chart/backstage/templates/frontend-deployment.yaml index b494738758..a5d84be2b2 100644 --- a/contrib/chart/backstage/templates/frontend-deployment.yaml +++ b/contrib/chart/backstage/templates/frontend-deployment.yaml @@ -29,8 +29,16 @@ spec: resources: {{- toYaml .Values.backend.resources | nindent 12 }} envFrom: - - configMapRef: - name: {{ include "backstage.fullname" . }}-app + - configMapRef: + name: {{ include "backstage.fullname" . }}-app-env + volumeMounts: + - name: app-config + mountPath: {{ printf "/usr/share/nginx/html/static/%s" (include "backstage.appConfigFilename" .) }} + subPath: {{ include "backstage.appConfigFilename" . }} + volumes: + - name: app-config + configMap: + name: {{ include "backstage.fullname" . }}-app-config {{- if .Values.frontend.enabled }} --- apiVersion: v1 @@ -48,4 +56,4 @@ spec: component: frontend type: ClusterIP -{{- end }} \ No newline at end of file +{{- end }} diff --git a/contrib/chart/backstage/templates/lighthouse-deployment.yaml b/contrib/chart/backstage/templates/lighthouse-deployment.yaml index b727f5d242..25eccd10e6 100644 --- a/contrib/chart/backstage/templates/lighthouse-deployment.yaml +++ b/contrib/chart/backstage/templates/lighthouse-deployment.yaml @@ -33,6 +33,8 @@ spec: envFrom: - configMapRef: name: backstage-lighthouse + - configMapRef: + name: {{ include "backstage.fullname" . }}-app-env env: - name: LAS_PORT @@ -69,4 +71,4 @@ spec: component: lighthouse-audit-service type: ClusterIP -{{- end }} \ No newline at end of file +{{- end }} From 8d578eed59eb7df344a684ef252682977cd40260 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:27 +0200 Subject: [PATCH 08/55] Update docker images to latest master changes --- .../backstage/files/app-config.local.yaml.tpl | 39 +++---------------- .../backstage/files/create-backend-dbs.sql | 5 ++- .../templates/backend-deployment.yaml | 6 ++- .../backstage/templates/backend-secret.yaml | 1 + .../templates/backstage-app-config.yaml | 7 ++++ .../templates/backstage-auth-config.yaml | 21 ++++++++++ .../chart/backstage/templates/ingress.yaml | 28 +++---------- contrib/chart/backstage/values.yaml | 31 ++++++++------- 8 files changed, 68 insertions(+), 70 deletions(-) create mode 100644 contrib/chart/backstage/templates/backstage-auth-config.yaml diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.local.yaml.tpl index 7fdfeb79a8..857e9ecafe 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.local.yaml.tpl @@ -1,6 +1,7 @@ backend: lighthouseHostname: {{ include "lighthouse.serviceName" . | quote }} - listen: {{ .Values.appConfig.backend.listen | quote }} + listen: + port: {{ .Values.appConfig.backend.listen.port | default 7000 }} cors: origin: {{ .Values.appConfig.backend.cors.origin | quote }} database: @@ -35,38 +36,10 @@ catalog: sentry: organization: {{ .Values.appConfig.sentry.organization | quote }} -auth: - providers: - github: - development: - clientId: {{ .Values.auth.github.clientId }} - appOrigin: {{ .Values.appConfig.auth.providers.github.development.appOrigin | quote }} - google: - development: - clientId: {{ .Values.auth.google.clientId }} - appOrigin: {{ .Values.appConfig.auth.providers.google.development.appOrigin | quote }} - gitlab: - development: - clientId: {{ .Values.auth.gitlab.clientId }} - appOrigin: {{ .Values.appConfig.auth.providers.gitlab.development.appOrigin | quote }} - audience: {{ .Values.auth.gitlab.baseUrl }} - okta: - development: - clientId: {{ .Values.auth.okta.clientId }} - audience: {{ .Values.auth.okta.audience }} - appOrigin: {{ .Values.appConfig.auth.providers.okta.development.appOrigin | quote }} - oauth2: - development: - clientId: {{ .Values.auth.oauth2.clientId }} - tokenUrl: {{ .Values.auth.oauth2.tokenUrl }} - appOrigin: {{ .Values.appConfig.auth.providers.oauth2.development.appOrigin | quote }} - auth0: - development: - clientId: {{ .Values.auth.auth0.clientId }} - microsoft: - development: - clientId: {{ .Values.auth.microsoft.clientId }} - tenantId: {{ .Values.auth.microsoft.tenantId }} lighthouse: baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote }} + +scaffolder: + azure: + baseUrl: https://dev.azure.com/some-org diff --git a/contrib/chart/backstage/files/create-backend-dbs.sql b/contrib/chart/backstage/files/create-backend-dbs.sql index e8124dbd22..7902b15b6d 100644 --- a/contrib/chart/backstage/files/create-backend-dbs.sql +++ b/contrib/chart/backstage/files/create-backend-dbs.sql @@ -5,7 +5,10 @@ create database {{ $backendDb }}; grant all privileges on database {{ $backendDb }} to {{ $user }}; +create database backstage_plugin_auth; +grant all privileges on database backstage_plugin_auth to {{ $user }}; + {{ if not (eq $backendDb $lighthouseDb) }} create database {{ $lighthouseDb }}; grant all privileges on database {{ $lighthouseDb }} to {{ $user }}; -{{ end }} \ No newline at end of file +{{ end }} diff --git a/contrib/chart/backstage/templates/backend-deployment.yaml b/contrib/chart/backstage/templates/backend-deployment.yaml index 9c6e8da67c..c57764db8e 100644 --- a/contrib/chart/backstage/templates/backend-deployment.yaml +++ b/contrib/chart/backstage/templates/backend-deployment.yaml @@ -34,8 +34,12 @@ spec: name: {{ include "backstage.fullname" . }}-backend - configMapRef: name: {{ include "backstage.fullname" . }}-app-env + - configMapRef: + name: {{ include "backstage.fullname" . }}-auth env: - - name: APP_CONFIG_backend_postgresPassword + - name: NODE_ENV + value: {{ .Values.backend.nodeEnv | default "development" }} + - name: APP_CONFIG_backend_database_connection_password valueFrom: secretKeyRef: name: {{ include "backend.postgresql.passwordSecret" .}} diff --git a/contrib/chart/backstage/templates/backend-secret.yaml b/contrib/chart/backstage/templates/backend-secret.yaml index 3acb220d81..ab8fff00ec 100644 --- a/contrib/chart/backstage/templates/backend-secret.yaml +++ b/contrib/chart/backstage/templates/backend-secret.yaml @@ -17,4 +17,5 @@ stringData: CIRCLECI_AUTH_TOKEN: {{ .Values.auth.circleciAuthToken }} GITHUB_ACCESS_TOKEN: {{ .Values.auth.githubAccessToken }} GITLAB_ACCESS_TOKEN: {{ .Values.auth.gitlabAccessToken }} + AZURE_PRIVATE_TOKEN: {{ .Values.auth.azure.api.token }} {{- end }} diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml index a75fc8108d..e419e5d14a 100644 --- a/contrib/chart/backstage/templates/backstage-app-config.yaml +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -17,3 +17,10 @@ data: APP_CONFIG_techdocs_storageUrl: {{ .Values.appConfig.techdocs.storageUrl | quote | quote }} APP_CONFIG_techdocs_requestUrl: {{ .Values.appConfig.techdocs.requestUrl | quote | quote }} APP_CONFIG_lighthouse_baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote | quote }} + APP_CONFIG_backend_database_connection_ssl_rejectUnauthorized: "false" + APP_CONFIG_auth_providers_github_development_appOrigin: {{ .Values.appConfig.auth.providers.github.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_google_development_appOrigin: {{ .Values.appConfig.auth.providers.google.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_gitlab_development_appOrigin: {{ .Values.appConfig.auth.providers.gitlab.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_okta_development_appOrigin: {{ .Values.appConfig.auth.providers.okta.development.appOrigin | quote | quote }} + APP_CONFIG_auth_providers_oauth2_development_appOrigin: {{ .Values.appConfig.auth.providers.oauth2.development.appOrigin | quote | quote }} + diff --git a/contrib/chart/backstage/templates/backstage-auth-config.yaml b/contrib/chart/backstage/templates/backstage-auth-config.yaml new file mode 100644 index 0000000000..7dcf8379aa --- /dev/null +++ b/contrib/chart/backstage/templates/backstage-auth-config.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "backstage.fullname" . }}-auth +data: + AUTH_GOOGLE_CLIENT_ID: {{ .Values.auth.google.clientId }} + AUTH_GITHUB_CLIENT_ID: {{ .Values.auth.github.clientId }} + AUTH_GITLAB_CLIENT_ID: {{ .Values.auth.gitlab.clientId }} + # This should not be prefixed with AUTH_. This could be a typo in the Backstage app config. + # Regardless, it is not decided by me. + GITLAB_BASE_URL: {{ .Values.auth.gitlab.baseUrl }} + AUTH_OKTA_CLIENT_ID: {{ .Values.auth.okta.clientId }} + AUTH_OKTA_AUDIENCE: {{ .Values.auth.okta.audience }} + AUTH_OAUTH2_CLIENT_ID: {{ .Values.auth.oauth2.clientId }} + AUTH_OAUTH2_AUTH_URL: {{ .Values.auth.oauth2.authUrl }} + AUTH_OAUTH2_TOKEN_URL: {{ .Values.auth.oauth2.tokenUrl }} + AUTH_AUTH0_CLIENT_ID: {{ .Values.auth.auth0.clientId }} + AUTH_AUTH0_DOMAIN: {{ .Values.auth.auth0.domain }} + AUTH_MICROSOFT_CLIENT_ID: {{ .Values.auth.microsoft.clientId }} + AUTH_MICROSOFT_TENANT_ID: {{ .Values.auth.microsoft.tenantId }} + diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index 6996bb5d8d..a4a3c0ff00 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -1,37 +1,21 @@ apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: - name: {{ include "backstage.fullname" . }}-ingress-backend + name: {{ include "backstage.fullname" . }}-ingress {{- with .Values.ingress.annotations }} annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 {{- toYaml . | nindent 4 }} {{- end }} spec: rules: - http: paths: - - backend: + - path: /api + backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 - path: /api(/|$)(.*) ---- -# Having rewrite rules in an ingress with a '/' path results in an error when loading the -# site "Unexpected token: <". That's why we need two ingress resources -# See https://stackoverflow.com/questions/59931177/gke-install-nginx-ingress-with-static-ip-and-fanout -apiVersion: networking.k8s.io/v1beta1 -kind: Ingress -metadata: - name: {{ include "backstage.fullname" . }}-ingress-frontend - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - rules: - - http: - paths: - - backend: + - path: / + backend: serviceName: {{ include "frontend.serviceName" . }} servicePort: 80 - path: / + diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 64cf5e91be..9616efe58d 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -6,8 +6,8 @@ frontend: enabled: true replicaCount: 1 image: - repository: roadiehq/backstage-k8s-demo-frontend - tag: latest + repository: martinaif/backstage-k8s-demo-frontend + tag: test1 pullPolicy: IfNotPresent containerPort: 80 resources: @@ -18,10 +18,11 @@ frontend: backend: enabled: true + nodeEnv: development replicaCount: 1 image: - repository: roadiehq/backstage-k8s-demo-backend - tag: latest + repository: martinaif/backstage-k8s-demo-backend + tag: test1 pullPolicy: IfNotPresent containerPort: 7000 resources: @@ -81,20 +82,21 @@ appConfig: baseUrl: https://demo.example.com title: Backstage backend: - baseUrl: /api - listen: 0.0.0.0:7000 + baseUrl: https://demo.example.com + listen: + port: 7000 cors: origin: https://demo.example.com database: client: pg connection: - database: backend + database: backstage_plugin_catalog host: user: port: password: ssl: - rejectUnauthorized: false + rejectUnauthorized: true ca: sentry: organization: spotify @@ -116,7 +118,7 @@ appConfig: providers: google: development: - appOrigin: 'http://localhost:3000/' + appOrigin: "http://localhost:3000/" secure: false clientId: $secret: @@ -126,7 +128,7 @@ appConfig: env: AUTH_GOOGLE_CLIENT_SECRET github: development: - appOrigin: 'http://localhost:3000/' + appOrigin: "http://localhost:3000/" secure: false clientId: $secret: @@ -139,7 +141,7 @@ appConfig: env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL gitlab: development: - appOrigin: 'http://localhost:3000/' + appOrigin: "http://localhost:3000/" secure: false clientId: $secret: @@ -152,7 +154,7 @@ appConfig: env: GITLAB_BASE_URL okta: development: - appOrigin: 'http://localhost:3000/' + appOrigin: "http://localhost:3000/" secure: false clientId: $secret: @@ -165,7 +167,7 @@ appConfig: env: AUTH_OKTA_AUDIENCE oauth2: development: - appOrigin: 'http://localhost:3000/' + appOrigin: "http://localhost:3000/" secure: false clientId: $secret: @@ -230,6 +232,9 @@ auth: clientId: f clientSecret: f tenantId: f + azure: + api: + token: h sentryToken: e rollbarAccountToken: f # This is a 'Personal Access Token' From 19932ff7f51bd51cf3f0522635afd6138e17ded4 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:28 +0200 Subject: [PATCH 09/55] Use hosts in ingress based on baseUrls again --- .../chart/backstage/templates/ingress.yaml | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index a4a3c0ff00..2ff713a3b6 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -8,14 +8,25 @@ metadata: {{- end }} spec: rules: - - http: - paths: - - path: /api - backend: - serviceName: {{ include "backend.serviceName" . }} - servicePort: 80 - - path: / - backend: - serviceName: {{ include "frontend.serviceName" . }} - servicePort: 80 + - host: {{ .Values.appConfig.app.baseUrl | trimPrefix "https://" | trimSuffix "/" }} + http: + paths: + - path: / + backend: + serviceName: {{ include "frontend.serviceName" . }} + servicePort: 80 + - host: {{ .Values.appConfig.backend.baseUrl | trimPrefix "https://" | trimSuffix "/" }} + http: + paths: + - path: /api + backend: + serviceName: {{ include "backend.serviceName" . }} + servicePort: 80 + - host: {{ .Values.appConfig.lighthouse.baseUrl | trimPrefix "https://" | trimSuffix "/" }} + http: + paths: + - path: / + backend: + serviceName: {{ include "lighthouse.serviceName" . }} + servicePort: 80 From 4b67e8c17623ed13a451925b229eba7892ac70a8 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:29 +0200 Subject: [PATCH 10/55] Draft README --- contrib/chart/backstage/README.md | 77 ++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index bb2ff84411..bccc934da8 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -1 +1,76 @@ -# TO DO +# Backstage demo helm charts + +This folder contains Helm charts that can easily create a Kubernetes deployment of a demo Backstage app. + +To deploy it chose a DNS name where this demo will live and run + +``` +git clone https://github.com/spotify/backstage.git +cd contrib/chart/backstage +helm install backstage . \ +--set appConfig.app.baseUrl="https://backstage.mydomain.com" \ +--set appConfig.backend.baseUrl="https://backstage.mydomain.com" \ +--set appConfig.backend.cors.origin.baseUrl="https://backstage.mydomain.com" \ +``` + +This command will deploy the following pieces: + +- Backstage frontend +- Backstage backend with scaffolder and auth plugins +- (optional) a PostgreSQL instance +- lighthouse plugin +- ingress + +After a few minutes Backstage should be up and running in your cluster under the DNS specified earlier. + +Make sure to create the appropriate DNS entry in your infrastructure. To find the IP address run + +```bash +$ kubectl get ingress +NAME HOSTS ADDRESS PORTS AGE +backstage-ingress * 34.77.171.192 80 17m +``` + +> **NOTE**: this is not a production ready deployment. + +## Customization + +Configuring a connection to an existing PostgreSQL instance is possible through the chart's values: + +```bash +appConfig: + backend: + database: + client: pg + connection: + database: backstage_plugin_catalog + host: + user: + port: + password: + ssl: + rejectUnauthorized: true +``` + +For the CA, create a `configMap` named `ca.crt`: + +``` +kubectl create configmap %s --from-file=ca.crt" +``` + +## Troubleshooting + +#### Unable to verify signature + +``` +Backend failed to start up Error: unable to verify the first certificate + at TLSSocket.onConnectSecure (_tls_wrap.js:1501:34) + at TLSSocket.emit (events.js:315:20) + at TLSSocket._finishInit (_tls_wrap.js:936:8) + at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:710:12) { + code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' +``` + +This error happens in the backend when it tries to connect to the configured PostgreSQL database and the specified CA is not correct. The solution is to make sure that the contents of the `configmap` that holds the certificate match the CA for the PostgreSQL instance. A workaround is to set `appConfig.backend.database.connection.ssl.rejectUnauthorized` to `false` in the chart's values. + + From 30c72a6ee0bf258bf378e5d4935544568f2f18f0 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:29 +0200 Subject: [PATCH 11/55] Fix prettier --- contrib/chart/backstage/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 9616efe58d..3993d3fee3 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -118,7 +118,7 @@ appConfig: providers: google: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -128,7 +128,7 @@ appConfig: env: AUTH_GOOGLE_CLIENT_SECRET github: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -141,7 +141,7 @@ appConfig: env: AUTH_GITHUB_ENTERPRISE_INSTANCE_URL gitlab: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -154,7 +154,7 @@ appConfig: env: GITLAB_BASE_URL okta: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: @@ -167,7 +167,7 @@ appConfig: env: AUTH_OKTA_AUDIENCE oauth2: development: - appOrigin: "http://localhost:3000/" + appOrigin: 'http://localhost:3000/' secure: false clientId: $secret: From 8c8560f3578a22d6914bbd7a241b6890c57fb9d7 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:30 +0200 Subject: [PATCH 12/55] Fix name of lightouse configmap ref --- contrib/chart/backstage/templates/lighthouse-deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/chart/backstage/templates/lighthouse-deployment.yaml b/contrib/chart/backstage/templates/lighthouse-deployment.yaml index 25eccd10e6..70341a2a22 100644 --- a/contrib/chart/backstage/templates/lighthouse-deployment.yaml +++ b/contrib/chart/backstage/templates/lighthouse-deployment.yaml @@ -32,7 +32,7 @@ spec: envFrom: - configMapRef: - name: backstage-lighthouse + name: {{ include "backstage.fullname" . -}}-lighthouse - configMapRef: name: {{ include "backstage.fullname" . }}-app-env From 5db315a48b43c84c2348a3ca725da767f1bf09fc Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:31 +0200 Subject: [PATCH 13/55] Add chart testing workflow --- .github/workflows/charts-lint-test.yaml | 32 +++++++++++++++++++ chart_schema.yaml | 37 ++++++++++++++++++++++ contrib/chart/backstage/Chart.yaml | 2 +- ct.yaml | 8 +++++ lintconf.yaml | 42 +++++++++++++++++++++++++ 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/charts-lint-test.yaml create mode 100644 chart_schema.yaml create mode 100644 ct.yaml create mode 100644 lintconf.yaml diff --git a/.github/workflows/charts-lint-test.yaml b/.github/workflows/charts-lint-test.yaml new file mode 100644 index 0000000000..ab73407e9d --- /dev/null +++ b/.github/workflows/charts-lint-test.yaml @@ -0,0 +1,32 @@ +name: Lint and Test Charts + +on: pull_request + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Fetch history + run: git fetch --prune --unshallow + + - name: Run chart-testing (lint) + id: lint + uses: helm/chart-testing-action@v1.1.0 + with: + command: lint + config: ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.0.0 + # Only build a kind cluster if there are chart changes to test. + if: steps.lint.outputs.changed == 'true' + + - name: Install charts + uses: helm/chart-testing-action@v1.1.0 + if: steps.lint.outputs.changed == 'true' + with: + command: install + config: ct.yaml diff --git a/chart_schema.yaml b/chart_schema.yaml new file mode 100644 index 0000000000..61fc3e14b2 --- /dev/null +++ b/chart_schema.yaml @@ -0,0 +1,37 @@ +name: str() +home: str(required=False) +version: str() +apiVersion: str() +appVersion: any(str(), num(), required=False) +description: str() +keywords: list(str(), required=False) +sources: list(str(), required=False) +maintainers: list(include('maintainer'), required=False) +dependencies: list(include('dependency'), required=False) +icon: str(required=False) +engine: str(required=False) +condition: str(required=False) +tags: str(required=False) +deprecated: bool(required=False) +kubeVersion: str(required=False) +annotations: map(str(), str(), required=False) +type: str(required=False) +--- +maintainer: + name: str() + email: str(required=False) + url: str(required=False) +--- +dependency: + name: str() + version: str() + repository: str() + condition: str(required=False) + tags: list(str(), required=False) + enabled: bool(required=False) + import-values: any(list(str()), list(include('import-value')), required=False) + alias: str(required=False) +--- +import-value: + child: str() + parent: str() diff --git a/contrib/chart/backstage/Chart.yaml b/contrib/chart/backstage/Chart.yaml index 92b5e3e309..7d2a489199 100644 --- a/contrib/chart/backstage/Chart.yaml +++ b/contrib/chart/backstage/Chart.yaml @@ -22,7 +22,7 @@ dependencies: repository: https://charts.bitnami.com/bitnami maintainers: - - name: Martina Iglesias Fernandez + - name: Martina Iglesias Fernández email: martina@roadie.io url: https://roadie.io - name: David Tuite diff --git a/ct.yaml b/ct.yaml new file mode 100644 index 0000000000..53a47c95c2 --- /dev/null +++ b/ct.yaml @@ -0,0 +1,8 @@ +charts: + - contrib/chart/backstage + +validate-maintainers: false +debug: true +target-branch: master +chart-repos: + - bitnami=https://charts.bitnami.com/bitnami diff --git a/lintconf.yaml b/lintconf.yaml new file mode 100644 index 0000000000..b9eb34ff2d --- /dev/null +++ b/lintconf.yaml @@ -0,0 +1,42 @@ +--- +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + require-starting-space: true + min-spaces-from-content: 2 + document-end: disable + document-start: disable # No --- to start a file + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + hyphens: + max-spaces-after: 1 + indentation: + spaces: consistent + indent-sequences: whatever # - list indentation will handle both indentation and without + check-multi-line-strings: false + key-duplicates: enable + line-length: disable # Lines can be any length + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + level: warning From 56fae192b548da6ea32a131dae2e5a5116446d0c Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:31 +0200 Subject: [PATCH 14/55] Fix postgres password secret --- .../backstage/templates/postgresql-password-secret.yaml | 6 +++--- contrib/chart/backstage/values.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/chart/backstage/templates/postgresql-password-secret.yaml b/contrib/chart/backstage/templates/postgresql-password-secret.yaml index 7e72888607..9685130a03 100644 --- a/contrib/chart/backstage/templates/postgresql-password-secret.yaml +++ b/contrib/chart/backstage/templates/postgresql-password-secret.yaml @@ -11,7 +11,7 @@ metadata: "helm.sh/hook": "pre-install" "helm.sh/hook-delete-policy": "before-hook-creation" data: - postgresql-password: {{ .Values.appConfig.backend.database.connection.password }} + postgresql-password: {{ .Values.appConfig.backend.database.connection.password | b64enc }} {{- end }} {{- if not .Values.postgresql.enabled }} --- @@ -26,5 +26,5 @@ metadata: "helm.sh/hook": "pre-install" "helm.sh/hook-delete-policy": "before-hook-creation" data: - postgresql-password: {{ .Values.lighthouse.database.connection.password }} -{{- end }} \ No newline at end of file + postgresql-password: {{ .Values.lighthouse.database.connection.password | b64enc }} +{{- end }} diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 3993d3fee3..37ac9b2243 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -96,7 +96,7 @@ appConfig: port: password: ssl: - rejectUnauthorized: true + rejectUnauthorized: false ca: sentry: organization: spotify From 024b8bceee2ac5500a695546c1e6acb3a4dacb42 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:32 +0200 Subject: [PATCH 15/55] Add docs --- contrib/chart/backstage/README.md | 42 ++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index bccc934da8..51f0bb0d7c 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -35,27 +35,51 @@ backstage-ingress * 34.77.171.192 80 17m ## Customization -Configuring a connection to an existing PostgreSQL instance is possible through the chart's values: +Configuring a connection to an existing PostgreSQL instance is possible through the chart's values. + +First create a yaml file with the configuration you want to override, for example `backstage-prod.yaml`: ```bash +postgresql: + enabled: false + appConfig: + app: + baseUrl: https://backstage-demo.mydomain.com + title: Backstage backend: + baseUrl: https://backstage-demo.mydomain.com + cors: + origin: https://backstage-demo.mydomain.com database: client: pg connection: database: backstage_plugin_catalog host: - user: - port: + user: password: - ssl: - rejectUnauthorized: true -``` - -For the CA, create a `configMap` named `ca.crt`: +lighthouse: + database: + client: pg + connection: + host: + user: + password: + database: lighthouse_audit_service ``` -kubectl create configmap %s --from-file=ca.crt" + +For the CA, create a `configMap` named `-postgres-ca` with a file called `ca.crt`: + +``` +kubectl create configmap my-backstage --from-file=ca.crt" +``` + +Now install the helm chart: + +``` +cd contrib/chart/backstage +helm install -f backstage-prod.yaml my-backstage . ``` ## Troubleshooting From 4851528f2ee60e68f5d534b0b75f4ffdff52f24a Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 5 Oct 2020 17:29:33 +0200 Subject: [PATCH 16/55] Make demo data configurable and add more docs --- contrib/chart/backstage/README.md | 18 ++++++++++++++++++ .../backstage/files/app-config.local.yaml.tpl | 4 ++++ contrib/chart/backstage/values.yaml | 1 + 3 files changed, 23 insertions(+) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index 51f0bb0d7c..22c1fae5df 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -35,6 +35,8 @@ backstage-ingress * 34.77.171.192 80 17m ## Customization +### Custom PostgreSQL instance + Configuring a connection to an existing PostgreSQL instance is possible through the chart's values. First create a yaml file with the configuration you want to override, for example `backstage-prod.yaml`: @@ -82,6 +84,22 @@ cd contrib/chart/backstage helm install -f backstage-prod.yaml my-backstage . ``` +### Different namespace + +To install the charts a specific namespace use `--namespace `: + +``` +helm install -f my_values.yaml --namespace demos backstage . +``` + +### Disable loading of demo data + +To deploy backstage with the pre-loaded demo data disable `backend.demoData`: + +``` +helm install -f my_values.yaml --set backend.demoData=false backstage . +``` + ## Troubleshooting #### Unable to verify signature diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.local.yaml.tpl index 857e9ecafe..d803213a40 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.local.yaml.tpl @@ -16,6 +16,7 @@ backend: ca: {{ include "backstage.backend.postgresCaFilename" . | quote }} catalog: +{{- if .Values.backend.demoData }} locations: # Backstage example components - type: github @@ -32,6 +33,9 @@ catalog: # Backstage example templates - type: github target: https://github.com/spotify/backstage/blob/master/plugins/scaffolder-backend/sample-templates/all-templates.yaml +{{- else }} + locations: [] +{{- end }} sentry: organization: {{ .Values.appConfig.sentry.organization | quote }} diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index 37ac9b2243..ea9cd077f8 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -19,6 +19,7 @@ frontend: backend: enabled: true nodeEnv: development + demoData: true replicaCount: 1 image: repository: martinaif/backstage-k8s-demo-backend From 34f6182e4820e0b83d562212c84d91da9dfa1a6e Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Tue, 6 Oct 2020 16:15:14 +0200 Subject: [PATCH 17/55] Fix ingress and baseUrls --- .../backstage/files/app-config.local.yaml.tpl | 4 --- .../chart/backstage/templates/ingress.yaml | 25 +++++++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.local.yaml.tpl index d803213a40..f5e0b94225 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.local.yaml.tpl @@ -40,10 +40,6 @@ catalog: sentry: organization: {{ .Values.appConfig.sentry.organization | quote }} - -lighthouse: - baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote }} - scaffolder: azure: baseUrl: https://dev.azure.com/some-org diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index 2ff713a3b6..df501b18d0 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -1,3 +1,6 @@ +{{- $frontendUrl := urlParse .Values.appConfig.app.baseUrl}} +{{- $backendUrl := urlParse .Values.appConfig.backend.baseUrl}} +{{- $lighthouseUrl := urlParse .Values.appConfig.lighthouse.baseUrl}} apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: @@ -8,24 +11,32 @@ metadata: {{- end }} spec: rules: - - host: {{ .Values.appConfig.app.baseUrl | trimPrefix "https://" | trimSuffix "/" }} + - host: {{ $frontendUrl.host }} http: paths: - path: / backend: serviceName: {{ include "frontend.serviceName" . }} servicePort: 80 - - host: {{ .Values.appConfig.backend.baseUrl | trimPrefix "https://" | trimSuffix "/" }} - http: - paths: - - path: /api + - path: /techdocs backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 - - host: {{ .Values.appConfig.lighthouse.baseUrl | trimPrefix "https://" | trimSuffix "/" }} + - path: /metadata + backend: + serviceName: {{ include "backend.serviceName" . }} + servicePort: 80 + - host: {{ $backendUrl.host }} http: paths: - - path: / + - path: {{ $backendUrl.path | default "/" }} + backend: + serviceName: {{ include "backend.serviceName" . }} + servicePort: 80 + - host: {{ $lighthouseUrl.host }} + http: + paths: + - path: {{ $lighthouseUrl.path | default "/" }} backend: serviceName: {{ include "lighthouse.serviceName" . }} servicePort: 80 From d517a32bcbc59005e801547b34070adc43002951 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Tue, 6 Oct 2020 19:21:06 +0200 Subject: [PATCH 18/55] Fix ingress for lighthouse connection --- .../chart/backstage/templates/ingress.yaml | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index df501b18d0..481bacbfb3 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -7,6 +7,11 @@ metadata: name: {{ include "backstage.fullname" . }}-ingress {{- with .Values.ingress.annotations }} annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/configuration-snippet: | + if ($scheme = https) { + add_header Strict-Transport-Security "max-age=0;"; + } {{- toYaml . | nindent 4 }} {{- end }} spec: @@ -18,6 +23,8 @@ spec: backend: serviceName: {{ include "frontend.serviceName" . }} servicePort: 80 +{{/* Route the backend inside the same hostname as the frontend when they are the same */}} +{{- if eq $frontendUrl.host $backendUrl.host}} - path: /techdocs backend: serviceName: {{ include "backend.serviceName" . }} @@ -26,6 +33,12 @@ spec: backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 + - path: /api + backend: + serviceName: {{ include "backend.serviceName" . }} + servicePort: 80 +{{/* Route the backend through a different host */}} +{{- else -}} - host: {{ $backendUrl.host }} http: paths: @@ -33,11 +46,40 @@ spec: backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 - - host: {{ $lighthouseUrl.host }} +{{- end }} +{{/* Route lighthouse through a different host */}} +{{- if not ( eq $frontendUrl.host $lighthouseUrl.host ) }} + - host: {{ $lighthouseUrl.host }} http: paths: - path: {{ $lighthouseUrl.path | default "/" }} backend: serviceName: {{ include "lighthouse.serviceName" . }} servicePort: 80 - +{{- else }} +{{/* Route lighthouse by path with re-write rules when it is hosted under the same hostname */}} +--- +apiVersion: networking.k8s.io/v1beta1 +kind: Ingress +metadata: + name: {{ include "backstage.fullname" . }}-ingress-lighthouse + {{- with .Values.ingress.annotations }} + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/configuration-snippet: | + if ($scheme = https) { + add_header Strict-Transport-Security "max-age=0;"; + } + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $frontendUrl.host }} + http: + paths: + - path: {{$lighthouseUrl.path}}(/|$)(.*) + backend: + serviceName: {{ include "lighthouse.serviceName" . }} + servicePort: 80 +{{- end }} From e0a960558b71ff37232046e1867fa647b3da4a5a Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Wed, 7 Oct 2020 15:50:27 +0200 Subject: [PATCH 19/55] Fix techdocs and CORS the cors setting was not loaded by the frontend because it can't see the app-config.yaml file so it needs to be part of the environment variables --- .../backstage/files/app-config.local.yaml.tpl | 6 ++++-- .../templates/backstage-app-config.yaml | 1 + .../chart/backstage/templates/ingress.yaml | 19 ++++++------------- contrib/chart/backstage/values.yaml | 6 +++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.local.yaml.tpl index f5e0b94225..646d438771 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.local.yaml.tpl @@ -2,8 +2,6 @@ backend: lighthouseHostname: {{ include "lighthouse.serviceName" . | quote }} listen: port: {{ .Values.appConfig.backend.listen.port | default 7000 }} - cors: - origin: {{ .Values.appConfig.backend.cors.origin | quote }} database: client: {{ .Values.appConfig.backend.database.client | quote }} connection: @@ -43,3 +41,7 @@ sentry: scaffolder: azure: baseUrl: https://dev.azure.com/some-org + +techdocs: + generators: + techdocs: 'local' diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml index e419e5d14a..987ad8e160 100644 --- a/contrib/chart/backstage/templates/backstage-app-config.yaml +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -14,6 +14,7 @@ data: APP_CONFIG_app_baseUrl: {{ .Values.appConfig.app.baseUrl | quote | quote }} APP_CONFIG_app_title: {{ .Values.appConfig.app.title | quote | quote }} APP_CONFIG_backend_baseUrl: {{ .Values.appConfig.backend.baseUrl | quote | quote }} + APP_CONFIG_backend_cors_origin: {{ .Values.appConfig.backend.cors.origin | quote | quote }} APP_CONFIG_techdocs_storageUrl: {{ .Values.appConfig.techdocs.storageUrl | quote | quote }} APP_CONFIG_techdocs_requestUrl: {{ .Values.appConfig.techdocs.requestUrl | quote | quote }} APP_CONFIG_lighthouse_baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote | quote }} diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index 481bacbfb3..7705d52a93 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -23,22 +23,14 @@ spec: backend: serviceName: {{ include "frontend.serviceName" . }} servicePort: 80 -{{/* Route the backend inside the same hostname as the frontend when they are the same */}} -{{- if eq $frontendUrl.host $backendUrl.host}} - - path: /techdocs - backend: - serviceName: {{ include "backend.serviceName" . }} - servicePort: 80 - - path: /metadata - backend: - serviceName: {{ include "backend.serviceName" . }} - servicePort: 80 + {{/* Route the backend inside the same hostname as the frontend when they are the same */}} + {{- if eq $frontendUrl.host $backendUrl.host}} - path: /api backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 -{{/* Route the backend through a different host */}} -{{- else -}} + {{/* Route the backend through a different host */}} + {{- else -}} - host: {{ $backendUrl.host }} http: paths: @@ -46,7 +38,8 @@ spec: backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 -{{- end }} + {{- end }} + {{/* Route lighthouse through a different host */}} {{- if not ( eq $frontendUrl.host $lighthouseUrl.host ) }} - host: {{ $lighthouseUrl.host }} diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index ea9cd077f8..e307701249 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -102,10 +102,10 @@ appConfig: sentry: organization: spotify techdocs: - storageUrl: https://backend.example.com/techdocs/static/docs - requestUrl: https://backend.example.com/techdocs/docs + storageUrl: https://demo.example.com/api/techdocs/static/docs + requestUrl: https://demo.example.com/api/techdocs lighthouse: - baseUrl: https://lighthouse.example.com + baseUrl: https://demo.example.com/lighthouse-api rollbar: organization: roadie From 9f44b650f0d46ac9c6a4cf8a916b9d031c0dc99e Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Wed, 7 Oct 2020 16:24:08 +0200 Subject: [PATCH 20/55] Fix ingress bug --- contrib/chart/backstage/templates/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index 7705d52a93..034862ef75 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -42,7 +42,7 @@ spec: {{/* Route lighthouse through a different host */}} {{- if not ( eq $frontendUrl.host $lighthouseUrl.host ) }} - - host: {{ $lighthouseUrl.host }} + - host: {{ $lighthouseUrl.host }} http: paths: - path: {{ $lighthouseUrl.path | default "/" }} From 6289cea398a13124ec19b7cbb92c43378a4214f8 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Wed, 7 Oct 2020 17:37:03 +0200 Subject: [PATCH 21/55] Add more documentation to charts README and k8s guide --- contrib/chart/backstage/README.md | 115 +++++++++++++++++++++++-- docs/getting-started/deployment-k8s.md | 63 +++++++++++++- 2 files changed, 169 insertions(+), 9 deletions(-) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index 22c1fae5df..1a045e09ca 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -2,15 +2,43 @@ This folder contains Helm charts that can easily create a Kubernetes deployment of a demo Backstage app. -To deploy it chose a DNS name where this demo will live and run +### Pre-requisites + +These charts depend on the `nginx-ingress` controller being present in the cluster. If it's not already installed you +can run: + +``` +helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx +helm install nginx-ingress ingress-nginx/ingress-nginx +``` + +### Installing the charts + +After choosing a DNS name where backstage will be hosted create a yaml file for your custom configuration. + +``` +appConfig: + app: + baseUrl: https://backstage.mydomain.com + title: Backstage + backend: + baseUrl: https://backstage.mydomain.com + cors: + origin: https://backstage.mydomain.com + lighthouse: + baseUrl: https://backstage.mydomain.com/lighthouse-api + techdocs: + storageUrl: https://backstage.mydomain.com/api/techdocs/static/docs + requestUrl: https://backstage.mydomain.com/api/techdocs + +``` + +Then use it to run: ``` git clone https://github.com/spotify/backstage.git cd contrib/chart/backstage -helm install backstage . \ ---set appConfig.app.baseUrl="https://backstage.mydomain.com" \ ---set appConfig.backend.baseUrl="https://backstage.mydomain.com" \ ---set appConfig.backend.cors.origin.baseUrl="https://backstage.mydomain.com" \ +helm install -f backstage-mydomain.yaml backstage . ``` This command will deploy the following pieces: @@ -23,16 +51,21 @@ This command will deploy the following pieces: After a few minutes Backstage should be up and running in your cluster under the DNS specified earlier. -Make sure to create the appropriate DNS entry in your infrastructure. To find the IP address run +Make sure to create the appropriate DNS entry in your infrastructure. To find the public IP address run: ```bash $ kubectl get ingress NAME HOSTS ADDRESS PORTS AGE -backstage-ingress * 34.77.171.192 80 17m +backstage-ingress * 123.1.2.3 80 17m ``` > **NOTE**: this is not a production ready deployment. +## Caveats + +The current implementation does not generate certificates for the ingress which means the browser will alert that the +site is insecure and using self-signed certificates. + ## Customization ### Custom PostgreSQL instance @@ -60,6 +93,9 @@ appConfig: host: user: password: + lighthouse: + baseUrl: https://backstage-demo.mydomain.com/lighthouse-api + lighthouse: database: client: pg @@ -84,6 +120,27 @@ cd contrib/chart/backstage helm install -f backstage-prod.yaml my-backstage . ``` +### Use your own docker images + +The docker images used for the deployment can be configured through the charts values: + +``` +frontend: + image: + repository: + tag: + +backend: + image: + repository: + tag: + +frontend: + image: + repository: +``` + ### Different namespace To install the charts a specific namespace use `--namespace `: @@ -100,8 +157,38 @@ To deploy backstage with the pre-loaded demo data disable `backend.demoData`: helm install -f my_values.yaml --set backend.demoData=false backstage . ``` +### Other options + +For more customization options take a look at the [values.yaml](/contrib/chart/backstage/values.yaml) file. + ## Troubleshooting +Some resources created by these charts are meant to survive after upgrades and even after uninstalls. When +troubleshooting these charts it can be useful to delete these resources between re-installs. + +Secrets: + +``` +-postgresql-certs -- contains the certificates used by the deployed PostgreSQL +``` + +Persistent volumes: + +``` +data--postgresql-0 -- this is the data volume used by PostgreSQL to store data and configuration +``` + +> **NOTE**: this volume also stores the configuration for PostgreSQL which includes things like the password for the +> `postgres` user. This means that uninstalling and re-installing the charts with `postgres.enabled` set to `true` and +> auto generated passwords will fail. The solution is to delete this volume with +> `kubectl delete pvc data--postgresql-0` + +ConfigMaps: + +``` +-postgres-ca -- contains the generated CA certificate for PostgreSQL when `postgres` is enabled +``` + #### Unable to verify signature ``` @@ -113,6 +200,18 @@ Backend failed to start up Error: unable to verify the first certificate code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' ``` -This error happens in the backend when it tries to connect to the configured PostgreSQL database and the specified CA is not correct. The solution is to make sure that the contents of the `configmap` that holds the certificate match the CA for the PostgreSQL instance. A workaround is to set `appConfig.backend.database.connection.ssl.rejectUnauthorized` to `false` in the chart's values. +This error happens in the backend when it tries to connect to the configured PostgreSQL database and the specified CA is not correct. The solution is to make sure that the contents of the `configMap` that holds the certificate match the CA for the PostgreSQL instance. A workaround is to set `appConfig.backend.database.connection.ssl.rejectUnauthorized` to `false` in the chart's values. + +## Uninstalling Backstage + +To uninstall Backstage simply run: + +``` +RELEASE_NAME= # use `helm list` to find out the name +helm uninstall ${RELEASE_NAME} +kubectl delete pvc data-${RELEASE_NAME}-postgresql-0 +kubectl delete secret ${RELEASE_NAME}-postgresql-certs +kubectl delete configMap ${RELEASE_NAME}-postgres-ca +``` diff --git a/docs/getting-started/deployment-k8s.md b/docs/getting-started/deployment-k8s.md index ddcbd290c6..c2682d85a4 100644 --- a/docs/getting-started/deployment-k8s.md +++ b/docs/getting-started/deployment-k8s.md @@ -4,4 +4,65 @@ title: Kubernetes description: Documentation on Kubernetes and K8s Deployment --- -Coming soon! +# Helm charts + +An example Backstage app can be deployed in Kubernetes using the [Backstage Helm +charts][backstage-helm-charts] + +First, choose a DNS name where backstage will be hosted create a yaml file for +your custom configuration. + +``` +appConfig: + app: + baseUrl: https://backstage.mydomain.com + title: Backstage + backend: + baseUrl: https://backstage.mydomain.com + cors: + origin: https://backstage.mydomain.com + lighthouse: + baseUrl: https://backstage.mydomain.com/lighthouse-api + techdocs: + storageUrl: https://backstage.mydomain.com/api/techdocs/static/docs + requestUrl: https://backstage.mydomain.com/api/techdocs + +``` + +Then use it to run: + +``` +git clone https://github.com/spotify/backstage.git +cd contrib/chart/backstage +helm install -f backstage-mydomain.yaml backstage . +``` + +This command will deploy the following pieces: + +- Backstage frontend +- Backstage backend with scaffolder and auth plugins +- (optional) a PostgreSQL instance +- lighthouse plugin +- ingress + +After a few minutes Backstage should be up and running in your cluster under the +DNS specified earlier. + +Make sure to create the appropriate DNS entry in your infrastructure. To find +the public IP address run: + +```bash +$ kubectl get ingress +NAME HOSTS ADDRESS PORTS AGE +backstage-ingress * 123.1.2.3 80 17m +``` + +> **NOTE**: this is not a production ready deployment. + +For more information on how to customize the deployment check the +[README][charts-readme]. + +[backstage-helm-charts]: + (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage) +[charts-readme]: + (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage/README.md) From 797ac6a450f386d2f80b3f942f19eeef301b9323 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Thu, 8 Oct 2020 15:28:58 +0200 Subject: [PATCH 22/55] Use app-config.development.yaml to provide configuration instead of local The app-config.yaml file that comes inside the docker image for the backend contains configuration for the key `scaffolder.azure`. This automatically enables the use of azure and it is not possible to set its values to dummy ones because it will fail when it tries to validate them. To avoid the backend throwing an exception for this, the charts are using the "development" mode (via setting NODE_ENV=development). This means that the app-config.development.yaml file that ships in the container woud have higher precedence than the app-config.local.yaml file that the charts tried to create before. For that reason, for now, they will override the development file. A better solution would be to ship the docker images with a minimal app-config.yaml or even without any config. And then have these charts provide said file. --- ...ocal.yaml.tpl => app-config.development.yaml.tpl} | 12 ++++++++---- contrib/chart/backstage/templates/_helpers.tpl | 2 +- .../backstage/templates/backstage-app-config.yaml | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) rename contrib/chart/backstage/files/{app-config.local.yaml.tpl => app-config.development.yaml.tpl} (97%) diff --git a/contrib/chart/backstage/files/app-config.local.yaml.tpl b/contrib/chart/backstage/files/app-config.development.yaml.tpl similarity index 97% rename from contrib/chart/backstage/files/app-config.local.yaml.tpl rename to contrib/chart/backstage/files/app-config.development.yaml.tpl index 646d438771..76d6499145 100644 --- a/contrib/chart/backstage/files/app-config.local.yaml.tpl +++ b/contrib/chart/backstage/files/app-config.development.yaml.tpl @@ -35,12 +35,16 @@ catalog: locations: [] {{- end }} -sentry: - organization: {{ .Values.appConfig.sentry.organization | quote }} +auth: + providers: + microsoft: null scaffolder: - azure: - baseUrl: https://dev.azure.com/some-org + azure: null + + +sentry: + organization: {{ .Values.appConfig.sentry.organization | quote }} techdocs: generators: diff --git a/contrib/chart/backstage/templates/_helpers.tpl b/contrib/chart/backstage/templates/_helpers.tpl index ec54c91d1b..5d49ba6975 100644 --- a/contrib/chart/backstage/templates/_helpers.tpl +++ b/contrib/chart/backstage/templates/_helpers.tpl @@ -282,5 +282,5 @@ Postgres password for lighthouse app-config file name */}} {{- define "backstage.appConfigFilename" -}} -{{- "app-config.local.yaml" -}} +{{- "app-config.development.yaml" -}} {{- end -}} diff --git a/contrib/chart/backstage/templates/backstage-app-config.yaml b/contrib/chart/backstage/templates/backstage-app-config.yaml index 987ad8e160..061fc3285b 100644 --- a/contrib/chart/backstage/templates/backstage-app-config.yaml +++ b/contrib/chart/backstage/templates/backstage-app-config.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "backstage.fullname" . }}-app-config data: {{ include "backstage.appConfigFilename" . | indent 2 }}: | -{{ tpl (.Files.Get "files/app-config.local.yaml.tpl") . | indent 4 }} +{{ tpl (.Files.Get "files/app-config.development.yaml.tpl") . | indent 4 }} --- apiVersion: v1 kind: ConfigMap From 84e6d0e2305a7bdb23f2b8bbd200b3a984c46d3d Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Thu, 8 Oct 2020 15:58:19 +0200 Subject: [PATCH 23/55] Remove line in initdb script that creates backend db Since this is already created by the backend --- contrib/chart/backstage/files/create-backend-dbs.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/chart/backstage/files/create-backend-dbs.sql b/contrib/chart/backstage/files/create-backend-dbs.sql index 7902b15b6d..043ff7daf5 100644 --- a/contrib/chart/backstage/files/create-backend-dbs.sql +++ b/contrib/chart/backstage/files/create-backend-dbs.sql @@ -2,7 +2,6 @@ {{ $lighthouseDb := .Values.lighthouse.database.connection.database }} {{ $user := .Values.global.postgresql.postgresqlUsername }} -create database {{ $backendDb }}; grant all privileges on database {{ $backendDb }} to {{ $user }}; create database backstage_plugin_auth; From dd5be710f523ec165ad7b80fe9ccf06fff086724 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Thu, 8 Oct 2020 17:04:58 +0200 Subject: [PATCH 24/55] Move the k8s deployment docs to its own helm deployment page --- docs/getting-started/deployment-helm.md | 68 +++++++++++++++++++++++++ docs/getting-started/deployment-k8s.md | 63 +---------------------- 2 files changed, 69 insertions(+), 62 deletions(-) create mode 100644 docs/getting-started/deployment-helm.md diff --git a/docs/getting-started/deployment-helm.md b/docs/getting-started/deployment-helm.md new file mode 100644 index 0000000000..dc8430e95e --- /dev/null +++ b/docs/getting-started/deployment-helm.md @@ -0,0 +1,68 @@ +--- +id: deployment-helm +title: Helm +description: Documentation on Kubernetes and Helm Deployment +--- + +# Helm charts + +An example Backstage app can be deployed in Kubernetes using the [Backstage Helm +charts][backstage-helm-charts] + +First, choose a DNS name where backstage will be hosted create a yaml file for +your custom configuration. + +``` +appConfig: + app: + baseUrl: https://backstage.mydomain.com + title: Backstage + backend: + baseUrl: https://backstage.mydomain.com + cors: + origin: https://backstage.mydomain.com + lighthouse: + baseUrl: https://backstage.mydomain.com/lighthouse-api + techdocs: + storageUrl: https://backstage.mydomain.com/api/techdocs/static/docs + requestUrl: https://backstage.mydomain.com/api/techdocs + +``` + +Then use it to run: + +``` +git clone https://github.com/spotify/backstage.git +cd contrib/chart/backstage +helm install -f backstage-mydomain.yaml backstage . +``` + +This command will deploy the following pieces: + +- Backstage frontend +- Backstage backend with scaffolder and auth plugins +- (optional) a PostgreSQL instance +- lighthouse plugin +- ingress + +After a few minutes Backstage should be up and running in your cluster under the +DNS specified earlier. + +Make sure to create the appropriate DNS entry in your infrastructure. To find +the public IP address run: + +```bash +$ kubectl get ingress +NAME HOSTS ADDRESS PORTS AGE +backstage-ingress * 123.1.2.3 80 17m +``` + +> **NOTE**: this is not a production ready deployment. + +For more information on how to customize the deployment check the +[README][charts-readme]. + +[backstage-helm-charts]: + (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage) +[charts-readme]: + (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage/README.md) diff --git a/docs/getting-started/deployment-k8s.md b/docs/getting-started/deployment-k8s.md index c2682d85a4..ddcbd290c6 100644 --- a/docs/getting-started/deployment-k8s.md +++ b/docs/getting-started/deployment-k8s.md @@ -4,65 +4,4 @@ title: Kubernetes description: Documentation on Kubernetes and K8s Deployment --- -# Helm charts - -An example Backstage app can be deployed in Kubernetes using the [Backstage Helm -charts][backstage-helm-charts] - -First, choose a DNS name where backstage will be hosted create a yaml file for -your custom configuration. - -``` -appConfig: - app: - baseUrl: https://backstage.mydomain.com - title: Backstage - backend: - baseUrl: https://backstage.mydomain.com - cors: - origin: https://backstage.mydomain.com - lighthouse: - baseUrl: https://backstage.mydomain.com/lighthouse-api - techdocs: - storageUrl: https://backstage.mydomain.com/api/techdocs/static/docs - requestUrl: https://backstage.mydomain.com/api/techdocs - -``` - -Then use it to run: - -``` -git clone https://github.com/spotify/backstage.git -cd contrib/chart/backstage -helm install -f backstage-mydomain.yaml backstage . -``` - -This command will deploy the following pieces: - -- Backstage frontend -- Backstage backend with scaffolder and auth plugins -- (optional) a PostgreSQL instance -- lighthouse plugin -- ingress - -After a few minutes Backstage should be up and running in your cluster under the -DNS specified earlier. - -Make sure to create the appropriate DNS entry in your infrastructure. To find -the public IP address run: - -```bash -$ kubectl get ingress -NAME HOSTS ADDRESS PORTS AGE -backstage-ingress * 123.1.2.3 80 17m -``` - -> **NOTE**: this is not a production ready deployment. - -For more information on how to customize the deployment check the -[README][charts-readme]. - -[backstage-helm-charts]: - (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage) -[charts-readme]: - (https://github.com/spotify/backstage/tree/master/contrib/chart/backstage/README.md) +Coming soon! From 001fd7c57ad739ce3c0a2ac78300103f033af9d4 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Fri, 9 Oct 2020 08:31:05 +0200 Subject: [PATCH 25/55] Only lint charts on Pull Requests --- .github/workflows/charts-lint-test.yaml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/charts-lint-test.yaml b/.github/workflows/charts-lint-test.yaml index ab73407e9d..032f70f96f 100644 --- a/.github/workflows/charts-lint-test.yaml +++ b/.github/workflows/charts-lint-test.yaml @@ -18,15 +18,3 @@ jobs: with: command: lint config: ct.yaml - - - name: Create kind cluster - uses: helm/kind-action@v1.0.0 - # Only build a kind cluster if there are chart changes to test. - if: steps.lint.outputs.changed == 'true' - - - name: Install charts - uses: helm/chart-testing-action@v1.1.0 - if: steps.lint.outputs.changed == 'true' - with: - command: install - config: ct.yaml From 22848a96fde8e1fb7008bfc9982e1030b172c3ad Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Fri, 9 Oct 2020 12:16:33 +0200 Subject: [PATCH 26/55] Remove chart testing workflow for now --- .github/workflows/charts-lint-test.yaml | 20 ------------ chart_schema.yaml | 37 ---------------------- ct.yaml | 8 ----- lintconf.yaml | 42 ------------------------- 4 files changed, 107 deletions(-) delete mode 100644 .github/workflows/charts-lint-test.yaml delete mode 100644 chart_schema.yaml delete mode 100644 ct.yaml delete mode 100644 lintconf.yaml diff --git a/.github/workflows/charts-lint-test.yaml b/.github/workflows/charts-lint-test.yaml deleted file mode 100644 index 032f70f96f..0000000000 --- a/.github/workflows/charts-lint-test.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Lint and Test Charts - -on: pull_request - -jobs: - lint-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Fetch history - run: git fetch --prune --unshallow - - - name: Run chart-testing (lint) - id: lint - uses: helm/chart-testing-action@v1.1.0 - with: - command: lint - config: ct.yaml diff --git a/chart_schema.yaml b/chart_schema.yaml deleted file mode 100644 index 61fc3e14b2..0000000000 --- a/chart_schema.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: str() -home: str(required=False) -version: str() -apiVersion: str() -appVersion: any(str(), num(), required=False) -description: str() -keywords: list(str(), required=False) -sources: list(str(), required=False) -maintainers: list(include('maintainer'), required=False) -dependencies: list(include('dependency'), required=False) -icon: str(required=False) -engine: str(required=False) -condition: str(required=False) -tags: str(required=False) -deprecated: bool(required=False) -kubeVersion: str(required=False) -annotations: map(str(), str(), required=False) -type: str(required=False) ---- -maintainer: - name: str() - email: str(required=False) - url: str(required=False) ---- -dependency: - name: str() - version: str() - repository: str() - condition: str(required=False) - tags: list(str(), required=False) - enabled: bool(required=False) - import-values: any(list(str()), list(include('import-value')), required=False) - alias: str(required=False) ---- -import-value: - child: str() - parent: str() diff --git a/ct.yaml b/ct.yaml deleted file mode 100644 index 53a47c95c2..0000000000 --- a/ct.yaml +++ /dev/null @@ -1,8 +0,0 @@ -charts: - - contrib/chart/backstage - -validate-maintainers: false -debug: true -target-branch: master -chart-repos: - - bitnami=https://charts.bitnami.com/bitnami diff --git a/lintconf.yaml b/lintconf.yaml deleted file mode 100644 index b9eb34ff2d..0000000000 --- a/lintconf.yaml +++ /dev/null @@ -1,42 +0,0 @@ ---- -rules: - braces: - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: -1 - max-spaces-inside-empty: -1 - brackets: - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: -1 - max-spaces-inside-empty: -1 - colons: - max-spaces-before: 0 - max-spaces-after: 1 - commas: - max-spaces-before: 0 - min-spaces-after: 1 - max-spaces-after: 1 - comments: - require-starting-space: true - min-spaces-from-content: 2 - document-end: disable - document-start: disable # No --- to start a file - empty-lines: - max: 2 - max-start: 0 - max-end: 0 - hyphens: - max-spaces-after: 1 - indentation: - spaces: consistent - indent-sequences: whatever # - list indentation will handle both indentation and without - check-multi-line-strings: false - key-duplicates: enable - line-length: disable # Lines can be any length - new-line-at-end-of-file: enable - new-lines: - type: unix - trailing-spaces: enable - truthy: - level: warning From cafe45b4a90bcdf8aa6804c9a7a443ce535ff70f Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 12 Oct 2020 09:24:04 +0200 Subject: [PATCH 27/55] Fix feedback from dtuite --- contrib/chart/backstage/README.md | 3 ++- docs/getting-started/deployment-helm.md | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/chart/backstage/README.md b/contrib/chart/backstage/README.md index 1a045e09ca..4f247252b1 100644 --- a/contrib/chart/backstage/README.md +++ b/contrib/chart/backstage/README.md @@ -38,6 +38,7 @@ Then use it to run: ``` git clone https://github.com/spotify/backstage.git cd contrib/chart/backstage +helm dependency update helm install -f backstage-mydomain.yaml backstage . ``` @@ -135,7 +136,7 @@ backend: repository: tag: -frontend: +lighthouse: image: repository: diff --git a/docs/getting-started/deployment-helm.md b/docs/getting-started/deployment-helm.md index dc8430e95e..bc239d9306 100644 --- a/docs/getting-started/deployment-helm.md +++ b/docs/getting-started/deployment-helm.md @@ -34,6 +34,7 @@ Then use it to run: ``` git clone https://github.com/spotify/backstage.git cd contrib/chart/backstage +helm dependency update helm install -f backstage-mydomain.yaml backstage . ``` From 9c27e58c03a3f492fc54d8070061564b1e24e764 Mon Sep 17 00:00:00 2001 From: Martina Iglesias Fernandez Date: Mon, 12 Oct 2020 09:56:28 +0200 Subject: [PATCH 28/55] Update name of env authentication env vars --- contrib/chart/backstage/templates/backend-secret.yaml | 6 +++--- contrib/chart/backstage/values.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/chart/backstage/templates/backend-secret.yaml b/contrib/chart/backstage/templates/backend-secret.yaml index ab8fff00ec..63eddc2742 100644 --- a/contrib/chart/backstage/templates/backend-secret.yaml +++ b/contrib/chart/backstage/templates/backend-secret.yaml @@ -15,7 +15,7 @@ stringData: SENTRY_TOKEN: {{ .Values.auth.sentryToken }} ROLLBAR_ACCOUNT_TOKEN: {{ .Values.auth.rollbarAccountToken }} CIRCLECI_AUTH_TOKEN: {{ .Values.auth.circleciAuthToken }} - GITHUB_ACCESS_TOKEN: {{ .Values.auth.githubAccessToken }} - GITLAB_ACCESS_TOKEN: {{ .Values.auth.gitlabAccessToken }} - AZURE_PRIVATE_TOKEN: {{ .Values.auth.azure.api.token }} + GITHUB_TOKEN: {{ .Values.auth.githubToken }} + GITLAB_TOKEN: {{ .Values.auth.gitlabToken }} + AZURE_TOKEN: {{ .Values.auth.azure.api.token }} {{- end }} diff --git a/contrib/chart/backstage/values.yaml b/contrib/chart/backstage/values.yaml index e307701249..3ce45c5330 100644 --- a/contrib/chart/backstage/values.yaml +++ b/contrib/chart/backstage/values.yaml @@ -241,5 +241,5 @@ auth: # This is a 'Personal Access Token' circleciAuthToken: r # Used by the scaffolder to create GitHub repos. Must have 'repo' scope. - githubAccessToken: g - gitlabAccessToken: g + githubToken: g + gitlabToken: g From c26ee13e3e7b6a15ef8805ea5c26b51317d855a8 Mon Sep 17 00:00:00 2001 From: nikek Date: Mon, 12 Oct 2020 10:52:03 +0200 Subject: [PATCH 29/55] Move card header bg to up contrast, fix #2558 --- plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 470fef1148..04ad8b0959 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -25,6 +25,7 @@ const useStyles = makeStyles(theme => ({ padding: theme.spacing(2, 2, 6), backgroundImage: (props: { backgroundImage: string }) => props.backgroundImage, + backgroundPosition: '0 center', }, content: { padding: theme.spacing(2), From 68497758fcc3094fbd98ac636ce87447582a1b30 Mon Sep 17 00:00:00 2001 From: nikek Date: Mon, 12 Oct 2020 11:02:16 +0200 Subject: [PATCH 30/55] remove unnecessary center keyword --- plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 04ad8b0959..fde7080f4c 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -25,7 +25,7 @@ const useStyles = makeStyles(theme => ({ padding: theme.spacing(2, 2, 6), backgroundImage: (props: { backgroundImage: string }) => props.backgroundImage, - backgroundPosition: '0 center', + backgroundPosition: 0, }, content: { padding: theme.spacing(2), From 390a6d798269380f9eefdbb570cdcd1bda529bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 12 Oct 2020 11:16:12 +0200 Subject: [PATCH 31/55] fix(catalog-backend): actually use modified entity output (default namespace was broken) --- packages/catalog-model/src/EntityPolicies.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/catalog-model/src/EntityPolicies.ts b/packages/catalog-model/src/EntityPolicies.ts index ca59338c16..acdfb4df2a 100644 --- a/packages/catalog-model/src/EntityPolicies.ts +++ b/packages/catalog-model/src/EntityPolicies.ts @@ -40,10 +40,13 @@ class AllEntityPolicies implements EntityPolicy { async enforce(entity: Entity): Promise { let result = entity; for (const policy of this.policies) { - const output = await policy.enforce(entity); - if (output) { - result = output; + const output = await policy.enforce(result); + if (!output) { + throw new Error( + `Policy ${policy.constructor.name} did not return a result`, + ); } + result = output; } return result; } @@ -54,10 +57,10 @@ class AllEntityPolicies implements EntityPolicy { class AnyEntityPolicy implements EntityPolicy { constructor(private readonly policies: EntityPolicy[]) {} - async enforce(entity: Entity): Promise { + async enforce(entity: Entity): Promise { for (const policy of this.policies) { const output = await policy.enforce(entity); - if (output !== null) { + if (output) { return output; } } From bec280e5796f4c7f1326208c441ea025fb4546c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Mon, 12 Oct 2020 11:30:43 +0200 Subject: [PATCH 32/55] Update project Copyright (#2852) * Update project Copyright * Update project Copyright --- .github/styles/vocab.txt | 2 ++ README.md | 7 +++---- microsite/core/Footer.js | 26 +++++++++++++------------- microsite/siteConfig.js | 2 +- microsite/static/css/custom.css | 7 +++++++ 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index 59a0eadb49..c20a9862b0 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -205,3 +205,5 @@ cloudbuild Grafana Iain Snyk +www +WWW diff --git a/README.md b/README.md index e05c1eb16e..49fd52e73d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ # [Backstage](https://backstage.io) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![CNCF Status](https://img.shields.io/badge/cncf%20status-sandbox-blue.svg)](https://www.cncf.io/projects) ![](https://github.com/spotify/backstage/workflows/Frontend%20CI/badge.svg) [![Discord](https://img.shields.io/discord/687207715902193673)](https://discord.gg/EBHEGzX) ![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) @@ -24,9 +25,7 @@ Out of the box, Backstage includes: - [Backstage TechDocs](https://backstage.io/docs/features/techdocs/techdocs-overview) for making it easy to create, maintain, find, and use technical documentation, using a "docs like code" approach - Plus, a growing ecosystem of [open source plugins](https://github.com/spotify/backstage/tree/master/plugins) that further expand Backstage’s customizability and functionality -For more information go to [backstage.io](https://backstage.io) or join our [Discord chatroom](https://discord.gg/EBHEGzX). - -🎉 Backstage is a CNCF Sandbox project. Read the announcement [here](https://backstage.io/blog/2020/09/23/backstage-cncf-sandbox). +Backstage was created by Spotify but is now hosted by the [Cloud Native Computing Foundation (CNCF)](https://www.cncf.io) as a Sandbox level project. Read the announcement [here](https://backstage.io/blog/2020/09/23/backstage-cncf-sandbox). ## Project roadmap @@ -58,6 +57,6 @@ Check out [the documentation](https://backstage.io/docs/getting-started) on how ## License -Copyright 2020 Spotify AB. +Copyright 2020 © Backstage Project Authors. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page: https://www.linuxfoundation.org/trademark-usage Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 diff --git a/microsite/core/Footer.js b/microsite/core/Footer.js index 8e3c4c086d..1bebf2f399 100644 --- a/microsite/core/Footer.js +++ b/microsite/core/Footer.js @@ -1,8 +1,17 @@ -/** - * Copyright (c) 2017-present, Facebook, Inc. +/* + * Copyright 2020 Backstage Project Authors. * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. + * 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. */ const React = require('react'); @@ -82,15 +91,6 @@ class Footer extends React.Component { )} - - - Made with at {this.props.config.organizationName} -

{this.props.config.copyright}

); diff --git a/microsite/siteConfig.js b/microsite/siteConfig.js index d034321d6c..370d491eb3 100644 --- a/microsite/siteConfig.js +++ b/microsite/siteConfig.js @@ -78,7 +78,7 @@ const siteConfig = { }, // This copyright info is used in /core/Footer.js and blog RSS/Atom feeds. - copyright: `Copyright © ${new Date().getFullYear()} Spotify AB`, + copyright: `Copyright © ${new Date().getFullYear()} Backstage Project Authors. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page: https://www.linuxfoundation.org/trademark-usage`, highlight: { // Highlight.js theme to use for syntax highlighting in code blocks. diff --git a/microsite/static/css/custom.css b/microsite/static/css/custom.css index 738478724f..6599aef6a6 100644 --- a/microsite/static/css/custom.css +++ b/microsite/static/css/custom.css @@ -1084,3 +1084,10 @@ code { margin-bottom: 40px; margin-top: 20px; } + +.nav-footer .copyright { + width: 600px; + color: #fff; + margin: auto; + font-size: 10pt; +} From 252024d04734c38f80af4cd026c447a2b5a59f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 9 Oct 2020 16:47:27 +0200 Subject: [PATCH 33/55] fix(catalog-backend): limit search value lengths --- .../src/database/search.test.ts | 100 ++++++------ .../catalog-backend/src/database/search.ts | 154 +++++++++--------- 2 files changed, 128 insertions(+), 126 deletions(-) diff --git a/plugins/catalog-backend/src/database/search.test.ts b/plugins/catalog-backend/src/database/search.test.ts index fad17da733..d108820ca9 100644 --- a/plugins/catalog-backend/src/database/search.test.ts +++ b/plugins/catalog-backend/src/database/search.test.ts @@ -14,51 +14,36 @@ * limitations under the License. */ -import { ENTITY_DEFAULT_NAMESPACE, Entity } from '@backstage/catalog-model'; -import { buildEntitySearch, visitEntityPart } from './search'; -import type { DbEntitiesSearchRow } from './types'; +import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model'; +import { buildEntitySearch, mapToRows, traverse } from './search'; describe('search', () => { - describe('visitEntityPart', () => { + describe('traverse', () => { it('expands lists of strings to several rows', () => { const input = { a: ['b', 'c', 'd'] }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); + const output = traverse(input); expect(output).toEqual([ - { entity_id: 'eid', key: 'a', value: 'b' }, - { entity_id: 'eid', key: 'a', value: 'c' }, - { entity_id: 'eid', key: 'a', value: 'd' }, + { key: 'a', value: 'b' }, + { key: 'a', value: 'c' }, + { key: 'a', value: 'd' }, ]); }); it('expands objects', () => { const input = { a: { b: { c: 'd' }, e: 'f' } }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); + const output = traverse(input); expect(output).toEqual([ - { entity_id: 'eid', key: 'a.b.c', value: 'd' }, - { entity_id: 'eid', key: 'a.e', value: 'f' }, + { key: 'a.b.c', value: 'd' }, + { key: 'a.e', value: 'f' }, ]); }); - it('converts base types to strings or null', () => { - const input = { - a: true, - b: false, - c: 7, - d: 'string', - e: null, - f: undefined, - }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); + it('expands list of objects', () => { + const input = { root: { list: [{ a: 1 }, { a: 2 }] } }; + const output = traverse(input); expect(output).toEqual([ - { entity_id: 'eid', key: 'a', value: 'true' }, - { entity_id: 'eid', key: 'b', value: 'false' }, - { entity_id: 'eid', key: 'c', value: '7' }, - { entity_id: 'eid', key: 'd', value: 'string' }, - { entity_id: 'eid', key: 'e', value: null }, - { entity_id: 'eid', key: 'f', value: null }, + { key: 'root.list.a', value: 1 }, + { key: 'root.list.a', value: 2 }, ]); }); @@ -76,34 +61,47 @@ describe('search', () => { }, d: 'd', }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); + const output = traverse(input); expect(output).toEqual([ - { entity_id: 'eid', key: 'a', value: 'a' }, - { entity_id: 'eid', key: 'metadata.b', value: 'b' }, - { entity_id: 'eid', key: 'metadata.c', value: 'c' }, - { entity_id: 'eid', key: 'd', value: 'd' }, + { key: 'a', value: 'a' }, + { key: 'metadata.b', value: 'b' }, + { key: 'metadata.c', value: 'c' }, + { key: 'd', value: 'd' }, ]); }); + }); - it('expands list of objects', () => { - const input = { root: { list: [{ a: 1 }, { a: 2 }] } }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); + describe('mapToRows', () => { + it('converts base types to strings or null', () => { + const input = [ + { key: 'a', value: true }, + { key: 'b', value: false }, + { key: 'c', value: 7 }, + { key: 'd', value: 'string' }, + { key: 'e', value: null }, + { key: 'f', value: undefined }, + ]; + const output = mapToRows(input, 'eid'); expect(output).toEqual([ - { entity_id: 'eid', key: 'root.list.a', value: '1' }, - { entity_id: 'eid', key: 'root.list.a', value: '2' }, + { entity_id: 'eid', key: 'a', value: 'true' }, + { entity_id: 'eid', key: 'b', value: 'false' }, + { entity_id: 'eid', key: 'c', value: '7' }, + { entity_id: 'eid', key: 'd', value: 'string' }, + { entity_id: 'eid', key: 'e', value: null }, + { entity_id: 'eid', key: 'f', value: null }, ]); }); it('emits lowercase version of keys and values', () => { - const input = { theRoot: { listItems: [{ a: 'One' }, { a: 2 }] } }; - const output: DbEntitiesSearchRow[] = []; - visitEntityPart('eid', '', input, output); - expect(output).toEqual([ - { entity_id: 'eid', key: 'theroot.listitems.a', value: 'one' }, - { entity_id: 'eid', key: 'theroot.listitems.a', value: '2' }, - ]); + const input = [{ key: 'fOo', value: 'BaR' }]; + const output = mapToRows(input, 'eid'); + expect(output).toEqual([{ entity_id: 'eid', key: 'foo', value: 'bar' }]); + }); + + it('skips very large values', () => { + const input = [{ key: 'foo', value: 'a'.repeat(10000) }]; + const output = mapToRows(input, 'eid'); + expect(output).toEqual([]); }); }); @@ -115,6 +113,8 @@ describe('search', () => { metadata: { name: 'n' }, }; expect(buildEntitySearch('eid', input)).toEqual([ + { entity_id: 'eid', key: 'apiversion', value: 'a' }, + { entity_id: 'eid', key: 'kind', value: 'b' }, { entity_id: 'eid', key: 'metadata.name', value: 'n' }, { entity_id: 'eid', key: 'metadata.namespace', value: null }, { entity_id: 'eid', key: 'metadata.uid', value: null }, @@ -123,8 +123,6 @@ describe('search', () => { key: 'metadata.namespace', value: ENTITY_DEFAULT_NAMESPACE, }, - { entity_id: 'eid', key: 'apiversion', value: 'a' }, - { entity_id: 'eid', key: 'kind', value: 'b' }, ]); }); }); diff --git a/plugins/catalog-backend/src/database/search.ts b/plugins/catalog-backend/src/database/search.ts index bbed2fac47..863b86ee9a 100644 --- a/plugins/catalog-backend/src/database/search.ts +++ b/plugins/catalog-backend/src/database/search.ts @@ -28,16 +28,18 @@ const SPECIAL_KEYS = [ 'metadata.generation', ]; -function toValue(current: any): string | null { - if (current === undefined || current === null) { - return null; - } +// The maximum length allowed for search values. These columns are indexed, and +// database engines do not like to index on massive values. For example, +// postgres will balk after 8191 byte line sizes. +const MAX_VALUE_LENGTH = 200; - return String(current).toLowerCase(); -} +type Kv = { + key: string; + value: any; +}; -// Helper for iterating through a nested structure and outputting a list of -// path->value entries. +// Helper for traversing through a nested structure and outputting a list of +// path->value entries of the leaves. // // For example, this yaml structure // @@ -53,57 +55,77 @@ function toValue(current: any): string | null { // // will result in // -// "a", "1" +// "a", 1 // "b.c", null // "b.e": "f" // "b.e": "g" -// "h.i": "1" +// "h.i": 1 // "h.j": "k" -// "h.i": "2" +// "h.i": 2 // "h.j": "l" -export function visitEntityPart( - entityId: string, - path: string, - current: any, - output: DbEntitiesSearchRow[], -) { - // ignored - if (SPECIAL_KEYS.includes(path)) { - return; - } +export function traverse(root: any): Kv[] { + const output: Kv[] = []; - // empty or scalar - if ( - current === undefined || - current === null || - ['string', 'number', 'boolean'].includes(typeof current) - ) { - output.push({ entity_id: entityId, key: path, value: toValue(current) }); - return; - } - - // unknown - if (typeof current !== 'object') { - return; - } - - // array - if (Array.isArray(current)) { - for (const item of current) { - visitEntityPart(entityId, path, item, output); + function visit(path: string, current: any) { + if (SPECIAL_KEYS.includes(path)) { + return; + } + + // empty or scalar + if ( + current === undefined || + current === null || + ['string', 'number', 'boolean'].includes(typeof current) + ) { + output.push({ key: path, value: current }); + return; + } + + // unknown + if (typeof current !== 'object') { + return; + } + + // array + if (Array.isArray(current)) { + for (const item of current) { + // keep the same path as currently + visit(path, item); + } + return; + } + + // object + for (const [key, value] of Object.entries(current)) { + visit(path ? `${path}.${key}` : key, value); } - return; } - // object - for (const [key, value] of Object.entries(current)) { - visitEntityPart( - entityId, - (path ? `${path}.${key}` : key).toLowerCase(), - value, - output, - ); + visit('', root); + + return output; +} + +// Translates a number of raw data rows to search table rows +export function mapToRows( + input: Kv[], + entityId: string, +): DbEntitiesSearchRow[] { + const result: DbEntitiesSearchRow[] = []; + + for (let { key, value } of input) { + key = key.toLowerCase(); + if (value === undefined || value === null) { + result.push({ entity_id: entityId, key, value: null }); + } else { + value = String(value).toLowerCase(); + if (value.length <= MAX_VALUE_LENGTH) { + result.push({ entity_id: entityId, key, value }); + } + } } + + return result; } /** @@ -117,38 +139,20 @@ export function buildEntitySearch( entityId: string, entity: Entity, ): DbEntitiesSearchRow[] { + // Visit the entire structure recursively + const raw = traverse(entity); + // Start with some special keys that are always present because you want to // be able to easily search for null specifically - const result: DbEntitiesSearchRow[] = [ - { - entity_id: entityId, - key: 'metadata.name', - value: toValue(entity.metadata.name), - }, - { - entity_id: entityId, - key: 'metadata.namespace', - value: toValue(entity.metadata.namespace), - }, - { - entity_id: entityId, - key: 'metadata.uid', - value: toValue(entity.metadata.uid), - }, - ]; + raw.push({ key: 'metadata.name', value: entity.metadata.name }); + raw.push({ key: 'metadata.namespace', value: entity.metadata.namespace }); + raw.push({ key: 'metadata.uid', value: entity.metadata.uid }); // Namespace not specified has the default value "default", so we want to // match on that as well if (!entity.metadata.namespace) { - result.push({ - entity_id: entityId, - key: 'metadata.namespace', - value: toValue(ENTITY_DEFAULT_NAMESPACE), - }); + raw.push({ key: 'metadata.namespace', value: ENTITY_DEFAULT_NAMESPACE }); } - // Visit the entire structure recursively - visitEntityPart(entityId, '', entity, result); - - return result; + return mapToRows(raw, entityId); } From 79340e44b4505609071f4d28de9cb1d4e921aa9a Mon Sep 17 00:00:00 2001 From: J Shamsul Bahri Date: Mon, 12 Oct 2020 18:11:28 +0800 Subject: [PATCH 34/55] make saml provider path from globalConfig (#2855) Co-authored-by: JShamsul --- plugins/auth-backend/src/providers/saml/provider.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/auth-backend/src/providers/saml/provider.ts b/plugins/auth-backend/src/providers/saml/provider.ts index a90f3e3053..59e46a86d7 100644 --- a/plugins/auth-backend/src/providers/saml/provider.ts +++ b/plugins/auth-backend/src/providers/saml/provider.ts @@ -118,15 +118,18 @@ type SAMLProviderOptions = { }; export const createSamlProvider: AuthProviderFactory = ({ + globalConfig, config, tokenIssuer, }) => { + const url = new URL(globalConfig.baseUrl); + const providerId = 'saml'; const entryPoint = config.getString('entryPoint'); const issuer = config.getString('issuer'); const opts = { entryPoint, issuer, - path: '/auth/saml/handler/frame', + path: `${url.pathname}/${providerId}/handler/frame`, tokenIssuer, }; From 90461a7eac7a5a321ec59dcdf8e48bc77a358e42 Mon Sep 17 00:00:00 2001 From: lewtakm Date: Mon, 12 Oct 2020 12:50:37 +0200 Subject: [PATCH 35/55] feat: Add Pull Request plugin to sample app. --- packages/app/package.json | 2 +- .../app/src/components/catalog/EntityPage.tsx | 11 +++++++++++ yarn.lock | 16 ++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index a3b150cef6..bc0b50eaf5 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -34,7 +34,7 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@octokit/rest": "^18.0.0", - "@roadiehq/backstage-plugin-github-pull-requests": "^0.4.3", + "@roadiehq/backstage-plugin-github-pull-requests": "^0.5.1", "@roadiehq/backstage-plugin-travis-ci": "^0.2.3", "dayjs": "^1.9.1", "history": "^5.0.0", diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 393ffe2631..e8b9a95fda 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -54,6 +54,7 @@ import { LastLighthouseAuditCard, isPluginApplicableToEntity as isLighthouseAvailable, } from '@backstage/plugin-lighthouse/'; +import { Router as GithubPullRequestsRouter } from '@roadiehq/backstage-plugin-github-pull-requests'; const CICDSwitcher = ({ entity }: { entity: Entity }) => { // This component is just an example of how you can implement your company's logic in entity page. @@ -160,6 +161,11 @@ const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( title="Kubernetes" element={} /> + } + /> ); @@ -195,6 +201,11 @@ const WebsiteEntityPage = ({ entity }: { entity: Entity }) => ( title="Kubernetes" element={} /> + } + /> ); const DefaultEntityPage = ({ entity }: { entity: Entity }) => ( diff --git a/yarn.lock b/yarn.lock index 34d0287c42..4f76b0a66b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3639,15 +3639,15 @@ resolved "https://registry.npmjs.org/@rjsf/material-ui/-/material-ui-2.3.0.tgz#a051eb4db2ad778e39933a31ba806f415dd3ba90" integrity sha512-v/xZ4Xk18ZgBARcCe99IDqdO97GU0UC784gG8PhGGFDdy5Rbdy7ixTjHkGYttkr43PB7SX6ttohNhkKSW4nATQ== -"@roadiehq/backstage-plugin-github-pull-requests@^0.4.3": - version "0.4.3" - resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-0.4.3.tgz#720fd3c53ae8e61d8cfc727cda47e236af442b02" - integrity sha512-IJGMys5FJ512sitaMwWgACll3ZTuE3nZUX05MNXly/WXty6VBcfboiPbSB6IzLAEWMmvYlV1YUwwL7hAl/62GQ== +"@roadiehq/backstage-plugin-github-pull-requests@^0.5.1": + version "0.5.1" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-0.5.1.tgz#a0e3ef97de20fe87e55a26f0198d4ff80b6ecd8c" + integrity sha512-0Btg4jn7SWAp/0A7+xCuHxD4LKPoE3LSEkjMvLmWk/AIIvNA6uSWXeAv1nJZSe4JBV0Qzt+r+TS+hCcFR+vcMg== dependencies: - "@backstage/catalog-model" "^0.1.1-alpha.23" - "@backstage/core" "^0.1.1-alpha.23" - "@backstage/plugin-catalog" "^0.1.1-alpha.23" - "@backstage/theme" "^0.1.1-alpha.23" + "@backstage/catalog-model" "^0.1.1-alpha.24" + "@backstage/core" "^0.1.1-alpha.24" + "@backstage/plugin-catalog" "^0.1.1-alpha.24" + "@backstage/theme" "^0.1.1-alpha.24" "@material-ui/core" "^4.11.0" "@material-ui/icons" "^4.9.1" "@material-ui/lab" "^4.0.0-alpha.56" From 65d7224554ab789951e327849f58d326ae3acce9 Mon Sep 17 00:00:00 2001 From: lewtakm Date: Mon, 12 Oct 2020 13:00:19 +0200 Subject: [PATCH 36/55] feat: add changeset --- .changeset/beige-apes-serve.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/beige-apes-serve.md diff --git a/.changeset/beige-apes-serve.md b/.changeset/beige-apes-serve.md new file mode 100644 index 0000000000..54ee39a85e --- /dev/null +++ b/.changeset/beige-apes-serve.md @@ -0,0 +1,5 @@ +--- +'example-app': patch +--- + +Add Pull Request tab to components view. From d9bfacffadf0fe35f5a83128ebc4bbb4450e9754 Mon Sep 17 00:00:00 2001 From: lewtakm Date: Mon, 12 Oct 2020 13:07:48 +0200 Subject: [PATCH 37/55] fix: update component name --- packages/app/src/components/catalog/EntityPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index e8b9a95fda..ed63e26e79 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -54,7 +54,7 @@ import { LastLighthouseAuditCard, isPluginApplicableToEntity as isLighthouseAvailable, } from '@backstage/plugin-lighthouse/'; -import { Router as GithubPullRequestsRouter } from '@roadiehq/backstage-plugin-github-pull-requests'; +import { Router as PullRequestsRouter } from '@roadiehq/backstage-plugin-github-pull-requests'; const CICDSwitcher = ({ entity }: { entity: Entity }) => { // This component is just an example of how you can implement your company's logic in entity page. @@ -164,7 +164,7 @@ const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( } + element={} /> ); @@ -204,7 +204,7 @@ const WebsiteEntityPage = ({ entity }: { entity: Entity }) => ( } + element={} /> ); From 9eea5da094a3761eb8136323d39e6fdde35edaf7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 12 Oct 2020 13:20:39 +0200 Subject: [PATCH 38/55] github/workflows: use the tip of master as the base for comparing PR code coverage --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65e092676d..d00f304b58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: if: ${{ steps.yarn-lock.outcome == 'failure' }} run: | yarn lerna -- run test -- --coverage - bash <(curl -s https://codecov.io/bash) + bash <(curl -s https://codecov.io/bash) -N $(git rev-parse FETCH_HEAD) - name: verify plugin template run: yarn lerna -- run diff -- --check From 69d50967e6a6f63003b6caed8d0f999a2a2d9bbf Mon Sep 17 00:00:00 2001 From: lewtakm Date: Mon, 12 Oct 2020 13:44:09 +0200 Subject: [PATCH 39/55] feat: add pull requests widget to overview page of the component --- packages/app/src/components/catalog/EntityPage.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 393ffe2631..d3e25238c7 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -54,6 +54,10 @@ import { LastLighthouseAuditCard, isPluginApplicableToEntity as isLighthouseAvailable, } from '@backstage/plugin-lighthouse/'; +import { + isPluginApplicableToEntity as isPullRequestsAvailable, + PullRequestsStatsCard, +} from '@roadiehq/backstage-plugin-github-pull-requests'; const CICDSwitcher = ({ entity }: { entity: Entity }) => { // This component is just an example of how you can implement your company's logic in entity page. @@ -125,6 +129,11 @@ const OverviewContent = ({ entity }: { entity: Entity }) => ( )} + {isPullRequestsAvailable(entity) && ( + + + + )} ); From f48f10340c383f0f787b0706787412f51ff87a09 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 12 Oct 2020 14:00:26 +0200 Subject: [PATCH 40/55] github/codecov: switch to informational mode --- .github/codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index 1b8e770b59..d39038615f 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -6,6 +6,7 @@ coverage: default: threshold: 0% # Ref: https://docs.codecov.io/docs/codecovyml-reference#coveragestatus target: auto + informational: true # Don't block PRs # Since Backstage is a mono repo, flags here help in getting the code coverage of individual packages. # Documentation: https://docs.codecov.io/docs/flags From 74a29db272aa5e9cb18ef2fcfd2c298bf1477324 Mon Sep 17 00:00:00 2001 From: lewtakm Date: Mon, 12 Oct 2020 14:04:40 +0200 Subject: [PATCH 41/55] fix: bumb package version --- packages/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index a3b150cef6..bc0b50eaf5 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -34,7 +34,7 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@octokit/rest": "^18.0.0", - "@roadiehq/backstage-plugin-github-pull-requests": "^0.4.3", + "@roadiehq/backstage-plugin-github-pull-requests": "^0.5.1", "@roadiehq/backstage-plugin-travis-ci": "^0.2.3", "dayjs": "^1.9.1", "history": "^5.0.0", From bce753c2325c00a278c993664965ff84af8b0462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20=C3=85lund?= Date: Mon, 12 Oct 2020 16:01:56 +0200 Subject: [PATCH 42/55] =?UTF-8?q?Update=20roadmap:=20Design=20System=20?= =?UTF-8?q?=F0=9F=9A=A2=20(#2858)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/overview/roadmap.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index 1c90916fb5..59505aa915 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -66,12 +66,6 @@ guidelines to get started. The platform APIs and features are stable and can be depended on for production use. After this plugins will require little to no maintenance. -- **Backstage Design System** - By providing design guidelines for common plugin - layouts together, rich set of reusable UI components - ([Storybook](https://backstage.io/storybook)) and Figma design resources. The - Design System will make it easy to design and build plugins that are - consistent across the platform -- supporting both developers and designers. - - Further improvements to platform documentation ### Plugins @@ -115,6 +109,7 @@ Chances are that someone will jump in and help build it. ### Completed milestones ✅ +- [Backstage Design System 💅](https://backstage.io/blog/2020/09/30/backstage-design-system) - [Cost Insights plugin 💸](https://engineering.atspotify.com/2020/09/29/managing-clouds-from-the-ground-up-cost-engineering-at-spotify/) - [Donate Backstage to the CNCF 🎉](https://backstage.io/blog/2020/09/23/backstage-cncf-sandbox) - [TechDocs v1](https://backstage.io/blog/2020/09/08/announcing-tech-docs) From 83d3f59b8cd18e8c3283b1dcb63673f3aa6d90e8 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Mon, 12 Oct 2020 18:33:56 +0200 Subject: [PATCH 43/55] Improve main CI build status badge in README (#2866) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49fd52e73d..70badd5321 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![CNCF Status](https://img.shields.io/badge/cncf%20status-sandbox-blue.svg)](https://www.cncf.io/projects) -![](https://github.com/spotify/backstage/workflows/Frontend%20CI/badge.svg) +[![Main CI Build](https://github.com/spotify/backstage/workflows/Main%20Master%20Build/badge.svg)](https://github.com/spotify/backstage/actions?query=workflow%3A%22Main+Master+Build%22) [![Discord](https://img.shields.io/discord/687207715902193673)](https://discord.gg/EBHEGzX) ![Code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg) [![Codecov](https://img.shields.io/codecov/c/github/spotify/backstage)](https://codecov.io/gh/spotify/backstage) From 08c392815bfb7c1b6238f1d8d72da7dda4107ae4 Mon Sep 17 00:00:00 2001 From: Mateusz Lewtak <36006588+lewtakm@users.noreply.github.com> Date: Mon, 12 Oct 2020 18:42:30 +0200 Subject: [PATCH 44/55] Add Code Insights plugin to sample app and marketplace (#2833) * feat - add code insights plugin to sample app and plugin to marketplace * feat - update plugin package version * Update code-insights.yaml Add an empty lane on the end of the file. * Update plugins.ts Add an empty lane at the end of the file after conflicts resolve. * Update code-insights.yaml * Update code-insights.yaml * Update code-insights.yaml * feat: update sample app with github insight plugin * Update github-insights.yaml * Update EntityPage.tsx --- microsite/data/plugins/github-insights.yaml | 9 ++++++ packages/app/package.json | 1 + .../app/src/components/catalog/EntityPage.tsx | 28 +++++++++++++++++++ packages/app/src/plugins.ts | 1 + yarn.lock | 20 ++++++++++++- 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 microsite/data/plugins/github-insights.yaml diff --git a/microsite/data/plugins/github-insights.yaml b/microsite/data/plugins/github-insights.yaml new file mode 100644 index 0000000000..8ac8321da0 --- /dev/null +++ b/microsite/data/plugins/github-insights.yaml @@ -0,0 +1,9 @@ +--- +title: GitHub Insights +author: roadie.io +authorUrl: https://roadie.io +category: Monitoring +description: View GitHub Insights for your components in Backstage. +documentation: https://roadie.io/backstage/plugins/github-insights +iconUrl: https://roadie.io/static/2ad5123c425908efde0c922d707e737b/06c84/code-icon.png +npmPackageName: '@roadiehq/backstage-plugin-github-insights' diff --git a/packages/app/package.json b/packages/app/package.json index a3b150cef6..01481bea29 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -36,6 +36,7 @@ "@octokit/rest": "^18.0.0", "@roadiehq/backstage-plugin-github-pull-requests": "^0.4.3", "@roadiehq/backstage-plugin-travis-ci": "^0.2.3", + "@roadiehq/backstage-plugin-github-insights": "^0.2.2", "dayjs": "^1.9.1", "history": "^5.0.0", "prop-types": "^15.7.2", diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx index 393ffe2631..16c105ca0b 100644 --- a/packages/app/src/components/catalog/EntityPage.tsx +++ b/packages/app/src/components/catalog/EntityPage.tsx @@ -40,6 +40,13 @@ import { Router as ApiDocsRouter } from '@backstage/plugin-api-docs'; import { Router as SentryRouter } from '@backstage/plugin-sentry'; import { EmbeddedDocsRouter as DocsRouter } from '@backstage/plugin-techdocs'; import { Router as KubernetesRouter } from '@backstage/plugin-kubernetes'; +import { + Router as GitHubInsightsRouter, + isPluginApplicableToEntity as isGitHubAvailable, + ReadMeCard, + LanguagesCard, + ReleasesCard, +} from '@roadiehq/backstage-plugin-github-insights'; import React, { ReactNode } from 'react'; import { AboutCard, @@ -120,6 +127,17 @@ const OverviewContent = ({ entity }: { entity: Entity }) => ( + {isGitHubAvailable(entity) && ( + <> + + + + + + + + + )} {isLighthouseAvailable(entity) && ( @@ -160,6 +178,11 @@ const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( title="Kubernetes" element={} /> + } + /> ); @@ -195,6 +218,11 @@ const WebsiteEntityPage = ({ entity }: { entity: Entity }) => ( title="Kubernetes" element={} /> + } + /> ); const DefaultEntityPage = ({ entity }: { entity: Entity }) => ( diff --git a/packages/app/src/plugins.ts b/packages/app/src/plugins.ts index 57dc8a3443..bdc3851318 100644 --- a/packages/app/src/plugins.ts +++ b/packages/app/src/plugins.ts @@ -36,4 +36,5 @@ export { plugin as GcpProjects } from '@backstage/plugin-gcp-projects'; export { plugin as Kubernetes } from '@backstage/plugin-kubernetes'; export { plugin as Cloudbuild } from '@backstage/plugin-cloudbuild'; export { plugin as CostInsights } from '@backstage/plugin-cost-insights'; +export { plugin as GitHubInsights } from '@roadiehq/backstage-plugin-github-insights'; export { plugin as UserSettings } from '@backstage/plugin-user-settings'; diff --git a/yarn.lock b/yarn.lock index 7dbc7f964a..4832a549b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3650,6 +3650,24 @@ resolved "https://registry.npmjs.org/@rjsf/material-ui/-/material-ui-2.3.0.tgz#a051eb4db2ad778e39933a31ba806f415dd3ba90" integrity sha512-v/xZ4Xk18ZgBARcCe99IDqdO97GU0UC784gG8PhGGFDdy5Rbdy7ixTjHkGYttkr43PB7SX6ttohNhkKSW4nATQ== +"@roadiehq/backstage-plugin-github-insights@^0.2.2": + version "0.2.2" + resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-insights/-/backstage-plugin-github-insights-0.2.2.tgz#1647aec22f1f8bc40268f075ae307abf660ae75c" + integrity sha512-m4j1kUmoj+ZCRyaisXVBkLW9kaI/OGMq8xzthm4adOb12mS0s2p2P9AMa4T+bRyLgHpQ0vB75qhw4p6sHJAvWA== + dependencies: + "@backstage/catalog-model" "^0.1.1-alpha.24" + "@backstage/core" "^0.1.1-alpha.24" + "@backstage/theme" "^0.1.1-alpha.24" + "@material-ui/core" "^4.11.0" + "@material-ui/icons" "^4.9.1" + "@material-ui/lab" "4.0.0-alpha.45" + history "^5.0.0" + react "^16.13.1" + react-dom "^16.13.1" + react-markdown "^4.3.1" + react-router "^6.0.0-beta.0" + react-use "^15.3.3" + "@roadiehq/backstage-plugin-github-pull-requests@^0.4.3": version "0.4.3" resolved "https://registry.npmjs.org/@roadiehq/backstage-plugin-github-pull-requests/-/backstage-plugin-github-pull-requests-0.4.3.tgz#720fd3c53ae8e61d8cfc727cda47e236af442b02" @@ -19374,7 +19392,7 @@ react-router@5.2.0: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" -react-router@6.0.0-beta.0: +react-router@6.0.0-beta.0, react-router@^6.0.0-beta.0: version "6.0.0-beta.0" resolved "https://registry.npmjs.org/react-router/-/react-router-6.0.0-beta.0.tgz#3e11f39b6ded4412c2fed9e4f989dd4c8156724d" integrity sha512-VgMdfpVcmFQki/LZuLh8E/MNACekDetz4xqft+a6fBZvvJnVqKbLqebF7hyoawGrV1HcO5tVaUang2Og4W2j1Q== From 0b2a13b5c9ef12b51f91b03253e9f9288546ce67 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 12 Oct 2020 22:19:50 +0200 Subject: [PATCH 45/55] chore(cli): backend plugins should have the backend suffix --- packages/cli/src/commands/create-plugin/createPlugin.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/create-plugin/createPlugin.ts b/packages/cli/src/commands/create-plugin/createPlugin.ts index cbaf956bdb..491e399b1f 100644 --- a/packages/cli/src/commands/create-plugin/createPlugin.ts +++ b/packages/cli/src/commands/create-plugin/createPlugin.ts @@ -224,9 +224,12 @@ export default async (cmd: Command) => { } const answers: Answers = await inquirer.prompt(questions); - const name = cmd.scope + const pluginName = cmd.scope ? `@${cmd.scope.replace(/^@/, '')}/plugin-${answers.id}` : `plugin-${answers.id}`; + + const name = cmd.backend ? `${pluginName}-backend` : pluginName; + const npmRegistry = cmd.npmRegistry && cmd.scope ? cmd.npmRegistry : ''; const privatePackage = cmd.private === false ? false : true; const isMonoRepo = await fs.pathExists(paths.resolveTargetRoot('lerna.json')); From a8a4f4138035d4e141b9adeee9ca30ac6772a6fe Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 12 Oct 2020 22:27:21 +0200 Subject: [PATCH 46/55] chore(cli): folder name etc should have the suffix too --- .../commands/create-plugin/createPlugin.ts | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/cli/src/commands/create-plugin/createPlugin.ts b/packages/cli/src/commands/create-plugin/createPlugin.ts index 491e399b1f..057e36ceb9 100644 --- a/packages/cli/src/commands/create-plugin/createPlugin.ts +++ b/packages/cli/src/commands/create-plugin/createPlugin.ts @@ -224,12 +224,11 @@ export default async (cmd: Command) => { } const answers: Answers = await inquirer.prompt(questions); - const pluginName = cmd.scope - ? `@${cmd.scope.replace(/^@/, '')}/plugin-${answers.id}` - : `plugin-${answers.id}`; - - const name = cmd.backend ? `${pluginName}-backend` : pluginName; + const pluginId = cmd.backend ? `${answers.id}-backend` : answers.id; + const name = cmd.scope + ? `@${cmd.scope.replace(/^@/, '')}/plugin-${pluginId}` + : `plugin-${pluginId}`; const npmRegistry = cmd.npmRegistry && cmd.scope ? cmd.npmRegistry : ''; const privatePackage = cmd.private === false ? false : true; const isMonoRepo = await fs.pathExists(paths.resolveTargetRoot('lerna.json')); @@ -239,10 +238,10 @@ export default async (cmd: Command) => { ? 'templates/default-backend-plugin' : 'templates/default-plugin', ); - const tempDir = resolvePath(os.tmpdir(), answers.id); + const tempDir = resolvePath(os.tmpdir(), pluginId); const pluginDir = isMonoRepo - ? paths.resolveTargetRoot('plugins', answers.id) - : paths.resolveTargetRoot(answers.id); + ? paths.resolveTargetRoot('plugins', pluginId) + : paths.resolveTargetRoot(pluginId); const ownerIds = parseOwnerIds(answers.owner); const { version } = isMonoRepo ? await fs.readJson(paths.resolveTargetRoot('lerna.json')) @@ -270,7 +269,7 @@ export default async (cmd: Command) => { }); Task.section('Moving to final location'); - await movePlugin(tempDir, pluginDir, answers.id); + await movePlugin(tempDir, pluginDir, pluginId); Task.section('Building the plugin'); await buildPlugin(pluginDir); @@ -280,13 +279,13 @@ export default async (cmd: Command) => { await addPluginDependencyToApp(paths.targetRoot, name, version); Task.section('Import plugin in app'); - await addPluginToApp(paths.targetRoot, answers.id, name); + await addPluginToApp(paths.targetRoot, pluginId, name); } if (ownerIds && ownerIds.length) { await addCodeownersEntry( codeownersPath!, - `/plugins/${answers.id}`, + `/plugins/${pluginId}`, ownerIds, ); } From 46960a61ec8861ce821f2d0c01276fc6846cda4b Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 12 Oct 2020 22:42:54 +0200 Subject: [PATCH 47/55] v0.1.1-alpha.25 --- lerna.json | 7 ++- packages/app/package.json | 58 ++++++++++++------------- packages/backend-common/package.json | 10 ++--- packages/backend/package.json | 32 +++++++------- packages/catalog-model/package.json | 6 +-- packages/cli-common/package.json | 2 +- packages/cli/package.json | 8 ++-- packages/config-loader/package.json | 4 +- packages/config/package.json | 2 +- packages/core-api/package.json | 10 ++--- packages/core/package.json | 12 ++--- packages/create-app/package.json | 4 +- packages/dev-utils/package.json | 10 ++--- packages/docgen/package.json | 2 +- packages/e2e-test/package.json | 4 +- packages/storybook/package.json | 4 +- packages/techdocs-cli/package.json | 4 +- packages/test-utils-core/package.json | 2 +- packages/test-utils/package.json | 10 ++--- packages/theme/package.json | 4 +- plugins/api-docs/package.json | 16 +++---- plugins/app-backend/package.json | 8 ++-- plugins/auth-backend/package.json | 10 ++--- plugins/catalog-backend/package.json | 10 ++--- plugins/catalog-graphql/package.json | 10 ++--- plugins/catalog/package.json | 18 ++++---- plugins/circleci/package.json | 14 +++--- plugins/cloudbuild/package.json | 14 +++--- plugins/cost-insights/package.json | 14 +++--- plugins/explore/package.json | 12 ++--- plugins/gcp-projects/package.json | 10 ++--- plugins/github-actions/package.json | 16 +++---- plugins/gitops-profiles/package.json | 10 ++--- plugins/graphiql/package.json | 12 ++--- plugins/graphql/package.json | 10 ++--- plugins/jenkins/package.json | 14 +++--- plugins/kubernetes-backend/package.json | 8 ++-- plugins/kubernetes/package.json | 18 ++++---- plugins/lighthouse/package.json | 24 +++++----- plugins/newrelic/package.json | 10 ++--- plugins/proxy-backend/package.json | 8 ++-- plugins/register-component/package.json | 14 +++--- plugins/rollbar-backend/package.json | 8 ++-- plugins/rollbar/package.json | 16 +++---- plugins/scaffolder-backend/package.json | 10 ++--- plugins/scaffolder/package.json | 16 +++---- plugins/sentry-backend/package.json | 6 +-- plugins/sentry/package.json | 12 ++--- plugins/tech-radar/package.json | 12 ++--- plugins/techdocs-backend/package.json | 10 ++--- plugins/techdocs/package.json | 18 ++++---- plugins/user-settings/package.json | 12 ++--- plugins/welcome/package.json | 10 ++--- 53 files changed, 304 insertions(+), 301 deletions(-) diff --git a/lerna.json b/lerna.json index 7d514abb97..8b25e8a883 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,9 @@ { - "packages": ["packages/*", "plugins/*"], + "packages": [ + "packages/*", + "plugins/*" + ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.1.1-alpha.24" + "version": "0.1.1-alpha.25" } diff --git a/packages/app/package.json b/packages/app/package.json index 01481bea29..15b5cbed6e 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,42 +1,42 @@ { "name": "example-app", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": true, "bundled": true, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-api-docs": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/plugin-circleci": "^0.1.1-alpha.24", - "@backstage/plugin-cloudbuild": "^0.1.1-alpha.24", - "@backstage/plugin-cost-insights": "^0.1.1-alpha.24", - "@backstage/plugin-explore": "^0.1.1-alpha.24", - "@backstage/plugin-gcp-projects": "^0.1.1-alpha.24", - "@backstage/plugin-github-actions": "^0.1.1-alpha.24", - "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.24", - "@backstage/plugin-graphiql": "^0.1.1-alpha.24", - "@backstage/plugin-jenkins": "^0.1.1-alpha.24", - "@backstage/plugin-kubernetes": "^0.1.1-alpha.24", - "@backstage/plugin-lighthouse": "^0.1.1-alpha.24", - "@backstage/plugin-newrelic": "^0.1.1-alpha.24", - "@backstage/plugin-register-component": "^0.1.1-alpha.24", - "@backstage/plugin-rollbar": "^0.1.1-alpha.24", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.24", - "@backstage/plugin-sentry": "^0.1.1-alpha.24", - "@backstage/plugin-tech-radar": "^0.1.1-alpha.24", - "@backstage/plugin-techdocs": "^0.1.1-alpha.24", - "@backstage/plugin-user-settings": "^0.1.1-alpha.24", - "@backstage/plugin-welcome": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-api-docs": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/plugin-circleci": "^0.1.1-alpha.25", + "@backstage/plugin-cloudbuild": "^0.1.1-alpha.25", + "@backstage/plugin-cost-insights": "^0.1.1-alpha.25", + "@backstage/plugin-explore": "^0.1.1-alpha.25", + "@backstage/plugin-gcp-projects": "^0.1.1-alpha.25", + "@backstage/plugin-github-actions": "^0.1.1-alpha.25", + "@backstage/plugin-gitops-profiles": "^0.1.1-alpha.25", + "@backstage/plugin-graphiql": "^0.1.1-alpha.25", + "@backstage/plugin-jenkins": "^0.1.1-alpha.25", + "@backstage/plugin-kubernetes": "^0.1.1-alpha.25", + "@backstage/plugin-lighthouse": "^0.1.1-alpha.25", + "@backstage/plugin-newrelic": "^0.1.1-alpha.25", + "@backstage/plugin-register-component": "^0.1.1-alpha.25", + "@backstage/plugin-rollbar": "^0.1.1-alpha.25", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.25", + "@backstage/plugin-sentry": "^0.1.1-alpha.25", + "@backstage/plugin-tech-radar": "^0.1.1-alpha.25", + "@backstage/plugin-techdocs": "^0.1.1-alpha.25", + "@backstage/plugin-user-settings": "^0.1.1-alpha.25", + "@backstage/plugin-welcome": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@octokit/rest": "^18.0.0", + "@roadiehq/backstage-plugin-github-insights": "^0.2.2", "@roadiehq/backstage-plugin-github-pull-requests": "^0.4.3", "@roadiehq/backstage-plugin-travis-ci": "^0.2.3", - "@roadiehq/backstage-plugin-github-insights": "^0.2.2", "dayjs": "^1.9.1", "history": "^5.0.0", "prop-types": "^15.7.2", diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index b012b5205b..249fa9e72c 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/config-loader": "^0.1.1-alpha.24", + "@backstage/cli-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/config-loader": "^0.1.1-alpha.25", "@types/cors": "^2.8.6", "@types/express": "^4.17.6", "compression": "^1.7.4", @@ -60,7 +60,7 @@ } }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/compression": "^1.7.0", "@types/http-errors": "^1.6.3", "@types/morgan": "^1.9.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index c3a912c93e..ef55b007a7 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "dist/index.cjs.js", "types": "src/index.ts", "private": true, @@ -18,24 +18,24 @@ "migrate:create": "knex migrate:make -x ts" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/plugin-app-backend": "^0.1.1-alpha.24", - "@backstage/plugin-auth-backend": "^0.1.1-alpha.24", - "@backstage/plugin-catalog-backend": "^0.1.1-alpha.24", - "@backstage/plugin-graphql-backend": "^0.1.1-alpha.24", - "@backstage/plugin-kubernetes-backend": "^0.1.1-alpha.24", - "@backstage/plugin-proxy-backend": "^0.1.1-alpha.24", - "@backstage/plugin-rollbar-backend": "^0.1.1-alpha.24", - "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.24", - "@backstage/plugin-sentry-backend": "^0.1.1-alpha.24", - "@backstage/plugin-techdocs-backend": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/plugin-app-backend": "^0.1.1-alpha.25", + "@backstage/plugin-auth-backend": "^0.1.1-alpha.25", + "@backstage/plugin-catalog-backend": "^0.1.1-alpha.25", + "@backstage/plugin-graphql-backend": "^0.1.1-alpha.25", + "@backstage/plugin-kubernetes-backend": "^0.1.1-alpha.25", + "@backstage/plugin-proxy-backend": "^0.1.1-alpha.25", + "@backstage/plugin-rollbar-backend": "^0.1.1-alpha.25", + "@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.25", + "@backstage/plugin-sentry-backend": "^0.1.1-alpha.25", + "@backstage/plugin-techdocs-backend": "^0.1.1-alpha.25", "@gitbeaker/node": "^23.5.0", "@octokit/rest": "^18.0.0", "azure-devops-node-api": "^10.1.1", "dockerode": "^3.2.0", - "example-app": "^0.1.1-alpha.24", + "example-app": "^0.1.1-alpha.25", "express": "^4.17.1", "express-promise-router": "^3.0.3", "knex": "^0.21.1", @@ -45,7 +45,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/dockerode": "^2.5.32", "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5", diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index 6a543f7f84..8fc4484d33 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/catalog-model", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/config": "^0.1.1-alpha.25", "@types/json-schema": "^7.0.5", "@types/yup": "^0.28.2", "json-schema": "^0.2.5", @@ -29,7 +29,7 @@ "yup": "^0.29.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "@types/jest": "^26.0.7", "@types/lodash": "^4.14.151", diff --git a/packages/cli-common/package.json b/packages/cli-common/package.json index abb4b5f9a1..d9492ef127 100644 --- a/packages/cli-common/package.json +++ b/packages/cli-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli-common", "description": "Common functionality used by cli, backend, and create-app", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "main": "src/index.ts", "types": "src/index.ts", diff --git a/packages/cli/package.json b/packages/cli/package.json index 9bbbe9f29a..5bd732f1d2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public" @@ -28,9 +28,9 @@ "backstage-cli": "bin/backstage-cli" }, "dependencies": { - "@backstage/cli-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/config-loader": "^0.1.1-alpha.24", + "@backstage/cli-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/config-loader": "^0.1.1-alpha.25", "@hot-loader/react-dom": "^16.13.0", "@lerna/package-graph": "^3.18.5", "@lerna/project": "^3.18.0", diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 6a17eba76c..0a95dc8c86 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config-loader", "description": "Config loading functionality used by Backstage backend, and CLI", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -30,7 +30,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/config": "^0.1.1-alpha.25", "fs-extra": "^9.0.0", "yaml": "^1.9.2", "yup": "^0.29.1" diff --git a/packages/config/package.json b/packages/config/package.json index d3695ebf33..589c87c15c 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config", "description": "Config API used by Backstage core, backend, and CLI", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", diff --git a/packages/core-api/package.json b/packages/core-api/package.json index c925471695..5859382c5c 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-api", "description": "Internal Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -29,8 +29,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@types/react": "^16.9", @@ -41,8 +41,8 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/test-utils-core": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/test-utils-core": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/packages/core/package.json b/packages/core/package.json index 4890552c99..4d70457f6c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core", "description": "Core API used by Backstage plugins and apps", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -29,9 +29,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/core-api": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/core-api": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -55,8 +55,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 4ff0baf4fb..44745a7a81 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "Create app package for Backstage", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public" @@ -27,7 +27,7 @@ "start": "nodemon --" }, "dependencies": { - "@backstage/cli-common": "^0.1.1-alpha.24", + "@backstage/cli-common": "^0.1.1-alpha.25", "chalk": "^4.0.0", "commander": "^6.1.0", "fs-extra": "^9.0.0", diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 05bab2f415..21793bda81 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/dev-utils", "description": "Utilities for developing Backstage plugins.", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/docgen/package.json b/packages/docgen/package.json index 99591f5869..61efc0bbd4 100644 --- a/packages/docgen/package.json +++ b/packages/docgen/package.json @@ -1,7 +1,7 @@ { "name": "docgen", "description": "Tool for generating API Documentation for itself", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": true, "homepage": "https://backstage.io", "repository": { diff --git a/packages/e2e-test/package.json b/packages/e2e-test/package.json index c746fc7dbc..8a0246d4db 100644 --- a/packages/e2e-test/package.json +++ b/packages/e2e-test/package.json @@ -1,7 +1,7 @@ { "name": "e2e-test", "description": "E2E test for verifying Backstage packages", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": true, "homepage": "https://backstage.io", "repository": { @@ -24,7 +24,7 @@ "e2e-test": "bin/e2e-test" }, "devDependencies": { - "@backstage/cli-common": "^0.1.1-alpha.24", + "@backstage/cli-common": "^0.1.1-alpha.25", "@types/fs-extra": "^9.0.1", "@types/node": "^13.7.2", "chalk": "^4.0.0", diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 4cfc21be59..b1e45a26b6 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -1,6 +1,6 @@ { "name": "storybook", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "description": "Storybook build for core package", "private": true, "scripts": { @@ -14,7 +14,7 @@ ] }, "dependencies": { - "@backstage/theme": "^0.1.1-alpha.24" + "@backstage/theme": "^0.1.1-alpha.25" }, "devDependencies": { "@storybook/addon-actions": "^6.0.21", diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 77940d8299..adce3dd101 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@techdocs/cli", "description": "CLI for running TechDocs locally.", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public" @@ -44,7 +44,7 @@ "ext": "ts" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "commander": "^6.1.0", "fs-extra": "^9.0.1", "http-proxy": "^1.18.1", diff --git a/packages/test-utils-core/package.json b/packages/test-utils-core/package.json index ffdcdc02fb..96d153d397 100644 --- a/packages/test-utils-core/package.json +++ b/packages/test-utils-core/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils-core", "description": "Utilities to test Backstage core", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index efe5cafaed..1b7d35a197 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/test-utils", "description": "Utilities to test Backstage plugins and apps.", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -29,10 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/core-api": "^0.1.1-alpha.24", - "@backstage/test-utils-core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/core-api": "^0.1.1-alpha.25", + "@backstage/test-utils-core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", diff --git a/packages/theme/package.json b/packages/theme/package.json index e9f3a346ce..95d0ee150b 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/theme", "description": "material-ui theme for use with Backstage.", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -31,7 +31,7 @@ "@material-ui/core": "^4.11.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24" + "@backstage/cli": "^0.1.1-alpha.25" }, "files": [ "dist" diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index a703b6afe5..b6764f6593 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-api-docs", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,10 +20,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@kyma-project/asyncapi-react": "^0.13.1", "@material-icons/font": "^1.0.2", "@material-ui/core": "^4.11.0", @@ -39,9 +39,9 @@ "swagger-ui-react": "^3.31.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index 98873f88c7..b402d9fa5b 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-app-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/config-loader": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/config-loader": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^3.0.3", @@ -30,7 +30,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/supertest": "^2.0.8", "msw": "^0.20.5", "supertest": "^4.0.2" diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index fca8fb7178..aff536d334 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "compression": "^1.7.4", "cookie-parser": "^1.4.5", @@ -51,7 +51,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/jwt-decode": "2.2.1", diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 3d14563524..718bb2964c 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@octokit/graphql": "^4.5.6", "@types/express": "^4.17.6", "@types/node-fetch": "^2.5.7", @@ -46,7 +46,7 @@ "yup": "^0.29.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/core-js": "^2.5.4", "@types/git-url-parse": "^9.0.0", "@types/ldapjs": "^1.0.9", diff --git a/plugins/catalog-graphql/package.json b/plugins/catalog-graphql/package.json index 0c18624e0f..73832bb8ef 100644 --- a/plugins/catalog-graphql/package.json +++ b/plugins/catalog-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-graphql", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@graphql-modules/core": "^0.7.17", "apollo-server": "^2.16.1", "graphql": "^15.3.0", @@ -32,7 +32,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@graphql-codegen/cli": "^1.17.7", "@graphql-codegen/typescript": "^1.17.7", "@graphql-codegen/typescript-resolvers": "^1.17.7", diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index ea270b6fe9..b29a93e69d 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,11 +21,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-scaffolder": "^0.1.1-alpha.24", - "@backstage/plugin-techdocs": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-scaffolder": "^0.1.1-alpha.25", + "@backstage/plugin-techdocs": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -41,9 +41,9 @@ "swr": "^0.3.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/react-hooks": "^3.3.0", diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json index 24dc8a40e1..64684b0f99 100644 --- a/plugins/circleci/package.json +++ b/plugins/circleci/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-circleci", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "postpack": "backstage-cli postpack" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -38,8 +38,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/cloudbuild/package.json b/plugins/cloudbuild/package.json index 1caac1ecc5..6c3ea2ff9a 100644 --- a/plugins/cloudbuild/package.json +++ b/plugins/cloudbuild/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-cloudbuild", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -40,8 +40,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json index 8609bc316f..68561fc041 100644 --- a/plugins/cost-insights/package.json +++ b/plugins/cost-insights/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-cost-insights", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -43,8 +43,8 @@ "recharts": "^1.8.5" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/explore/package.json b/plugins/explore/package.json index 5bd78ab088..feeaf31985 100644 --- a/plugins/explore/package.json +++ b/plugins/explore/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-explore", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -33,9 +33,9 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/gcp-projects/package.json b/plugins/gcp-projects/package.json index 18a957d701..8de69290e0 100644 --- a/plugins/gcp-projects/package.json +++ b/plugins/gcp-projects/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-gcp-projects", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -31,8 +31,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index a43e351d47..0a5a8c4b41 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-github-actions", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,11 +21,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/core-api": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/core-api": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -40,8 +40,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json index 7c63ea350c..5cfeb24077 100644 --- a/plugins/gitops-profiles/package.json +++ b/plugins/gitops-profiles/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-gitops-profiles", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json index 654c5ab378..749be5c96f 100644 --- a/plugins/graphiql/package.json +++ b/plugins/graphiql/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-graphiql", "description": "Backstage plugin for browsing GraphQL APIs", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "private": false, "publishConfig": { "access": "public", @@ -31,8 +31,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -43,9 +43,9 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/graphql/package.json b/plugins/graphql/package.json index edd3f2782e..645334f791 100644 --- a/plugins/graphql/package.json +++ b/plugins/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-graphql-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -19,9 +19,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/plugin-catalog-graphql": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/plugin-catalog-graphql": "^0.1.1-alpha.25", "@graphql-modules/core": "^0.7.17", "@types/express": "^4.17.6", "apollo-server": "^2.16.1", @@ -36,7 +36,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/supertest": "^2.0.8", "eslint-plugin-graphql": "^4.0.0", "msw": "^0.20.5", diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json index 186fdbcc33..d14b9ff297 100644 --- a/plugins/jenkins/package.json +++ b/plugins/jenkins/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-jenkins", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index a44199ec8b..1be8b7509b 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@kubernetes/client-node": "^0.12.1", "@types/express": "^4.17.6", "compression": "^1.7.4", @@ -37,7 +37,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "jest-fetch-mock": "^3.0.3", "supertest": "^4.0.2" }, diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 2adefebbd6..9a0e41689d 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-kubernetes", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,11 +20,11 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-kubernetes-backend": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-kubernetes-backend": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@kubernetes/client-node": "^0.12.1", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -35,9 +35,9 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json index 7446f09ed4..1cc177cba7 100644 --- a/plugins/lighthouse/package.json +++ b/plugins/lighthouse/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-lighthouse", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,27 +21,27 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/core-api": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/core-api": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", "@testing-library/react-hooks": "^3.4.2", + "@types/react": "^16.9", "react": "^16.13.1", "react-dom": "^16.13.1", "react-markdown": "^4.3.1", "react-router-dom": "6.0.0-beta.0", - "react-use": "^15.3.3", - "@types/react": "^16.9" + "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/newrelic/package.json b/plugins/newrelic/package.json index 603d01d62b..9ca33c8ad1 100644 --- a/plugins/newrelic/package.json +++ b/plugins/newrelic/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-newrelic", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -31,8 +31,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index 11f18287f0..e96faaec0f 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-proxy-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -19,8 +19,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "express": "^4.17.1", "express-promise-router": "^3.0.3", @@ -34,7 +34,7 @@ "yup": "^0.29.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/http-proxy-middleware": "^0.19.3", "@types/node-fetch": "^2.5.7", "@types/supertest": "^2.0.8", diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 9dbd598dee..464dd60a98 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-register-component", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/rollbar-backend/package.json b/plugins/rollbar-backend/package.json index cda105a73f..2e559a698f 100644 --- a/plugins/rollbar-backend/package.json +++ b/plugins/rollbar-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-rollbar-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "axios": "^0.20.0", "camelcase-keys": "^6.2.2", @@ -37,7 +37,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/supertest": "^2.0.8", "jest-fetch-mock": "^3.0.3", "supertest": "^4.0.2" diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json index ba690fde64..2289096ce7 100644 --- a/plugins/rollbar/package.json +++ b/plugins/rollbar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-rollbar", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -37,9 +37,9 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/react-hooks": "^3.3.0", diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index b146609d8d..66d6457333 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@gitbeaker/core": "^23.5.0", "@gitbeaker/node": "^23.5.0", "@octokit/rest": "^18.0.0", @@ -47,7 +47,7 @@ "yaml": "^1.10.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@octokit/types": "^5.4.1", "@types/fs-extra": "^9.0.1", "@types/git-url-parse": "^9.0.0", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index 1e59019ad7..fe6f54593d 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-scaffolder", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,10 +21,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -41,9 +41,9 @@ "swr": "^0.3.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/sentry-backend/package.json b/plugins/sentry-backend/package.json index c52f7176e3..9e69e58507 100644 --- a/plugins/sentry-backend/package.json +++ b/plugins/sentry-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", "@types/express": "^4.17.6", "axios": "^0.20.0", "compression": "^1.7.4", @@ -34,7 +34,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "jest-fetch-mock": "^3.0.3" }, "files": [ diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json index 6972b87823..a926c6b4db 100644 --- a/plugins/sentry/package.json +++ b/plugins/sentry/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-sentry", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,9 +21,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -36,8 +36,8 @@ "timeago.js": "^4.0.2" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json index d6067ba3e2..21b4c50bfd 100644 --- a/plugins/tech-radar/package.json +++ b/plugins/tech-radar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-tech-radar", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,9 +21,9 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -35,8 +35,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index a9b6621a20..dd602f766f 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs-backend", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -20,9 +20,9 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/backend-common": "^0.1.1-alpha.24", - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/config": "^0.1.1-alpha.24", + "@backstage/backend-common": "^0.1.1-alpha.25", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/config": "^0.1.1-alpha.25", "@types/dockerode": "^2.5.34", "@types/express": "^4.17.6", "command-exists-promise": "^2.0.2", @@ -38,7 +38,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", "@types/node-fetch": "^2.5.7", "supertest": "^4.0.2" }, diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 27b0b0b881..99742d2661 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-techdocs", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,12 +22,12 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/catalog-model": "^0.1.1-alpha.24", - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/core-api": "^0.1.1-alpha.24", - "@backstage/plugin-catalog": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/catalog-model": "^0.1.1-alpha.25", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/core-api": "^0.1.1-alpha.25", + "@backstage/plugin-catalog": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -40,8 +40,8 @@ "sanitize-html": "^1.27.0" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json index 29f86c774b..029ff99222 100644 --- a/plugins/user-settings/package.json +++ b/plugins/user-settings/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-user-settings", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -21,8 +21,8 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,9 +32,9 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", - "@backstage/test-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", + "@backstage/test-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", diff --git a/plugins/welcome/package.json b/plugins/welcome/package.json index 80f930bbc2..4a23e5ee86 100644 --- a/plugins/welcome/package.json +++ b/plugins/welcome/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-welcome", - "version": "0.1.1-alpha.24", + "version": "0.1.1-alpha.25", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -21,8 +21,8 @@ "start": "backstage-cli plugin:serve" }, "dependencies": { - "@backstage/core": "^0.1.1-alpha.24", - "@backstage/theme": "^0.1.1-alpha.24", + "@backstage/core": "^0.1.1-alpha.25", + "@backstage/theme": "^0.1.1-alpha.25", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", @@ -32,8 +32,8 @@ "react-use": "^15.3.3" }, "devDependencies": { - "@backstage/cli": "^0.1.1-alpha.24", - "@backstage/dev-utils": "^0.1.1-alpha.24", + "@backstage/cli": "^0.1.1-alpha.25", + "@backstage/dev-utils": "^0.1.1-alpha.25", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^10.4.1", "@testing-library/user-event": "^12.0.7", From bd3864385b3085c02d47094d40fdd0c986068bd1 Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 12 Oct 2020 22:51:17 +0200 Subject: [PATCH 48/55] chore(e2e): fix the e2e test --- packages/e2e-test/src/commands/run.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index 2a0f641014..7111ff1867 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -56,7 +56,7 @@ export async function run() { const pluginName = await createPlugin('test-plugin', appDir); print('Creating a Backstage Backend Plugin'); - await createPlugin('test-backend-plugin', appDir, ['--backend']); + await createPlugin('test-plugin', appDir, ['--backend']); print('Starting the app'); await testAppServe(pluginName, appDir); @@ -265,13 +265,16 @@ async function createPlugin( print('Waiting for plugin create script to be done'); await waitForExit(child); - const pluginDir = resolvePath(appDir, 'plugins', pluginName); + const canonicalName = options.includes('--backend') + ? `${pluginName}-backend}` + : pluginName; + const pluginDir = resolvePath(appDir, 'plugins', canonicalName); for (const cmd of [['tsc'], ['lint'], ['test', '--no-watch']]) { print(`Running 'yarn ${cmd.join(' ')}' in newly created plugin`); await runPlain(['yarn', ...cmd], { cwd: pluginDir }); } - return pluginName; + return canonicalName; } finally { child.kill(); } From 113f5d10c201a5626bdeefb2929107ff737d9c4d Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 12 Oct 2020 22:52:20 +0200 Subject: [PATCH 49/55] chore: fix lerna linting --- lerna.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index 8b25e8a883..f804c800de 100644 --- a/lerna.json +++ b/lerna.json @@ -1,8 +1,5 @@ { - "packages": [ - "packages/*", - "plugins/*" - ], + "packages": ["packages/*", "plugins/*"], "npmClient": "yarn", "useWorkspaces": true, "version": "0.1.1-alpha.25" From b7d15b4f1ac20a7c0abab11de272a7846b20fc03 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 13 Oct 2020 03:02:58 +0200 Subject: [PATCH 50/55] chore(cli): remove superfluous bracket that was causing all the things --- packages/e2e-test/src/commands/run.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index 7111ff1867..cfe0ad9685 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -266,9 +266,11 @@ async function createPlugin( await waitForExit(child); const canonicalName = options.includes('--backend') - ? `${pluginName}-backend}` + ? `${pluginName}-backend` : pluginName; + const pluginDir = resolvePath(appDir, 'plugins', canonicalName); + for (const cmd of [['tsc'], ['lint'], ['test', '--no-watch']]) { print(`Running 'yarn ${cmd.join(' ')}' in newly created plugin`); await runPlain(['yarn', ...cmd], { cwd: pluginDir }); From a0a3e6d6cacdeb2218065c6bacf6be1485bff175 Mon Sep 17 00:00:00 2001 From: J Shamsul Bahri Date: Tue, 13 Oct 2020 12:49:16 +0800 Subject: [PATCH 51/55] Fix: SAML provider postMessageResponse localhost (#2870) * make saml provider path from globalConfig * fix:(auth-backend/saml) change hardcoded localhost Co-authored-by: JShamsul --- plugins/auth-backend/src/providers/saml/provider.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/auth-backend/src/providers/saml/provider.ts b/plugins/auth-backend/src/providers/saml/provider.ts index 59e46a86d7..a8edc9a714 100644 --- a/plugins/auth-backend/src/providers/saml/provider.ts +++ b/plugins/auth-backend/src/providers/saml/provider.ts @@ -41,8 +41,10 @@ type SamlInfo = { export class SamlAuthProvider implements AuthProviderRouteHandlers { private readonly strategy: SamlStrategy; private readonly tokenIssuer: TokenIssuer; + private readonly appUrl: string; constructor(options: SAMLProviderOptions) { + this.appUrl = options.appUrl; this.tokenIssuer = options.tokenIssuer; this.strategy = new SamlStrategy({ ...options }, (( profile: SamlProfile, @@ -82,7 +84,7 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { claims: { sub: id }, }); - return postMessageResponse(res, 'http://localhost:3000', { + return postMessageResponse(res, this.appUrl, { type: 'authorization_response', response: { providerInfo: {}, @@ -91,7 +93,7 @@ export class SamlAuthProvider implements AuthProviderRouteHandlers { }, }); } catch (error) { - return postMessageResponse(res, 'http://localhost:3000', { + return postMessageResponse(res, this.appUrl, { type: 'authorization_response', error: { name: error.name, @@ -115,6 +117,7 @@ type SAMLProviderOptions = { issuer: string; path: string; tokenIssuer: TokenIssuer; + appUrl: string; }; export const createSamlProvider: AuthProviderFactory = ({ @@ -131,6 +134,7 @@ export const createSamlProvider: AuthProviderFactory = ({ issuer, path: `${url.pathname}/${providerId}/handler/frame`, tokenIssuer, + appUrl: globalConfig.appUrl, }; return new SamlAuthProvider(opts); From 321da5aff61051e080b90d90d9751006948afe0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2020 06:52:44 +0200 Subject: [PATCH 52/55] chore(deps): bump @testing-library/jest-dom from 5.10.1 to 5.11.4 (#2792) Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.10.1 to 5.11.4. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/master/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v5.10.1...v5.11.4) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4832a549b8..c0630e742b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4545,17 +4545,16 @@ pretty-format "^26.4.2" "@testing-library/jest-dom@^5.10.1": - version "5.10.1" - resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.10.1.tgz#6508a9f007bd74e5d3c0b3135b668027ab663989" - integrity sha512-uv9lLAnEFRzwUTN/y9lVVXVXlEzazDkelJtM5u92PsGkEasmdI+sfzhZHxSDzlhZVTrlLfuMh2safMr8YmzXLg== + version "5.11.4" + resolved "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.11.4.tgz#f325c600db352afb92995c2576022b35621ddc99" + integrity sha512-6RRn3epuweBODDIv3dAlWjOEHQLpGJHB2i912VS3JQtsD22+ENInhdDNl4ZZQiViLlIfFinkSET/J736ytV9sw== dependencies: "@babel/runtime" "^7.9.2" "@types/testing-library__jest-dom" "^5.9.1" + aria-query "^4.2.2" chalk "^3.0.0" - css "^2.2.4" + css "^3.0.0" css.escape "^1.5.1" - jest-diff "^25.1.0" - jest-matcher-utils "^25.1.0" lodash "^4.17.15" redent "^3.0.0" @@ -9227,15 +9226,14 @@ css.escape@1.5.1, css.escape@^1.5.1: resolved "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb" integrity sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s= -css@^2.2.4: - version "2.2.4" - resolved "https://registry.npmjs.org/css/-/css-2.2.4.tgz#c646755c73971f2bba6a601e2cf2fd71b1298929" - integrity sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw== +css@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" + integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== dependencies: - inherits "^2.0.3" + inherits "^2.0.4" source-map "^0.6.1" - source-map-resolve "^0.5.2" - urix "^0.1.0" + source-map-resolve "^0.6.0" cssesc@^3.0.0: version "3.0.0" @@ -14121,7 +14119,7 @@ jest-css-modules@^2.1.0: dependencies: identity-obj-proxy "3.0.0" -jest-diff@^25.1.0, jest-diff@^25.2.1: +jest-diff@^25.2.1: version "25.5.0" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9" integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A== @@ -14200,7 +14198,7 @@ jest-fetch-mock@^3.0.3: cross-fetch "^3.0.4" promise-polyfill "^8.1.3" -jest-get-type@^25.1.0, jest-get-type@^25.2.6: +jest-get-type@^25.2.6: version "25.2.6" resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz#0b0a32fab8908b44d508be81681487dbabb8d877" integrity sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig== @@ -14263,16 +14261,6 @@ jest-leak-detector@^26.5.2: jest-get-type "^26.3.0" pretty-format "^26.5.2" -jest-matcher-utils@^25.1.0: - version "25.1.0" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.1.0.tgz#fa5996c45c7193a3c24e73066fc14acdee020220" - integrity sha512-KGOAFcSFbclXIFE7bS4C53iYobKI20ZWleAdAFun4W1Wz1Kkej8Ng6RRbhL8leaEvIOjGXhGf/a1JjO8bkxIWQ== - dependencies: - chalk "^3.0.0" - jest-diff "^25.1.0" - jest-get-type "^25.1.0" - pretty-format "^25.1.0" - jest-matcher-utils@^26.5.2: version "26.5.2" resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.5.2.tgz#6aa2c76ce8b9c33e66f8856ff3a52bab59e6c85a" @@ -18557,7 +18545,7 @@ pretty-error@^2.1.1: renderkid "^2.0.1" utila "~0.4" -pretty-format@^25.1.0, pretty-format@^25.2.1, pretty-format@^25.5.0: +pretty-format@^25.2.1, pretty-format@^25.5.0: version "25.5.0" resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a" integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ== @@ -21036,7 +21024,7 @@ source-list-map@^2.0.0: resolved "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: +source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== @@ -21047,6 +21035,14 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" +source-map-resolve@^0.6.0: + version "0.6.0" + resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" + integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.19" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" From b041aab8adea2e199564011cdb0f445a0a614479 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Tue, 13 Oct 2020 09:07:14 +0200 Subject: [PATCH 53/55] [TechDocs] Remove all git preparers and use a commonGit preparer instead (#2856) * Remove all git preparers and use a commonGit preparer instead * Added more tests * Updated default-app template --- packages/backend/src/plugins/techdocs.ts | 15 ++--- .../packages/backend/src/plugins/techdocs.ts | 7 +- .../src/techdocs/stages/prepare/azure.test.ts | 63 ------------------ .../src/techdocs/stages/prepare/azure.ts | 55 ---------------- .../{github.test.ts => commonGit.test.ts} | 36 ++++++++++- .../prepare/{gitlab.ts => commonGit.ts} | 9 +-- .../src/techdocs/stages/prepare/github.ts | 55 ---------------- .../techdocs/stages/prepare/gitlab.test.ts | 64 ------------------- .../src/techdocs/stages/prepare/index.ts | 4 +- 9 files changed, 46 insertions(+), 262 deletions(-) delete mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/azure.test.ts delete mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/azure.ts rename plugins/techdocs-backend/src/techdocs/stages/prepare/{github.test.ts => commonGit.test.ts} (59%) rename plugins/techdocs-backend/src/techdocs/stages/prepare/{gitlab.ts => commonGit.ts} (83%) delete mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/github.ts delete mode 100644 plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.test.ts diff --git a/packages/backend/src/plugins/techdocs.ts b/packages/backend/src/plugins/techdocs.ts index 6e36c26f39..dea31c763b 100644 --- a/packages/backend/src/plugins/techdocs.ts +++ b/packages/backend/src/plugins/techdocs.ts @@ -21,9 +21,7 @@ import { Generators, LocalPublish, TechdocsGenerator, - GithubPreparer, - GitlabPreparer, - AzurePreparer, + CommonGitPreparer, } from '@backstage/plugin-techdocs-backend'; import { PluginEnvironment } from '../types'; import Docker from 'dockerode'; @@ -38,14 +36,13 @@ export default async function createPlugin({ generators.register('techdocs', techdocsGenerator); const preparers = new Preparers(); - const githubPreparer = new GithubPreparer(logger); - const gitlabPreparer = new GitlabPreparer(logger); - const azurePreparer = new AzurePreparer(logger); + const commonGitPreparer = new CommonGitPreparer(logger); + const directoryPreparer = new DirectoryPreparer(logger); preparers.register('dir', directoryPreparer); - preparers.register('github', githubPreparer); - preparers.register('gitlab', gitlabPreparer); - preparers.register('azure/api', azurePreparer); + preparers.register('github', commonGitPreparer); + preparers.register('gitlab', commonGitPreparer); + preparers.register('azure/api', commonGitPreparer); const publisher = new LocalPublish(logger); diff --git a/packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts b/packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts index b522992a75..5506228962 100644 --- a/packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts +++ b/packages/create-app/templates/default-app/packages/backend/src/plugins/techdocs.ts @@ -1,7 +1,7 @@ import { createRouter, DirectoryPreparer, - GithubPreparer, + CommonGitPreparer, Preparers, Generators, LocalPublish, @@ -22,10 +22,11 @@ export default async function createPlugin({ const preparers = new Preparers(); const directoryPreparer = new DirectoryPreparer(logger); - const githubPreparer = new GithubPreparer(logger); + const commonGitPreparer = new CommonGitPreparer(logger); preparers.register('dir', directoryPreparer); - preparers.register('github', githubPreparer); + preparers.register('github', commonGitPreparer); + preparers.register('gitlab', commonGitPreparer); const publisher = new LocalPublish(logger); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.test.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.test.ts deleted file mode 100644 index 39a3d5c7fa..0000000000 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.test.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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 { AzurePreparer } from './azure'; -import { checkoutGitRepository } from '../../../helpers'; - -function normalizePath(path: string) { - return path - .replace(/^[a-z]:/i, '') - .split('\\') - .join('/'); -} - -jest.mock('../../../helpers', () => ({ - ...jest.requireActual<{}>('../../../helpers'), - checkoutGitRepository: jest.fn(() => '/tmp/backstage-repo/org/name/branch'), -})); - -const createMockEntity = (annotations = {}) => { - return { - apiVersion: 'version', - kind: 'TestKind', - metadata: { - name: 'test-component-name', - annotations: { - ...annotations, - }, - }, - }; -}; - -const logger = getVoidLogger(); - -describe('Azure DevOps preparer', () => { - it('should prepare temp docs path from Azure DevOps repo', async () => { - const preparer = new AzurePreparer(logger); - - const mockEntity = createMockEntity({ - 'backstage.io/techdocs-ref': - 'azure/api:https://dev.azure.com/backstage-org/backstage-project/_git/template-repo?path=%2Ftemplate.yaml', - }); - - const tempDocsPath = await preparer.prepare(mockEntity); - expect(checkoutGitRepository).toHaveBeenCalledTimes(1); - expect(normalizePath(tempDocsPath)).toEqual( - '/tmp/backstage-repo/org/name/branch/template.yaml', - ); - }); -}); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.ts deleted file mode 100644 index 18e6c3c755..0000000000 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/azure.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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 path from 'path'; -import { Entity } from '@backstage/catalog-model'; -import { InputError } from '@backstage/backend-common'; -import { PreparerBase } from './types'; -import parseGitUrl from 'git-url-parse'; -import { - parseReferenceAnnotation, - checkoutGitRepository, -} from '../../../helpers'; - -import { Logger } from 'winston'; - -export class AzurePreparer implements PreparerBase { - private readonly logger: Logger; - - constructor(logger: Logger) { - this.logger = logger; - } - - async prepare(entity: Entity): Promise { - const { type, target } = parseReferenceAnnotation( - 'backstage.io/techdocs-ref', - entity, - ); - - if (type !== 'azure/api') { - throw new InputError(`Wrong target type: ${type}, should be 'azure/api'`); - } - - try { - const repoPath = await checkoutGitRepository(target, this.logger); - const parsedGitLocation = parseGitUrl(target); - - return path.join(repoPath, parsedGitLocation.filepath); - } catch (error) { - this.logger.debug(`Repo checkout failed with error ${error.message}`); - throw error; - } - } -} diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/github.test.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.test.ts similarity index 59% rename from plugins/techdocs-backend/src/techdocs/stages/prepare/github.test.ts rename to plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.test.ts index a657cd1697..cec1110f97 100644 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/github.test.ts +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.test.ts @@ -15,7 +15,7 @@ */ import { getVoidLogger } from '@backstage/backend-common'; -import { GithubPreparer } from './github'; +import { CommonGitPreparer } from './commonGit'; import { checkoutGitRepository } from '../../../helpers'; function normalizePath(path: string) { @@ -45,9 +45,9 @@ const createMockEntity = (annotations = {}) => { const logger = getVoidLogger(); -describe('github preparer', () => { +describe('commonGit preparer', () => { it('should prepare temp docs path from github repo', async () => { - const preparer = new GithubPreparer(logger); + const preparer = new CommonGitPreparer(logger); const mockEntity = createMockEntity({ 'backstage.io/techdocs-ref': @@ -60,4 +60,34 @@ describe('github preparer', () => { '/tmp/backstage-repo/org/name/branch/plugins/techdocs-backend/examples/documented-component', ); }); + + it('should prepare temp docs path from gitlab repo', async () => { + const preparer = new CommonGitPreparer(logger); + + const mockEntity = createMockEntity({ + 'backstage.io/techdocs-ref': + 'gitlab:https://gitlab.com/xesjkeee/go-logger/blob/master/catalog-info.yaml', + }); + + const tempDocsPath = await preparer.prepare(mockEntity); + expect(checkoutGitRepository).toHaveBeenCalledTimes(2); + expect(normalizePath(tempDocsPath)).toEqual( + '/tmp/backstage-repo/org/name/branch/catalog-info.yaml', + ); + }); + + it('should prepare temp docs path from azure repo', async () => { + const preparer = new CommonGitPreparer(logger); + + const mockEntity = createMockEntity({ + 'backstage.io/techdocs-ref': + 'azure/api:https://dev.azure.com/backstage-org/backstage-project/_git/template-repo?path=%2Ftemplate.yaml', + }); + + const tempDocsPath = await preparer.prepare(mockEntity); + expect(checkoutGitRepository).toHaveBeenCalledTimes(3); + expect(normalizePath(tempDocsPath)).toEqual( + '/tmp/backstage-repo/org/name/branch/template.yaml', + ); + }); }); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.ts similarity index 83% rename from plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.ts rename to plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.ts index 56f3793fbb..d9ba96a031 100644 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.ts +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/commonGit.ts @@ -15,7 +15,6 @@ */ import path from 'path'; import { Entity } from '@backstage/catalog-model'; -import { InputError } from '@backstage/backend-common'; import { PreparerBase } from './types'; import parseGitUrl from 'git-url-parse'; import { @@ -25,7 +24,7 @@ import { import { Logger } from 'winston'; -export class GitlabPreparer implements PreparerBase { +export class CommonGitPreparer implements PreparerBase { private readonly logger: Logger; constructor(logger: Logger) { @@ -33,15 +32,11 @@ export class GitlabPreparer implements PreparerBase { } async prepare(entity: Entity): Promise { - const { type, target } = parseReferenceAnnotation( + const { target } = parseReferenceAnnotation( 'backstage.io/techdocs-ref', entity, ); - if (type !== 'gitlab') { - throw new InputError(`Wrong target type: ${type}, should be 'gitlab'`); - } - try { const repoPath = await checkoutGitRepository(target, this.logger); const parsedGitLocation = parseGitUrl(target); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/github.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/github.ts deleted file mode 100644 index a0f91a375a..0000000000 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/github.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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 path from 'path'; -import { Entity } from '@backstage/catalog-model'; -import { InputError } from '@backstage/backend-common'; -import { PreparerBase } from './types'; -import parseGitUrl from 'git-url-parse'; -import { - parseReferenceAnnotation, - checkoutGitRepository, -} from '../../../helpers'; - -import { Logger } from 'winston'; - -export class GithubPreparer implements PreparerBase { - private readonly logger: Logger; - - constructor(logger: Logger) { - this.logger = logger; - } - - async prepare(entity: Entity): Promise { - const { type, target } = parseReferenceAnnotation( - 'backstage.io/techdocs-ref', - entity, - ); - - if (type !== 'github') { - throw new InputError(`Wrong target type: ${type}, should be 'github'`); - } - - try { - const repoPath = await checkoutGitRepository(target, this.logger); - - const parsedGitLocation = parseGitUrl(target); - return path.join(repoPath, parsedGitLocation.filepath); - } catch (error) { - this.logger.debug(`Repo checkout failed with error ${error.message}`); - throw error; - } - } -} diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.test.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.test.ts deleted file mode 100644 index 75cad50224..0000000000 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/gitlab.test.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2020 Spotify AB - * - * 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 { GitlabPreparer } from './gitlab'; -import { checkoutGitRepository } from '../../../helpers'; - -function normalizePath(path: string) { - return path - .replace(/^[a-z]:/i, '') - .split('\\') - .join('/'); -} - -jest.mock('../../../helpers', () => ({ - ...jest.requireActual<{}>('../../../helpers'), - checkoutGitRepository: jest.fn(() => '/tmp/backstage-repo/org/name/branch'), -})); - -const createMockEntity = (annotations = {}) => { - return { - apiVersion: 'version', - kind: 'TestKind', - metadata: { - name: 'test-component-name', - annotations: { - ...annotations, - }, - }, - }; -}; - -const logger = getVoidLogger(); - -describe('gitlab preparer', () => { - it('should prepare temp docs path from gitlab repo', async () => { - const preparer = new GitlabPreparer(logger); - - // TODO: fix url repo - const mockEntity = createMockEntity({ - 'backstage.io/techdocs-ref': - 'gitlab:https://gitlab.com/xesjkeee/go-logger/blob/master/catalog-info.yaml', - }); - - const tempDocsPath = await preparer.prepare(mockEntity); - expect(checkoutGitRepository).toHaveBeenCalledTimes(1); - expect(normalizePath(tempDocsPath)).toEqual( - '/tmp/backstage-repo/org/name/branch/catalog-info.yaml', - ); - }); -}); diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts index 249854f7ee..46e1d84c69 100644 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/index.ts @@ -14,8 +14,6 @@ * limitations under the License. */ export { DirectoryPreparer } from './dir'; -export { GithubPreparer } from './github'; -export { GitlabPreparer } from './gitlab'; -export { AzurePreparer } from './azure'; +export { CommonGitPreparer } from './commonGit'; export { Preparers } from './preparers'; export type { PreparerBuilder, PreparerBase } from './types'; From 46b9ae82ba111a7f9ecfed0bcb419357ab413cc3 Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Tue, 13 Oct 2020 09:45:25 +0200 Subject: [PATCH 54/55] Add filters to API Explorer (#2830) * fix: support nested fields in table filter Add support for nested fields like metadata.name to the table filters. Previously only top-level fields were allowed. In addition, support for filtering on fields that are arrays is introduced (like tags). Filters are now distinct. * feat: introduce table filters to the api explorer * fix: allow to close select in multiple mode * fix: export TableFilter --- .../core/src/components/Select/Select.tsx | 48 ++++---- .../core/src/components/Table/Filters.tsx | 2 +- packages/core/src/components/Table/Table.tsx | 107 ++++++++++++++---- packages/core/src/components/Table/index.ts | 4 +- .../ApiExplorerPage/ApiExplorerPage.test.tsx | 2 +- .../ApiExplorerPage/ApiExplorerPage.tsx | 1 - .../ApiExplorerTable.test.tsx | 8 +- .../ApiExplorerTable/ApiExplorerTable.tsx | 27 ++++- 8 files changed, 133 insertions(+), 66 deletions(-) diff --git a/packages/core/src/components/Select/Select.tsx b/packages/core/src/components/Select/Select.tsx index a2efcc7725..1c691340b2 100644 --- a/packages/core/src/components/Select/Select.tsx +++ b/packages/core/src/components/Select/Select.tsx @@ -14,25 +14,23 @@ * limitations under the License. */ -import React, { useEffect, useState } from 'react'; +import { + Checkbox, + Chip, + ClickAwayListener, + FormControl, + InputBase, + MenuItem, + Select, + Typography, +} from '@material-ui/core'; import { createStyles, makeStyles, - withStyles, Theme, + withStyles, } from '@material-ui/core/styles'; - -import { - FormControl, - Select, - MenuItem, - InputBase, - Chip, - Typography, - Checkbox, - ClickAwayListener, -} from '@material-ui/core'; - +import React, { useEffect, useState } from 'react'; import ClosedDropdown from './static/ClosedDropdown'; import OpenedDropdown from './static/OpenedDropdown'; @@ -111,7 +109,7 @@ export const SelectComponent = (props: SelectProps) => { const [value, setValue] = useState( multiple ? [] : '', ); - const [canOpen, setCanOpen] = React.useState(false); + const [isOpen, setOpen] = useState(false); useEffect(() => { setValue(multiple ? [] : ''); @@ -122,19 +120,17 @@ export const SelectComponent = (props: SelectProps) => { onChange(event.target.value); }; - const selectHandleOnOpen = () => { - setCanOpen(previous => { - if (multiple) { + const handleClick = (event: React.ChangeEvent) => { + setOpen(previous => { + if (multiple && !(event.target instanceof HTMLElement)) { return true; } return !previous; }); }; - const handleClickAway = (event: React.ChangeEvent) => { - if (event.target.id !== 'menu-item') { - setCanOpen(false); - } + const handleClickAway = () => { + setOpen(false); }; const handleDelete = (selectedValue: string | number) => () => { @@ -154,8 +150,8 @@ export const SelectComponent = (props: SelectProps) => { displayEmpty multiple={multiple} onChange={handleChange} - onClick={selectHandleOnOpen} - open={canOpen} + onClick={handleClick} + open={isOpen} input={} renderValue={selected => multiple && (value as any[]).length !== 0 ? ( @@ -181,7 +177,7 @@ export const SelectComponent = (props: SelectProps) => { ) } IconComponent={() => - !canOpen ? : + !isOpen ? : } MenuProps={{ anchorOrigin: { @@ -200,7 +196,7 @@ export const SelectComponent = (props: SelectProps) => { )} {items && items.map(item => ( - + {multiple && ( (theme => ({ }, })); -type Without = Pick>; +export type Without = Pick>; export type Filter = { type: 'select' | 'checkbox-tree' | 'multiple-select'; diff --git a/packages/core/src/components/Table/Table.tsx b/packages/core/src/components/Table/Table.tsx index 5d0b7d8344..87ad50e58f 100644 --- a/packages/core/src/components/Table/Table.tsx +++ b/packages/core/src/components/Table/Table.tsx @@ -45,7 +45,9 @@ import MTable, { Options, } from 'material-table'; import React, { forwardRef, useCallback, useEffect, useState } from 'react'; -import { Filters, SelectedFilters } from './Filters'; +import { CheckboxTreeProps } from '../CheckboxTree/CheckboxTree'; +import { SelectProps } from '../Select/Select'; +import { Filter, Filters, SelectedFilters, Without } from './Filters'; const tableIcons = { Add: forwardRef((props, ref: React.Ref) => ( @@ -101,6 +103,23 @@ const tableIcons = { )), }; +// TODO: Material table might already have such a function internally that we can use? +function extractValueByField(data: any, field: string): any | undefined { + const path = field.split('.'); + let value = data[path[0]]; + + for (let i = 1; i < path.length; ++i) { + if (value === undefined) { + return value; + } + + const f = path[i]; + value = value[f]; + } + + return value; +} + const useHeaderStyles = makeStyles(theme => ({ header: { padding: theme.spacing(1, 2, 1, 2.5), @@ -234,11 +253,21 @@ export function Table({ el => !!Object.entries(selectedFilters) .filter(([, value]) => !!value.length) - .every(([key, value]) => { - if (Array.isArray(value)) { - return value.includes(el[getFieldByTitle(key)]); + .every(([key, filterValue]) => { + const fieldValue = extractValueByField( + el, + getFieldByTitle(key) as string, + ); + + if (Array.isArray(fieldValue) && Array.isArray(filterValue)) { + return fieldValue.some(v => filterValue.includes(v)); + } else if (Array.isArray(fieldValue)) { + return fieldValue.includes(filterValue); + } else if (Array.isArray(filterValue)) { + return filterValue.includes(fieldValue); } - return el[getFieldByTitle(key)] === value; + + return fieldValue === filterValue; }), ); setTableData(newData); @@ -248,29 +277,61 @@ export function Table({ setSelectedFiltersLength(selectedFiltersArray.flat().length); }, [data, selectedFilters, getFieldByTitle]); - const constructFilters = (filterConfig: TableFilter[], dataValue: any[]) => { - const extractColumnData = (column: string | keyof T) => - dataValue.map(el => ({ label: el[column], options: [] })); + const constructFilters = ( + filterConfig: TableFilter[], + dataValue: any[], + ): Filter[] => { + const extractDistinctValues = (field: string | keyof T): Set => { + const distinctValues = new Set(); + const addValue = (value: any) => { + if (value !== undefined && value !== null) { + distinctValues.add(value); + } + }; + + dataValue.forEach(el => { + const value = extractValueByField(el, getFieldByTitle(field) as string); + + if (Array.isArray(value)) { + (value as []).forEach(addValue); + } else { + addValue(value); + } + }); + + return distinctValues; + }; + + const constructCheckboxTree = ( + filter: TableFilter, + ): Without => ({ + label: filter.column, + subCategories: [...extractDistinctValues(filter.column)].map(v => ({ + label: v, + options: [], + })), + }); + + const constructSelect = ( + filter: TableFilter, + ): Without => { + return { + placeholder: 'All results', + label: filter.column, + multiple: filter.type === 'multiple-select', + items: [...extractDistinctValues(filter.column)].map(value => ({ + label: value, + value, + })), + }; + }; return filterConfig.map(filter => ({ type: filter.type, element: filter.type === 'checkbox-tree' - ? { - label: filter.column, - subCategories: extractColumnData( - getFieldByTitle(filter.column) || '', - ), - } - : { - placeholder: 'All results', - label: filter.column, - multiple: filter.type === 'multiple-select', - items: dataValue.map(el => ({ - label: el[getFieldByTitle(filter.column) || ''], - value: el[getFieldByTitle(filter.column) || ''], - })), - }, + ? constructCheckboxTree(filter) + : constructSelect(filter), })); }; diff --git a/packages/core/src/components/Table/index.ts b/packages/core/src/components/Table/index.ts index c10399dc59..9cb8478688 100644 --- a/packages/core/src/components/Table/index.ts +++ b/packages/core/src/components/Table/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ -export { Table } from './Table'; -export type { TableColumn, TableProps } from './Table'; export { SubvalueCell } from './SubvalueCell'; +export { Table } from './Table'; +export type { TableColumn, TableFilter, TableProps } from './Table'; diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx index e386f281e8..46cf014134 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.test.tsx @@ -72,6 +72,6 @@ describe('ApiCatalogPage', () => { // https://github.com/mbrn/material-table/issues/1293 it('should render', async () => { const { findByText } = renderWrapped(); - expect(await findByText(/APIs \(2\)/)).toBeInTheDocument(); + expect(await findByText(/Backstage API Explorer/)).toBeInTheDocument(); }); }); diff --git a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx index b6440edc3a..c6a8d62b58 100644 --- a/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx +++ b/plugins/api-docs/src/components/ApiExplorerPage/ApiExplorerPage.tsx @@ -44,7 +44,6 @@ export const ApiExplorerPage = () => { All your APIs { wrapInTestApp( { const rendered = render( wrapInTestApp( - + , ), ); - expect(rendered.getByText(/APIs \(3\)/)).toBeInTheDocument(); expect(rendered.getByText(/api1/)).toBeInTheDocument(); expect(rendered.getByText(/api2/)).toBeInTheDocument(); expect(rendered.getByText(/api3/)).toBeInTheDocument(); diff --git a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx index 485fcc216d..f3be9f664b 100644 --- a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx +++ b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx @@ -15,7 +15,7 @@ */ import { ApiEntityV1alpha1, Entity } from '@backstage/catalog-model'; -import { Table, TableColumn, useApi } from '@backstage/core'; +import { Table, TableFilter, TableColumn, useApi } from '@backstage/core'; import { Chip, Link } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; import React from 'react'; @@ -90,9 +90,27 @@ const columns: TableColumn[] = [ }, ]; +const filters: TableFilter[] = [ + { + column: 'Owner', + type: 'select', + }, + { + column: 'Type', + type: 'multiple-select', + }, + { + column: 'Lifecycle', + type: 'multiple-select', + }, + { + column: 'Tags', + type: 'checkbox-tree', + }, +]; + type ExplorerTableProps = { entities: Entity[]; - titlePreamble: string; loading: boolean; error?: any; }; @@ -101,7 +119,6 @@ export const ApiExplorerTable = ({ entities, loading, error, - titlePreamble, }: ExplorerTableProps) => { if (error) { return ( @@ -114,7 +131,7 @@ export const ApiExplorerTable = ({ } return ( - + ); }; From 9cc95aa90f3ff2957ef7a7c782ebca091cbd0f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 13 Oct 2020 17:12:19 +0200 Subject: [PATCH 55/55] fix(templates): add some jsonify to fix escaping issues --- .../{{cookiecutter.component_id}}/component-info.yaml | 8 ++++---- .../{{cookiecutter.component_id}}/mkdocs.yml | 6 +++--- .../{{cookiecutter.component_id}}/component-info.yaml | 8 ++++---- .../{{cookiecutter.component_id}}/mkdocs.yml | 4 ++-- .../{{cookiecutter.component_id}}/component-info.yaml | 8 ++++---- .../{{cookiecutter.component_id}}/mkdocs.yml | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/component-info.yaml b/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/component-info.yaml index 854b692fcf..e39350e928 100644 --- a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/component-info.yaml +++ b/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/component-info.yaml @@ -1,12 +1,12 @@ apiVersion: backstage.io/v1alpha1 kind: Component metadata: - name: {{cookiecutter.component_id}} - description: {{cookiecutter.description}} + name: {{cookiecutter.component_id | jsonify}} + description: {{cookiecutter.description | jsonify}} annotations: - github.com/project-slug: {{cookiecutter.storePath}} + github.com/project-slug: {{cookiecutter.storePath | jsonify}} backstage.io/techdocs-ref: github:https://github.com/{{cookiecutter.storePath}} spec: type: documentation lifecycle: experimental - owner: {{cookiecutter.owner}} + owner: {{cookiecutter.owner | jsonify}} diff --git a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml b/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml index 2126971502..64f1e9ee8e 100644 --- a/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml +++ b/plugins/scaffolder-backend/sample-templates/docs-template/{{cookiecutter.component_id}}/mkdocs.yml @@ -1,7 +1,7 @@ -site_name: {{cookiecutter.component_id}} -site_description: {{cookiecutter.description}} +site_name: {{cookiecutter.component_id | jsonify}} +site_description: {{cookiecutter.description | jsonify}} -nav: +nav: - Introduction: index.md plugins: diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/component-info.yaml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/component-info.yaml index f6e1d2c8d9..423c8683a1 100644 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/component-info.yaml +++ b/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/component-info.yaml @@ -1,12 +1,12 @@ apiVersion: backstage.io/v1alpha1 kind: Component metadata: - name: {{cookiecutter.component_id}} - description: {{cookiecutter.description}} + name: {{cookiecutter.component_id | jsonify}} + description: {{cookiecutter.description | jsonify}} annotations: - github.com/project-slug: {{cookiecutter.storePath}} + github.com/project-slug: {{cookiecutter.storePath | jsonify}} backstage.io/techdocs-ref: github:https://github.com/{{cookiecutter.storePath}} spec: type: website lifecycle: experimental - owner: {{cookiecutter.owner}} + owner: {{cookiecutter.owner | jsonify}} diff --git a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml b/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml index 0d10d11063..64f1e9ee8e 100644 --- a/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml +++ b/plugins/scaffolder-backend/sample-templates/react-ssr-template/{{cookiecutter.component_id}}/mkdocs.yml @@ -1,5 +1,5 @@ -site_name: {{cookiecutter.component_id}} -site_description: {{cookiecutter.description}} +site_name: {{cookiecutter.component_id | jsonify}} +site_description: {{cookiecutter.description | jsonify}} nav: - Introduction: index.md diff --git a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/component-info.yaml b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/component-info.yaml index 05b87c9c0c..f4ff350d10 100644 --- a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/component-info.yaml +++ b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/component-info.yaml @@ -1,12 +1,12 @@ apiVersion: backstage.io/v1alpha1 kind: Component metadata: - name: {{cookiecutter.component_id}} - description: {{cookiecutter.description}} + name: {{cookiecutter.component_id | jsonify}} + description: {{cookiecutter.description | jsonify}} annotations: - github.com/project-slug: {{cookiecutter.storePath}} + github.com/project-slug: {{cookiecutter.storePath | jsonify}} backstage.io/techdocs-ref: github:https://github.com/{{cookiecutter.storePath}} spec: type: service lifecycle: experimental - owner: {{cookiecutter.owner}} + owner: {{cookiecutter.owner | jsonify}} diff --git a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/mkdocs.yml b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/mkdocs.yml index 0d10d11063..64f1e9ee8e 100644 --- a/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/mkdocs.yml +++ b/plugins/scaffolder-backend/sample-templates/springboot-grpc-template/{{cookiecutter.component_id}}/mkdocs.yml @@ -1,5 +1,5 @@ -site_name: {{cookiecutter.component_id}} -site_description: {{cookiecutter.description}} +site_name: {{cookiecutter.component_id | jsonify}} +site_description: {{cookiecutter.description | jsonify}} nav: - Introduction: index.md