From 5353b4df61235b2b9e7c9d16e3a4838783455775 Mon Sep 17 00:00:00 2001 From: Heikki Hellgren Date: Fri, 6 Jan 2023 20:26:05 +0200 Subject: [PATCH 01/38] feat: add entity context menu tooltip closes #15609 Signed-off-by: Heikki Hellgren --- .changeset/silver-papayas-cough.md | 5 ++++ .../EntityContextMenu/EntityContextMenu.tsx | 29 ++++++++++--------- 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 .changeset/silver-papayas-cough.md diff --git a/.changeset/silver-papayas-cough.md b/.changeset/silver-papayas-cough.md new file mode 100644 index 0000000000..40d6898ebe --- /dev/null +++ b/.changeset/silver-papayas-cough.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +There is now tooltip in the entity context menu diff --git a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx index f7a329c7be..d22f9bde10 100644 --- a/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx +++ b/plugins/catalog/src/components/EntityContextMenu/EntityContextMenu.tsx @@ -22,6 +22,7 @@ import { MenuItem, MenuList, Popover, + Tooltip, } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import BugReportIcon from '@material-ui/icons/BugReport'; @@ -114,19 +115,21 @@ export function EntityContextMenu(props: EntityContextMenuProps) { return ( <> - - - + + + + + Date: Fri, 6 Jan 2023 19:03:00 +0000 Subject: [PATCH 02/38] feat(scaffolder-backend-module-rails) add skipActiveRecord argument Co-authored-by: Guilherme Co-authored-by: Daniela Co-authored-by: Sarah Signed-off-by: Rogerio Angeliski --- .changeset/chatty-moose-matter.md | 5 +++++ .../src/actions/fetch/rails/index.ts | 6 ++++++ .../src/actions/fetch/rails/railsArgumentResolver.test.ts | 1 + .../src/actions/fetch/rails/railsArgumentResolver.ts | 5 +++++ 4 files changed, 17 insertions(+) create mode 100644 .changeset/chatty-moose-matter.md diff --git a/.changeset/chatty-moose-matter.md b/.changeset/chatty-moose-matter.md new file mode 100644 index 0000000000..35f73e690a --- /dev/null +++ b/.changeset/chatty-moose-matter.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-rails': patch +--- + +handle skipActiveRecord rails new argument diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/index.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/index.ts index 7a77470e9b..4a5bd7dfd1 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/index.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/index.ts @@ -128,6 +128,12 @@ export function createFetchRailsAction(options: { description: 'Skip Action Text gem', type: 'boolean', }, + skipActiveRecord: { + title: 'skipActiveRecord', + description: 'Skip Active Record files', + type: 'boolean', + }, + force: { title: 'force', description: 'Overwrite files that already exist', diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.test.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.test.ts index 401ebb295f..935c8f96bd 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.test.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.test.ts @@ -33,6 +33,7 @@ describe('railsArgumentResolver', () => { [{ skipActionMailbox: true }, ['--skip-action-mailbox']], [{ skipActiveStorage: true }, ['--skip-active-storage']], [{ skipActionText: true }, ['--skip-action-text']], + [{ skipActiveRecord: true }, ['--skip-active-record']], [{ force: true }, ['--force']], [{ webpacker: 'vue' }, ['--webpack', 'vue']], [{ database: 'postgresql' }, ['--database', 'postgresql']], diff --git a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts index 666eac7958..bcfc8cc487 100644 --- a/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts +++ b/plugins/scaffolder-backend-module-rails/src/actions/fetch/rails/railsArgumentResolver.ts @@ -57,6 +57,7 @@ export type RailsRunOptions = { skipBundle?: boolean; skipTest?: boolean; skipWebpackInstall?: boolean; + skipActiveRecord?: boolean; template?: string; webpacker?: Webpacker; }; @@ -84,6 +85,10 @@ export const railsArgumentResolver = ( argumentsToRun.push('--skip-webpack-install'); } + if (options?.skipActiveRecord) { + argumentsToRun.push('--skip-active-record'); + } + if (options?.skipTest) { argumentsToRun.push('--skip-test'); } From f0de7895f9c05d603ce90f709e9dabe82134d227 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 9 Jan 2023 16:29:59 +0100 Subject: [PATCH 03/38] Add Scaffolder Sentry Plugin Signed-off-by: Dominik Pfaffenbauer --- .../.eslintrc.js | 1 + .../README.md | 160 ++++++++++++++++++ .../package.json | 48 ++++++ .../src/actions/createProject.ts | 122 +++++++++++++ .../src/index.ts | 17 ++ 5 files changed, 348 insertions(+) create mode 100644 plugins/scaffolder-backend-module-sentry/.eslintrc.js create mode 100644 plugins/scaffolder-backend-module-sentry/README.md create mode 100644 plugins/scaffolder-backend-module-sentry/package.json create mode 100644 plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts create mode 100644 plugins/scaffolder-backend-module-sentry/src/index.ts diff --git a/plugins/scaffolder-backend-module-sentry/.eslintrc.js b/plugins/scaffolder-backend-module-sentry/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/scaffolder-backend-module-sentry/README.md b/plugins/scaffolder-backend-module-sentry/README.md new file mode 100644 index 0000000000..cbab253bd9 --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/README.md @@ -0,0 +1,160 @@ +# scaffolder-backend-module-sentry + +Welcome to the Setnry Module for Scaffolder. + +Here you can find all Sentry related features to imrpove your scaffolder: + +## Getting started + +You need to configure the action in your ackend: + +## From your Backstage root directory + +```bash +# From your Backstage root directory +yarn add --cwd packages/backend @backstage/plugin-scaffolder-backend-module-sentry +``` + +Configure the action (you can check +the [docs](https://backstage.io/docs/features/software-templates/writing-custom-actions#registering-custom-actions) to +see all options): + +```typescript +const actions = [ + createSentryCreateProjectAction({ + integrations, + reader: env.reader, + containerRunner, + }), +]; + +return await createRouter({ + containerRunner, + catalogClient, + actions, + logger: env.logger, + config: env.config, + database: env.database, + reader: env.reader, +}); +``` + +You need to define your Sentry API Token in your `app-config.yaml`: + +```yaml +scaffolder: + sentry: + token: ${SENTRY_TOKEN} +``` + +After that you can use the action in your template: + +```yaml +apiVersion: scaffolder.backstage.io/v1beta3 +kind: Template +metadata: + name: sentry-demo + title: Sentry template + description: scaffolder sentry app +spec: + owner: backstage/techdocs-core + type: service + + parameters: + - title: Fill in some steps + required: + - name + - owner + properties: + name: + title: Name + type: string + description: Unique name of the component + ui:autofocus: true + ui:options: + rows: 5 + owner: + title: Owner + type: string + description: Owner of the component + ui:field: OwnerPicker + ui:options: + catalogFilter: + kind: Group + system: + title: System + type: string + description: System of the component + ui:field: EntityPicker + ui:options: + catalogFilter: + kind: System + defaultKind: System + + - title: Choose a location + required: + - repoUrl + - dryRun + properties: + repoUrl: + title: Repository Location + type: string + ui:field: RepoUrlPicker + ui:options: + allowedHosts: + - github.com + dryRun: + title: Only perform a dry run, don't publish anything + type: boolean + default: false + + steps: + - id: fetch + name: Fetch + action: fetch:template + input: + url: https://github.com/TEMPLATE + values: + name: ${{ parameters.name }} + + - id: create-sentry-project + if: ${{ parameters.dryRun !== true }} + name: Create Sentry Project + action: sentry:create-project + input: + organizationSlug: ORG-SLUG + teamSlug: TEAM-SLUG + name: ${{ parameters.name }} + + - id: publish + if: ${{ parameters.dryRun !== true }} + name: Publish + action: publish:github + input: + allowedHosts: + - github.com + description: This is ${{ parameters.name }} + repoUrl: ${{ parameters.repoUrl }} + + - id: register + if: ${{ parameters.dryRun !== true }} + name: Register + action: catalog:register + input: + repoContentsUrl: ${{ steps['publish'].output.repoContentsUrl }} + catalogInfoPath: '/catalog-info.yaml' + + - name: Results + if: ${{ parameters.dryRun }} + action: debug:log + input: + listWorkspace: true + + output: + links: + - title: Repository + url: ${{ steps['publish'].output.remoteUrl }} + - title: Open in catalog + icon: catalog + entityRef: ${{ steps['register'].output.entityRef }} +``` diff --git a/plugins/scaffolder-backend-module-sentry/package.json b/plugins/scaffolder-backend-module-sentry/package.json new file mode 100644 index 0000000000..8eaf5c398d --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/package.json @@ -0,0 +1,48 @@ +{ + "name": "@backstage/plugin-scaffolder-backend-module-sentry", + "version": "0.1.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "publishConfig": { + "access": "public", + "main": "dist/index.esm.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "frontend-plugin" + }, + "scripts": { + "start": "backstage-cli package start", + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "clean": "backstage-cli package clean", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack" + }, + "dependencies": { + "@backstage/config": "workspace:^", + "@backstage/errors": "workspace:^", + "@backstage/integration": "workspace:^", + "@backstage/plugin-scaffolder-backend": "workspace:^" + }, + "peerDependencies": { + "react": "^16.13.1 || ^17.0.0" + }, + "devDependencies": { + "@backstage/cli": "workspace:^", + "@backstage/core-app-api": "workspace:^", + "@backstage/dev-utils": "workspace:^", + "@backstage/test-utils": "workspace:^", + "@testing-library/jest-dom": "^5.10.1", + "@testing-library/react": "^12.1.3", + "@testing-library/user-event": "^14.0.0", + "@types/node": "*", + "cross-fetch": "^3.1.5", + "msw": "^0.49.0" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts b/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts new file mode 100644 index 0000000000..a3457ae159 --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts @@ -0,0 +1,122 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { createTemplateAction } from '@backstage/plugin-scaffolder-backend'; +import { InputError } from '@backstage/errors'; +import { Config } from '@backstage/config'; + +/** + * Creates the `sentry:craete-project` Scaffolder action. + * + * @remarks + * + * See {@link https://backstage.io/docs/features/software-templates/writing-custom-actions}. + * + * @param options - Configuration of the Sentry API. + * @public + */ +export function createSentryCreateProjectAction(options: { config: Config }) { + const { config } = options; + + return createTemplateAction<{ + organizationSlug: string; + teamSlug: string; + name: string; + slug: string; + authToken?: string; + }>({ + id: 'sentry:create-project', + schema: { + input: { + required: ['organizationSlug', 'teamSlug', 'name'], + type: 'object', + properties: { + organizationSlug: { + title: 'The slug of the organization the team belongs to', + type: 'string', + }, + teamSlug: { + title: 'The slug of the team to create a new project for', + type: 'string', + }, + name: { + title: 'The name for the new project', + type: 'string', + }, + slug: { + title: + 'Optional slug for the new project. If not provided a slug is generated from the name', + type: 'string', + }, + authToken: { + title: + 'authenticate via bearer auth token. Requires scope: project:write', + type: 'string', + }, + }, + }, + }, + async handler(ctx) { + const { organizationSlug, teamSlug, name, slug, authToken } = ctx.input; + + const body: any = { + name: name, + }; + + if (slug) { + body.slug = slug; + } + + const token = authToken + ? authToken + : config.getOptionalString('scaffolder.sentry.token'); + + if (!token) { + throw new InputError(`No valid sentry token given`); + } + + const response = await fetch( + `https://sentry.io/api/0/teams/${organizationSlug}/${teamSlug}/projects/`, + { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + }, + ); + + const contentType = response.headers.get('content-type'); + + if (contentType !== 'application/json') { + throw new InputError( + `Unexpected Sentry Response Type: ${await response.text()}`, + ); + } + + const code = response.status; + const result = await response.json(); + + if (code !== 201) { + throw new InputError(`Sentry Response was: ${await result.detail}`); + } + + ctx.output('id', result.id); + ctx.output('result', result); + }, + }); +} diff --git a/plugins/scaffolder-backend-module-sentry/src/index.ts b/plugins/scaffolder-backend-module-sentry/src/index.ts new file mode 100644 index 0000000000..f6c0820874 --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { createSentryCreateProjectAction } from './actions/createProject'; From 4070a59c93a0bea334aa9fea511d7cd573b9ebd5 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 9 Jan 2023 16:40:53 +0100 Subject: [PATCH 04/38] add yarn.lock Signed-off-by: Dominik Pfaffenbauer --- yarn.lock | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/yarn.lock b/yarn.lock index 588d41c776..0062c90d30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7359,6 +7359,29 @@ __metadata: languageName: unknown linkType: soft +"@backstage/plugin-scaffolder-backend-module-sentry@workspace:plugins/scaffolder-backend-module-sentry": + version: 0.0.0-use.local + resolution: "@backstage/plugin-scaffolder-backend-module-sentry@workspace:plugins/scaffolder-backend-module-sentry" + dependencies: + "@backstage/cli": "workspace:^" + "@backstage/config": "workspace:^" + "@backstage/core-app-api": "workspace:^" + "@backstage/dev-utils": "workspace:^" + "@backstage/errors": "workspace:^" + "@backstage/integration": "workspace:^" + "@backstage/plugin-scaffolder-backend": "workspace:^" + "@backstage/test-utils": "workspace:^" + "@testing-library/jest-dom": ^5.10.1 + "@testing-library/react": ^12.1.3 + "@testing-library/user-event": ^14.0.0 + "@types/node": "*" + cross-fetch: ^3.1.5 + msw: ^0.49.0 + peerDependencies: + react: ^16.13.1 || ^17.0.0 + languageName: unknown + linkType: soft + "@backstage/plugin-scaffolder-backend-module-yeoman@workspace:plugins/scaffolder-backend-module-yeoman": version: 0.0.0-use.local resolution: "@backstage/plugin-scaffolder-backend-module-yeoman@workspace:plugins/scaffolder-backend-module-yeoman" From 66ff367af6e24f6cbe0324fb9eb1e6059c8b7228 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 9 Jan 2023 16:42:23 +0100 Subject: [PATCH 05/38] add changeset Signed-off-by: Dominik Pfaffenbauer --- .changeset/olive-actors-beam.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/olive-actors-beam.md diff --git a/.changeset/olive-actors-beam.md b/.changeset/olive-actors-beam.md new file mode 100644 index 0000000000..940502bc8d --- /dev/null +++ b/.changeset/olive-actors-beam.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-sentry': minor +--- + +Add Sentry "Create Project" Scaffolder as new package From b6d6350256c535121f53c963c436a7de0dd59f34 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 9 Jan 2023 16:56:58 +0100 Subject: [PATCH 06/38] Doc Spell Issues Signed-off-by: Dominik Pfaffenbauer --- plugins/scaffolder-backend-module-sentry/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-sentry/README.md b/plugins/scaffolder-backend-module-sentry/README.md index cbab253bd9..14751185c4 100644 --- a/plugins/scaffolder-backend-module-sentry/README.md +++ b/plugins/scaffolder-backend-module-sentry/README.md @@ -1,12 +1,12 @@ # scaffolder-backend-module-sentry -Welcome to the Setnry Module for Scaffolder. +Welcome to the Sentry Module for Scaffolder. -Here you can find all Sentry related features to imrpove your scaffolder: +Here you can find all Sentry related features to improve your scaffolder: ## Getting started -You need to configure the action in your ackend: +You need to configure the action in your backend: ## From your Backstage root directory From 599e00b9884aa86f198ad4529bb908013b93d1d1 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 9 Jan 2023 17:10:39 +0100 Subject: [PATCH 07/38] Add API Report Signed-off-by: Dominik Pfaffenbauer --- .../api-report.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/scaffolder-backend-module-sentry/api-report.md diff --git a/plugins/scaffolder-backend-module-sentry/api-report.md b/plugins/scaffolder-backend-module-sentry/api-report.md new file mode 100644 index 0000000000..a72e8a1524 --- /dev/null +++ b/plugins/scaffolder-backend-module-sentry/api-report.md @@ -0,0 +1,21 @@ +## API Report File for "@backstage/plugin-scaffolder-backend-module-sentry" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { Config } from '@backstage/config'; +import { TemplateAction } from '@backstage/plugin-scaffolder-backend'; + +// @public +export function createSentryCreateProjectAction(options: { + config: Config; +}): TemplateAction<{ + organizationSlug: string; + teamSlug: string; + name: string; + slug: string; + authToken?: string | undefined; +}>; + +// (No @packageDocumentation comment for this package) +``` From 667912113704dea8f7cb1fd5dc8c0436a2963a00 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 09:09:39 +0000 Subject: [PATCH 08/38] fix(deps): update dependency dompurify to v2.4.3 Signed-off-by: Renovate Bot --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index b5d82d8162..26b656084e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8300,12 +8300,12 @@ __metadata: "@testing-library/react": ^12.1.3 "@testing-library/react-hooks": ^8.0.0 "@testing-library/user-event": ^14.0.0 - "@types/dompurify": ^2.2.2 + "@types/dompurify": ^2.3.3 "@types/event-source-polyfill": ^1.0.0 "@types/node": ^16.11.26 canvas: ^2.10.2 cross-fetch: ^3.1.5 - dompurify: ^2.2.9 + dompurify: ^2.3.6 event-source-polyfill: 1.0.25 git-url-parse: ^13.0.0 jss: ~10.9.0 @@ -14342,7 +14342,7 @@ __metadata: languageName: node linkType: hard -"@types/dompurify@npm:^2.1.0, @types/dompurify@npm:^2.2.2, @types/dompurify@npm:^2.3.3": +"@types/dompurify@npm:^2.1.0, @types/dompurify@npm:^2.3.3": version: 2.3.4 resolution: "@types/dompurify@npm:2.3.4" dependencies: @@ -20973,7 +20973,7 @@ __metadata: languageName: node linkType: hard -"dompurify@npm:^2.2.7, dompurify@npm:^2.2.9, dompurify@npm:^2.3.6": +"dompurify@npm:^2.2.7, dompurify@npm:^2.3.6": version: 2.4.0 resolution: "dompurify@npm:2.4.0" checksum: c93ea73cf8e3ba044588450198563e56ce6902e36d0e16e3699df2fa59e82c4fdd11d4ad04ef5024569ce96a35b46f29d0bbea522516add33cd39a7f56a8a675 From fe84f6c25fa4740bcdae2c45a2e2c429308111c5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 09:20:24 +0000 Subject: [PATCH 09/38] fix(deps): update dependency @google-cloud/firestore to v6.4.2 Signed-off-by: Renovate Bot --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index b5d82d8162..6384301d31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9416,14 +9416,14 @@ __metadata: linkType: hard "@google-cloud/firestore@npm:^6.0.0": - version: 6.4.1 - resolution: "@google-cloud/firestore@npm:6.4.1" + version: 6.4.2 + resolution: "@google-cloud/firestore@npm:6.4.2" dependencies: fast-deep-equal: ^3.1.1 functional-red-black-tree: ^1.0.1 - google-gax: ^3.5.1 + google-gax: ^3.5.2 protobufjs: ^7.0.0 - checksum: 7bd79d7444cefd8ffe8f768c28dbd1f0b32628ff5b611b4bdaa9b415428436f5368a8e258a002948d084381762b64501a574828c51c5cea7c054cc604f93b6d6 + checksum: c259f59905d4939f0b1fff2fdfa3db38a0436454af9e4a8939ea951ee700d5f801375ed090e77f610fbf3f02db1aeba9d70437eb6a8ca6f0ba2088c8964c58d0 languageName: node linkType: hard @@ -24012,7 +24012,7 @@ __metadata: languageName: node linkType: hard -"google-gax@npm:^3.5.1, google-gax@npm:^3.5.2": +"google-gax@npm:^3.5.2": version: 3.5.2 resolution: "google-gax@npm:3.5.2" dependencies: From 3acc6e3a0b5f5f57d566879a2b0ac1645ce5fddb Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 10 Jan 2023 11:21:53 +0100 Subject: [PATCH 10/38] chore: updating yarn.lock Signed-off-by: blam --- yarn.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 26b656084e..8ed99e3493 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8300,12 +8300,12 @@ __metadata: "@testing-library/react": ^12.1.3 "@testing-library/react-hooks": ^8.0.0 "@testing-library/user-event": ^14.0.0 - "@types/dompurify": ^2.3.3 + "@types/dompurify": ^2.2.2 "@types/event-source-polyfill": ^1.0.0 "@types/node": ^16.11.26 canvas: ^2.10.2 cross-fetch: ^3.1.5 - dompurify: ^2.3.6 + dompurify: ^2.2.9 event-source-polyfill: 1.0.25 git-url-parse: ^13.0.0 jss: ~10.9.0 @@ -14342,12 +14342,12 @@ __metadata: languageName: node linkType: hard -"@types/dompurify@npm:^2.1.0, @types/dompurify@npm:^2.3.3": - version: 2.3.4 - resolution: "@types/dompurify@npm:2.3.4" +"@types/dompurify@npm:^2.1.0, @types/dompurify@npm:^2.2.2, @types/dompurify@npm:^2.3.3": + version: 2.4.0 + resolution: "@types/dompurify@npm:2.4.0" dependencies: "@types/trusted-types": "*" - checksum: ea55678bc9fd32fcdae904ca191f2b8cc5b475277937e5e4c024690b0c3b9c73accfb7391f56d26d0f53fcff496a013773293e189a07a79afdd2b2ed4efacd5f + checksum: b48cd81e997794ebc390c7c5bef1a67ec14a6f2f0521973e07e06af186c7583abe114d94d24868c0632b9573f5bd77131a4b76f3fffdf089ba99a4e53dd46c39 languageName: node linkType: hard @@ -20973,10 +20973,10 @@ __metadata: languageName: node linkType: hard -"dompurify@npm:^2.2.7, dompurify@npm:^2.3.6": - version: 2.4.0 - resolution: "dompurify@npm:2.4.0" - checksum: c93ea73cf8e3ba044588450198563e56ce6902e36d0e16e3699df2fa59e82c4fdd11d4ad04ef5024569ce96a35b46f29d0bbea522516add33cd39a7f56a8a675 +"dompurify@npm:^2.2.7, dompurify@npm:^2.2.9, dompurify@npm:^2.3.6": + version: 2.4.3 + resolution: "dompurify@npm:2.4.3" + checksum: b440981f2a38cada2085759cc3d1e2f94571afc34343d011a8a6aa1ad91ae6abf651adbfa4994b0e2283f0ce81f7891cdb04b67d0b234c8d190cb70e9691f026 languageName: node linkType: hard From 3b8fd4169b67b9f0384bb17fe37419d59761b9c7 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 10 Jan 2023 16:25:38 +0100 Subject: [PATCH 11/38] backend-app-api: restructure implementation layout Signed-off-by: Patrik Oldsberg --- .changeset/twenty-moons-sneeze.md | 5 ++++ .../cacheFactory.ts} | 0 .../services/implementations/cache/index.ts | 17 +++++++++++++ .../configFactory.ts} | 0 .../services/implementations/config/index.ts | 17 +++++++++++++ .../databaseFactory.ts} | 0 .../implementations/database/index.ts | 17 +++++++++++++ .../discoveryFactory.ts} | 0 .../implementations/discovery/index.ts | 17 +++++++++++++ .../src/services/implementations/index.ts | 25 +++++++++---------- .../implementations/lifecycle/index.ts | 17 +++++++++++++ .../lifecycleFactory.ts} | 0 .../services/implementations/logger/index.ts | 17 +++++++++++++ .../loggerFactory.ts} | 0 .../implementations/permissions/index.ts | 17 +++++++++++++ .../permissionsFactory.ts} | 0 .../implementations/rootLifecycle/index.ts | 17 +++++++++++++ .../rootLifecycleFactory.test.ts} | 2 +- .../rootLifecycleFactory.ts} | 0 .../implementations/rootLogger/index.ts | 17 +++++++++++++ .../rootLoggerFactory.ts} | 0 .../implementations/scheduler/index.ts | 17 +++++++++++++ .../schedulerFactory.ts} | 0 .../implementations/tokenManager/index.ts | 17 +++++++++++++ .../tokenManagerFactory.ts} | 0 .../implementations/urlReader/index.ts | 17 +++++++++++++ .../urlReaderFactory.ts} | 0 .../src/wiring/BackendInitializer.ts | 2 +- 28 files changed, 223 insertions(+), 15 deletions(-) create mode 100644 .changeset/twenty-moons-sneeze.md rename packages/backend-app-api/src/services/implementations/{cacheService.ts => cache/cacheFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/cache/index.ts rename packages/backend-app-api/src/services/implementations/{configService.ts => config/configFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/config/index.ts rename packages/backend-app-api/src/services/implementations/{databaseService.ts => database/databaseFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/database/index.ts rename packages/backend-app-api/src/services/implementations/{discoveryService.ts => discovery/discoveryFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/discovery/index.ts create mode 100644 packages/backend-app-api/src/services/implementations/lifecycle/index.ts rename packages/backend-app-api/src/services/implementations/{lifecycleService.ts => lifecycle/lifecycleFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/logger/index.ts rename packages/backend-app-api/src/services/implementations/{loggerService.ts => logger/loggerFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/permissions/index.ts rename packages/backend-app-api/src/services/implementations/{permissionsService.ts => permissions/permissionsFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/rootLifecycle/index.ts rename packages/backend-app-api/src/services/implementations/{rootLifecycleService.test.ts => rootLifecycle/rootLifecycleFactory.test.ts} (95%) rename packages/backend-app-api/src/services/implementations/{rootLifecycleService.ts => rootLifecycle/rootLifecycleFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/rootLogger/index.ts rename packages/backend-app-api/src/services/implementations/{rootLoggerService.ts => rootLogger/rootLoggerFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/scheduler/index.ts rename packages/backend-app-api/src/services/implementations/{schedulerService.ts => scheduler/schedulerFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/tokenManager/index.ts rename packages/backend-app-api/src/services/implementations/{tokenManagerService.ts => tokenManager/tokenManagerFactory.ts} (100%) create mode 100644 packages/backend-app-api/src/services/implementations/urlReader/index.ts rename packages/backend-app-api/src/services/implementations/{urlReaderService.ts => urlReader/urlReaderFactory.ts} (100%) diff --git a/.changeset/twenty-moons-sneeze.md b/.changeset/twenty-moons-sneeze.md new file mode 100644 index 0000000000..4c3a6072cf --- /dev/null +++ b/.changeset/twenty-moons-sneeze.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-app-api': patch +--- + +Internal folder structure refactor. diff --git a/packages/backend-app-api/src/services/implementations/cacheService.ts b/packages/backend-app-api/src/services/implementations/cache/cacheFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/cacheService.ts rename to packages/backend-app-api/src/services/implementations/cache/cacheFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/cache/index.ts b/packages/backend-app-api/src/services/implementations/cache/index.ts new file mode 100644 index 0000000000..3d1bcd75a7 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/cache/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { cacheFactory } from './cacheFactory'; diff --git a/packages/backend-app-api/src/services/implementations/configService.ts b/packages/backend-app-api/src/services/implementations/config/configFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/configService.ts rename to packages/backend-app-api/src/services/implementations/config/configFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/config/index.ts b/packages/backend-app-api/src/services/implementations/config/index.ts new file mode 100644 index 0000000000..a9019b5b1c --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/config/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { configFactory } from './configFactory'; diff --git a/packages/backend-app-api/src/services/implementations/databaseService.ts b/packages/backend-app-api/src/services/implementations/database/databaseFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/databaseService.ts rename to packages/backend-app-api/src/services/implementations/database/databaseFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/database/index.ts b/packages/backend-app-api/src/services/implementations/database/index.ts new file mode 100644 index 0000000000..0045630e15 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/database/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { databaseFactory } from './databaseFactory'; diff --git a/packages/backend-app-api/src/services/implementations/discoveryService.ts b/packages/backend-app-api/src/services/implementations/discovery/discoveryFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/discoveryService.ts rename to packages/backend-app-api/src/services/implementations/discovery/discoveryFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/discovery/index.ts b/packages/backend-app-api/src/services/implementations/discovery/index.ts new file mode 100644 index 0000000000..182b9f6cd2 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/discovery/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { discoveryFactory } from './discoveryFactory'; diff --git a/packages/backend-app-api/src/services/implementations/index.ts b/packages/backend-app-api/src/services/implementations/index.ts index 73c3418090..8b9d0c0679 100644 --- a/packages/backend-app-api/src/services/implementations/index.ts +++ b/packages/backend-app-api/src/services/implementations/index.ts @@ -14,18 +14,17 @@ * limitations under the License. */ +export * from './cache'; +export * from './config'; +export * from './database'; +export * from './discovery'; export * from './httpRouter'; +export * from './lifecycle'; +export * from './logger'; +export * from './permissions'; export * from './rootHttpRouter'; - -export { cacheFactory } from './cacheService'; -export { configFactory } from './configService'; -export { databaseFactory } from './databaseService'; -export { discoveryFactory } from './discoveryService'; -export { loggerFactory } from './loggerService'; -export { rootLoggerFactory } from './rootLoggerService'; -export { permissionsFactory } from './permissionsService'; -export { schedulerFactory } from './schedulerService'; -export { tokenManagerFactory } from './tokenManagerService'; -export { urlReaderFactory } from './urlReaderService'; -export { lifecycleFactory } from './lifecycleService'; -export { rootLifecycleFactory } from './rootLifecycleService'; +export * from './rootLifecycle'; +export * from './rootLogger'; +export * from './scheduler'; +export * from './tokenManager'; +export * from './urlReader'; diff --git a/packages/backend-app-api/src/services/implementations/lifecycle/index.ts b/packages/backend-app-api/src/services/implementations/lifecycle/index.ts new file mode 100644 index 0000000000..cfca37a162 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/lifecycle/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { lifecycleFactory } from './lifecycleFactory'; diff --git a/packages/backend-app-api/src/services/implementations/lifecycleService.ts b/packages/backend-app-api/src/services/implementations/lifecycle/lifecycleFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/lifecycleService.ts rename to packages/backend-app-api/src/services/implementations/lifecycle/lifecycleFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/logger/index.ts b/packages/backend-app-api/src/services/implementations/logger/index.ts new file mode 100644 index 0000000000..acef1b178f --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/logger/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { loggerFactory } from './loggerFactory'; diff --git a/packages/backend-app-api/src/services/implementations/loggerService.ts b/packages/backend-app-api/src/services/implementations/logger/loggerFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/loggerService.ts rename to packages/backend-app-api/src/services/implementations/logger/loggerFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/permissions/index.ts b/packages/backend-app-api/src/services/implementations/permissions/index.ts new file mode 100644 index 0000000000..29a6aa237a --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/permissions/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { permissionsFactory } from './permissionsFactory'; diff --git a/packages/backend-app-api/src/services/implementations/permissionsService.ts b/packages/backend-app-api/src/services/implementations/permissions/permissionsFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/permissionsService.ts rename to packages/backend-app-api/src/services/implementations/permissions/permissionsFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/rootLifecycle/index.ts b/packages/backend-app-api/src/services/implementations/rootLifecycle/index.ts new file mode 100644 index 0000000000..8adefbfe84 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/rootLifecycle/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { rootLifecycleFactory } from './rootLifecycleFactory'; diff --git a/packages/backend-app-api/src/services/implementations/rootLifecycleService.test.ts b/packages/backend-app-api/src/services/implementations/rootLifecycle/rootLifecycleFactory.test.ts similarity index 95% rename from packages/backend-app-api/src/services/implementations/rootLifecycleService.test.ts rename to packages/backend-app-api/src/services/implementations/rootLifecycle/rootLifecycleFactory.test.ts index e7827e5fc3..fc1c266775 100644 --- a/packages/backend-app-api/src/services/implementations/rootLifecycleService.test.ts +++ b/packages/backend-app-api/src/services/implementations/rootLifecycle/rootLifecycleFactory.test.ts @@ -15,7 +15,7 @@ */ import { getVoidLogger } from '@backstage/backend-common'; -import { BackendLifecycleImpl } from './rootLifecycleService'; +import { BackendLifecycleImpl } from './rootLifecycleFactory'; describe('lifecycleService', () => { it('should execute registered shutdown hook', async () => { diff --git a/packages/backend-app-api/src/services/implementations/rootLifecycleService.ts b/packages/backend-app-api/src/services/implementations/rootLifecycle/rootLifecycleFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/rootLifecycleService.ts rename to packages/backend-app-api/src/services/implementations/rootLifecycle/rootLifecycleFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/rootLogger/index.ts b/packages/backend-app-api/src/services/implementations/rootLogger/index.ts new file mode 100644 index 0000000000..ce5816e6fa --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/rootLogger/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { rootLoggerFactory } from './rootLoggerFactory'; diff --git a/packages/backend-app-api/src/services/implementations/rootLoggerService.ts b/packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/rootLoggerService.ts rename to packages/backend-app-api/src/services/implementations/rootLogger/rootLoggerFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/scheduler/index.ts b/packages/backend-app-api/src/services/implementations/scheduler/index.ts new file mode 100644 index 0000000000..8b84906b5b --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/scheduler/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { schedulerFactory } from './schedulerFactory'; diff --git a/packages/backend-app-api/src/services/implementations/schedulerService.ts b/packages/backend-app-api/src/services/implementations/scheduler/schedulerFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/schedulerService.ts rename to packages/backend-app-api/src/services/implementations/scheduler/schedulerFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/tokenManager/index.ts b/packages/backend-app-api/src/services/implementations/tokenManager/index.ts new file mode 100644 index 0000000000..c0685079c4 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/tokenManager/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { tokenManagerFactory } from './tokenManagerFactory'; diff --git a/packages/backend-app-api/src/services/implementations/tokenManagerService.ts b/packages/backend-app-api/src/services/implementations/tokenManager/tokenManagerFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/tokenManagerService.ts rename to packages/backend-app-api/src/services/implementations/tokenManager/tokenManagerFactory.ts diff --git a/packages/backend-app-api/src/services/implementations/urlReader/index.ts b/packages/backend-app-api/src/services/implementations/urlReader/index.ts new file mode 100644 index 0000000000..5da0ef4049 --- /dev/null +++ b/packages/backend-app-api/src/services/implementations/urlReader/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { urlReaderFactory } from './urlReaderFactory'; diff --git a/packages/backend-app-api/src/services/implementations/urlReaderService.ts b/packages/backend-app-api/src/services/implementations/urlReader/urlReaderFactory.ts similarity index 100% rename from packages/backend-app-api/src/services/implementations/urlReaderService.ts rename to packages/backend-app-api/src/services/implementations/urlReader/urlReaderFactory.ts diff --git a/packages/backend-app-api/src/wiring/BackendInitializer.ts b/packages/backend-app-api/src/wiring/BackendInitializer.ts index 69512ba4c2..ce17398a79 100644 --- a/packages/backend-app-api/src/wiring/BackendInitializer.ts +++ b/packages/backend-app-api/src/wiring/BackendInitializer.ts @@ -20,7 +20,7 @@ import { coreServices, ServiceRef, } from '@backstage/backend-plugin-api'; -import { BackendLifecycleImpl } from '../services/implementations/rootLifecycleService'; +import { BackendLifecycleImpl } from '../services/implementations/rootLifecycle/rootLifecycleFactory'; import { BackendRegisterInit, EnumerableServiceHolder, From e04dcef5a0f903fdf0b439918845ecea1a53e439 Mon Sep 17 00:00:00 2001 From: Damon Kaswell Date: Tue, 10 Jan 2023 08:54:07 -0800 Subject: [PATCH 12/38] Do not try to commit empty array of entity records Signed-off-by: Damon Kaswell --- .../IncrementalIngestionDatabaseManager.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts b/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts index 9eb52c4558..e837f2b259 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/database/IncrementalIngestionDatabaseManager.ts @@ -577,13 +577,15 @@ export class IncrementalIngestionDatabaseManager { .update('ingestion_mark_id', markId) .whereIn('ref', existingRefsArray); - await tx('ingestion_mark_entities').insert( - newRefs.map(ref => ({ - id: v4(), - ingestion_mark_id: markId, - ref, - })), - ); + if (newRefs.length > 0) { + await tx('ingestion_mark_entities').insert( + newRefs.map(ref => ({ + id: v4(), + ingestion_mark_id: markId, + ref, + })), + ); + } }); } From 045b66ce02169c8eb099e23190c41d53f0a90e1c Mon Sep 17 00:00:00 2001 From: Damon Kaswell Date: Tue, 10 Jan 2023 09:01:24 -0800 Subject: [PATCH 13/38] Add changeset Signed-off-by: Damon Kaswell --- .changeset/six-crabs-sell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/six-crabs-sell.md diff --git a/.changeset/six-crabs-sell.md b/.changeset/six-crabs-sell.md new file mode 100644 index 0000000000..59c527d921 --- /dev/null +++ b/.changeset/six-crabs-sell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-incremental-ingestion': patch +--- + +Fixed issue with sometimes trying to commit an empty array of references From 0dfaf1b78bd6c31a15fdc781e886100cb55d5255 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Lopez Date: Thu, 15 Dec 2022 14:53:19 -0500 Subject: [PATCH 14/38] feat: setup forbid-elements ESLint rule for spans Signed-off-by: Carlos Esteban Lopez --- .eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index cf01ffe3a6..ea73a299c3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -247,6 +247,10 @@ module.exports = { { forbid: [ { element: 'button', message: 'use MUI