From b219821a01c1eee7bf06c989d6db9ff1bdcdf6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20A=CC=8Ahsberg?= Date: Tue, 27 Apr 2021 15:47:40 +0000 Subject: [PATCH 01/73] Expose BitbucketRepositoryParser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Åhsberg --- .changeset/khaki-rice-accept.md | 5 +++++ plugins/catalog-backend/src/ingestion/processors/index.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/khaki-rice-accept.md diff --git a/.changeset/khaki-rice-accept.md b/.changeset/khaki-rice-accept.md new file mode 100644 index 0000000000..72f1c635ed --- /dev/null +++ b/.changeset/khaki-rice-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Expose `BitbucketRepositoryParser` introduced in [#5295](https://github.com/backstage/backstage/pull/5295) diff --git a/plugins/catalog-backend/src/ingestion/processors/index.ts b/plugins/catalog-backend/src/ingestion/processors/index.ts index 8aedc8889b..8d1a7967cd 100644 --- a/plugins/catalog-backend/src/ingestion/processors/index.ts +++ b/plugins/catalog-backend/src/ingestion/processors/index.ts @@ -35,3 +35,7 @@ export * from './types'; export { UrlReaderProcessor } from './UrlReaderProcessor'; export { parseEntityYaml } from './util/parse'; export { results }; + +export * from './bitbucket/types'; +export { BitbucketClient } from './bitbucket'; +export type { BitbucketRepositoryParser } from './bitbucket'; From d5b892d0410eb2c75711087acc81a876a47a953f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20A=CC=8Ahsberg?= Date: Wed, 28 Apr 2021 15:18:55 +0000 Subject: [PATCH 02/73] Wrap Bitbucket types into separate namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Åhsberg --- .../processors/BitbucketDiscoveryProcessor.ts | 4 ++-- .../BitbucketRepositoryParser.test.ts | 6 ++--- .../bitbucket/BitbucketRepositoryParser.ts | 4 ++-- .../ingestion/processors/bitbucket/types.ts | 24 ++++++++++--------- .../src/ingestion/processors/index.ts | 3 +-- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts index f92a5c6f7c..858219423f 100644 --- a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts @@ -22,7 +22,7 @@ import { } from '@backstage/integration'; import { LocationSpec } from '@backstage/catalog-model'; import { - Repository, + Bitbucket, BitbucketRepositoryParser, BitbucketClient, defaultRepositoryParser, @@ -159,5 +159,5 @@ function escapeRegExp(str: string): RegExp { type Result = { scanned: number; - matches: Repository[]; + matches: Bitbucket.Repository[]; }; diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts index ab5080f446..e0d430f77b 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { defaultRepositoryParser } from './BitbucketRepositoryParser'; -import { Project, Repository } from './types'; +import { Bitbucket } from './types'; import { BitbucketClient } from './client'; import { results } from '../index'; @@ -36,12 +36,12 @@ describe('BitbucketRepositoryParser', () => { const actual = await defaultRepositoryParser({ client: {} as BitbucketClient, repository: { - project: {} as Project, + project: {} as Bitbucket.Project, slug: 'repo-slug', links: { self: [{ href: browseUrl }], }, - } as Repository, + } as Bitbucket.Repository, path: path, }); diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts index f786b6dac8..05e3c6822a 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Repository } from './types'; +import { Bitbucket } from './types'; import { CatalogProcessorResult } from '../types'; import { results } from '../index'; import { BitbucketClient } from './client'; export type BitbucketRepositoryParser = (options: { client: BitbucketClient; - repository: Repository; + repository: Bitbucket.Repository; path: string; }) => AsyncIterable; diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts index 75dd372faa..8a8656f666 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts @@ -13,16 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export type Project = { - key: string; -}; +export namespace Bitbucket { + export type Project = { + key: string; + }; -export type Repository = { - project: Project; - slug: string; - links: Record; -}; + export type Repository = { + project: Project; + slug: string; + links: Record; + }; -export type Link = { - href: string; -}; + export type Link = { + href: string; + }; +} diff --git a/plugins/catalog-backend/src/ingestion/processors/index.ts b/plugins/catalog-backend/src/ingestion/processors/index.ts index 8d1a7967cd..c8f51bbccc 100644 --- a/plugins/catalog-backend/src/ingestion/processors/index.ts +++ b/plugins/catalog-backend/src/ingestion/processors/index.ts @@ -36,6 +36,5 @@ export { UrlReaderProcessor } from './UrlReaderProcessor'; export { parseEntityYaml } from './util/parse'; export { results }; -export * from './bitbucket/types'; export { BitbucketClient } from './bitbucket'; -export type { BitbucketRepositoryParser } from './bitbucket'; +export type { BitbucketRepositoryParser, Bitbucket } from './bitbucket'; From 54ef04e72ac16e2f09ee6016c6dcf714c8683094 Mon Sep 17 00:00:00 2001 From: Heather Lee Date: Wed, 28 Apr 2021 17:21:26 -0700 Subject: [PATCH 03/73] Added lax option to app:build Signed-off-by: Heather Lee --- packages/cli/src/commands/app/build.ts | 1 + packages/cli/src/commands/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/cli/src/commands/app/build.ts b/packages/cli/src/commands/app/build.ts index 21189e9427..0da4112646 100644 --- a/packages/cli/src/commands/app/build.ts +++ b/packages/cli/src/commands/app/build.ts @@ -30,6 +30,7 @@ export default async (cmd: Command) => { ...(await loadCliConfig({ args: cmd.config, fromPackage: name, + mockEnv: cmd.lax, })), }); }; diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index c770239464..ae39941106 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -29,6 +29,7 @@ export function registerCommands(program: CommanderStatic) { .command('app:build') .description('Build an app for a production release') .option('--stats', 'Write bundle stats to output directory') + .option('--lax', 'Do not require environment variables to be set') .option(...configOption) .action(lazy(() => import('./app/build').then(m => m.default))); From fc79a6dd3c9932327b50b161409c33469700d231 Mon Sep 17 00:00:00 2001 From: Heather Lee Date: Wed, 28 Apr 2021 17:27:58 -0700 Subject: [PATCH 04/73] Added changeset Signed-off-by: Heather Lee --- .changeset/nice-shirts-fetch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nice-shirts-fetch.md diff --git a/.changeset/nice-shirts-fetch.md b/.changeset/nice-shirts-fetch.md new file mode 100644 index 0000000000..e9537e63b3 --- /dev/null +++ b/.changeset/nice-shirts-fetch.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Added lax option to backstage-cli app:build command From 3923318d8780f51f416f4b688da8d0c9bdfa4d06 Mon Sep 17 00:00:00 2001 From: Heather Lee Date: Wed, 28 Apr 2021 17:41:45 -0700 Subject: [PATCH 05/73] Updated documentation Signed-off-by: Heather Lee --- docs/cli/commands.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/cli/commands.md b/docs/cli/commands.md index 324d17463c..a99d4cd9d0 100644 --- a/docs/cli/commands.md +++ b/docs/cli/commands.md @@ -111,6 +111,7 @@ Usage: backstage-cli app:build Options: --stats Write bundle stats to output directory + --lax Do not require environment variables to be set --config <path> Config files to load instead of app-config.yaml (default: []) -h, --help display help for command ``` @@ -486,6 +487,7 @@ Usage: backstage-cli config:print [options] Options: --package <name> Only load config schema that applies to the given package + --lax Do not require environment variables to be set --frontend Print only the frontend configuration --with-secrets Include secrets in the printed configuration --format <format> Format to print the configuration in, either json or yaml [yaml] @@ -506,6 +508,7 @@ Usage: backstage-cli config:check [options] Options: --package <name> Only load config schema that applies to the given package + --lax Do not require environment variables to be set --config <path> Config files to load instead of app-config.yaml (default: []) -h, --help display help for command ``` From 85409a343ea196ad2814b52fba160f3bccf9d968 Mon Sep 17 00:00:00 2001 From: David Tuite Date: Thu, 29 Apr 2021 10:35:29 +0100 Subject: [PATCH 06/73] Mention error handling on GitHub discovery docs Signed-off-by: David Tuite --- docs/integrations/github/discovery.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index a578d0893d..3e776c8088 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -52,3 +52,13 @@ Backstage to use the [github-apps plugin](../../plugins/github-apps.md). This is true for any method of adding GitHub entities to the catalog, but especially easy to hit with automatic discovery. + +## Error handling + +Syntax errors or other types of errors present in `catalog-info.yaml` files will +be logged for investigation and the importer will continue. Errors do not cause +the process to fail. + +When multiple `catalog-info.yaml` files with the same `metadata.name` property +are discovered, one will be skipped and the process will continue. This action +will be logged for later investication. From ce563d118be2535e7a080252427e1da92af3a000 Mon Sep 17 00:00:00 2001 From: David Tuite Date: Thu, 29 Apr 2021 10:48:04 +0100 Subject: [PATCH 07/73] Fix spelling error Signed-off-by: David Tuite --- docs/integrations/github/discovery.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 3e776c8088..8d2ca8fb32 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -61,4 +61,4 @@ the process to fail. When multiple `catalog-info.yaml` files with the same `metadata.name` property are discovered, one will be skipped and the process will continue. This action -will be logged for later investication. +will be logged for later investigation. From 1d6159e40db6f665fb8396b5a097fc33ed84776a Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Wed, 14 Apr 2021 17:53:48 +0200 Subject: [PATCH 08/73] kubernetes-common: Adds initial shared types and files Signed-off-by: Juan Lulkin --- packages/kubernetes-common/.eslintrc.js | 0 packages/kubernetes-common/CHANGELOG.md | 7 + packages/kubernetes-common/README.md | 3 + packages/kubernetes-common/package.json | 48 ++++++ packages/kubernetes-common/src/index.ts | 17 ++ packages/kubernetes-common/src/types.ts | 208 ++++++++++++++++++++++++ 6 files changed, 283 insertions(+) create mode 100644 packages/kubernetes-common/.eslintrc.js create mode 100644 packages/kubernetes-common/CHANGELOG.md create mode 100644 packages/kubernetes-common/README.md create mode 100644 packages/kubernetes-common/package.json create mode 100644 packages/kubernetes-common/src/index.ts create mode 100644 packages/kubernetes-common/src/types.ts diff --git a/packages/kubernetes-common/.eslintrc.js b/packages/kubernetes-common/.eslintrc.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/kubernetes-common/CHANGELOG.md b/packages/kubernetes-common/CHANGELOG.md new file mode 100644 index 0000000000..4b73dbafad --- /dev/null +++ b/packages/kubernetes-common/CHANGELOG.md @@ -0,0 +1,7 @@ +# @backstage/techdocs-common + +## 0.1.0 + +### Minor Changes + +- Adds the following types to be shared by the backend and the front end: \ No newline at end of file diff --git a/packages/kubernetes-common/README.md b/packages/kubernetes-common/README.md new file mode 100644 index 0000000000..db3989cdcb --- /dev/null +++ b/packages/kubernetes-common/README.md @@ -0,0 +1,3 @@ +# @backstage/kubernetes-common + +Common types and functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend. \ No newline at end of file diff --git a/packages/kubernetes-common/package.json b/packages/kubernetes-common/package.json new file mode 100644 index 0000000000..ff541911ba --- /dev/null +++ b/packages/kubernetes-common/package.json @@ -0,0 +1,48 @@ +{ + "name": "@backstage/kubernetes-common", + "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin", + "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" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/kubernetes-common" + }, + "keywords": [ + "techdocs", + "kubernetes" + ], + "files": [ + "dist" + ], + "scripts": { + "build": "backstage-cli build --outputs cjs,types", + "lint": "backstage-cli lint", + "test": "backstage-cli test", + "prepack": "backstage-cli prepack", + "postpack": "backstage-cli postpack", + "clean": "backstage-cli clean" + }, + "bugs": { + "url": "https://github.com/backstage/backstage/issues" + }, + "dependencies": { + "@kubernetes/client-node": "^0.14.0" + }, + "devDependencies": { + "@backstage/cli": "^0.6.5" + }, + "jest": { + "roots": [ + ".." + ] + } +} diff --git a/packages/kubernetes-common/src/index.ts b/packages/kubernetes-common/src/index.ts new file mode 100644 index 0000000000..50e9534751 --- /dev/null +++ b/packages/kubernetes-common/src/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export * from './types'; diff --git a/packages/kubernetes-common/src/types.ts b/packages/kubernetes-common/src/types.ts new file mode 100644 index 0000000000..84ca08585b --- /dev/null +++ b/packages/kubernetes-common/src/types.ts @@ -0,0 +1,208 @@ +/* + * 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 { + ExtensionsV1beta1Ingress, + V1ConfigMap, + V1Deployment, + V1HorizontalPodAutoscaler, + V1Pod, + V1ReplicaSet, + V1Service, +} from '@kubernetes/client-node'; +import { Entity } from '@backstage/catalog-model'; + +export interface ClusterDetails { + name: string; + url: string; + authProvider: string; + serviceAccountToken?: string | undefined; +} + +export interface KubernetesRequestBody { + auth?: { + google?: string; + }; + entity: Entity; +} + +export interface ClusterObjects { + cluster: { name: string }; + resources: FetchResponse[]; + errors: KubernetesFetchError[]; +} + +export interface ObjectsByEntityResponse { + items: ClusterObjects[]; +} + +export interface FetchResponseWrapper { + errors: KubernetesFetchError[]; + responses: FetchResponse[]; +} + +export type FetchResponse = + | PodFetchResponse + | ServiceFetchResponse + | ConfigMapFetchResponse + | DeploymentFetchResponse + | ReplicaSetsFetchResponse + | HorizontalPodAutoscalersFetchResponse + | IngressesFetchResponse + | CustomResourceFetchResponse; + +// TODO fairly sure there's a easier way to do this + +export type KubernetesObjectTypes = + | 'pods' + | 'services' + | 'configmaps' + | 'deployments' + | 'replicasets' + | 'horizontalpodautoscalers' + | 'ingresses' + | 'customresources'; + +export interface PodFetchResponse { + type: 'pods'; + resources: Array; +} + +export interface ServiceFetchResponse { + type: 'services'; + resources: Array; +} + +export interface ConfigMapFetchResponse { + type: 'configmaps'; + resources: Array; +} + +export interface DeploymentFetchResponse { + type: 'deployments'; + resources: Array; +} + +export interface ReplicaSetsFetchResponse { + type: 'replicasets'; + resources: Array; +} + +export interface HorizontalPodAutoscalersFetchResponse { + type: 'horizontalpodautoscalers'; + resources: Array; +} + +export interface IngressesFetchResponse { + type: 'ingresses'; + resources: Array; +} + +export interface CustomResourceFetchResponse { + type: 'customresources'; + resources: Array; +} + +export interface ObjectFetchParams { + serviceId: string; + clusterDetails: ClusterDetails; + objectTypesToFetch: Set; + labelSelector: string; + customResources: CustomResource[]; +} + +// Fetches information from a kubernetes cluster using the cluster details object +// to target a specific cluster +export interface KubernetesFetcher { + fetchObjectsForService( + params: ObjectFetchParams, + ): Promise; +} + +// Used to locate which cluster(s) a service is running on +export interface KubernetesServiceLocator { + getClustersByServiceId(serviceId: string): Promise; +} + +// Used to load cluster details from different sources +export interface KubernetesClustersSupplier { + getClusters(): Promise; +} + +export type KubernetesErrorTypes = + | 'BAD_REQUEST' + | 'UNAUTHORIZED_ERROR' + | 'SYSTEM_ERROR' + | 'UNKNOWN_ERROR'; + +export interface KubernetesFetchError { + errorType: KubernetesErrorTypes; + statusCode?: number; + resourcePath?: string; +} + +export interface ConfigClusterLocatorMethod { + /** + * @visibility frontend + */ + type: 'config'; + clusters: { + /** + * @visibility frontend + */ + url: string; + /** + * @visibility frontend + */ + name: string; + /** + * @visibility secret + */ + serviceAccountToken: string | undefined; + /** + * @visibility frontend + */ + authProvider: 'aws' | 'google' | 'serviceAccount'; + }[]; +} + +export interface GKEClusterLocatorMethod { + /** + * @visibility frontend + */ + type: 'gke'; + /** + * @visibility frontend + */ + projectId: string; + /** + * @visibility frontend + */ + region?: string; +} + +export type ClusterLocatorMethod = + | ConfigClusterLocatorMethod + | GKEClusterLocatorMethod; + +export type ServiceLocatorMethod = 'multiTenant' | 'http'; // TODO implement http +export type AuthProviderType = 'google' | 'serviceAccount' | 'aws'; + +export interface CustomResource { + group: string; + apiVersion: string; + plural: string; +} From 1f790d756fa6a796217b693eef109f872b80dfc1 Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Wed, 14 Apr 2021 17:54:18 +0200 Subject: [PATCH 09/73] kubernetes-backend: Updates kube backend to reexport types from common Signed-off-by: Juan Lulkin --- plugins/kubernetes-backend/package.json | 1 + plugins/kubernetes-backend/src/types/types.ts | 208 ++---------------- 2 files changed, 16 insertions(+), 193 deletions(-) diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 7a8b16bc8a..6c600f4d8b 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -34,6 +34,7 @@ "@backstage/backend-common": "^0.6.3", "@backstage/catalog-model": "^0.7.7", "@backstage/config": "^0.1.4", + "@backstage/kubernetes-common": "^0.1.0", "@google-cloud/container": "^2.2.0", "@kubernetes/client-node": "^0.14.0", "@types/express": "^4.17.6", diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index c597c718c5..2316740af0 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -14,196 +14,18 @@ * limitations under the License. */ -import { - ExtensionsV1beta1Ingress, - V1ConfigMap, - V1Deployment, - V1HorizontalPodAutoscaler, - V1Pod, - V1ReplicaSet, - V1Service, -} from '@kubernetes/client-node'; -import { Entity } from '@backstage/catalog-model'; - -export interface ClusterDetails { - name: string; - url: string; - authProvider: string; - serviceAccountToken?: string | undefined; - skipTLSVerify?: boolean; -} - -export interface KubernetesRequestBody { - auth?: { - google?: string; - }; - entity: Entity; -} - -export interface ClusterObjects { - cluster: { name: string }; - resources: FetchResponse[]; - errors: KubernetesFetchError[]; -} - -export interface ObjectsByEntityResponse { - items: ClusterObjects[]; -} - -export interface FetchResponseWrapper { - errors: KubernetesFetchError[]; - responses: FetchResponse[]; -} - -export type FetchResponse = - | PodFetchResponse - | ServiceFetchResponse - | ConfigMapFetchResponse - | DeploymentFetchResponse - | ReplicaSetsFetchResponse - | HorizontalPodAutoscalersFetchResponse - | IngressesFetchResponse - | CustomResourceFetchResponse; - -// TODO fairly sure there's a easier way to do this - -export type KubernetesObjectTypes = - | 'pods' - | 'services' - | 'configmaps' - | 'deployments' - | 'replicasets' - | 'horizontalpodautoscalers' - | 'ingresses' - | 'customresources'; - -export interface PodFetchResponse { - type: 'pods'; - resources: Array; -} - -export interface ServiceFetchResponse { - type: 'services'; - resources: Array; -} - -export interface ConfigMapFetchResponse { - type: 'configmaps'; - resources: Array; -} - -export interface DeploymentFetchResponse { - type: 'deployments'; - resources: Array; -} - -export interface ReplicaSetsFetchResponse { - type: 'replicasets'; - resources: Array; -} - -export interface HorizontalPodAutoscalersFetchResponse { - type: 'horizontalpodautoscalers'; - resources: Array; -} - -export interface IngressesFetchResponse { - type: 'ingresses'; - resources: Array; -} - -export interface CustomResourceFetchResponse { - type: 'customresources'; - resources: Array; -} - -export interface ObjectFetchParams { - serviceId: string; - clusterDetails: ClusterDetails; - objectTypesToFetch: Set; - labelSelector: string; - customResources: CustomResource[]; -} - -// Fetches information from a kubernetes cluster using the cluster details object -// to target a specific cluster -export interface KubernetesFetcher { - fetchObjectsForService( - params: ObjectFetchParams, - ): Promise; -} - -// Used to locate which cluster(s) a service is running on -export interface KubernetesServiceLocator { - getClustersByServiceId(serviceId: string): Promise; -} - -// Used to load cluster details from different sources -export interface KubernetesClustersSupplier { - getClusters(): Promise; -} - -export type KubernetesErrorTypes = - | 'BAD_REQUEST' - | 'UNAUTHORIZED_ERROR' - | 'SYSTEM_ERROR' - | 'UNKNOWN_ERROR'; - -export interface KubernetesFetchError { - errorType: KubernetesErrorTypes; - statusCode?: number; - resourcePath?: string; -} - -export interface ConfigClusterLocatorMethod { - /** - * @visibility frontend - */ - type: 'config'; - clusters: { - /** - * @visibility frontend - */ - url: string; - /** - * @visibility frontend - */ - name: string; - /** - * @visibility secret - */ - serviceAccountToken: string | undefined; - /** - * @visibility frontend - */ - authProvider: 'aws' | 'google' | 'serviceAccount'; - }[]; -} - -export interface GKEClusterLocatorMethod { - /** - * @visibility frontend - */ - type: 'gke'; - /** - * @visibility frontend - */ - projectId: string; - /** - * @visibility frontend - */ - region?: string; -} - -export type ClusterLocatorMethod = - | ConfigClusterLocatorMethod - | GKEClusterLocatorMethod; - -export type ServiceLocatorMethod = 'multiTenant' | 'http'; // TODO implement http -export type AuthProviderType = 'google' | 'serviceAccount' | 'aws'; - -export interface CustomResource { - group: string; - apiVersion: string; - plural: string; -} +export type { + ClusterDetails, + CustomResource, + FetchResponse, + FetchResponseWrapper, + KubernetesClustersSupplier, + KubernetesErrorTypes, + KubernetesFetchError, + KubernetesFetcher, + KubernetesObjectTypes, + KubernetesRequestBody, + KubernetesServiceLocator, + ObjectFetchParams, + ServiceLocatorMethod, +} from '@backstage/kubernetes-common'; From 0b61c22e0af1fdc74e74b5556cef9994b64b3c7e Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Wed, 14 Apr 2021 17:55:09 +0200 Subject: [PATCH 10/73] kubernetes: Updates kubernetes frontend to use common Signed-off-by: Juan Lulkin --- plugins/kubernetes/package.json | 4 ++-- plugins/kubernetes/schema.d.ts | 2 +- plugins/kubernetes/src/api/KubernetesBackendClient.ts | 2 +- plugins/kubernetes/src/api/types.ts | 2 +- .../src/components/KubernetesContent/ErrorPanel.tsx | 2 +- .../src/components/KubernetesContent/KubernetesContent.tsx | 2 +- .../kubernetes/src/error-detection/error-detection.test.ts | 2 +- plugins/kubernetes/src/error-detection/error-detection.ts | 2 +- plugins/kubernetes/src/hooks/useKubernetesObjects.ts | 2 +- .../src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts | 2 +- .../kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts | 2 +- .../src/kubernetes-auth-provider/KubernetesAuthProviders.ts | 2 +- .../ServiceAccountKubernetesAuthProvider.ts | 2 +- plugins/kubernetes/src/kubernetes-auth-provider/types.ts | 2 +- plugins/kubernetes/src/utils/response.ts | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 03013e1480..7c607b1776 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -34,8 +34,8 @@ "@backstage/catalog-model": "^0.7.4", "@backstage/config": "^0.1.4", "@backstage/core": "^0.7.6", - "@backstage/plugin-catalog-react": "^0.1.3", - "@backstage/plugin-kubernetes-backend": "^0.3.2", + "@backstage/kubernetes-common": "^0.1.0", + "@backstage/plugin-catalog-react": "^0.1.3", "@backstage/theme": "^0.2.6", "@kubernetes/client-node": "^0.14.0", "@material-ui/core": "^4.11.0", diff --git a/plugins/kubernetes/schema.d.ts b/plugins/kubernetes/schema.d.ts index 196f5ba76d..e421100760 100644 --- a/plugins/kubernetes/schema.d.ts +++ b/plugins/kubernetes/schema.d.ts @@ -17,7 +17,7 @@ import { ClusterLocatorMethod, CustomResource, -} from '@backstage/plugin-kubernetes-backend'; +} from '@backstage/kubernetes-common'; export interface Config { kubernetes?: { diff --git a/plugins/kubernetes/src/api/KubernetesBackendClient.ts b/plugins/kubernetes/src/api/KubernetesBackendClient.ts index 1eadec3fb0..0bbba7c8f7 100644 --- a/plugins/kubernetes/src/api/KubernetesBackendClient.ts +++ b/plugins/kubernetes/src/api/KubernetesBackendClient.ts @@ -19,7 +19,7 @@ import { KubernetesApi } from './types'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/plugin-kubernetes-backend'; +} from '@backstage/kubernetes-common'; export class KubernetesBackendClient implements KubernetesApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/kubernetes/src/api/types.ts b/plugins/kubernetes/src/api/types.ts index da1b36989a..a575aea4b8 100644 --- a/plugins/kubernetes/src/api/types.ts +++ b/plugins/kubernetes/src/api/types.ts @@ -18,7 +18,7 @@ import { createApiRef } from '@backstage/core'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/plugin-kubernetes-backend'; +} from '@backstage/kubernetes-common'; export const kubernetesApiRef = createApiRef({ id: 'plugin.kubernetes.service', diff --git a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx index 650e6ddff1..2261cd5e3f 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { WarningPanel } from '@backstage/core'; import { Typography } from '@material-ui/core'; -import { ClusterObjects } from '@backstage/plugin-kubernetes-backend'; +import { ClusterObjects } from '@backstage/kubernetes-common'; const clustersWithErrorsToErrorMessage = ( clustersWithErrors: ClusterObjects[], diff --git a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx index cda8dd7e6b..5b30c62949 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx @@ -31,7 +31,7 @@ import { StatusOK, } from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; -import { ClusterObjects } from '@backstage/plugin-kubernetes-backend'; +import { ClusterObjects } from '@backstage/kubernetes-common'; import { ErrorPanel } from './ErrorPanel'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { DeploymentsAccordions } from '../DeploymentsAccordions'; diff --git a/plugins/kubernetes/src/error-detection/error-detection.test.ts b/plugins/kubernetes/src/error-detection/error-detection.test.ts index 8a4575c8be..50cf81a522 100644 --- a/plugins/kubernetes/src/error-detection/error-detection.test.ts +++ b/plugins/kubernetes/src/error-detection/error-detection.test.ts @@ -30,7 +30,7 @@ import * as maxedOutHpa from './__fixtures__/hpa-maxed-out.json'; import { FetchResponse, ObjectsByEntityResponse, -} from '@backstage/plugin-kubernetes-backend'; +} from '@backstage/kubernetes-common'; const CLUSTER_NAME = 'cluster-a'; diff --git a/plugins/kubernetes/src/error-detection/error-detection.ts b/plugins/kubernetes/src/error-detection/error-detection.ts index a44747969d..5cffbc181f 100644 --- a/plugins/kubernetes/src/error-detection/error-detection.ts +++ b/plugins/kubernetes/src/error-detection/error-detection.ts @@ -15,7 +15,7 @@ */ import { DetectedError, DetectedErrorsByCluster } from './types'; -import { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-backend'; +import { ObjectsByEntityResponse } from '@backstage/kubernetes-common'; import { groupResponses } from '../utils/response'; import { detectErrorsInPods } from './pods'; import { detectErrorsInDeployments } from './deployments'; diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 7c4de9ff1a..44434ec8f5 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts @@ -22,7 +22,7 @@ import { useEffect, useState } from 'react'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/plugin-kubernetes-backend'; +} from '@backstage/kubernetes-common'; export interface KubernetesObjects { kubernetesObjects: ObjectsByEntityResponse | undefined; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts index cab81f3622..cb14574bdc 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts @@ -15,7 +15,7 @@ */ import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesRequestBody } from '@backstage/kubernetes-common'; export class AwsKubernetesAuthProvider implements KubernetesAuthProvider { async decorateRequestBodyForAuth( diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts index 570806a1a4..649f0c14da 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts @@ -16,7 +16,7 @@ import { OAuthApi } from '@backstage/core'; import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesRequestBody } from '@backstage/kubernetes-common'; export class GoogleKubernetesAuthProvider implements KubernetesAuthProvider { authProvider: OAuthApi; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts index dc9d9b5e0d..bc74b2717f 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts @@ -15,7 +15,7 @@ */ import { OAuthApi } from '@backstage/core'; -import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesRequestBody } from '@backstage/kubernetes-common'; import { KubernetesAuthProvider, KubernetesAuthProvidersApi } from './types'; import { GoogleKubernetesAuthProvider } from './GoogleKubernetesAuthProvider'; import { ServiceAccountKubernetesAuthProvider } from './ServiceAccountKubernetesAuthProvider'; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts index 5d33521ae4..f54c51bf48 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts @@ -15,7 +15,7 @@ */ import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesRequestBody } from '@backstage/kubernetes-common'; export class ServiceAccountKubernetesAuthProvider implements KubernetesAuthProvider { diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts index 2bed2838b9..afb2615939 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts @@ -15,7 +15,7 @@ */ import { createApiRef } from '@backstage/core'; -import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-backend'; +import { KubernetesRequestBody } from '@backstage/kubernetes-common'; export interface KubernetesAuthProvider { decorateRequestBodyForAuth( diff --git a/plugins/kubernetes/src/utils/response.ts b/plugins/kubernetes/src/utils/response.ts index a9b10e7759..a38010ba74 100644 --- a/plugins/kubernetes/src/utils/response.ts +++ b/plugins/kubernetes/src/utils/response.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { FetchResponse } from '@backstage/plugin-kubernetes-backend'; +import { FetchResponse } from '@backstage/kubernetes-common'; import { GroupedResponses } from '../types/types'; // TODO this could probably be a lodash groupBy From f53fba29f6559c4ca0560100e1bccdef424a6476 Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Wed, 14 Apr 2021 18:15:47 +0200 Subject: [PATCH 11/73] kubernetes-common: Adds changeset and fixes linting Signed-off-by: Juan Lulkin --- .changeset/silly-tables-build.md | 6 ++++++ packages/kubernetes-common/.eslintrc.js | 3 +++ packages/kubernetes-common/CHANGELOG.md | 2 +- packages/kubernetes-common/README.md | 2 +- packages/kubernetes-common/package.json | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/silly-tables-build.md diff --git a/.changeset/silly-tables-build.md b/.changeset/silly-tables-build.md new file mode 100644 index 0000000000..3f7b3182dd --- /dev/null +++ b/.changeset/silly-tables-build.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-kubernetes-backend': patch +--- + +Adds @backstage/kubernetes-common library to share types between kubernetes frontend and backend. diff --git a/packages/kubernetes-common/.eslintrc.js b/packages/kubernetes-common/.eslintrc.js index e69de29bb2..16a033dbc6 100644 --- a/packages/kubernetes-common/.eslintrc.js +++ b/packages/kubernetes-common/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/packages/kubernetes-common/CHANGELOG.md b/packages/kubernetes-common/CHANGELOG.md index 4b73dbafad..a10c37c7d1 100644 --- a/packages/kubernetes-common/CHANGELOG.md +++ b/packages/kubernetes-common/CHANGELOG.md @@ -4,4 +4,4 @@ ### Minor Changes -- Adds the following types to be shared by the backend and the front end: \ No newline at end of file +- Adds types to be shared by the backend and the front end. diff --git a/packages/kubernetes-common/README.md b/packages/kubernetes-common/README.md index db3989cdcb..0034efbbff 100644 --- a/packages/kubernetes-common/README.md +++ b/packages/kubernetes-common/README.md @@ -1,3 +1,3 @@ # @backstage/kubernetes-common -Common types and functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend. \ No newline at end of file +Common types and functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend. diff --git a/packages/kubernetes-common/package.json b/packages/kubernetes-common/package.json index ff541911ba..9494b29ed0 100644 --- a/packages/kubernetes-common/package.json +++ b/packages/kubernetes-common/package.json @@ -35,6 +35,7 @@ "url": "https://github.com/backstage/backstage/issues" }, "dependencies": { + "@backstage/catalog-model": "^0.7.6", "@kubernetes/client-node": "^0.14.0" }, "devDependencies": { From 1cf63d00df1abc0d62f0f1f0f57e3750a46b86db Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 15 Apr 2021 10:21:25 +0200 Subject: [PATCH 12/73] plugin-kubernetes-common: Moves packages/kuberntes-common to plugins as per ADR11 Signed-off-by: Juan Lulkin --- plugins/kubernetes-backend/package.json | 2 +- plugins/kubernetes-backend/src/types/types.ts | 2 +- {packages => plugins}/kubernetes-common/.eslintrc.js | 0 {packages => plugins}/kubernetes-common/CHANGELOG.md | 2 +- {packages => plugins}/kubernetes-common/README.md | 2 +- {packages => plugins}/kubernetes-common/package.json | 4 ++-- {packages => plugins}/kubernetes-common/src/index.ts | 0 {packages => plugins}/kubernetes-common/src/types.ts | 0 plugins/kubernetes/schema.d.ts | 2 +- plugins/kubernetes/src/api/KubernetesBackendClient.ts | 2 +- plugins/kubernetes/src/api/types.ts | 2 +- .../src/components/KubernetesContent/ErrorPanel.tsx | 2 +- .../src/components/KubernetesContent/KubernetesContent.tsx | 2 +- .../kubernetes/src/error-detection/error-detection.test.ts | 2 +- plugins/kubernetes/src/error-detection/error-detection.ts | 2 +- plugins/kubernetes/src/hooks/useKubernetesObjects.ts | 2 +- .../src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts | 2 +- .../kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts | 2 +- .../src/kubernetes-auth-provider/KubernetesAuthProviders.ts | 2 +- .../ServiceAccountKubernetesAuthProvider.ts | 2 +- plugins/kubernetes/src/kubernetes-auth-provider/types.ts | 2 +- plugins/kubernetes/src/utils/response.ts | 2 +- 22 files changed, 20 insertions(+), 20 deletions(-) rename {packages => plugins}/kubernetes-common/.eslintrc.js (100%) rename {packages => plugins}/kubernetes-common/CHANGELOG.md (70%) rename {packages => plugins}/kubernetes-common/README.md (73%) rename {packages => plugins}/kubernetes-common/package.json (92%) rename {packages => plugins}/kubernetes-common/src/index.ts (100%) rename {packages => plugins}/kubernetes-common/src/types.ts (100%) diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json index 6c600f4d8b..3c8380b661 100644 --- a/plugins/kubernetes-backend/package.json +++ b/plugins/kubernetes-backend/package.json @@ -34,7 +34,7 @@ "@backstage/backend-common": "^0.6.3", "@backstage/catalog-model": "^0.7.7", "@backstage/config": "^0.1.4", - "@backstage/kubernetes-common": "^0.1.0", + "@backstage/plugin-kubernetes-common": "^0.1.0", "@google-cloud/container": "^2.2.0", "@kubernetes/client-node": "^0.14.0", "@types/express": "^4.17.6", diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index 2316740af0..119ca0451e 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -28,4 +28,4 @@ export type { KubernetesServiceLocator, ObjectFetchParams, ServiceLocatorMethod, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; diff --git a/packages/kubernetes-common/.eslintrc.js b/plugins/kubernetes-common/.eslintrc.js similarity index 100% rename from packages/kubernetes-common/.eslintrc.js rename to plugins/kubernetes-common/.eslintrc.js diff --git a/packages/kubernetes-common/CHANGELOG.md b/plugins/kubernetes-common/CHANGELOG.md similarity index 70% rename from packages/kubernetes-common/CHANGELOG.md rename to plugins/kubernetes-common/CHANGELOG.md index a10c37c7d1..44c9066ada 100644 --- a/packages/kubernetes-common/CHANGELOG.md +++ b/plugins/kubernetes-common/CHANGELOG.md @@ -1,4 +1,4 @@ -# @backstage/techdocs-common +# @backstage/plugin-kubernetes-common ## 0.1.0 diff --git a/packages/kubernetes-common/README.md b/plugins/kubernetes-common/README.md similarity index 73% rename from packages/kubernetes-common/README.md rename to plugins/kubernetes-common/README.md index 0034efbbff..c366d0493c 100644 --- a/packages/kubernetes-common/README.md +++ b/plugins/kubernetes-common/README.md @@ -1,3 +1,3 @@ -# @backstage/kubernetes-common +# @backstage/plugin-kubernetes-common Common types and functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend. diff --git a/packages/kubernetes-common/package.json b/plugins/kubernetes-common/package.json similarity index 92% rename from packages/kubernetes-common/package.json rename to plugins/kubernetes-common/package.json index 9494b29ed0..813b965c2c 100644 --- a/packages/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -1,5 +1,5 @@ { - "name": "@backstage/kubernetes-common", + "name": "@backstage/plugin-kubernetes-common", "description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin", "version": "0.1.0", "main": "src/index.ts", @@ -14,7 +14,7 @@ "repository": { "type": "git", "url": "https://github.com/backstage/backstage", - "directory": "packages/kubernetes-common" + "directory": "plugin/kubernetes-common" }, "keywords": [ "techdocs", diff --git a/packages/kubernetes-common/src/index.ts b/plugins/kubernetes-common/src/index.ts similarity index 100% rename from packages/kubernetes-common/src/index.ts rename to plugins/kubernetes-common/src/index.ts diff --git a/packages/kubernetes-common/src/types.ts b/plugins/kubernetes-common/src/types.ts similarity index 100% rename from packages/kubernetes-common/src/types.ts rename to plugins/kubernetes-common/src/types.ts diff --git a/plugins/kubernetes/schema.d.ts b/plugins/kubernetes/schema.d.ts index e421100760..9845fa4e47 100644 --- a/plugins/kubernetes/schema.d.ts +++ b/plugins/kubernetes/schema.d.ts @@ -17,7 +17,7 @@ import { ClusterLocatorMethod, CustomResource, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; export interface Config { kubernetes?: { diff --git a/plugins/kubernetes/src/api/KubernetesBackendClient.ts b/plugins/kubernetes/src/api/KubernetesBackendClient.ts index 0bbba7c8f7..19f1602143 100644 --- a/plugins/kubernetes/src/api/KubernetesBackendClient.ts +++ b/plugins/kubernetes/src/api/KubernetesBackendClient.ts @@ -19,7 +19,7 @@ import { KubernetesApi } from './types'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; export class KubernetesBackendClient implements KubernetesApi { private readonly discoveryApi: DiscoveryApi; diff --git a/plugins/kubernetes/src/api/types.ts b/plugins/kubernetes/src/api/types.ts index a575aea4b8..2e91783132 100644 --- a/plugins/kubernetes/src/api/types.ts +++ b/plugins/kubernetes/src/api/types.ts @@ -18,7 +18,7 @@ import { createApiRef } from '@backstage/core'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; export const kubernetesApiRef = createApiRef({ id: 'plugin.kubernetes.service', diff --git a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx index 2261cd5e3f..ba0026ac47 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/ErrorPanel.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { WarningPanel } from '@backstage/core'; import { Typography } from '@material-ui/core'; -import { ClusterObjects } from '@backstage/kubernetes-common'; +import { ClusterObjects } from '@backstage/plugin-kubernetes-common'; const clustersWithErrorsToErrorMessage = ( clustersWithErrors: ClusterObjects[], diff --git a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx index 5b30c62949..1461f52112 100644 --- a/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx +++ b/plugins/kubernetes/src/components/KubernetesContent/KubernetesContent.tsx @@ -31,7 +31,7 @@ import { StatusOK, } from '@backstage/core'; import { Entity } from '@backstage/catalog-model'; -import { ClusterObjects } from '@backstage/kubernetes-common'; +import { ClusterObjects } from '@backstage/plugin-kubernetes-common'; import { ErrorPanel } from './ErrorPanel'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { DeploymentsAccordions } from '../DeploymentsAccordions'; diff --git a/plugins/kubernetes/src/error-detection/error-detection.test.ts b/plugins/kubernetes/src/error-detection/error-detection.test.ts index 50cf81a522..5079ed9245 100644 --- a/plugins/kubernetes/src/error-detection/error-detection.test.ts +++ b/plugins/kubernetes/src/error-detection/error-detection.test.ts @@ -30,7 +30,7 @@ import * as maxedOutHpa from './__fixtures__/hpa-maxed-out.json'; import { FetchResponse, ObjectsByEntityResponse, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; const CLUSTER_NAME = 'cluster-a'; diff --git a/plugins/kubernetes/src/error-detection/error-detection.ts b/plugins/kubernetes/src/error-detection/error-detection.ts index 5cffbc181f..91544fe623 100644 --- a/plugins/kubernetes/src/error-detection/error-detection.ts +++ b/plugins/kubernetes/src/error-detection/error-detection.ts @@ -15,7 +15,7 @@ */ import { DetectedError, DetectedErrorsByCluster } from './types'; -import { ObjectsByEntityResponse } from '@backstage/kubernetes-common'; +import { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common'; import { groupResponses } from '../utils/response'; import { detectErrorsInPods } from './pods'; import { detectErrorsInDeployments } from './deployments'; diff --git a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts index 44434ec8f5..1dfe85fe38 100644 --- a/plugins/kubernetes/src/hooks/useKubernetesObjects.ts +++ b/plugins/kubernetes/src/hooks/useKubernetesObjects.ts @@ -22,7 +22,7 @@ import { useEffect, useState } from 'react'; import { KubernetesRequestBody, ObjectsByEntityResponse, -} from '@backstage/kubernetes-common'; +} from '@backstage/plugin-kubernetes-common'; export interface KubernetesObjects { kubernetesObjects: ObjectsByEntityResponse | undefined; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts index cb14574bdc..ef541b0173 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/AwsKubernetesAuthProvider.ts @@ -15,7 +15,7 @@ */ import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/kubernetes-common'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export class AwsKubernetesAuthProvider implements KubernetesAuthProvider { async decorateRequestBodyForAuth( diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts index 649f0c14da..9c9db0b9fc 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/GoogleKubernetesAuthProvider.ts @@ -16,7 +16,7 @@ import { OAuthApi } from '@backstage/core'; import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/kubernetes-common'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export class GoogleKubernetesAuthProvider implements KubernetesAuthProvider { authProvider: OAuthApi; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts index bc74b2717f..a96565f0c0 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/KubernetesAuthProviders.ts @@ -15,7 +15,7 @@ */ import { OAuthApi } from '@backstage/core'; -import { KubernetesRequestBody } from '@backstage/kubernetes-common'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { KubernetesAuthProvider, KubernetesAuthProvidersApi } from './types'; import { GoogleKubernetesAuthProvider } from './GoogleKubernetesAuthProvider'; import { ServiceAccountKubernetesAuthProvider } from './ServiceAccountKubernetesAuthProvider'; diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts b/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts index f54c51bf48..b88fd7679e 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/ServiceAccountKubernetesAuthProvider.ts @@ -15,7 +15,7 @@ */ import { KubernetesAuthProvider } from './types'; -import { KubernetesRequestBody } from '@backstage/kubernetes-common'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export class ServiceAccountKubernetesAuthProvider implements KubernetesAuthProvider { diff --git a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts index afb2615939..8d4cead11a 100644 --- a/plugins/kubernetes/src/kubernetes-auth-provider/types.ts +++ b/plugins/kubernetes/src/kubernetes-auth-provider/types.ts @@ -15,7 +15,7 @@ */ import { createApiRef } from '@backstage/core'; -import { KubernetesRequestBody } from '@backstage/kubernetes-common'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export interface KubernetesAuthProvider { decorateRequestBodyForAuth( diff --git a/plugins/kubernetes/src/utils/response.ts b/plugins/kubernetes/src/utils/response.ts index a38010ba74..1d860ca226 100644 --- a/plugins/kubernetes/src/utils/response.ts +++ b/plugins/kubernetes/src/utils/response.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { FetchResponse } from '@backstage/kubernetes-common'; +import { FetchResponse } from '@backstage/plugin-kubernetes-common'; import { GroupedResponses } from '../types/types'; // TODO this could probably be a lodash groupBy From a3b25f6c2e0bb1f17e3513567211f945b6fde5ac Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 15 Apr 2021 11:43:08 +0200 Subject: [PATCH 13/73] kubernetes: Removes schema.d.ts Signed-off-by: Juan Lulkin --- plugins/kubernetes/package.json | 4 +--- plugins/kubernetes/schema.d.ts | 42 --------------------------------- 2 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 plugins/kubernetes/schema.d.ts diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index 7c607b1776..c808678922 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -19,7 +19,6 @@ "backstage", "kubernetes" ], - "configSchema": "schema.d.ts", "scripts": { "build": "backstage-cli plugin:build", "start": "backstage-cli plugin:serve", @@ -63,7 +62,6 @@ "msw": "^0.21.2" }, "files": [ - "dist", - "schema.d.ts" + "dist" ] } diff --git a/plugins/kubernetes/schema.d.ts b/plugins/kubernetes/schema.d.ts deleted file mode 100644 index 9845fa4e47..0000000000 --- a/plugins/kubernetes/schema.d.ts +++ /dev/null @@ -1,42 +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 { - ClusterLocatorMethod, - CustomResource, -} from '@backstage/plugin-kubernetes-common'; - -export interface Config { - kubernetes?: { - /** - * @visibility frontend - */ - serviceLocatorMethod: { - /** - * @visibility frontend - */ - type: 'multiTenant'; - }; - /** - * @visibility frontend - */ - clusterLocatorMethods: ClusterLocatorMethod[]; - /** - * @visibility frontend - */ - customResources?: CustomResource[]; - }; -} From 219313b29db39fdface66981e5c7b8450f928761 Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 15 Apr 2021 11:48:01 +0200 Subject: [PATCH 14/73] kubernetes-backend: Moves backend specific types back from common Signed-off-by: Juan Lulkin --- plugins/kubernetes-backend/src/types/types.ts | 118 ++++++++++++++++-- plugins/kubernetes-common/src/types.ts | 111 +--------------- 2 files changed, 113 insertions(+), 116 deletions(-) diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index 119ca0451e..b7822557c2 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -14,18 +14,116 @@ * limitations under the License. */ -export type { - ClusterDetails, - CustomResource, +import type { + FetchResponse, + KubernetesFetchError, +} from '@backstage/plugin-kubernetes-common'; + +export type { FetchResponse, - FetchResponseWrapper, - KubernetesClustersSupplier, KubernetesErrorTypes, KubernetesFetchError, - KubernetesFetcher, - KubernetesObjectTypes, KubernetesRequestBody, - KubernetesServiceLocator, - ObjectFetchParams, - ServiceLocatorMethod, } from '@backstage/plugin-kubernetes-common'; + +export type ClusterLocatorMethod = + | ConfigClusterLocatorMethod + | GKEClusterLocatorMethod; + +export interface ConfigClusterLocatorMethod { + /** + * @visibility frontend + */ + type: 'config'; + clusters: { + /** + * @visibility frontend + */ + url: string; + /** + * @visibility frontend + */ + name: string; + /** + * @visibility secret + */ + serviceAccountToken: string | undefined; + /** + * @visibility frontend + */ + authProvider: 'aws' | 'google' | 'serviceAccount'; + }[]; +} + +export interface GKEClusterLocatorMethod { + /** + * @visibility frontend + */ + type: 'gke'; + /** + * @visibility frontend + */ + projectId: string; + /** + * @visibility frontend + */ + region?: string; +} + +export interface CustomResource { + group: string; + apiVersion: string; + plural: string; +} + +export interface ObjectFetchParams { + serviceId: string; + clusterDetails: ClusterDetails; + objectTypesToFetch: Set; + labelSelector: string; + customResources: CustomResource[]; +} + +// Fetches information from a kubernetes cluster using the cluster details object +// to target a specific cluster +export interface KubernetesFetcher { + fetchObjectsForService( + params: ObjectFetchParams, + ): Promise; +} + +export interface FetchResponseWrapper { + errors: KubernetesFetchError[]; + responses: FetchResponse[]; +} + +// TODO fairly sure there's a easier way to do this + +export type KubernetesObjectTypes = + | 'pods' + | 'services' + | 'configmaps' + | 'deployments' + | 'replicasets' + | 'horizontalpodautoscalers' + | 'ingresses' + | 'customresources'; + +// Used to load cluster details from different sources +export interface KubernetesClustersSupplier { + getClusters(): Promise; +} + +// Used to locate which cluster(s) a service is running on +export interface KubernetesServiceLocator { + getClustersByServiceId(serviceId: string): Promise; +} + +export type ServiceLocatorMethod = 'multiTenant' | 'http'; // TODO implement http + +export interface ClusterDetails { + name: string; + url: string; + authProvider: string; + serviceAccountToken?: string | undefined; +} diff --git a/plugins/kubernetes-common/src/types.ts b/plugins/kubernetes-common/src/types.ts index 84ca08585b..23dc4f0f3c 100644 --- a/plugins/kubernetes-common/src/types.ts +++ b/plugins/kubernetes-common/src/types.ts @@ -25,13 +25,6 @@ import { } from '@kubernetes/client-node'; import { Entity } from '@backstage/catalog-model'; -export interface ClusterDetails { - name: string; - url: string; - authProvider: string; - serviceAccountToken?: string | undefined; -} - export interface KubernetesRequestBody { auth?: { google?: string; @@ -49,10 +42,7 @@ export interface ObjectsByEntityResponse { items: ClusterObjects[]; } -export interface FetchResponseWrapper { - errors: KubernetesFetchError[]; - responses: FetchResponse[]; -} +export type AuthProviderType = 'google' | 'serviceAccount' | 'aws'; export type FetchResponse = | PodFetchResponse @@ -64,18 +54,6 @@ export type FetchResponse = | IngressesFetchResponse | CustomResourceFetchResponse; -// TODO fairly sure there's a easier way to do this - -export type KubernetesObjectTypes = - | 'pods' - | 'services' - | 'configmaps' - | 'deployments' - | 'replicasets' - | 'horizontalpodautoscalers' - | 'ingresses' - | 'customresources'; - export interface PodFetchResponse { type: 'pods'; resources: Array; @@ -116,30 +94,10 @@ export interface CustomResourceFetchResponse { resources: Array; } -export interface ObjectFetchParams { - serviceId: string; - clusterDetails: ClusterDetails; - objectTypesToFetch: Set; - labelSelector: string; - customResources: CustomResource[]; -} - -// Fetches information from a kubernetes cluster using the cluster details object -// to target a specific cluster -export interface KubernetesFetcher { - fetchObjectsForService( - params: ObjectFetchParams, - ): Promise; -} - -// Used to locate which cluster(s) a service is running on -export interface KubernetesServiceLocator { - getClustersByServiceId(serviceId: string): Promise; -} - -// Used to load cluster details from different sources -export interface KubernetesClustersSupplier { - getClusters(): Promise; +export interface KubernetesFetchError { + errorType: KubernetesErrorTypes; + statusCode?: number; + resourcePath?: string; } export type KubernetesErrorTypes = @@ -147,62 +105,3 @@ export type KubernetesErrorTypes = | 'UNAUTHORIZED_ERROR' | 'SYSTEM_ERROR' | 'UNKNOWN_ERROR'; - -export interface KubernetesFetchError { - errorType: KubernetesErrorTypes; - statusCode?: number; - resourcePath?: string; -} - -export interface ConfigClusterLocatorMethod { - /** - * @visibility frontend - */ - type: 'config'; - clusters: { - /** - * @visibility frontend - */ - url: string; - /** - * @visibility frontend - */ - name: string; - /** - * @visibility secret - */ - serviceAccountToken: string | undefined; - /** - * @visibility frontend - */ - authProvider: 'aws' | 'google' | 'serviceAccount'; - }[]; -} - -export interface GKEClusterLocatorMethod { - /** - * @visibility frontend - */ - type: 'gke'; - /** - * @visibility frontend - */ - projectId: string; - /** - * @visibility frontend - */ - region?: string; -} - -export type ClusterLocatorMethod = - | ConfigClusterLocatorMethod - | GKEClusterLocatorMethod; - -export type ServiceLocatorMethod = 'multiTenant' | 'http'; // TODO implement http -export type AuthProviderType = 'google' | 'serviceAccount' | 'aws'; - -export interface CustomResource { - group: string; - apiVersion: string; - plural: string; -} From 99930d194c3cab71dd7bc0f54921ab586ce925f0 Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 15 Apr 2021 13:35:55 +0200 Subject: [PATCH 15/73] kubernetes-common: Exports types in a way that pleases the transpiler Signed-off-by: Juan Lulkin --- plugins/kubernetes-backend/src/types/types.ts | 9 +++++---- plugins/kubernetes-common/package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index b7822557c2..344e265426 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -15,17 +15,18 @@ */ import type { - FetchResponse, - KubernetesFetchError, + FetchResponse as FetchResponseCommon, + KubernetesFetchError as KubernetesFetchErrorCommon, } from '@backstage/plugin-kubernetes-common'; export type { - FetchResponse, KubernetesErrorTypes, - KubernetesFetchError, KubernetesRequestBody, } from '@backstage/plugin-kubernetes-common'; +export type KubernetesFetchError = KubernetesFetchErrorCommon; +export type FetchResponse = FetchResponseCommon; + export type ClusterLocatorMethod = | ConfigClusterLocatorMethod | GKEClusterLocatorMethod; diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json index 813b965c2c..682223d92e 100644 --- a/plugins/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -24,7 +24,7 @@ "dist" ], "scripts": { - "build": "backstage-cli build --outputs cjs,types", + "build": "backstage-cli build", "lint": "backstage-cli lint", "test": "backstage-cli test", "prepack": "backstage-cli prepack", From fb4ebd961edc3059c89c5f230c4371e29fa9ecaa Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 15 Apr 2021 14:11:20 +0200 Subject: [PATCH 16/73] plugin-kubernetes-common: Adds pass with no tests, since these are just types Signed-off-by: Juan Lulkin --- plugins/kubernetes-common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json index 682223d92e..3551eb6413 100644 --- a/plugins/kubernetes-common/package.json +++ b/plugins/kubernetes-common/package.json @@ -26,7 +26,7 @@ "scripts": { "build": "backstage-cli build", "lint": "backstage-cli lint", - "test": "backstage-cli test", + "test": "backstage-cli test --passWithNoTests", "prepack": "backstage-cli prepack", "postpack": "backstage-cli postpack", "clean": "backstage-cli clean" From 34a4aa2c1e44664a08cdabc4bc2e68eabe86b14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20A=CC=8Ahsberg?= Date: Wed, 28 Apr 2021 15:52:33 +0000 Subject: [PATCH 17/73] Pass processor logger to repository parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Åhsberg --- .../processors/BitbucketDiscoveryProcessor.ts | 19 ++++++++------- .../BitbucketRepositoryParser.test.ts | 16 ++++--------- .../bitbucket/BitbucketRepositoryParser.ts | 15 ++++++------ .../ingestion/processors/bitbucket/client.ts | 9 -------- .../ingestion/processors/bitbucket/types.ts | 23 ++++++++----------- 5 files changed, 31 insertions(+), 51 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts index 858219423f..9c56eb14e3 100644 --- a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts @@ -22,11 +22,11 @@ import { } from '@backstage/integration'; import { LocationSpec } from '@backstage/catalog-model'; import { - Bitbucket, BitbucketRepositoryParser, BitbucketClient, defaultRepositoryParser, paginated, + BitbucketRepository, } from './bitbucket'; import { CatalogProcessor, CatalogProcessorEmit } from './types'; @@ -66,20 +66,19 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { return false; } - const bitbucketConfig = this.integrations.bitbucket.byUrl(location.target) - ?.config; - if (!bitbucketConfig) { + const integration = this.integrations.bitbucket.byUrl(location.target); + if (!integration) { throw new Error( `There is no Bitbucket integration that matches ${location.target}. Please add a configuration entry for it under integrations.bitbucket`, ); - } else if (bitbucketConfig.host === 'bitbucket.org') { + } else if (integration.config.host === 'bitbucket.org') { throw new Error( `Component discovery for Bitbucket Cloud is not yet supported`, ); } const client = new BitbucketClient({ - config: bitbucketConfig, + config: integration.config, }); const startTimestamp = Date.now(); this.logger.info(`Reading Bitbucket repositories from ${location.target}`); @@ -90,9 +89,9 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { for (const repository of result.matches) { for await (const entity of this.parser({ - client: client, - repository: repository, - path: catalogPath, + integration: integration, + target: `${repository.links.self[0]}${catalogPath}`, + logger: this.logger, })) { emit(entity); } @@ -159,5 +158,5 @@ function escapeRegExp(str: string): RegExp { type Result = { scanned: number; - matches: Bitbucket.Repository[]; + matches: BitbucketRepository[]; }; diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts index e0d430f77b..3d42d9c4ba 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.test.ts @@ -14,9 +14,9 @@ * limitations under the License. */ import { defaultRepositoryParser } from './BitbucketRepositoryParser'; -import { Bitbucket } from './types'; -import { BitbucketClient } from './client'; import { results } from '../index'; +import { getVoidLogger } from '@backstage/backend-common'; +import { BitbucketIntegration } from '@backstage/integration'; describe('BitbucketRepositoryParser', () => { describe('defaultRepositoryParser', () => { @@ -34,15 +34,9 @@ describe('BitbucketRepositoryParser', () => { ), ]; const actual = await defaultRepositoryParser({ - client: {} as BitbucketClient, - repository: { - project: {} as Bitbucket.Project, - slug: 'repo-slug', - links: { - self: [{ href: browseUrl }], - }, - } as Bitbucket.Repository, - path: path, + integration: {} as BitbucketIntegration, + target: `${browseUrl}${path}`, + logger: getVoidLogger(), }); let i = 0; diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts index 05e3c6822a..9ad038f9ec 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/BitbucketRepositoryParser.ts @@ -13,25 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Bitbucket } from './types'; import { CatalogProcessorResult } from '../types'; import { results } from '../index'; -import { BitbucketClient } from './client'; +import { Logger } from 'winston'; +import { BitbucketIntegration } from '@backstage/integration'; export type BitbucketRepositoryParser = (options: { - client: BitbucketClient; - repository: Bitbucket.Repository; - path: string; + integration: BitbucketIntegration; + target: string; + logger: Logger; }) => AsyncIterable; export const defaultRepositoryParser: BitbucketRepositoryParser = async function* defaultRepositoryParser({ - repository, - path, + target, }) { yield results.location( { type: 'url', - target: `${repository.links.self[0].href}${path}`, + target: target, }, // Not all locations may actually exist, since the user defined them as a wildcard pattern. // Thus, we emit them as optional and let the downstream processor find them while not outputting diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/client.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/client.ts index 601461dcf5..c3c27aedfc 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/client.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/client.ts @@ -41,15 +41,6 @@ export class BitbucketClient { ); } - async getRaw( - projectKey: string, - repo: string, - path: string, - ): Promise { - const request = `${this.config.apiBaseUrl}/projects/${projectKey}/repos/${repo}/raw/${path}`; - return fetch(request, getBitbucketRequestOptions(this.config)); - } - private async pagedRequest( endpoint: string, options?: ListOptions, diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts index 8a8656f666..32dc28eb98 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/types.ts @@ -13,18 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export namespace Bitbucket { - export type Project = { +export type BitbucketRepository = { + project: { key: string; }; - - export type Repository = { - project: Project; - slug: string; - links: Record; - }; - - export type Link = { - href: string; - }; -} + slug: string; + links: Record< + string, + { + href: string; + }[] + >; +}; From 6e9d535c697ad1bde957b2c55023d6029b1c2096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20A=CC=8Ahsberg?= Date: Thu, 29 Apr 2021 14:20:41 +0000 Subject: [PATCH 18/73] Do not expose Bitbucket internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathias Åhsberg --- .../BitbucketDiscoveryProcessor.test.ts | 211 ++++++++---------- .../processors/BitbucketDiscoveryProcessor.ts | 2 +- .../ingestion/processors/bitbucket/index.ts | 6 +- .../src/ingestion/processors/index.ts | 3 +- 4 files changed, 93 insertions(+), 129 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.test.ts b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.test.ts index 73f4281a51..1f01b77f42 100644 --- a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.test.ts @@ -17,21 +17,73 @@ import { getVoidLogger } from '@backstage/backend-common'; import { BitbucketDiscoveryProcessor } from './BitbucketDiscoveryProcessor'; import { ConfigReader } from '@backstage/config'; import { LocationSpec } from '@backstage/catalog-model'; -import { - BitbucketClient, - BitbucketRepositoryParser, - PagedResponse, -} from './bitbucket'; +import { BitbucketRepositoryParser, PagedResponse } from './bitbucket'; import { results } from './index'; +import { RequestHandler, rest } from 'msw'; +import { setupServer } from 'msw/node'; -function pagedResponse(values: any): PagedResponse { - return { - values: values, - isLastPage: true, - } as PagedResponse; +const server = setupServer(); + +function setupStubs(projects: any[]) { + function pagedResponse(values: any): PagedResponse { + return { + values: values, + isLastPage: true, + } as PagedResponse; + } + + function stubbedProject( + project: string, + repos: string[], + ): RequestHandler { + return rest.get( + `https://bitbucket.mycompany.com/api/rest/1.0/projects/${project}/repos`, + (_, res, ctx) => { + const response = []; + for (const repo of repos) { + response.push({ + slug: repo, + links: { + self: [ + { + href: `https://bitbucket.mycompany.com/projects/${project}/repos/${repo}/browse`, + }, + ], + }, + }); + } + return res(ctx.json(pagedResponse(response))); + }, + ); + } + + server.use( + rest.get( + `https://bitbucket.mycompany.com/api/rest/1.0/projects`, + (_, res, ctx) => { + return res( + ctx.json( + pagedResponse( + projects.map(p => { + return { key: p.key }; + }), + ), + ), + ); + }, + ), + ); + + for (const project of projects) { + server.use(stubbedProject(project.key, project.repos)); + } } describe('BitbucketDiscoveryProcessor', () => { + beforeAll(() => server.listen()); + afterEach(() => server.resetHandlers()); + afterAll(() => server.close()); + afterEach(() => jest.resetAllMocks()); describe('reject unrelated entries', () => { @@ -81,58 +133,29 @@ describe('BitbucketDiscoveryProcessor', () => { const processor = BitbucketDiscoveryProcessor.fromConfig( new ConfigReader({ integrations: { - bitbucket: [{ host: 'bitbucket.mycompany.com', token: 'blob' }], + bitbucket: [ + { + host: 'bitbucket.mycompany.com', + token: 'blob', + apiBaseUrl: 'https://bitbucket.mycompany.com/api/rest/1.0', + }, + ], }, }), { logger: getVoidLogger() }, ); it('output all repositories', async () => { + setupStubs([ + { key: 'backstage', repos: ['backstage'] }, + { key: 'demo', repos: ['demo'] }, + ]); const location: LocationSpec = { type: 'bitbucket-discovery', target: 'https://bitbucket.mycompany.com/projects/*/repos/*/catalog.yaml', }; - jest - .spyOn(BitbucketClient.prototype, 'listProjects') - .mockResolvedValue( - pagedResponse([{ key: 'backstage' }, { key: 'demo' }]), - ); - jest - .spyOn(BitbucketClient.prototype, 'listRepositories') - .mockResolvedValueOnce( - pagedResponse([ - { - slug: 'backstage', - links: { - self: [ - { - href: - 'https://bitbucket.mycompany.com/projects/backstage/repos/backstage/browse', - }, - ], - }, - }, - ]), - ); - jest - .spyOn(BitbucketClient.prototype, 'listRepositories') - .mockResolvedValueOnce( - pagedResponse([ - { - slug: 'demo', - links: { - self: [ - { - href: - 'https://bitbucket.mycompany.com/projects/demo/repos/demo/browse', - }, - ], - }, - }, - ]), - ); const emitter = jest.fn(); await processor.readLocation(location, false, emitter); @@ -158,44 +181,16 @@ describe('BitbucketDiscoveryProcessor', () => { }); it('output repositories with wildcards', async () => { + setupStubs([ + { key: 'backstage', repos: ['backstage', 'techdocs-cli'] }, + { key: 'demo', repos: ['demo'] }, + ]); const location: LocationSpec = { type: 'bitbucket-discovery', target: 'https://bitbucket.mycompany.com/projects/backstage/repos/techdocs-*/catalog.yaml', }; - jest - .spyOn(BitbucketClient.prototype, 'listProjects') - .mockResolvedValue(pagedResponse([{ key: 'backstage' }])); - jest - .spyOn(BitbucketClient.prototype, 'listRepositories') - .mockResolvedValueOnce( - pagedResponse([ - { slug: 'backstage' }, - { - slug: 'techdocs-cli', - links: { - self: [ - { - href: - 'https://bitbucket.mycompany.com/projects/backstage/repos/techdocs-cli/browse', - }, - ], - }, - }, - { - slug: 'techdocs-container', - links: { - self: [ - { - href: - 'https://bitbucket.mycompany.com/projects/backstage/repos/techdocs-container/browse', - }, - ], - }, - }, - ]), - ); const emitter = jest.fn(); await processor.readLocation(location, false, emitter); @@ -208,46 +203,15 @@ describe('BitbucketDiscoveryProcessor', () => { }, optional: true, }); - expect(emitter).toHaveBeenCalledWith({ - type: 'location', - location: { - type: 'url', - target: - 'https://bitbucket.mycompany.com/projects/backstage/repos/techdocs-container/browse/catalog.yaml', - }, - optional: true, - }); }); it('filter unrelated repositories', async () => { + setupStubs([{ key: 'backstage', repos: ['test', 'abctest', 'testxyz'] }]); const location: LocationSpec = { type: 'bitbucket-discovery', target: 'https://bitbucket.mycompany.com/projects/backstage/repos/test/catalog.yaml', }; - jest - .spyOn(BitbucketClient.prototype, 'listProjects') - .mockResolvedValue(pagedResponse([{ key: 'backstage' }])); - jest - .spyOn(BitbucketClient.prototype, 'listRepositories') - .mockResolvedValue( - pagedResponse([ - { slug: 'abstest' }, - { slug: 'testxyz' }, - { - slug: 'test', - links: { - self: [ - { - href: - 'https://bitbucket.mycompany.com/projects/backstage/repos/test', - }, - ], - }, - }, - ]), - ); - const emitter = jest.fn(); await processor.readLocation(location, false, emitter); @@ -256,7 +220,7 @@ describe('BitbucketDiscoveryProcessor', () => { location: { type: 'url', target: - 'https://bitbucket.mycompany.com/projects/backstage/repos/test/catalog.yaml', + 'https://bitbucket.mycompany.com/projects/backstage/repos/test/browse/catalog.yaml', }, optional: true, }); @@ -277,26 +241,27 @@ describe('BitbucketDiscoveryProcessor', () => { const processor = BitbucketDiscoveryProcessor.fromConfig( new ConfigReader({ integrations: { - bitbucket: [{ host: 'bitbucket.mycompany.com', token: 'blob' }], + bitbucket: [ + { + host: 'bitbucket.mycompany.com', + token: 'blob', + apiBaseUrl: 'https://bitbucket.mycompany.com/api/rest/1.0', + }, + ], }, }), { parser: customRepositoryParser, logger: getVoidLogger() }, ); it('use custom repository parser', async () => { + setupStubs([{ key: 'backstage', repos: ['test'] }]); + const location: LocationSpec = { type: 'bitbucket-discovery', target: 'https://bitbucket.mycompany.com/projects/backstage/repos/test/catalog.yaml', }; - jest - .spyOn(BitbucketClient.prototype, 'listProjects') - .mockResolvedValue(pagedResponse([{ key: 'backstage' }])); - jest - .spyOn(BitbucketClient.prototype, 'listRepositories') - .mockResolvedValue(pagedResponse([{ slug: 'test' }])); - const emitter = jest.fn(); await processor.readLocation(location, false, emitter); diff --git a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts index 9c56eb14e3..399adfbc14 100644 --- a/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/BitbucketDiscoveryProcessor.ts @@ -90,7 +90,7 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { for (const repository of result.matches) { for await (const entity of this.parser({ integration: integration, - target: `${repository.links.self[0]}${catalogPath}`, + target: `${repository.links.self[0].href}${catalogPath}`, logger: this.logger, })) { emit(entity); diff --git a/plugins/catalog-backend/src/ingestion/processors/bitbucket/index.ts b/plugins/catalog-backend/src/ingestion/processors/bitbucket/index.ts index ba2a2b3afe..06effffcd2 100644 --- a/plugins/catalog-backend/src/ingestion/processors/bitbucket/index.ts +++ b/plugins/catalog-backend/src/ingestion/processors/bitbucket/index.ts @@ -14,7 +14,7 @@ * limitations under the License. */ export { BitbucketClient, paginated } from './client'; -export type { PagedResponse } from './client'; -export * from './types'; -export type { BitbucketRepositoryParser } from './BitbucketRepositoryParser'; export { defaultRepositoryParser } from './BitbucketRepositoryParser'; +export type { PagedResponse } from './client'; +export type { BitbucketRepository } from './types'; +export type { BitbucketRepositoryParser } from './BitbucketRepositoryParser'; diff --git a/plugins/catalog-backend/src/ingestion/processors/index.ts b/plugins/catalog-backend/src/ingestion/processors/index.ts index c8f51bbccc..a92cc9ed3b 100644 --- a/plugins/catalog-backend/src/ingestion/processors/index.ts +++ b/plugins/catalog-backend/src/ingestion/processors/index.ts @@ -36,5 +36,4 @@ export { UrlReaderProcessor } from './UrlReaderProcessor'; export { parseEntityYaml } from './util/parse'; export { results }; -export { BitbucketClient } from './bitbucket'; -export type { BitbucketRepositoryParser, Bitbucket } from './bitbucket'; +export type { BitbucketRepositoryParser } from './bitbucket'; From cec7fb9b372c7ba20565119918f030ea50990bb4 Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Tue, 30 Mar 2021 17:23:24 +0200 Subject: [PATCH 19/73] Add support for json schema to API docs Signed-off-by: Oliver Sand --- .changeset/six-mayflies-peel.md | 5 + packages/catalog-model/examples/all-apis.yaml | 1 + .../examples/apis/config-schema-api.yaml | 11 + plugins/api-docs/README.md | 1 + plugins/api-docs/dev/index.tsx | 15 + .../api-docs/dev/jsonschema-example-api.yaml | 32 + plugins/api-docs/package.json | 3 + .../ApiDefinitionCard/ApiDefinitionWidget.tsx | 9 + .../JsonSchemaDefinitionWidget.test.tsx | 61 + .../JsonSchemaDefinitionWidget.tsx | 50 + .../JsonSchemaDefinitionWidget/index.ts | 17 + plugins/api-docs/src/components/index.ts | 1 + yarn.lock | 1038 ++++++++++++++++- 13 files changed, 1238 insertions(+), 6 deletions(-) create mode 100644 .changeset/six-mayflies-peel.md create mode 100644 packages/catalog-model/examples/apis/config-schema-api.yaml create mode 100644 plugins/api-docs/dev/jsonschema-example-api.yaml create mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx create mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx create mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts diff --git a/.changeset/six-mayflies-peel.md b/.changeset/six-mayflies-peel.md new file mode 100644 index 0000000000..9d022bca0a --- /dev/null +++ b/.changeset/six-mayflies-peel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-api-docs': patch +--- + +Add support for displaying JSON schemas. diff --git a/packages/catalog-model/examples/all-apis.yaml b/packages/catalog-model/examples/all-apis.yaml index e23f1b3656..8ec9203b28 100644 --- a/packages/catalog-model/examples/all-apis.yaml +++ b/packages/catalog-model/examples/all-apis.yaml @@ -5,6 +5,7 @@ metadata: description: A collection of all Backstage example APIs spec: targets: + - ./apis/config-schema-api.yaml - ./apis/hello-world-api.yaml - ./apis/petstore-api.yaml - ./apis/spotify-api.yaml diff --git a/packages/catalog-model/examples/apis/config-schema-api.yaml b/packages/catalog-model/examples/apis/config-schema-api.yaml new file mode 100644 index 0000000000..4bd8976614 --- /dev/null +++ b/packages/catalog-model/examples/apis/config-schema-api.yaml @@ -0,0 +1,11 @@ +apiVersion: backstage.io/v1alpha1 +kind: API +metadata: + name: config-schema + description: A Backstage config schemas. +spec: + type: jsonschema + lifecycle: production + owner: team-a + definition: + $text: https://github.com/backstage/backstage/blob/master/plugins/config-schema/dev/example-schema.json diff --git a/plugins/api-docs/README.md b/plugins/api-docs/README.md index dac4b6ff4d..f995a7d002 100644 --- a/plugins/api-docs/README.md +++ b/plugins/api-docs/README.md @@ -15,6 +15,7 @@ Right now, the following API formats are supported: - [OpenAPI](https://swagger.io/specification/) 2 & 3 - [AsyncAPI](https://www.asyncapi.com/docs/specifications/latest/) - [GraphQL](https://graphql.org/learn/schema/) +- [JSON Schema](https://json-schema.org/) Other formats are displayed as plain text, but this can easily be extended. diff --git a/plugins/api-docs/dev/index.tsx b/plugins/api-docs/dev/index.tsx index fbfab37f5b..d51d3a714c 100644 --- a/plugins/api-docs/dev/index.tsx +++ b/plugins/api-docs/dev/index.tsx @@ -27,6 +27,7 @@ import { } from '../src'; import asyncapiApiEntity from './asyncapi-example-api.yaml'; import graphqlApiEntity from './graphql-example-api.yaml'; +import jsonschemaApiEntity from './jsonschema-example-api.yaml'; import openapiApiEntity from './openapi-example-api.yaml'; import otherApiEntity from './other-example-api.yaml'; @@ -41,6 +42,7 @@ createDevApp() items: [ openapiApiEntity, asyncapiApiEntity, + jsonschemaApiEntity, graphqlApiEntity, otherApiEntity, ], @@ -87,6 +89,19 @@ createDevApp() ), }) + .addPage({ + title: 'JSON Schema', + element: ( + +
+ + + + + + + ), + }) .addPage({ title: 'GraphQL', element: ( diff --git a/plugins/api-docs/dev/jsonschema-example-api.yaml b/plugins/api-docs/dev/jsonschema-example-api.yaml new file mode 100644 index 0000000000..a34b4f9a49 --- /dev/null +++ b/plugins/api-docs/dev/jsonschema-example-api.yaml @@ -0,0 +1,32 @@ +apiVersion: backstage.io/v1alpha1 +kind: API +metadata: + name: persons + description: Person dataset +spec: + type: jsonschema + lifecycle: experimental + owner: team-c + # From https://json-schema.org/learn/miscellaneous-examples.html + definition: | + { + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } + } diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index 5c9f9ca7ee..be5d5186d2 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -38,6 +38,9 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", + "@stoplight/json-schema-viewer": "^4.0.0-beta.16", + "@stoplight/mosaic": "^1.0.0-beta.46", + "@stoplight/reporter": "^1.10.0", "@types/react": "^16.9", "graphiql": "^1.0.0-alpha.10", "graphql": "^15.3.0", diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx index 360404af40..fc23c338ee 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx @@ -16,6 +16,7 @@ import React from 'react'; import { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget'; import { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget'; +import { JsonSchemaDefinitionWidget } from '../JsonSchemaDefinitionWidget'; import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget'; export type ApiDefinitionWidget = { @@ -51,5 +52,13 @@ export function defaultDefinitionWidgets(): ApiDefinitionWidget[] { ), }, + { + type: 'jsonschema', + title: 'JSON Schema', + rawLanguage: 'json', + component: definition => ( + + ), + }, ]; } diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx new file mode 100644 index 0000000000..b4077e6ea2 --- /dev/null +++ b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx @@ -0,0 +1,61 @@ +/* + * 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 { renderInTestApp } from '@backstage/test-utils'; +import React from 'react'; +import { JsonSchemaDefinitionWidget } from './JsonSchemaDefinitionWidget'; + +describe('', () => { + it('renders json schema', async () => { + // From https://json-schema.org/learn/miscellaneous-examples.html + const definition = ` +{ + "$id": "https://example.com/person.schema.json", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "Person", + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "The person's first name." + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + } + } +} + `; + const { getByText } = await renderInTestApp( + , + ); + + expect(getByText(/lastName/i)).toBeInTheDocument(); + expect(getByText(/The person's last name./i)).toBeInTheDocument(); + }); + + it('renders error if definition is missing', async () => { + const { getByText } = await renderInTestApp( + , + ); + expect(getByText(/No schema defined/i)).toBeInTheDocument(); + }); +}); diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx new file mode 100644 index 0000000000..ea8ac652c8 --- /dev/null +++ b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx @@ -0,0 +1,50 @@ +/* + * 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 { useTheme } from '@material-ui/core'; +import { JsonSchemaViewer } from '@stoplight/json-schema-viewer'; +import { injectStyles, useThemeStore } from '@stoplight/mosaic'; +import React, { useMemo } from 'react'; +import { useEffectOnce } from 'react-use'; + +injectStyles(); + +type Props = { + definition: any; +}; + +export const JsonSchemaDefinitionWidget = ({ definition }: Props) => { + const schema = useMemo(() => JSON.parse(definition), [definition]); + const theme = useTheme(); + const themeStore = useThemeStore(); + + useEffectOnce(() => { + themeStore.setColor('background', theme.palette.background.paper); + themeStore.setColor('text', theme.palette.text.primary); + themeStore.setColor('primary', theme.palette.primary.main); + themeStore.setColor('success', theme.palette.success.main); + themeStore.setColor('warning', theme.palette.warning.main); + themeStore.setColor('danger', theme.palette.error.main); + themeStore.setMode(theme.palette.type); + }); + return ( + + ); +}; diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts new file mode 100644 index 0000000000..47d2619ec2 --- /dev/null +++ b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export { JsonSchemaDefinitionWidget } from './JsonSchemaDefinitionWidget'; diff --git a/plugins/api-docs/src/components/index.ts b/plugins/api-docs/src/components/index.ts index cfd985f47c..afac37dc31 100644 --- a/plugins/api-docs/src/components/index.ts +++ b/plugins/api-docs/src/components/index.ts @@ -20,3 +20,4 @@ export * from './AsyncApiDefinitionWidget'; export * from './ComponentsCards'; export * from './OpenApiDefinitionWidget'; export * from './PlainApiDefinitionWidget'; +export * from './JsonSchemaDefinitionWidget'; diff --git a/yarn.lock b/yarn.lock index 5fdd60715c..4831b9f51a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,24 @@ # yarn lockfile v1 +"@amplitude/types@^1.5.4": + version "1.5.4" + resolved "https://registry.npmjs.org/@amplitude/types/-/types-1.5.4.tgz#7fcbcbfb321d794b6367596cd950a92c752431d1" + integrity sha512-+e+wqlO5E4lNTM19lATf+lJldV+VD2RGzrDEy45cPEtfpXxHJUHwhfOKZkKg/zlx+YAubcpNhWLm2NSPpHUs9A== + +"@amplitude/ua-parser-js@0.7.24": + version "0.7.24" + resolved "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz#2ce605af7d2c38d4a01313fb2385df55fbbd69aa" + integrity sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA== + +"@amplitude/utils@^1.0.5": + version "1.5.4" + resolved "https://registry.npmjs.org/@amplitude/utils/-/utils-1.5.4.tgz#457e847d751522ac8dd910037667d780ef501642" + integrity sha512-VAd/ibhwBBeL8pKqCz8tjCnSx8epOvUa+Je6sA3AB4R8855xl+bdrDjYwMmOWOILvEH3Pltq2jVJCE2thBoFdQ== + dependencies: + "@amplitude/types" "^1.5.4" + tslib "^1.9.3" + "@apidevtools/json-schema-ref-parser@^9.0.6": version "9.0.6" resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#5d9000a3ac1fd25404da886da6b266adcd99cf1c" @@ -1623,6 +1641,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.13.17", "@babel/runtime@^7.6.2": + version "7.13.17" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" + integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -2077,6 +2102,32 @@ dependencies: yaml-ast-parser "0.0.43" +"@fortawesome/fontawesome-common-types@^0.2.35": + version "0.2.35" + resolved "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.35.tgz#01dd3d054da07a00b764d78748df20daf2b317e9" + integrity sha512-IHUfxSEDS9dDGqYwIW7wTN6tn/O8E0n5PcAHz9cAaBoZw6UpG20IG/YM3NNLaGPwPqgjBAFjIURzqoQs3rrtuw== + +"@fortawesome/fontawesome-svg-core@^1.2.35": + version "1.2.35" + resolved "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.35.tgz#85aea8c25645fcec88d35f2eb1045c38d3e65cff" + integrity sha512-uLEXifXIL7hnh2sNZQrIJWNol7cTVIzwI+4qcBIq9QWaZqUblm0IDrtSqbNg+3SQf8SMGHkiSigD++rHmCHjBg== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.35" + +"@fortawesome/free-solid-svg-icons@^5.15.2", "@fortawesome/free-solid-svg-icons@^5.15.3": + version "5.15.3" + resolved "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.3.tgz#52eebe354f60dc77e0bde934ffc5c75ffd04f9d8" + integrity sha512-XPeeu1IlGYqz4VWGRAT5ukNMd4VHUEEJ7ysZ7pSSgaEtNvSo+FLurybGJVmiqkQdK50OkSja2bfZXOeyMGRD8Q== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.35" + +"@fortawesome/react-fontawesome@^0.1.14": + version "0.1.14" + resolved "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.14.tgz#bf28875c3935b69ce2dc620e1060b217a47f64ca" + integrity sha512-4wqNb0gRLVaBm/h+lGe8UfPPivcbuJ6ecI4hIgW0LjI7kzpYB9FkN0L9apbVzg+lsBdcTf0AlBtODjcSX5mmKA== + dependencies: + prop-types "^15.7.2" + "@gitbeaker/core@^28.0.2", "@gitbeaker/core@^28.2.0": version "28.2.0" resolved "https://registry.npmjs.org/@gitbeaker/core/-/core-28.2.0.tgz#87e6f789faf55d726f75d05e470020e4bbb8e08c" @@ -2733,6 +2784,21 @@ resolved "https://registry.npmjs.org/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== +"@internationalized/message@3.0.0-alpha.0": + version "3.0.0-alpha.0" + resolved "https://registry.npmjs.org/@internationalized/message/-/message-3.0.0-alpha.0.tgz#83015e2057d2b6b5034a3e23983b1e051f9d9e36" + integrity sha512-NT2eiVq5f5z7Yi9Hmchb8GAGYjEpYbYcD4u/Oxo5XG9XFbrnz7zNvrJJlzuQ+2jPozabq6pFKurqaFmM49DYUg== + dependencies: + "@babel/runtime" "^7.6.2" + intl-messageformat "^2.2.0" + +"@internationalized/number@3.0.0-alpha.0": + version "3.0.0-alpha.0" + resolved "https://registry.npmjs.org/@internationalized/number/-/number-3.0.0-alpha.0.tgz#27190fbc1d73a24ac96dfafdfe7aa4e520090eed" + integrity sha512-8aOD2I3HmEscIZO/cm1jkcrYMSmRPhoW9G1OsuQb4Ge/Y9HsJVGB9otTylUEXJUmoXi/eD8Mr1gx3+0FLCM4eA== + dependencies: + "@babel/runtime" "^7.6.2" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" @@ -4233,6 +4299,445 @@ prop-types "^15.6.1" react-lifecycles-compat "^3.0.4" +"@react-aria/button@~3.3.1": + version "3.3.1" + resolved "https://registry.npmjs.org/@react-aria/button/-/button-3.3.1.tgz#f180ffa95e3e822b7da4937421cf8280dd17af17" + integrity sha512-LXNuo0L79AhYqnxV+Y3J3xt7hPcmCVCEpZaC/dBzovR1MLunrdpk3QAXsRt3tqza1XvoqdvNhNHQm1Z1kyBTUg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.3" + "@react-aria/utils" "^3.6.0" + "@react-stately/toggle" "^3.2.1" + "@react-types/button" "^3.3.1" + +"@react-aria/dialog@~3.1.2": + version "3.1.2" + resolved "https://registry.npmjs.org/@react-aria/dialog/-/dialog-3.1.2.tgz#868970e7fdaa6ddb91a0d8d5b492778607d417fd" + integrity sha512-CUHzLdcKxnQ1IpbJOJ3BIDe762QoTOFXZfDAheNiTi24ym85w7KkW7dnfJDK2+J5RY15c5KWooOZvTaBmIJ7Xw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.2" + "@react-aria/utils" "^3.3.0" + "@react-stately/overlays" "^3.1.1" + "@react-types/dialog" "^3.3.0" + +"@react-aria/focus@^3.2.2", "@react-aria/focus@^3.2.3", "@react-aria/focus@^3.2.4", "@react-aria/focus@~3.2.4": + version "3.2.4" + resolved "https://registry.npmjs.org/@react-aria/focus/-/focus-3.2.4.tgz#86c4fbde51a7cae414407b2d421fb5b311cd62f5" + integrity sha512-qoJoUDSriI7RCRq3L7yDOPtFZfquyjLA9d2pOJzvMx1F6dEqfNCaycyIg9lHykHXXhShgrXwfpyGTXoSUQpmtw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-types/shared" "^3.5.0" + clsx "^1.1.1" + +"@react-aria/i18n@^3.3.0": + version "3.3.0" + resolved "https://registry.npmjs.org/@react-aria/i18n/-/i18n-3.3.0.tgz#7f92ae81f6536b19b17b89c0991ddb6c10f2512a" + integrity sha512-8KYk0tQiEf9Kd9xdF4cKliP1169WSIryKFnZgnm9dvZl96TyfDK1xJpZQy58XjRdbS/H45CKydFmMcZEElu3BQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@internationalized/message" "3.0.0-alpha.0" + "@internationalized/number" "3.0.0-alpha.0" + "@react-aria/ssr" "^3.0.1" + "@react-aria/utils" "^3.6.0" + "@react-types/shared" "^3.4.0" + +"@react-aria/interactions@^3.2.1", "@react-aria/interactions@^3.3.3", "@react-aria/interactions@^3.3.4", "@react-aria/interactions@~3.3.4": + version "3.3.4" + resolved "https://registry.npmjs.org/@react-aria/interactions/-/interactions-3.3.4.tgz#a5b3a87f886cf0f4e28cbd13fbe02c7efb4f1e2e" + integrity sha512-WzT9aIRWvLZvZvuwNKKUkZzeomZgIrquAtwgRYGWbjSbrYPOT9B3w/GBEWZDYUG0c1K8NkIEAxTX0e+QI+tqAA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.7.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/label@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-aria/label/-/label-3.1.1.tgz#03dc5c4813cd1f51760ba48783c186c2eeda1189" + integrity sha512-9kZKJonYSXeY6hZULZrsujAb6uXDGEy8qPq0tjTVoTA3+gx26LOmLCLgvHFtxUK1e4s99rHmaSPdOtq5qu3EVQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.3.0" + "@react-types/label" "^3.2.1" + "@react-types/shared" "^3.2.1" + +"@react-aria/listbox@~3.2.4": + version "3.2.4" + resolved "https://registry.npmjs.org/@react-aria/listbox/-/listbox-3.2.4.tgz#3162e47d64e1f6cd8fdfe45766cb88c3852a525d" + integrity sha512-IYs4oS2wzWVcWEtKG57zZLZI507WlDy24wuzymwgFxxIRXDVaBsSMOs7+uE7N1P4fLOa1yAlv170AvKDDbIJ2g== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.3" + "@react-aria/label" "^3.1.1" + "@react-aria/selection" "^3.3.2" + "@react-aria/utils" "^3.6.0" + "@react-stately/collections" "^3.3.0" + "@react-stately/list" "^3.2.2" + "@react-types/listbox" "^3.1.1" + "@react-types/shared" "^3.4.0" + +"@react-aria/menu@^3.2.0": + version "3.2.0" + resolved "https://registry.npmjs.org/@react-aria/menu/-/menu-3.2.0.tgz#cd9417105b3230f1c34ddddddb31a95f462393e2" + integrity sha512-CFgC82ZO/LjJtMhDUJFdE3+PV0jS88LK9CCr6w11ggp+U3Q2fPXPdkAVeEB3cJn4KI0TRCBgE+4EneIzdTEgcw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.3.4" + "@react-aria/overlays" "^3.6.2" + "@react-aria/selection" "^3.4.0" + "@react-aria/utils" "^3.7.0" + "@react-stately/collections" "^3.3.1" + "@react-stately/menu" "^3.2.1" + "@react-stately/tree" "^3.1.3" + "@react-types/button" "^3.3.1" + "@react-types/menu" "^3.1.1" + "@react-types/shared" "^3.5.0" + +"@react-aria/overlays@^3.6.1", "@react-aria/overlays@^3.6.2", "@react-aria/overlays@~3.6.2": + version "3.6.2" + resolved "https://registry.npmjs.org/@react-aria/overlays/-/overlays-3.6.2.tgz#0a9fcb7426d4321dc80ee636282228eb7be83a84" + integrity sha512-6f9o1fypGcB/VcprvoDm5280glaiAp/9RZeNPP+HPXE5MxpQIzFDJCzTrSezAUYNkueh/KNMpUxOUUgytloScQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-aria/visually-hidden" "^3.2.1" + "@react-stately/overlays" "^3.1.1" + "@react-types/button" "^3.3.1" + "@react-types/overlays" "^3.4.0" + dom-helpers "^3.3.1" + +"@react-aria/select@~3.3.1": + version "3.3.1" + resolved "https://registry.npmjs.org/@react-aria/select/-/select-3.3.1.tgz#cfa694ff4b2020846e08b58f6f0a489f0d2b24ff" + integrity sha512-E/EZ4SKf8P5EMVznCmTjfa9y1cR6L+WIzXHTFAlwrmmIzNirHSipbFp6LpJzoByqd0p9IKxhBdxqFP92url0Qg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/label" "^3.1.1" + "@react-aria/menu" "^3.2.0" + "@react-aria/selection" "^3.4.0" + "@react-aria/utils" "^3.7.0" + "@react-aria/visually-hidden" "^3.2.1" + "@react-stately/select" "^3.1.1" + "@react-types/button" "^3.3.1" + "@react-types/select" "^3.2.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/selection@^3.3.2", "@react-aria/selection@^3.4.0": + version "3.4.0" + resolved "https://registry.npmjs.org/@react-aria/selection/-/selection-3.4.0.tgz#abd7aa5435f504e314a72122f2bcaef43b06fa78" + integrity sha512-ddxiB9zhy8JEkG4+DElSMNrSKxRI3RQKyOwQf4i3omqXj8bMH1XJesFwbdGNmR/zrbzXvr35ln9y3S0WS+4ClA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.4" + "@react-aria/i18n" "^3.3.0" + "@react-aria/interactions" "^3.3.4" + "@react-aria/utils" "^3.7.0" + "@react-stately/collections" "^3.3.1" + "@react-stately/selection" "^3.4.0" + "@react-types/shared" "^3.5.0" + +"@react-aria/separator@~3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-aria/separator/-/separator-3.1.1.tgz#bfcd71bb5ab50dc04a7f307b84bd77955f08002f" + integrity sha512-VbiqQsTtKKMjvMcPVWgTbDHzx7qMP3VFC+y9cEVajicMwRoO4bn7kJgcSzainXpWx70bhT5RW1mt84fzxMF+Lg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/utils" "^3.3.0" + "@react-types/shared" "^3.2.1" + +"@react-aria/ssr@^3.0.1", "@react-aria/ssr@~3.0.1": + version "3.0.1" + resolved "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.0.1.tgz#5f7c111f9ecd184b8f6140139703c1ee552dca30" + integrity sha512-rweMNcSkUO4YkcmgFIoZFvgPyHN2P9DOjq3VOHnZ8SG3Y4TTvSY6Iv90KgzeEfmWCUqqt65FYH4JgrpGNToEMw== + dependencies: + "@babel/runtime" "^7.6.2" + +"@react-aria/tooltip@~3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-aria/tooltip/-/tooltip-3.1.1.tgz#e0dfdd9e51b581563f684927249d70e1bad761e3" + integrity sha512-wTszWN6lG3A9Ofdrhv1vG9aOmoqzuUZCbG9ZbXZ9+RtiOMwP/WnuSLWXcMH+KaWYpaImy7h1MDfOgHeaPxCbag== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/focus" "^3.2.3" + "@react-aria/interactions" "^3.3.3" + "@react-aria/overlays" "^3.6.1" + "@react-aria/utils" "^3.6.0" + "@react-stately/tooltip" "^3.0.2" + "@react-types/shared" "^3.4.0" + "@react-types/tooltip" "^3.1.1" + +"@react-aria/utils@^3.3.0", "@react-aria/utils@^3.6.0", "@react-aria/utils@^3.7.0", "@react-aria/utils@~3.7.0": + version "3.7.0" + resolved "https://registry.npmjs.org/@react-aria/utils/-/utils-3.7.0.tgz#0aab1f682e9f1781cfadd2dd1ef9494bfaca0cbf" + integrity sha512-sMCdX0eF+4B05I+SX9V/NzI1/fD45vabi0dNyJhbSu2xNI82VIYgPcMBDjGU83NJSnjY969R3/JbbLjBrtKUgA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/ssr" "^3.0.1" + "@react-stately/utils" "^3.2.0" + "@react-types/shared" "^3.5.0" + clsx "^1.1.1" + +"@react-aria/visually-hidden@^3.2.1": + version "3.2.1" + resolved "https://registry.npmjs.org/@react-aria/visually-hidden/-/visually-hidden-3.2.1.tgz#c022c562346140a473242448045add59269a74fd" + integrity sha512-ba7bQD09MuzUghtPyrQoXHgQnRRfOu039roVKPz2em9gHD0Wy4ap2UPwlzx35KzNq6FdCzMDZeSZHSnUWlzKnw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/interactions" "^3.2.1" + "@react-aria/utils" "^3.3.0" + clsx "^1.1.1" + +"@react-hook/debounce@^3.0.0": + version "3.0.0" + resolved "https://registry.npmjs.org/@react-hook/debounce/-/debounce-3.0.0.tgz#9eea8b5d81d4cb67cd72dd8657b3ff724afc7cad" + integrity sha512-ir/kPrSfAzY12Gre0sOHkZ2rkEmM4fS5M5zFxCi4BnCeXh2nvx9Ujd+U4IGpKCuPA+EQD0pg1eK2NGLvfWejag== + dependencies: + "@react-hook/latest" "^1.0.2" + +"@react-hook/event@^1.2.1": + version "1.2.3" + resolved "https://registry.npmjs.org/@react-hook/event/-/event-1.2.3.tgz#cfe86d5cf36f53e85b367ff619990d001b5c82ae" + integrity sha512-WMBwLnYY2rubLeecsi4skl1imfx0oiXTgazV/1ByPT6WkmLvxUao3hC+mxps5D/+JK4Fq3uG9OWU/dn5jMtXyg== + dependencies: + "@react-hook/passive-layout-effect" "^1.2.0" + +"@react-hook/latest@^1.0.2": + version "1.0.3" + resolved "https://registry.npmjs.org/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" + integrity sha512-dy6duzl+JnAZcDbNTfmaP3xHiKtbXYOaz3G51MGVljh548Y8MWzTr+PHLOfvpypEVW9zwvl+VyKjbWKEVbV1Rg== + +"@react-hook/passive-layout-effect@^1.2.0": + version "1.2.1" + resolved "https://registry.npmjs.org/@react-hook/passive-layout-effect/-/passive-layout-effect-1.2.1.tgz#c06dac2d011f36d61259aa1c6df4f0d5e28bc55e" + integrity sha512-IwEphTD75liO8g+6taS+4oqz+nnroocNfWVHWz7j+N+ZO2vYrc6PV1q7GQhuahL0IOR7JccFTsFKQ/mb6iZWAg== + +"@react-hook/resize-observer@^1.1.0": + version "1.2.0" + resolved "https://registry.npmjs.org/@react-hook/resize-observer/-/resize-observer-1.2.0.tgz#a44b385d998f4ab33aa9481a43c4ac33af21f7d7" + integrity sha512-7Cpy0aaZ3xXlSabQ43aZcfgzwYSidrshEKGDqpfvdx7pHnGDGskr8m1Ajb6yamJUSdTRgqCemYQcwouCqMmZoQ== + dependencies: + "@react-hook/latest" "^1.0.2" + "@react-hook/passive-layout-effect" "^1.2.0" + "@types/raf-schd" "^4.0.0" + raf-schd "^4.0.2" + resize-observer-polyfill "^1.5.1" + +"@react-hook/size@^2.1.1": + version "2.1.1" + resolved "https://registry.npmjs.org/@react-hook/size/-/size-2.1.1.tgz#10d3fb5bc61e128f0d7924714a925a04c992ed1f" + integrity sha512-QtHDsrvz8p4cai2UKxBpzk0r/uM63UyhmozTVChaDHJsVpN5/7A2yu8wuGyNhExdeCYMclLM21QjY1dyqpGbuQ== + dependencies: + "@react-hook/passive-layout-effect" "^1.2.0" + "@react-hook/resize-observer" "^1.1.0" + +"@react-hook/throttle@^2.2.0": + version "2.2.0" + resolved "https://registry.npmjs.org/@react-hook/throttle/-/throttle-2.2.0.tgz#d0402714a06e1ba0bc1da1fdf5c3c5cd0e08d45a" + integrity sha512-LJ5eg+yMV8lXtqK3lR+OtOZ2WH/EfWvuiEEu0M3bhR7dZRfTyEJKxH1oK9uyBxiXPtWXiQggWbZirMCXam51tg== + dependencies: + "@react-hook/latest" "^1.0.2" + +"@react-hook/window-size@^3.0.7": + version "3.0.7" + resolved "https://registry.npmjs.org/@react-hook/window-size/-/window-size-3.0.7.tgz#00d176e7a8eb55814e161eae34aae20afbcbe35d" + integrity sha512-bK5ed/jN+cxy0s1jt2CelCnUt7jZRseUvPQ22ZJkUl/QDOsD+7CA/6wcqC3c0QweM/fPBRP6uI56TJ48SnlVww== + dependencies: + "@react-hook/debounce" "^3.0.0" + "@react-hook/event" "^1.2.1" + "@react-hook/throttle" "^2.2.0" + +"@react-spectrum/utils@~3.5.1": + version "3.5.1" + resolved "https://registry.npmjs.org/@react-spectrum/utils/-/utils-3.5.1.tgz#dd733913e30e0ed59c6bdae430531283b4cdcc96" + integrity sha512-lSdxCtshkj9dsi9sGcem6s9lak2XT55uyZGZr2S3w6iwm3aS7OlJNoT/4xtUFGW3t1bF2oxNngHX6eLl+quFyw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-aria/i18n" "^3.3.0" + "@react-aria/ssr" "^3.0.1" + "@react-aria/utils" "^3.6.0" + "@react-types/shared" "^3.4.0" + clsx "^1.1.1" + +"@react-stately/collections@^3.2.1", "@react-stately/collections@^3.3.0", "@react-stately/collections@^3.3.1": + version "3.3.1" + resolved "https://registry.npmjs.org/@react-stately/collections/-/collections-3.3.1.tgz#683acf6e7a4e9ea174e1cf82a13bb8175ba0a1a0" + integrity sha512-bBiOj0hszFpCbk9KhSm04Jo87GAODm8kA52uFiGAO99yb2ypO+UTFYseBExFQ59cV7b++UMCfdJe/+Ymv9RALg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-types/shared" "^3.5.0" + +"@react-stately/list@^3.2.1", "@react-stately/list@^3.2.2": + version "3.2.2" + resolved "https://registry.npmjs.org/@react-stately/list/-/list-3.2.2.tgz#fb368cc7678503179202d11aef0ef8d48d1cbf12" + integrity sha512-8sJvy0cUhllhUMadYjX1qKmTxAWMRGxkvZpU/6reOEChlvibjAwbn2paoR8yZ+ppieeQOBe+AAYTl53gK8fKDA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.0" + "@react-stately/selection" "^3.2.1" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/menu@^3.2.1": + version "3.2.1" + resolved "https://registry.npmjs.org/@react-stately/menu/-/menu-3.2.1.tgz#314646217e5dd49fa1da6886d33f485d44d6f0dd" + integrity sha512-8cpCynynjjn3qWNzrZMJEpsdk4tkXK9q3Xaw0ADqVym/NC/wPU3P3cqL4HY+ETar01tS2x8K23qYHbOZz0cQtQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/overlays" "^3.1.1" + "@react-stately/utils" "^3.1.1" + "@react-types/menu" "^3.1.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/overlays@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-stately/overlays/-/overlays-3.1.1.tgz#6c1a393b77148184f7b1df22ece832d694d5a8b4" + integrity sha512-79YYXvmWKflezNPhc4fvXA1rDZurZvvEJcmbStNlR5Ryrnk/sQiOQCoVWooi2M4glSMT3UOTvD7YEnXxARcuIQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/utils" "^3.1.1" + "@react-types/overlays" "^3.2.1" + +"@react-stately/select@^3.1.1", "@react-stately/select@~3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-stately/select/-/select-3.1.1.tgz#f49602ee7fc71f14550360bfa7c5becab58ac877" + integrity sha512-cl63nW66IJPsn9WQjKvghAIFKdFKuU1txx4zdEGY9tcwB/Yc+bgniLGOOTExJqN/RdPW9uBny5jjWcc4OQXyJA== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.2.1" + "@react-stately/list" "^3.2.1" + "@react-stately/menu" "^3.2.1" + "@react-stately/selection" "^3.2.1" + "@react-stately/utils" "^3.1.1" + "@react-types/select" "^3.1.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/selection@^3.2.1", "@react-stately/selection@^3.4.0": + version "3.4.0" + resolved "https://registry.npmjs.org/@react-stately/selection/-/selection-3.4.0.tgz#795134e17b59f21cc4979b30179bccdfc2e3b9c1" + integrity sha512-5RV9f1Tm4WSTDguL1iizYcgzeWiK6Qe2EZ03zaaE9gm5UyyIrEPQD4WW9Semio2cUF8IFuWLaOvRCk+un7p53Q== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.1" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.5.0" + +"@react-stately/toggle@^3.2.1": + version "3.2.1" + resolved "https://registry.npmjs.org/@react-stately/toggle/-/toggle-3.2.1.tgz#8b10b5eb99c3c4df2c36d17a5f23b77773ed7722" + integrity sha512-gZVuJ8OYoATUoXzdprsyx6O1w3wCrN+J0KnjhrjjKTrBG68n3pZH0p6dM0XpsaCzlSv0UgNa4fhHS3dYfr/ovw== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/utils" "^3.1.1" + "@react-types/checkbox" "^3.2.1" + "@react-types/shared" "^3.2.1" + +"@react-stately/tooltip@^3.0.2", "@react-stately/tooltip@~3.0.3": + version "3.0.3" + resolved "https://registry.npmjs.org/@react-stately/tooltip/-/tooltip-3.0.3.tgz#577fbf3cca39db7047ec2d77ddc03a56c454a82a" + integrity sha512-N98S8ccHEpgbgM6wIMZwqz37s8IQTa+5nPr8eVnIs5wqwdnAARFjvckr2okOGwaksofp1wtpcYbnNrIBwexJOg== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/overlays" "^3.1.1" + "@react-stately/utils" "^3.2.0" + "@react-types/tooltip" "^3.1.1" + +"@react-stately/tree@^3.1.3": + version "3.1.3" + resolved "https://registry.npmjs.org/@react-stately/tree/-/tree-3.1.3.tgz#5ceb1aa3793836a503253ddd47fc9227ac59c7b4" + integrity sha512-xwM2C3ppd8yJfduwgff7Gl2bNPMVeF4K65InFJZNVx5JLKFF6DJLAPTORAHLpCN+AoB8bY4sRK3V5fNBVpz0oQ== + dependencies: + "@babel/runtime" "^7.6.2" + "@react-stately/collections" "^3.3.1" + "@react-stately/selection" "^3.4.0" + "@react-stately/utils" "^3.1.1" + "@react-types/shared" "^3.5.0" + +"@react-stately/utils@^3.1.1", "@react-stately/utils@^3.2.0": + version "3.2.0" + resolved "https://registry.npmjs.org/@react-stately/utils/-/utils-3.2.0.tgz#0b90a70fee3236025ad8bed1f0e3555d5fc10296" + integrity sha512-vVBJvHVLnQySgqZ7OfP3ngDdwfGscJDsSD3WcN5ntHiT3JlZ5bksQReDkJEs20SFu2ST4w/0K7O4m97SbuMl2Q== + dependencies: + "@babel/runtime" "^7.6.2" + +"@react-types/button@^3.3.1": + version "3.3.1" + resolved "https://registry.npmjs.org/@react-types/button/-/button-3.3.1.tgz#4bdd325bc7df19c33911af256f63eae91e2a452e" + integrity sha512-xKLGSzGfsDBMe0SM7icOLNmzW38sdNSDSGMdrTLd3ygxb6pXY/LlcTdx7Sq28hdW8XL/ikFAnoQeS1VLXZHj7w== + dependencies: + "@react-types/shared" "^3.4.0" + +"@react-types/checkbox@^3.2.1": + version "3.2.2" + resolved "https://registry.npmjs.org/@react-types/checkbox/-/checkbox-3.2.2.tgz#7182d44a533e2ffd2c9118372cbc2c33b006eb18" + integrity sha512-WAAqLdjf6GUWjsMN5NaFMFumOtGTq+3+48CpM0ah2L+qmhMdj1s4gvHDerhls6u4ovRK/7zhg7XK+qQwcYVqMg== + dependencies: + "@react-types/shared" "^3.4.0" + +"@react-types/dialog@^3.3.0": + version "3.3.0" + resolved "https://registry.npmjs.org/@react-types/dialog/-/dialog-3.3.0.tgz#60a2b53f250ee082b53aef9340c80f1afe654bc7" + integrity sha512-63Vsr/UOZiaajlNDQUgWDi6v3EMenV1f8Cwh+L4lcyIJnbC6WeC2VEV3ld/TYVC0U58SQ0k7u2EIyHkWjc5kdQ== + dependencies: + "@react-types/overlays" "^3.2.1" + "@react-types/shared" "^3.2.1" + +"@react-types/label@^3.2.1": + version "3.4.0" + resolved "https://registry.npmjs.org/@react-types/label/-/label-3.4.0.tgz#6023dc9dd0146324ead52e08540cd60e57a3e27f" + integrity sha512-l84ysm1dcjL/5qVk9iN74z+/Ul0999XqnwTu6aTbuwAXqMk2sTU45eK2Yp/FJ7YWeflcF1vsomTkjMkX0BHKMw== + dependencies: + "@react-types/shared" "^3.4.0" + +"@react-types/listbox@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-types/listbox/-/listbox-3.1.1.tgz#b896303ccb87123cf59ee2c089953d7928497c9b" + integrity sha512-HAljfdpbyLoJL9iwqz7Fw9MOmRwfzODeN+sr5ncE0eXJxnRBFhb5LjbjAN1dUBrKFBkv3etGlYu5HvX+PJjpew== + dependencies: + "@react-types/shared" "^3.2.1" + +"@react-types/menu@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-types/menu/-/menu-3.1.1.tgz#e5aa52ac07c083243540dd5da0790a85fd1628c6" + integrity sha512-/xZWp4/3P/8dKFAGuzxz8IccSXvJH0TmHIk2/xnj2Eyw9152IfutIpOda3iswhjrx1LEkzUgdJ8bCdiebgg6QQ== + dependencies: + "@react-types/overlays" "^3.2.1" + "@react-types/shared" "^3.2.1" + +"@react-types/overlays@^3.2.1", "@react-types/overlays@^3.4.0": + version "3.4.0" + resolved "https://registry.npmjs.org/@react-types/overlays/-/overlays-3.4.0.tgz#3c4619906bb12e3697e770b59c2090bb18da25bd" + integrity sha512-ddiMB6JXR7acQnRFEL2/6SSdBropmNrcAFk3qFCfovuVZh6STYhPmoAgj06mJFDoAD63pxayysfPG2EvLl2yAw== + dependencies: + "@react-types/shared" "^3.3.0" + +"@react-types/select@^3.1.1", "@react-types/select@^3.2.0": + version "3.2.0" + resolved "https://registry.npmjs.org/@react-types/select/-/select-3.2.0.tgz#31b9e0f94fc24f053f4a1f073e174ffd59bac055" + integrity sha512-9vYhQWr1iB+3KWTZ1RxS2xZq0n0CJfsTRbEr0akLrtE/pRLC4O4l8RMFD49HyX0fShvz1FStmxTE2x7k8yVc4w== + dependencies: + "@react-types/shared" "^3.4.0" + +"@react-types/shared@^3.2.1", "@react-types/shared@^3.3.0", "@react-types/shared@^3.4.0", "@react-types/shared@^3.5.0": + version "3.5.0" + resolved "https://registry.npmjs.org/@react-types/shared/-/shared-3.5.0.tgz#dbc90e8fe711967e66d6f3ce0e17d34b24bd6283" + integrity sha512-997Me7AegwJOI10ye/Q5ds6fT+VBc6XcsXYzPqOD+HIbyL1kUQNDF/VoO37ib7KEH8jXH9aceoX9blz3Q1QcpA== + +"@react-types/tooltip@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@react-types/tooltip/-/tooltip-3.1.1.tgz#7d45a4dd8c57c422a1a2dcb03b6c043e7481c3ca" + integrity sha512-18gM2Co9tzCDfN0tEdfboD18sXDtD6YiKctd8HQ8tBiRO4IF1ce9ubKe6++Lj+38GQPq7GWFFoUiS1WArTWIHA== + dependencies: + "@react-types/overlays" "^3.4.0" + "@react-types/shared" "^3.4.0" + "@rjsf/core@^2.4.0": version "2.5.1" resolved "https://registry.npmjs.org/@rjsf/core/-/core-2.5.1.tgz#95a842d22bab5f83929662fcd73739108e9f5cbb" @@ -4440,6 +4945,179 @@ dependencies: any-observable "^0.3.0" +"@sentry/apm@5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/apm/-/apm-5.13.2.tgz#3a0809912426f52e19b1f4a603e99423a0ac8fb9" + integrity sha512-Pv6PRVkcmmYYIT422gXm968F8YQyf5uN1RSHOFBjWsxI3Ke/uRgeEdIVKPDo78GklBfETyRN6GyLEZ555jRe6g== + dependencies: + "@sentry/browser" "5.13.2" + "@sentry/hub" "5.13.2" + "@sentry/minimal" "5.13.2" + "@sentry/types" "5.13.2" + "@sentry/utils" "5.13.2" + tslib "^1.9.3" + +"@sentry/apm@5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/apm/-/apm-5.19.2.tgz#369fdcbc9fa5db992f707b24f3165e106a277cf7" + integrity sha512-V7p5niqG/Nn1OSMAyreChiIrQFYzFHKADKNaDEvIXqC4hxFnMG8lPRqEFJH49fNjsFBFfIG9iY1rO1ZFg3S42Q== + dependencies: + "@sentry/browser" "5.19.2" + "@sentry/hub" "5.19.2" + "@sentry/minimal" "5.19.2" + "@sentry/types" "5.19.2" + "@sentry/utils" "5.19.2" + tslib "^1.9.3" + +"@sentry/browser@5.13.2", "@sentry/browser@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/browser/-/browser-5.13.2.tgz#fcca630c8c80447ba8392803d4e4450fd2231b92" + integrity sha512-4MeauHs8Rf1c2FF6n84wrvA4LexEL1K/Tg3r+1vigItiqyyyYBx1sPjHGZeKeilgBi+6IEV5O8sy30QIrA/NsQ== + dependencies: + "@sentry/core" "5.13.2" + "@sentry/types" "5.13.2" + "@sentry/utils" "5.13.2" + tslib "^1.9.3" + +"@sentry/browser@5.19.2", "@sentry/browser@~5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/browser/-/browser-5.19.2.tgz#8bad445b8d1efd50e6510bb43b3018b941f6e5cb" + integrity sha512-o6Z532n+0N5ANDzgR9GN+Q6CU7zVlIJvBEW234rBiB+ZZj6XwTLS1dD+JexGr8lCo8PeXI2rypKcj1jUGLVW8w== + dependencies: + "@sentry/core" "5.19.2" + "@sentry/types" "5.19.2" + "@sentry/utils" "5.19.2" + tslib "^1.9.3" + +"@sentry/core@5.13.2", "@sentry/core@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/core/-/core-5.13.2.tgz#d89e199beef612d0a01e5c4df4e0bb7efcb72c74" + integrity sha512-iB7CQSt9e0EJhSmcNOCjzJ/u7E7qYJ3mI3h44GO83n7VOmxBXKSvtUl9FpKFypbWrsdrDz8HihLgAZZoMLWpPA== + dependencies: + "@sentry/hub" "5.13.2" + "@sentry/minimal" "5.13.2" + "@sentry/types" "5.13.2" + "@sentry/utils" "5.13.2" + tslib "^1.9.3" + +"@sentry/core@5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/core/-/core-5.19.2.tgz#99a64ef0e55230fc02a083c48fa07ada85de4929" + integrity sha512-sfbBsVXpA0WYJUichz5IhvqKD8xJUfQvsszrTsUKa7PQAMAboOmuh6bo8KquaVQnAZyZWZU08UduvlSV3tA7tw== + dependencies: + "@sentry/hub" "5.19.2" + "@sentry/minimal" "5.19.2" + "@sentry/types" "5.19.2" + "@sentry/utils" "5.19.2" + tslib "^1.9.3" + +"@sentry/electron@~1.3.0": + version "1.3.2" + resolved "https://registry.npmjs.org/@sentry/electron/-/electron-1.3.2.tgz#83c40943f2fad5e72c77dadf524fd59d1a773e3f" + integrity sha512-fhD6cF7Jy0AXAVNHrUnxhzK5d/reXpzRcp5Ggnr+IRoijGe7rsq/AlOX8KhLS6SmQdI/XXb3F7fxHdItBV9+7w== + dependencies: + "@sentry/browser" "~5.13.2" + "@sentry/core" "~5.13.2" + "@sentry/minimal" "~5.13.2" + "@sentry/node" "~5.13.2" + "@sentry/types" "~5.13.2" + "@sentry/utils" "~5.13.2" + electron-fetch "^1.4.0" + form-data "2.5.1" + util.promisify "1.0.1" + +"@sentry/hub@5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.13.2.tgz#875a5ba983d6ada5caae5b6b4decd0257ef5cdb7" + integrity sha512-/U7yq3DTuRz8SRpZVKAaenW9sD2F5wbj12kDVPxPnGspyqhy0wBWKs9j0YJfBiDXMKOwp3HX964O3ygtwjnfAw== + dependencies: + "@sentry/types" "5.13.2" + "@sentry/utils" "5.13.2" + tslib "^1.9.3" + +"@sentry/hub@5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.19.2.tgz#ab7f3d2d253c3441b2833a530b17c6de2418b2c7" + integrity sha512-2KkEYX4q9TDCOiaVEo2kQ1W0IXyZxJxZtIjDdFQyes9T4ubYlKHAbvCjTxHSQv37lDO4t7sOIApWG9rlkHzlEA== + dependencies: + "@sentry/types" "5.19.2" + "@sentry/utils" "5.19.2" + tslib "^1.9.3" + +"@sentry/minimal@5.13.2", "@sentry/minimal@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.13.2.tgz#e42e33dc74fc935f8857d1a43a528afd741640fd" + integrity sha512-VV0eA3HgrnN3mac1XVPpSCLukYsU+QxegbmpnZ8UL8eIQSZ/ZikYxagDNlZbdnmXHUpOEUeag2gxVntSCo5UcA== + dependencies: + "@sentry/hub" "5.13.2" + "@sentry/types" "5.13.2" + tslib "^1.9.3" + +"@sentry/minimal@5.19.2", "@sentry/minimal@~5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.19.2.tgz#0fc2fdf9911a0cb31b52f7ccad061b74785724a3" + integrity sha512-rApEOkjy+ZmkeqEItgFvUFxe5l+dht9AumuUzq74pWp+HJqxxv9IVTusKppBsE1adjtmyhwK4O3Wr8qyc75xlw== + dependencies: + "@sentry/hub" "5.19.2" + "@sentry/types" "5.19.2" + tslib "^1.9.3" + +"@sentry/node@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/node/-/node-5.13.2.tgz#3be5608e00fb3fe1b813ad8365073a465d19f5f6" + integrity sha512-LwNOUvc0+28jYfI0o4HmkDTEYdY3dWvSCnL5zggO12buon7Wc+jirXZbEQAx84HlXu7sGSjtKCTzUQOphv7sPw== + dependencies: + "@sentry/apm" "5.13.2" + "@sentry/core" "5.13.2" + "@sentry/hub" "5.13.2" + "@sentry/types" "5.13.2" + "@sentry/utils" "5.13.2" + cookie "^0.3.1" + https-proxy-agent "^4.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/node@~5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/node/-/node-5.19.2.tgz#8c1c2f6c983c3d8b25143e5b99c4b6cc745125ec" + integrity sha512-gbww3iTWkdvYIAhOmULbv8znKwkIpklGJ0SPtAh0orUMuaa0lVht+6HQIhRgeXp50lMzNaYC3fuzkbFfYgpS7A== + dependencies: + "@sentry/apm" "5.19.2" + "@sentry/core" "5.19.2" + "@sentry/hub" "5.19.2" + "@sentry/types" "5.19.2" + "@sentry/utils" "5.19.2" + cookie "^0.3.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/types@5.13.2", "@sentry/types@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/types/-/types-5.13.2.tgz#8e68c31f8fb99b4074374bff13ed01035b373d8c" + integrity sha512-mgAEQyc77PYBnAjnslSXUz6aKgDlunlg2c2qSK/ivKlEkTgTWWW/dE76++qVdrqM8SupnqQoiXyPDL0wUNdB3g== + +"@sentry/types@5.19.2", "@sentry/types@~5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/types/-/types-5.19.2.tgz#ead586f0b64b91c396d3521b938ca25f7b59d655" + integrity sha512-O6zkW8oM1qK5Uma9+B/UMlmlm9/gkw9MooqycWuEhIaKfDBj/yVbwb/UTiJmNkGc5VJQo0v1uXUZZQt6/Xq1GA== + +"@sentry/utils@5.13.2", "@sentry/utils@~5.13.2": + version "5.13.2" + resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.13.2.tgz#441594f4f9412bfd1690739ce986bf3a49687806" + integrity sha512-LwPQl6WRMKEnd16kg35HS3yE+VhBc8vN4+BBIlrgs7X0aoT+AbEd/sQLMisDgxNboCF44Ho3RCKtztiPb9blqg== + dependencies: + "@sentry/types" "5.13.2" + tslib "^1.9.3" + +"@sentry/utils@5.19.2": + version "5.19.2" + resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.19.2.tgz#f2819d9de5abc33173019e81955904247e4a8246" + integrity sha512-gEPkC0CJwvIWqcTcPSdIzqJkJa9N5vZzUZyBvdu1oiyJu7MfazpJEvj3whfJMysSfXJQxoJ+a1IPrA73VY23VA== + dependencies: + "@sentry/types" "5.19.2" + tslib "^1.9.3" + "@sideway/address@^4.1.0": version "4.1.1" resolved "https://registry.npmjs.org/@sideway/address/-/address-4.1.1.tgz#9e321e74310963fdf8eebfbee09c7bd69972de4d" @@ -4508,6 +5186,168 @@ resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-9.0.0.tgz#7b562d56573c6fc0094446fbc92b22bc318945dc" integrity sha512-In1q0tIiqTYKAGe3KOHDcFDdZRFISyQeSeipeTHGfki23ebHRZcjxvqj5SSdBkw65D4VpSREMi0s9i5iJiMcTw== +"@stoplight/beaver-logger@^4.0.12": + version "4.0.12" + resolved "https://registry.npmjs.org/@stoplight/beaver-logger/-/beaver-logger-4.0.12.tgz#f754d2f20b4728f5e96fdec574729988e4fb0c2d" + integrity sha512-VPSqZ706GaAB/7VcXcKvzaxaKwHmr2jUNcn0mTvhR3dwglmDEsqoKRvzTxH+Zu1VUIRjdcy9zmU7mSfjKjPt7Q== + dependencies: + belter "^1.0.17" + zalgo-promise "^1.0.26" + +"@stoplight/json-schema-merge-allof@^0.7.5": + version "0.7.6" + resolved "https://registry.npmjs.org/@stoplight/json-schema-merge-allof/-/json-schema-merge-allof-0.7.6.tgz#39efac12a497ed29a06ae48e0141885634a045a4" + integrity sha512-xLbJC2VOd9AxO1VvvgyP/mWOqZbeg6mLpYzlzU4egDTTIrTsSqtv+yFakpPciuuMlOmJU/KzZK9C5AbMgE+VgQ== + dependencies: + compute-lcm "^1.1.0" + json-schema-compare "^0.2.2" + lodash "^4.17.4" + +"@stoplight/json-schema-tree@^2.0.0": + version "2.0.0" + resolved "https://registry.npmjs.org/@stoplight/json-schema-tree/-/json-schema-tree-2.0.0.tgz#00d54cb6aa2a791c34be91fc30cc92e6d448258c" + integrity sha512-vnzcb0TC07xh89lAVGjBTJ2CWvCqmDJDIs3u+gvgvjDPY86CQ0Wl4D2Cmb0iuqd986aiDPc8vDQf1N0dSq5+9A== + dependencies: + "@stoplight/json" "^3.12.0" + "@stoplight/json-schema-merge-allof" "^0.7.5" + "@stoplight/lifecycle" "^2.3.2" + "@types/json-schema" "^7.0.7" + magic-error "^0.0.0" + +"@stoplight/json-schema-viewer@^4.0.0-beta.16": + version "4.0.0-beta.16" + resolved "https://registry.npmjs.org/@stoplight/json-schema-viewer/-/json-schema-viewer-4.0.0-beta.16.tgz#8f55debcb1e84ddcd6f55012ed52712560beaca5" + integrity sha512-f6GijfWi15maRQH4J/ulc8tFpoc+ejGeckiIH+USTLPd7fmGiIU5wINbJSVbLJ5Hccky8wraxlCzfdRuck84Jw== + dependencies: + "@fortawesome/free-solid-svg-icons" "^5.15.2" + "@stoplight/json" "^3.10.0" + "@stoplight/json-schema-tree" "^2.0.0" + "@stoplight/mosaic" "1.0.0-beta.46" + "@stoplight/react-error-boundary" "^1.0.0" + "@types/json-schema" "^7.0.7" + classnames "^2.2.6" + lodash "^4.17.19" + +"@stoplight/json@^3.10.0", "@stoplight/json@^3.12.0": + version "3.12.0" + resolved "https://registry.npmjs.org/@stoplight/json/-/json-3.12.0.tgz#26c8d32da78eac6a760ba2c9cca6ae717dc417b4" + integrity sha512-c0bvFOGICk8QWIat72Td2GG6Bdvq/6O2jQcDZ8rEjh56YOdC/YPn1S8ihKu3AntJCtvqC9eTfadWBqkNK9HAjw== + dependencies: + "@stoplight/ordered-object-literal" "^1.0.1" + "@stoplight/types" "^11.9.0" + jsonc-parser "~2.2.1" + lodash "^4.17.15" + safe-stable-stringify "^1.1" + +"@stoplight/lifecycle@^2.3.2": + version "2.3.2" + resolved "https://registry.npmjs.org/@stoplight/lifecycle/-/lifecycle-2.3.2.tgz#d61dff9ba20648241432e2daaef547214dc8976e" + integrity sha512-v0u8p27FA/eg04b4z6QXw4s0NeeFcRzyvseBW0+k/q4jtpg7EhVCqy42EbbbU43NTNDpIeQ81OcvkFz+6CYshw== + dependencies: + wolfy87-eventemitter "~5.2.8" + +"@stoplight/mosaic@1.0.0-beta.46": + version "1.0.0-beta.46" + resolved "https://registry.npmjs.org/@stoplight/mosaic/-/mosaic-1.0.0-beta.46.tgz#35fa3c9aebdb3c3535d1d8dd53cc52f1b2b1f5db" + integrity sha512-GlGLb2RzvzS7CQpq006c6eZhe7tIgRvDIt/nYqx+FXJEh0M045I2EObstdbyQt/sL7Zw5lae3uxiQ/1j8FqkRA== + dependencies: + "@fortawesome/fontawesome-svg-core" "^1.2.35" + "@fortawesome/free-solid-svg-icons" "^5.15.3" + "@fortawesome/react-fontawesome" "^0.1.14" + "@react-aria/button" "~3.3.1" + "@react-aria/dialog" "~3.1.2" + "@react-aria/focus" "~3.2.4" + "@react-aria/interactions" "~3.3.4" + "@react-aria/listbox" "~3.2.4" + "@react-aria/overlays" "~3.6.2" + "@react-aria/select" "~3.3.1" + "@react-aria/separator" "~3.1.1" + "@react-aria/ssr" "~3.0.1" + "@react-aria/tooltip" "~3.1.1" + "@react-aria/utils" "~3.7.0" + "@react-hook/size" "^2.1.1" + "@react-hook/window-size" "^3.0.7" + "@react-spectrum/utils" "~3.5.1" + "@react-stately/select" "~3.1.1" + "@react-stately/tooltip" "~3.0.3" + clsx "^1.1.1" + copy-to-clipboard "^3.3.1" + deepmerge "^4.2.2" + lodash.get "^4.4.2" + polished "^4.1.1" + reakit "npm:@stoplight/reakit@~1.3.5" + ts-keycode-enum "^1.0.6" + tslib "^2.1.0" + zustand "^3.3.3" + +"@stoplight/mosaic@^1.0.0-beta.46": + version "1.0.0-beta.47" + resolved "https://registry.npmjs.org/@stoplight/mosaic/-/mosaic-1.0.0-beta.47.tgz#6b212163af3ab7fb981dee75785f1b967299171e" + integrity sha512-Rp6aXslPB0X2hqj8MFmbYSWUvSjo/ResDFNQoMHD1BCBGw0nTmlcPZaQDKQApUFQrDBzih+OGRKTk0mGxrTP3A== + dependencies: + "@fortawesome/fontawesome-svg-core" "^1.2.35" + "@fortawesome/free-solid-svg-icons" "^5.15.3" + "@fortawesome/react-fontawesome" "^0.1.14" + "@react-aria/button" "~3.3.1" + "@react-aria/dialog" "~3.1.2" + "@react-aria/focus" "~3.2.4" + "@react-aria/interactions" "~3.3.4" + "@react-aria/listbox" "~3.2.4" + "@react-aria/overlays" "~3.6.2" + "@react-aria/select" "~3.3.1" + "@react-aria/separator" "~3.1.1" + "@react-aria/ssr" "~3.0.1" + "@react-aria/tooltip" "~3.1.1" + "@react-aria/utils" "~3.7.0" + "@react-hook/size" "^2.1.1" + "@react-hook/window-size" "^3.0.7" + "@react-spectrum/utils" "~3.5.1" + "@react-stately/select" "~3.1.1" + "@react-stately/tooltip" "~3.0.3" + clsx "^1.1.1" + copy-to-clipboard "^3.3.1" + deepmerge "^4.2.2" + lodash.get "^4.4.2" + polished "^4.1.1" + reakit "npm:@stoplight/reakit@~1.3.5" + ts-keycode-enum "^1.0.6" + tslib "^2.1.0" + zustand "^3.3.3" + +"@stoplight/ordered-object-literal@^1.0.1": + version "1.0.2" + resolved "https://registry.npmjs.org/@stoplight/ordered-object-literal/-/ordered-object-literal-1.0.2.tgz#2a88a5ebc8b68b54837ac9a9ae7b779cdd862062" + integrity sha512-0ZMS/9sNU3kVo/6RF3eAv7MK9DY8WLjiVJB/tVyfF2lhr2R4kqh534jZ0PlrFB9CRXrdndzn1DbX6ihKZXft2w== + +"@stoplight/react-error-boundary@^1.0.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@stoplight/react-error-boundary/-/react-error-boundary-1.1.0.tgz#9b0fb5d0538abbf9a416723b90f5b776bf68a75d" + integrity sha512-z/1gDVQAafqYuJksL212F1DXHSr604KDqAspZwbC+kWVqCsddQBmXzwI4Lqqem4wHbNGeVZYk3svW+sILX/PUQ== + dependencies: + "@stoplight/types" "^11.9.0" + +"@stoplight/reporter@^1.10.0": + version "1.10.0" + resolved "https://registry.npmjs.org/@stoplight/reporter/-/reporter-1.10.0.tgz#cbb58a7842422178ff56410e3f009517a474a5ba" + integrity sha512-XdHIT+TwS00rEhsEClCddrACZCqxK+sh/R2EBFuXBTbWMIwujoWVTLPxEwhVkfm2JF57pK3jzULOFxEnNRnmpQ== + dependencies: + "@sentry/browser" "~5.19.2" + "@sentry/electron" "~1.3.0" + "@sentry/minimal" "~5.19.2" + "@sentry/node" "~5.19.2" + "@sentry/types" "~5.19.2" + "@stoplight/beaver-logger" "^4.0.12" + "@types/amplitude-js" "^5.11.0" + amplitude-js "^7.1.0" + +"@stoplight/types@^11.9.0": + version "11.10.0" + resolved "https://registry.npmjs.org/@stoplight/types/-/types-11.10.0.tgz#60bbee770526f4de9cd1c613c7ab84c4e4674126" + integrity sha512-ffHD9i4UHS8Gsg7Ar8pKjI9B4kq7MRekE7tCROFGcFDzQhfRx9T92AduoLAtP/010XNYq23yDKpLBRPIEk8+xg== + dependencies: + "@types/json-schema" "^7.0.4" + utility-types "^3.10.0" + "@storybook/addon-actions@^6.1.11": version "6.1.17" resolved "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-6.1.17.tgz#9d32336284738cefa69b99acafa4b132d5533600" @@ -5631,6 +6471,11 @@ dependencies: "@types/node" "*" +"@types/amplitude-js@^5.11.0": + version "5.11.1" + resolved "https://registry.npmjs.org/@types/amplitude-js/-/amplitude-js-5.11.1.tgz#4883aa6f484530df3557de8683ff4529fcb7ec65" + integrity sha512-2BAZ8sMlOq4t0zC5LEBRL551u/kJPr+BTOe9OUtFT7J1U4Kgm+gHYmV4nYwq9sZnNj6MisCllKiiL27WEur7Sw== + "@types/anymatch@*": version "1.3.1" resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" @@ -6211,6 +7056,11 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== +"@types/json-schema@^7.0.7": + version "7.0.7" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" + integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== + "@types/json-stable-stringify@^1.0.32": version "1.0.32" resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" @@ -6532,6 +7382,11 @@ resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz#a59e851c1ba16c0513ea123830dd639a0a15cb6a" integrity sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ== +"@types/raf-schd@^4.0.0": + version "4.0.1" + resolved "https://registry.npmjs.org/@types/raf-schd/-/raf-schd-4.0.1.tgz#1f9e03736f277fe9c7b82102bf18570a6ee19f82" + integrity sha512-Ha+EnKHFIh9EKW0/XZJPUd3EGDFisEvauaBd4VVCRPKeOqUxNEc9TodiY2Zhk33XCgzJucoFEcaoNcBAPHTQ2A== + "@types/raf@^3.4.0": version "3.4.0" resolved "https://registry.npmjs.org/@types/raf/-/raf-3.4.0.tgz#2b72cbd55405e071f1c4d29992638e022b20acc2" @@ -7418,6 +8273,11 @@ address@1.1.2, address@^1.0.1: resolved "https://registry.npmjs.org/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== +agent-base@5: + version "5.1.1" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" + integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== + agent-base@6: version "6.0.1" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz#808007e4e5867decb0ab6ab2f928fbdb5a596db4" @@ -7507,6 +8367,16 @@ alphanum-sort@^1.0.0: resolved "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= +amplitude-js@^7.1.0: + version "7.4.4" + resolved "https://registry.npmjs.org/amplitude-js/-/amplitude-js-7.4.4.tgz#1abd76f96a44ebdbf90e7371b37d071010deffe6" + integrity sha512-3Ojj1draRcXvfxi5P+Ye/6Y4roxtf1lQEjczcLDnHU9vxbPtT4fDblC9+cdJy7XmlJkGoq+KvnItlWfLuHV9GQ== + dependencies: + "@amplitude/ua-parser-js" "0.7.24" + "@amplitude/utils" "^1.0.5" + blueimp-md5 "^2.10.0" + query-string "5" + anafanafo@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/anafanafo/-/anafanafo-1.0.0.tgz#2e67190aed5dc67f5f0043b710146e7276c1afb8" @@ -8715,6 +9585,15 @@ before-after-hook@^2.1.0: resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== +belter@^1.0.17: + version "1.0.165" + resolved "https://registry.npmjs.org/belter/-/belter-1.0.165.tgz#8bc32f0f30b94b67b80a63727b1584acd69942f0" + integrity sha512-TVOfXtLTTU3yyORjiYD2s9+fnTdxZp69KtR3pSDquLrdtK3OUmypgukVL+pIbcE6VMc85FRoFR48gybNZ2zHZQ== + dependencies: + cross-domain-safe-weakmap "^1" + cross-domain-utils "^2" + zalgo-promise "^1" + better-opn@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/better-opn/-/better-opn-2.0.0.tgz#c70d198e51164bdc220306a28a885d9ac7a14c44" @@ -8810,6 +9689,11 @@ bluebird@~3.4.1: resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= +blueimp-md5@^2.10.0: + version "2.18.0" + resolved "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.18.0.tgz#1152be1335f0c6b3911ed9e36db54f3e6ac52935" + integrity sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q== + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -8831,6 +9715,11 @@ body-parser@1.19.0, body-parser@^1.18.3: raw-body "2.4.0" type-is "~1.6.17" +body-scroll-lock@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-3.1.5.tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec" + integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg== + bonjour@^3.5.0: version "3.5.0" resolved "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" @@ -9863,7 +10752,7 @@ clone@^1.0.2: resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -clsx@^1.0.1, clsx@^1.0.2, clsx@^1.0.4, clsx@^1.1.0: +clsx@^1.0.1, clsx@^1.0.2, clsx@^1.0.4, clsx@^1.1.0, clsx@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== @@ -10403,6 +11292,11 @@ cookie@0.4.0: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +cookie@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= + cookie@^0.4.1, cookie@~0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" @@ -10605,6 +11499,20 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-domain-safe-weakmap@^1: + version "1.0.28" + resolved "https://registry.npmjs.org/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.28.tgz#d6c3c5af954340ce5f9d4ee5f3c38dba9513a165" + integrity sha512-gfQiQYSdWr9cYFVpmzp+b6MyTnefefDHr+fvm+JVv20hQxetV5J6chZOAusrpM/kFpTTbVDnHCziBFaREvgc0Q== + dependencies: + cross-domain-utils "^2.0.0" + +cross-domain-utils@^2, cross-domain-utils@^2.0.0: + version "2.0.34" + resolved "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.34.tgz#3f8dc8d82a5434213787433f17b76f51c316e382" + integrity sha512-ke4PirGRXwEElEmE/7k5aCvCW+EqbgseT7AOObzFfaVnOLuEVN9SjVWoOfS/qAT0rDPn3ggmNDW6mguMBy4HgA== + dependencies: + zalgo-promise "^1.0.11" + cross-env@^7.0.0: version "7.0.3" resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -11740,7 +12648,7 @@ dom-converter@^0.2: dependencies: utila "~0.4" -dom-helpers@^3.4.0: +dom-helpers@^3.3.1, dom-helpers@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8" integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA== @@ -12030,6 +12938,13 @@ ejs@^3.1.2: dependencies: jake "^10.6.1" +electron-fetch@^1.4.0: + version "1.7.3" + resolved "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.3.tgz#06cf363d7f64073ec00a37e9949ec9d29ce6b08a" + integrity sha512-1AVMaxrHXTTMqd7EK0MGWusdqNr07Rpj8Th6bG4at0oNgIi/1LBwa9CjT/0Zy+M0k/tSJPS04nFxHj0SXDVgVw== + dependencies: + encoding "^0.1.13" + electron-to-chromium@^1.3.378: version "1.3.509" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.509.tgz#830fcb89cd66dc2984d18d794973b99e3f00584c" @@ -12131,7 +13046,7 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -encoding@^0.1.12: +encoding@^0.1.12, encoding@^0.1.13: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -13550,7 +14465,7 @@ fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.0.5, for tapable "^1.0.0" worker-rpc "^0.1.0" -form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: +form-data@2.5.1, form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: version "2.5.1" resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== @@ -15095,6 +16010,14 @@ https-proxy-agent@^2.2.1: agent-base "^4.3.0" debug "^3.1.0" +https-proxy-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" + integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== + dependencies: + agent-base "5" + debug "4" + https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" @@ -15487,6 +16410,18 @@ interpret@^2.0.0, interpret@^2.2.0: resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== +intl-messageformat-parser@1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" + integrity sha1-tD1FqXRoytvkQzHXS7Ho3qRPwHU= + +intl-messageformat@^2.2.0: + version "2.2.0" + resolved "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" + integrity sha1-NFvNRt5jC3aDMwwuUhd/9eq0hPw= + dependencies: + intl-messageformat-parser "1.4.0" + invariant@^2.0.0, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: version "2.2.4" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -17027,6 +17962,11 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" +jsonc-parser@~2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" + integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -17795,7 +18735,7 @@ lodash.flattendeep@^4.0.0: resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= -lodash.get@^4, lodash.get@^4.0.0: +lodash.get@^4, lodash.get@^4.0.0, lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= @@ -18060,6 +19000,11 @@ lru-queue@^0.1.0: dependencies: es5-ext "~0.10.2" +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= + lunr@^2.3.9: version "2.3.9" resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -18085,6 +19030,11 @@ macos-release@^2.2.0: resolved "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== +magic-error@^0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/magic-error/-/magic-error-0.0.0.tgz#f8630c98c55764b4851601901fdcb63428758b7d" + integrity sha512-ZMU3ylGOb/YQEpJo0XtAXbPGmKJtwzc3cuOHPrKgosV8AAc6db8dlQYLe0cp64P3BxkYZGoUvkvdNR5JM78beA== + magic-string@^0.25.7: version "0.25.7" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -20881,6 +21831,13 @@ polished@^3.4.4: dependencies: "@babel/runtime" "^7.9.2" +polished@^4.1.1: + version "4.1.2" + resolved "https://registry.npmjs.org/polished/-/polished-4.1.2.tgz#c04fcc203e287e2d866e9cfcaf102dae1c01a816" + integrity sha512-jq4t3PJUpVRcveC53nnbEX35VyQI05x3tniwp26WFdm1dwaNUBHAi5awa/roBlwQxx1uRhwNSYeAi/aMbfiJCQ== + dependencies: + "@babel/runtime" "^7.13.17" + popper.js@1.16.1-lts: version "1.16.1-lts" resolved "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz#cf6847b807da3799d80ee3d6d2f90df8a3f50b05" @@ -21731,6 +22688,15 @@ qs@~6.5.2: resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +query-string@5: + version "5.1.1" + resolved "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" + integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== + dependencies: + decode-uri-component "^0.2.0" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" + query-string@^4.1.0: version "4.3.4" resolved "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" @@ -22645,6 +23611,36 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" +reakit-system@^0.15.1: + version "0.15.1" + resolved "https://registry.npmjs.org/reakit-system/-/reakit-system-0.15.1.tgz#bf5cc7a03f60a817373bc9cbb4a689c1f4100547" + integrity sha512-PkqfAyEohtcEu/gUvKriCv42NywDtUgvocEN3147BI45dOFAB89nrT7wRIbIcKJiUT598F+JlPXAZZVLWhc1Kg== + dependencies: + reakit-utils "^0.15.1" + +reakit-utils@^0.15.1: + version "0.15.1" + resolved "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.15.1.tgz#797f0a43f6a1dbc22d161224d5d2272e287dbfe3" + integrity sha512-6cZgKGvOkAMQgkwU9jdYbHfkuIN1Pr+vwcB19plLvcTfVN0Or10JhIuj9X+JaPZyI7ydqTDFaKNdUcDP69o/+Q== + +reakit-warning@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/reakit-warning/-/reakit-warning-0.6.1.tgz#dba33bb8866aebe30e67ac433ead707d16d38a36" + integrity sha512-poFUV0EyxB+CcV9uTNBAFmcgsnR2DzAbOTkld4Ul+QOKSeEHZB3b3+MoZQgcYHmbvG19Na1uWaM7ES+/Eyr8tQ== + dependencies: + reakit-utils "^0.15.1" + +"reakit@npm:@stoplight/reakit@~1.3.5": + version "1.3.5" + resolved "https://registry.npmjs.org/@stoplight/reakit/-/reakit-1.3.5.tgz#0c1a1ae89a92de98413d3723b993c05d943bd56b" + integrity sha512-/Con1m4eSaztckgnEPckNPMkAIcOCYku60mANTGScevY9wYk56V2L6vpv6HR4r8gsFCl4S/CVoNCVMxkxi/pGw== + dependencies: + "@popperjs/core" "^2.5.4" + body-scroll-lock "^3.1.5" + reakit-system "^0.15.1" + reakit-utils "^0.15.1" + reakit-warning "^0.6.1" + recharts-scale@^0.4.2: version "0.4.3" resolved "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.3.tgz#040b4f638ed687a530357292ecac880578384b59" @@ -23389,6 +24385,11 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" +safe-stable-stringify@^1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" + integrity sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw== + "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -25542,6 +26543,11 @@ ts-jest@^26.4.3: semver "7.x" yargs-parser "20.x" +ts-keycode-enum@^1.0.6: + version "1.0.6" + resolved "https://registry.npmjs.org/ts-keycode-enum/-/ts-keycode-enum-1.0.6.tgz#aeefd1c2fc7b0557f86a0e696e300905bbb4c1c1" + integrity sha512-DF8+Cf/FJJnPRxwz8agCoDelQXKZWQOS/gnnwx01nZ106tPJdB3BgJ9QTtLwXgR82D8O+nTjuZzWgf0Rg4vuRA== + ts-loader@^8.0.17: version "8.0.17" resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.17.tgz#98f2ccff9130074f4079fd89b946b4c637b1f2fc" @@ -26220,7 +27226,7 @@ util.promisify@1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util.promisify@^1.0.0, util.promisify@~1.0.0: +util.promisify@1.0.1, util.promisify@^1.0.0, util.promisify@~1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== @@ -26249,6 +27255,11 @@ utila@^0.4.0, utila@~0.4: resolved "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= +utility-types@^3.10.0: + version "3.10.0" + resolved "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" + integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== + utils-merge@1.0.1, utils-merge@1.x.x: version "1.0.1" resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -26809,6 +27820,11 @@ winston@^3.2.1: triple-beam "^1.3.0" winston-transport "^4.3.0" +wolfy87-eventemitter@~5.2.8: + version "5.2.9" + resolved "https://registry.npmjs.org/wolfy87-eventemitter/-/wolfy87-eventemitter-5.2.9.tgz#e879f770b30fbb6512a8afbb330c388591099c2a" + integrity sha512-P+6vtWyuDw+MB01X7UeF8TaHBvbCovf4HPEMF/SV7BdDc1SMTiBy13SRD71lQh4ExFTG1d/WNzDGDCyOKSMblw== + word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -27268,6 +28284,11 @@ z-schema@~3.18.3: optionalDependencies: commander "^2.7.1" +zalgo-promise@^1, zalgo-promise@^1.0.11, zalgo-promise@^1.0.26: + version "1.0.46" + resolved "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.46.tgz#325988d75d0be4cd63a266bad5e18f8f6cd85675" + integrity sha512-tzPpQRqaQQavxl17TY98nznvmr+judUg3My7ugsUcRDbdqisYOE2z79HNNDgXnyX3eA0mf2bMOJrqHptt00npg== + zen-observable-ts@^0.8.21: version "0.8.21" resolved "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" @@ -27313,6 +28334,11 @@ zombie@^6.1.4: tough-cookie "^2.3.4" ws "^6.1.2" +zustand@^3.3.3: + version "3.4.2" + resolved "https://registry.npmjs.org/zustand/-/zustand-3.4.2.tgz#22f0e0503a364672c6e3bb83399e69479bcea9b2" + integrity sha512-/v0RRbzi8NNyiXf7vw2eizPfJaTlTbXNM3fjQ6xF+qr5Xc0cF0ypaa0ARLOvyaKsGx/q2p5azVhfGxl4uHK0Ag== + zwitch@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" From 4075c63675b7b9ec530d796ec8ecfa26108fc342 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Sat, 24 Apr 2021 07:56:47 +0200 Subject: [PATCH 20/73] fix: optional git config for techdocs feedback Signed-off-by: Erik Larsson --- .changeset/ten-cups-relax.md | 5 +++++ .../src/reader/transformers/addGitFeedbackLink.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 .changeset/ten-cups-relax.md diff --git a/.changeset/ten-cups-relax.md b/.changeset/ten-cups-relax.md new file mode 100644 index 0000000000..9e32ad3856 --- /dev/null +++ b/.changeset/ten-cups-relax.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Make git config optional for techdocs feedback links diff --git a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts index d19d90228c..c74f06934d 100644 --- a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts +++ b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts @@ -35,20 +35,20 @@ export const addGitFeedbackLink = (configApi: any): Transformer => { const sourceURL = new URL(sourceAnchor.href); const githubHosts = configApi - .getConfigArray('integrations.github') - .map((integration: any) => integration.data.host); + .getOptionalConfigArray('integrations.github') + ?.map((integration: any) => integration.data.host); const gitlabHosts = configApi - .getConfigArray('integrations.gitlab') - .map((integration: any) => integration.data.host); + .getOptionalConfigArray('integrations.gitlab') + ?.map((integration: any) => integration.data.host); // don't show if can't identify edit link hostname as a gitlab/github hosting if ( - githubHosts.includes(sourceURL.hostname) || + githubHosts?.includes(sourceURL.hostname) || sourceURL.origin.includes('github') ) { gitHost = 'github'; } else if ( - gitlabHosts.includes(sourceURL.hostname) || + gitlabHosts?.includes(sourceURL.hostname) || sourceURL.origin.includes('gitlab') ) { gitHost = 'gitlab'; From b61b268fd00d8f49ff9e2042cacd0cac8d480482 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Sat, 24 Apr 2021 15:41:29 +0200 Subject: [PATCH 21/73] Update tests Signed-off-by: Erik Larsson --- .../src/reader/transformers/addGitFeedbackLink.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts index 4c9ea04fe9..5d88aab62e 100644 --- a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts +++ b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts @@ -18,10 +18,10 @@ import { createTestShadowDom } from '../../test-utils'; import { addGitFeedbackLink } from './addGitFeedbackLink'; const configApi = { - getConfigArray: function getConfigArray(key: string) { + getOptionalConfigArray: function getOptionalConfigArray(key: string) { return key === 'integrations.github' ? [{ data: { host: 'self-hosted-git-hub-provider.com' } }] - : []; + : undefined; }, }; From b9abc32f4928742b250e77d8d9a830037027cac5 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Wed, 28 Apr 2021 23:41:52 +0200 Subject: [PATCH 22/73] Use ScmIntegrationsApi Signed-off-by: Erik Larsson --- plugins/techdocs/package.json | 2 ++ plugins/techdocs/src/plugin.ts | 24 +++++++---------- .../src/reader/components/Reader.test.tsx | 11 ++++++++ .../techdocs/src/reader/components/Reader.tsx | 9 ++++--- .../reader/components/TechDocsPage.test.tsx | 11 ++++++++ .../transformers/addGitFeedbackLink.test.ts | 26 ++++++++++--------- .../reader/transformers/addGitFeedbackLink.ts | 19 +++++--------- 7 files changed, 59 insertions(+), 43 deletions(-) diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index 632feac3c1..55e5dadb54 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -34,6 +34,8 @@ "@backstage/config": "^0.1.4", "@backstage/catalog-model": "^0.7.7", "@backstage/core": "^0.7.7", + "@backstage/integration": "^0.5.0", + "@backstage/integration-react": "^0.1.1", "@backstage/plugin-catalog-react": "^0.1.4", "@backstage/theme": "^0.2.6", "@backstage/errors": "^0.1.1", diff --git a/plugins/techdocs/src/plugin.ts b/plugins/techdocs/src/plugin.ts index 97dd6f2150..bbd0b77ba9 100644 --- a/plugins/techdocs/src/plugin.ts +++ b/plugins/techdocs/src/plugin.ts @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* - * 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 { configApiRef, @@ -39,6 +24,10 @@ import { discoveryApiRef, identityApiRef, } from '@backstage/core'; +import { + ScmIntegrationsApi, + scmIntegrationsApiRef, +} from '@backstage/integration-react'; import { techdocsApiRef, techdocsStorageApiRef } from './api'; import { TechDocsClient, TechDocsStorageClient } from './client'; @@ -60,6 +49,11 @@ export const rootCatalogDocsRouteRef = createRouteRef({ export const techdocsPlugin = createPlugin({ id: 'techdocs', apis: [ + createApiFactory({ + api: scmIntegrationsApiRef, + deps: { configApi: configApiRef }, + factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi), + }), createApiFactory({ api: techdocsStorageApiRef, deps: { diff --git a/plugins/techdocs/src/reader/components/Reader.test.tsx b/plugins/techdocs/src/reader/components/Reader.test.tsx index b39134b0cd..fbdac95658 100644 --- a/plugins/techdocs/src/reader/components/Reader.test.tsx +++ b/plugins/techdocs/src/reader/components/Reader.test.tsx @@ -14,7 +14,12 @@ * limitations under the License. */ +import { ConfigReader } from '@backstage/config'; import { ApiProvider, ApiRegistry } from '@backstage/core'; +import { + ScmIntegrationsApi, + scmIntegrationsApiRef, +} from '@backstage/integration-react'; import { wrapInTestApp } from '@backstage/test-utils'; import { act, render } from '@testing-library/react'; import React from 'react'; @@ -39,9 +44,15 @@ describe('', () => { entityId: 'Component::backstage', }); + const scmIntegrationsApi: ScmIntegrationsApi = ScmIntegrationsApi.fromConfig( + new ConfigReader({ + integrations: {}, + }), + ); const techdocsStorageApi: Partial = {}; const apiRegistry = ApiRegistry.from([ + [scmIntegrationsApiRef, scmIntegrationsApi], [techdocsStorageApiRef, techdocsStorageApi], ]); diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index b16a566afa..82b5245cfa 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -14,7 +14,8 @@ * limitations under the License. */ import { EntityName } from '@backstage/catalog-model'; -import { configApiRef, useApi } from '@backstage/core'; +import { useApi } from '@backstage/core'; +import { scmIntegrationsApiRef } from '@backstage/integration-react'; import { BackstageTheme } from '@backstage/theme'; import { useTheme } from '@material-ui/core'; import { Alert } from '@material-ui/lab'; @@ -54,7 +55,7 @@ export const Reader = ({ entityId, onReady }: Props) => { const [loadedPath, setLoadedPath] = useState(''); const [atInitialLoad, setAtInitialLoad] = useState(true); const [newerDocsExist, setNewerDocsExist] = useState(false); - const configApi = useApi(configApiRef); + const scmIntegrationsApi = useApi(scmIntegrationsApiRef); const { value: isSynced, @@ -145,7 +146,7 @@ export const Reader = ({ entityId, onReady }: Props) => { rewriteDocLinks(), removeMkdocsHeader(), simplifyMkdocsFooter(), - addGitFeedbackLink(configApi), + addGitFeedbackLink(scmIntegrationsApi), injectCss({ css: ` body { @@ -327,7 +328,7 @@ export const Reader = ({ entityId, onReady }: Props) => { theme.palette.background.default, newerDocsExist, isSynced, - configApi, + scmIntegrationsApi, ]); // docLoadError not considered an error state if sync request is still ongoing diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx index 52ddd3794e..5b638ff668 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.test.tsx @@ -16,6 +16,11 @@ import React from 'react'; import { TechDocsPage } from './TechDocsPage'; import { render, act } from '@testing-library/react'; +import { ConfigReader } from '@backstage/config'; +import { + ScmIntegrationsApi, + scmIntegrationsApiRef, +} from '@backstage/integration-react'; import { wrapInTestApp } from '@backstage/test-utils'; import { ApiRegistry, ApiProvider } from '@backstage/core'; import { @@ -50,6 +55,11 @@ describe('', () => { entityId: 'Component::backstage', }); + const scmIntegrationsApi: ScmIntegrationsApi = ScmIntegrationsApi.fromConfig( + new ConfigReader({ + integrations: {}, + }), + ); const techdocsApi: Partial = { getEntityMetadata: () => Promise.resolve({ @@ -72,6 +82,7 @@ describe('', () => { }; const apiRegistry = ApiRegistry.from([ + [scmIntegrationsApiRef, scmIntegrationsApi], [techdocsApiRef, techdocsApi], [techdocsStorageApiRef, techdocsStorageApi], ]); diff --git a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts index 5d88aab62e..1b53b0141e 100644 --- a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts +++ b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.test.ts @@ -14,16 +14,18 @@ * limitations under the License. */ +import { ConfigReader } from '@backstage/config'; +import { ScmIntegrations } from '@backstage/integration'; import { createTestShadowDom } from '../../test-utils'; import { addGitFeedbackLink } from './addGitFeedbackLink'; -const configApi = { - getOptionalConfigArray: function getOptionalConfigArray(key: string) { - return key === 'integrations.github' - ? [{ data: { host: 'self-hosted-git-hub-provider.com' } }] - : undefined; - }, -}; +const integrations = ScmIntegrations.fromConfig( + new ConfigReader({ + integrations: { + github: [{ host: 'self-hosted-git-hub-provider.com' }], + }, + }), +); describe('addGitFeedbackLink', () => { it('adds a feedback link when a Gitlab source edit link is available', () => { @@ -38,7 +40,7 @@ describe('addGitFeedbackLink', () => { `, { - preTransformers: [addGitFeedbackLink(configApi)], + preTransformers: [addGitFeedbackLink(integrations)], postTransformers: [], }, ); @@ -63,7 +65,7 @@ describe('addGitFeedbackLink', () => { `, { - preTransformers: [addGitFeedbackLink(configApi)], + preTransformers: [addGitFeedbackLink(integrations)], postTransformers: [], }, ); @@ -87,7 +89,7 @@ describe('addGitFeedbackLink', () => { `, { - preTransformers: [addGitFeedbackLink(configApi)], + preTransformers: [addGitFeedbackLink(integrations)], postTransformers: [], }, ); @@ -107,7 +109,7 @@ describe('addGitFeedbackLink', () => { `, { - preTransformers: [addGitFeedbackLink(configApi)], + preTransformers: [addGitFeedbackLink(integrations)], postTransformers: [], }, ); @@ -127,7 +129,7 @@ describe('addGitFeedbackLink', () => { `, { - preTransformers: [addGitFeedbackLink(configApi)], + preTransformers: [addGitFeedbackLink(integrations)], postTransformers: [], }, ); diff --git a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts index c74f06934d..5d45946238 100644 --- a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts +++ b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts @@ -15,12 +15,15 @@ */ import type { Transformer } from './index'; +import { ScmIntegrationRegistry } from '@backstage/integration'; import FeedbackOutlinedIcon from '@material-ui/icons/FeedbackOutlined'; import React from 'react'; import ReactDOM from 'react-dom'; // requires repo -export const addGitFeedbackLink = (configApi: any): Transformer => { +export const addGitFeedbackLink = ( + scmIntegrationsApi: ScmIntegrationRegistry, +): Transformer => { return dom => { // attempting to use selectors that are more likely to be static as MkDocs updates over time const sourceAnchor = dom.querySelector( @@ -34,21 +37,13 @@ export const addGitFeedbackLink = (configApi: any): Transformer => { let gitHost = ''; const sourceURL = new URL(sourceAnchor.href); - const githubHosts = configApi - .getOptionalConfigArray('integrations.github') - ?.map((integration: any) => integration.data.host); - const gitlabHosts = configApi - .getOptionalConfigArray('integrations.gitlab') - ?.map((integration: any) => integration.data.host); + const integration = scmIntegrationsApi.byUrl(sourceURL); // don't show if can't identify edit link hostname as a gitlab/github hosting - if ( - githubHosts?.includes(sourceURL.hostname) || - sourceURL.origin.includes('github') - ) { + if (integration?.type === 'github' || sourceURL.origin.includes('github')) { gitHost = 'github'; } else if ( - gitlabHosts?.includes(sourceURL.hostname) || + integration?.type === 'gitlab' || sourceURL.origin.includes('gitlab') ) { gitHost = 'gitlab'; From 5f1f40a65c28c9d3d5168cd312964ce39c94864f Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Thu, 29 Apr 2021 10:33:26 +0200 Subject: [PATCH 23/73] Remove incorreect api factory creation Signed-off-by: Erik Larsson --- plugins/techdocs/src/plugin.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/plugins/techdocs/src/plugin.ts b/plugins/techdocs/src/plugin.ts index bbd0b77ba9..202d49373c 100644 --- a/plugins/techdocs/src/plugin.ts +++ b/plugins/techdocs/src/plugin.ts @@ -49,11 +49,6 @@ export const rootCatalogDocsRouteRef = createRouteRef({ export const techdocsPlugin = createPlugin({ id: 'techdocs', apis: [ - createApiFactory({ - api: scmIntegrationsApiRef, - deps: { configApi: configApiRef }, - factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi), - }), createApiFactory({ api: techdocsStorageApiRef, deps: { From 6381b7ec87b5f70f9dc1d3b7a618285a9cb43113 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Thu, 29 Apr 2021 17:13:43 +0200 Subject: [PATCH 24/73] tsc Signed-off-by: Erik Larsson --- plugins/techdocs/src/plugin.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/techdocs/src/plugin.ts b/plugins/techdocs/src/plugin.ts index 202d49373c..e25f245fb4 100644 --- a/plugins/techdocs/src/plugin.ts +++ b/plugins/techdocs/src/plugin.ts @@ -24,10 +24,6 @@ import { discoveryApiRef, identityApiRef, } from '@backstage/core'; -import { - ScmIntegrationsApi, - scmIntegrationsApiRef, -} from '@backstage/integration-react'; import { techdocsApiRef, techdocsStorageApiRef } from './api'; import { TechDocsClient, TechDocsStorageClient } from './client'; From 37dc8d6e9c5dcdbe1b08b358b862e89fb84cddda Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 29 Apr 2021 14:26:11 +0200 Subject: [PATCH 25/73] kubernetes-backend: Adds skipTLSVerify to ClusterDetails Signed-off-by: Juan Lulkin --- plugins/kubernetes-backend/src/types/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index 344e265426..d61c35e167 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -127,4 +127,5 @@ export interface ClusterDetails { url: string; authProvider: string; serviceAccountToken?: string | undefined; + skipTLSVerify?: boolean; } From e6715553b305fff00497be9e72c0aeb66c97d67a Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 29 Apr 2021 17:32:59 +0200 Subject: [PATCH 26/73] kubernetes-backend: Use imports directly from common Signed-off-by: Juan Lulkin --- .../GoogleKubernetesAuthTranslator.ts | 3 ++- .../ServiceAccountKubernetesAuthTranslator.ts | 3 ++- .../src/kubernetes-auth-translator/types.ts | 3 ++- .../src/service/KubernetesFanOutHandler.ts | 2 +- .../src/service/KubernetesFetcher.ts | 8 +++++--- plugins/kubernetes-backend/src/service/router.ts | 2 +- plugins/kubernetes-backend/src/types/types.ts | 12 ++---------- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/plugins/kubernetes-backend/src/kubernetes-auth-translator/GoogleKubernetesAuthTranslator.ts b/plugins/kubernetes-backend/src/kubernetes-auth-translator/GoogleKubernetesAuthTranslator.ts index 0dd2a4bcc2..9dc4519966 100644 --- a/plugins/kubernetes-backend/src/kubernetes-auth-translator/GoogleKubernetesAuthTranslator.ts +++ b/plugins/kubernetes-backend/src/kubernetes-auth-translator/GoogleKubernetesAuthTranslator.ts @@ -15,7 +15,8 @@ */ import { KubernetesAuthTranslator } from './types'; -import { KubernetesRequestBody, ClusterDetails } from '../types/types'; +import { ClusterDetails } from '../types/types'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export class GoogleKubernetesAuthTranslator implements KubernetesAuthTranslator { diff --git a/plugins/kubernetes-backend/src/kubernetes-auth-translator/ServiceAccountKubernetesAuthTranslator.ts b/plugins/kubernetes-backend/src/kubernetes-auth-translator/ServiceAccountKubernetesAuthTranslator.ts index 6433e41546..3610bd4d9f 100644 --- a/plugins/kubernetes-backend/src/kubernetes-auth-translator/ServiceAccountKubernetesAuthTranslator.ts +++ b/plugins/kubernetes-backend/src/kubernetes-auth-translator/ServiceAccountKubernetesAuthTranslator.ts @@ -15,7 +15,8 @@ */ import { KubernetesAuthTranslator } from './types'; -import { KubernetesRequestBody, ClusterDetails } from '../types/types'; +import { ClusterDetails } from '../types/types'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export class ServiceAccountKubernetesAuthTranslator implements KubernetesAuthTranslator { diff --git a/plugins/kubernetes-backend/src/kubernetes-auth-translator/types.ts b/plugins/kubernetes-backend/src/kubernetes-auth-translator/types.ts index c01a57889c..7a04e230c6 100644 --- a/plugins/kubernetes-backend/src/kubernetes-auth-translator/types.ts +++ b/plugins/kubernetes-backend/src/kubernetes-auth-translator/types.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { KubernetesRequestBody, ClusterDetails } from '../types/types'; +import { ClusterDetails } from '../types/types'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; export interface KubernetesAuthTranslator { decorateClusterDetailsWithAuth( diff --git a/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts b/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts index 6db6e2ad4a..75e2f8233c 100644 --- a/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts +++ b/plugins/kubernetes-backend/src/service/KubernetesFanOutHandler.ts @@ -20,9 +20,9 @@ import { CustomResource, KubernetesFetcher, KubernetesObjectTypes, - KubernetesRequestBody, KubernetesServiceLocator, } from '../types/types'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { KubernetesAuthTranslator } from '../kubernetes-auth-translator/types'; import { KubernetesAuthTranslatorGenerator } from '../kubernetes-auth-translator/KubernetesAuthTranslatorGenerator'; diff --git a/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts b/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts index 10e5640bab..6958bd3387 100644 --- a/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts +++ b/plugins/kubernetes-backend/src/service/KubernetesFetcher.ts @@ -32,15 +32,17 @@ import lodash, { Dictionary } from 'lodash'; import { Logger } from 'winston'; import { ClusterDetails, - FetchResponse, FetchResponseWrapper, - KubernetesErrorTypes, KubernetesFetcher, - KubernetesFetchError, KubernetesObjectTypes, ObjectFetchParams, CustomResource, } from '../types/types'; +import { + FetchResponse, + KubernetesFetchError, + KubernetesErrorTypes, +} from '@backstage/plugin-kubernetes-common'; import { KubernetesClientProvider } from './KubernetesClientProvider'; export interface Clients { diff --git a/plugins/kubernetes-backend/src/service/router.ts b/plugins/kubernetes-backend/src/service/router.ts index 189f2eb9c5..ab7bb5befa 100644 --- a/plugins/kubernetes-backend/src/service/router.ts +++ b/plugins/kubernetes-backend/src/service/router.ts @@ -23,11 +23,11 @@ import { MultiTenantServiceLocator } from '../service-locator/MultiTenantService import { ClusterDetails, KubernetesClustersSupplier, - KubernetesRequestBody, KubernetesServiceLocator, ServiceLocatorMethod, CustomResource, } from '../types/types'; +import { KubernetesRequestBody } from '@backstage/plugin-kubernetes-common'; import { KubernetesClientProvider } from './KubernetesClientProvider'; import { KubernetesFanOutHandler } from './KubernetesFanOutHandler'; import { KubernetesClientBasedFetcher } from './KubernetesFetcher'; diff --git a/plugins/kubernetes-backend/src/types/types.ts b/plugins/kubernetes-backend/src/types/types.ts index d61c35e167..0be0b447af 100644 --- a/plugins/kubernetes-backend/src/types/types.ts +++ b/plugins/kubernetes-backend/src/types/types.ts @@ -15,18 +15,10 @@ */ import type { - FetchResponse as FetchResponseCommon, - KubernetesFetchError as KubernetesFetchErrorCommon, + FetchResponse, + KubernetesFetchError, } from '@backstage/plugin-kubernetes-common'; -export type { - KubernetesErrorTypes, - KubernetesRequestBody, -} from '@backstage/plugin-kubernetes-common'; - -export type KubernetesFetchError = KubernetesFetchErrorCommon; -export type FetchResponse = FetchResponseCommon; - export type ClusterLocatorMethod = | ConfigClusterLocatorMethod | GKEClusterLocatorMethod; From 5550c49028c945bd7320d6bc1ac3bf26c2ec4155 Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Thu, 29 Apr 2021 17:33:42 +0200 Subject: [PATCH 27/73] plugin-kubernetes: Fixes common lib name Signed-off-by: Juan Lulkin --- .changeset/silly-tables-build.md | 2 +- plugins/kubernetes/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/silly-tables-build.md b/.changeset/silly-tables-build.md index 3f7b3182dd..cb2fd73950 100644 --- a/.changeset/silly-tables-build.md +++ b/.changeset/silly-tables-build.md @@ -3,4 +3,4 @@ '@backstage/plugin-kubernetes-backend': patch --- -Adds @backstage/kubernetes-common library to share types between kubernetes frontend and backend. +Adds @backstage/plugin-kubernetes-common library to share types between kubernetes frontend and backend. diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json index c808678922..d305ea4b4b 100644 --- a/plugins/kubernetes/package.json +++ b/plugins/kubernetes/package.json @@ -33,7 +33,7 @@ "@backstage/catalog-model": "^0.7.4", "@backstage/config": "^0.1.4", "@backstage/core": "^0.7.6", - "@backstage/kubernetes-common": "^0.1.0", + "@backstage/plugin-kubernetes-common": "^0.1.0", "@backstage/plugin-catalog-react": "^0.1.3", "@backstage/theme": "^0.2.6", "@kubernetes/client-node": "^0.14.0", From 3816ee1a91aee34a07ad9118527827213e05e69e Mon Sep 17 00:00:00 2001 From: Thomas Viaud Date: Fri, 30 Apr 2021 11:12:19 +0100 Subject: [PATCH 28/73] feat(scaffolder-backend,githubPR): Fixing Github URL submitted to get credentials Signed-off-by: Thomas Viaud --- .../scaffolder/actions/builtin/publish/githubPullRequest.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts index e2e4f17efb..18aef2b54c 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts @@ -29,7 +29,7 @@ import { InputError, CustomErrorBase } from '@backstage/errors'; import { createPullRequest } from 'octokit-plugin-create-pull-request'; import globby from 'globby'; -class GithubResponseError extends CustomErrorBase {} +class GithubResponseError extends CustomErrorBase { } type CreatePullRequestResponse = { data: { html_url: string }; @@ -87,7 +87,7 @@ export const defaultClientFactory = async ({ } const { token } = await credentialsProvider.getCredentials({ - url: `${host}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, + url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, }); if (!token) { From 69eefb5aeb8dd3bb08a2827fb384875d9d05e86a Mon Sep 17 00:00:00 2001 From: Thomas Viaud Date: Fri, 30 Apr 2021 11:13:38 +0100 Subject: [PATCH 29/73] feat(scaffolder-backend,doc): Adding Documentation for plugin Signed-off-by: Thomas Viaud --- .changeset/old-horses-brake.md | 6 ++++++ plugins/scaffolder-backend/README.md | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .changeset/old-horses-brake.md diff --git a/.changeset/old-horses-brake.md b/.changeset/old-horses-brake.md new file mode 100644 index 0000000000..ea41019b23 --- /dev/null +++ b/.changeset/old-horses-brake.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Fix GithubPR built-in action `credentialsProvider.getCredentials` URL. +Adding Documentation for GitHub PR built-in action. diff --git a/plugins/scaffolder-backend/README.md b/plugins/scaffolder-backend/README.md index 185938b006..2e8cc41ace 100644 --- a/plugins/scaffolder-backend/README.md +++ b/plugins/scaffolder-backend/README.md @@ -1,7 +1,18 @@ -# Title +# Scaffolder Backend Welcome to the scaffolder plugin! -## Sub-section 1 +## Jobs +Documentation for `Jobs` here +## Stages +Documentation for `Stages` here +## Tasks +Documentation for `Tasks` here -## Sub-section 2 +## Actions +### Built-in: +* #### GitHub Pull Request + * Minimum permissions required for GitHub App for creating a Pull Request with the built-in action: + - Read and Write permissions for `Contents`. + - Read and write permissions for `Pull Requests` and `Issues`. + - Read permissions on `Metadata`. From 900cb4c39d440e90eab2492d4df5eeb55ec9353c Mon Sep 17 00:00:00 2001 From: Thomas Viaud Date: Fri, 30 Apr 2021 11:28:59 +0100 Subject: [PATCH 30/73] Run Prettier on scaffolder-backend files Signed-off-by: Thomas Viaud --- plugins/scaffolder-backend/README.md | 17 ++++++++++++----- .../builtin/publish/githubPullRequest.ts | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/scaffolder-backend/README.md b/plugins/scaffolder-backend/README.md index 2e8cc41ace..304d43a750 100644 --- a/plugins/scaffolder-backend/README.md +++ b/plugins/scaffolder-backend/README.md @@ -3,16 +3,23 @@ Welcome to the scaffolder plugin! ## Jobs + Documentation for `Jobs` here + ## Stages + Documentation for `Stages` here + ## Tasks + Documentation for `Tasks` here ## Actions + ### Built-in: -* #### GitHub Pull Request - * Minimum permissions required for GitHub App for creating a Pull Request with the built-in action: - - Read and Write permissions for `Contents`. - - Read and write permissions for `Pull Requests` and `Issues`. - - Read permissions on `Metadata`. + +- #### GitHub Pull Request + - Minimum permissions required for GitHub App for creating a Pull Request with the built-in action: + - Read and Write permissions for `Contents`. + - Read and write permissions for `Pull Requests` and `Issues`. + - Read permissions on `Metadata`. diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts index 18aef2b54c..8f44fc3e19 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts @@ -87,7 +87,9 @@ export const defaultClientFactory = async ({ } const { token } = await credentialsProvider.getCredentials({ - url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`, + url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent( + repo, + )}`, }); if (!token) { From 939b9d0fffdd69fb2cc976d93ac2d4baec15f0cf Mon Sep 17 00:00:00 2001 From: Thomas Viaud Date: Fri, 30 Apr 2021 11:38:11 +0100 Subject: [PATCH 31/73] Fixing Prettier Warning Signed-off-by: Thomas Viaud --- .../src/scaffolder/actions/builtin/publish/githubPullRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts index 8f44fc3e19..5dd4046811 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/githubPullRequest.ts @@ -29,7 +29,7 @@ import { InputError, CustomErrorBase } from '@backstage/errors'; import { createPullRequest } from 'octokit-plugin-create-pull-request'; import globby from 'globby'; -class GithubResponseError extends CustomErrorBase { } +class GithubResponseError extends CustomErrorBase {} type CreatePullRequestResponse = { data: { html_url: string }; From 382f8f8f84db1e3e95ba448a5f0c3a8cd6748c53 Mon Sep 17 00:00:00 2001 From: Simon Knittel Date: Fri, 30 Apr 2021 15:19:25 +0200 Subject: [PATCH 32/73] Add support for non-organization accounts in GitHub Discovery Signed-off-by: Simon Knittel --- .../src/ingestion/processors/github/github.ts | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/github/github.ts b/plugins/catalog-backend/src/ingestion/processors/github/github.ts index e07ea8917b..0b7f3d831d 100644 --- a/plugins/catalog-backend/src/ingestion/processors/github/github.ts +++ b/plugins/catalog-backend/src/ingestion/processors/github/github.ts @@ -21,6 +21,7 @@ import { graphql } from '@octokit/graphql'; export type QueryResponse = { organization: Organization; + user: User; }; export type Organization = { @@ -41,6 +42,7 @@ export type User = { avatarUrl?: string; email?: string; name?: string; + repositories?: Connection; }; export type Team = { @@ -243,13 +245,27 @@ export async function getOrganizationRepositories( } } } + user(login: $org) { + name + repositories(first: 100, after: $cursor) { + nodes { + name + url + isArchived + } + pageInfo { + hasNextPage + endCursor + } + } + } } `; const repositories = await queryWithPaging( client, query, - r => r.organization?.repositories, + r => r.organization?.repositories || r.user?.repositories, x => x, { org }, ); @@ -327,10 +343,16 @@ export async function queryWithPaging< let cursor: string | undefined = undefined; for (let j = 0; j < 1000 /* just for sanity */; ++j) { - const response: Response = await client(query, { - ...variables, - cursor, - }); + let response: Response; + + try { + response = await client(query, { + ...variables, + cursor, + }); + } catch (e) { + response = e.data; + } const conn = connection(response); if (!conn) { From 80888659bff5549b3f6d7ec0381a33c6c6ee92ad Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 30 Apr 2021 15:37:55 +0200 Subject: [PATCH 33/73] chore: Align react-hook-form version across project Signed-off-by: Johan Haals --- .changeset/fuzzy-dancers-complain.md | 6 ++++++ packages/core/package.json | 2 +- plugins/register-component/package.json | 2 +- yarn.lock | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/fuzzy-dancers-complain.md diff --git a/.changeset/fuzzy-dancers-complain.md b/.changeset/fuzzy-dancers-complain.md new file mode 100644 index 0000000000..a23e6bc3df --- /dev/null +++ b/.changeset/fuzzy-dancers-complain.md @@ -0,0 +1,6 @@ +--- +'@backstage/core': patch +'@backstage/plugin-catalog-import': patch +--- + +Bump react-hook-form version to be the same for the entire project. diff --git a/packages/core/package.json b/packages/core/package.json index 59391e122a..75f5f67ae1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -57,7 +57,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "react-helmet": "6.1.0", - "react-hook-form": "^6.6.0", + "react-hook-form": "^6.15.4", "react-markdown": "^5.0.2", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", diff --git a/plugins/register-component/package.json b/plugins/register-component/package.json index 38d1e3202e..bd51a7db0b 100644 --- a/plugins/register-component/package.json +++ b/plugins/register-component/package.json @@ -39,7 +39,7 @@ "@material-ui/lab": "4.0.0-alpha.45", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-hook-form": "^6.6.0", + "react-hook-form": "^6.15.4", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", "react-use": "^15.3.3" diff --git a/yarn.lock b/yarn.lock index f24ce68740..6e9fe60885 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22074,7 +22074,7 @@ react-helmet@6.1.0: react-fast-compare "^3.1.1" react-side-effect "^2.1.0" -react-hook-form@^6.15.4, react-hook-form@^6.6.0: +react-hook-form@^6.15.4: version "6.15.4" resolved "https://registry.npmjs.org/react-hook-form/-/react-hook-form-6.15.4.tgz#328003e1ccc096cd158899ffe7e3b33735a9b024" integrity sha512-K+Sw33DtTMengs8OdqFJI3glzNl1wBzSefD/ksQw/hJf9CnOHQAU6qy82eOrh0IRNt2G53sjr7qnnw1JDjvx1w== From c1238cc022fdfe9467ef23833770629cd0c65846 Mon Sep 17 00:00:00 2001 From: Simon Knittel Date: Sat, 1 May 2021 11:07:17 +0200 Subject: [PATCH 34/73] Use different query for GitHub Discovery depending on the repository owner Signed-off-by: Simon Knittel --- .../src/ingestion/processors/github/github.ts | 97 +++++++++++++------ 1 file changed, 66 insertions(+), 31 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/github/github.ts b/plugins/catalog-backend/src/ingestion/processors/github/github.ts index 0b7f3d831d..f5230ce044 100644 --- a/plugins/catalog-backend/src/ingestion/processors/github/github.ts +++ b/plugins/catalog-backend/src/ingestion/processors/github/github.ts @@ -66,6 +66,14 @@ export type Connection = { nodes: T[]; }; +export type RepositoryOwnerType = { + __typename: 'Organization' | 'User'; +}; + +export type RepositoryOwnerResponse = { + repositoryOwner: RepositoryOwnerType | null; +}; + /** * Gets all the users out of a GitHub organization. * @@ -229,38 +237,49 @@ export async function getOrganizationRepositories( client: typeof graphql, org: string, ): Promise<{ repositories: Repository[] }> { - const query = ` - query repositories($org: String!, $cursor: String) { - organization(login: $org) { - name - repositories(first: 100, after: $cursor) { - nodes { - name - url - isArchived - } - pageInfo { - hasNextPage - endCursor - } - } - } - user(login: $org) { - name - repositories(first: 100, after: $cursor) { - nodes { - name - url - isArchived - } - pageInfo { - hasNextPage - endCursor - } - } - } + let query = ``; + + switch (await getLoginType(client, org)) { + case 'Organization': + query = ` + query repositories($org: String!, $cursor: String) { + organization(login: $org) { + name + repositories(first: 100, after: $cursor) { + nodes { + name + url + isArchived + } + pageInfo { + hasNextPage + endCursor + } + } + } + }`; + break; + + default: + query = ` + query repositories($org: String!, $cursor: String) { + user(login: $org) { + name + repositories(first: 100, after: $cursor) { + nodes { + name + url + isArchived + } + pageInfo { + hasNextPage + endCursor + } + } + } + }`; + break; } - `; const repositories = await queryWithPaging( client, @@ -372,3 +391,19 @@ export async function queryWithPaging< return result; } + +export async function getLoginType(client: typeof graphql, login: string) { + const query = ` + query repositoryOwner($login: String!) { + repositoryOwner(login: $login) { + __typename + } + }`; + + const response: RepositoryOwnerResponse = await client(query, { login }); + if (response.repositoryOwner === null) { + throw new Error(`Unknown repository owner for "${login}"`); + } + + return response.repositoryOwner.__typename; +} From 650af9bc9543fda44cffa9f634d09ab11b419c0d Mon Sep 17 00:00:00 2001 From: David Tuite Date: Sat, 1 May 2021 11:14:34 +0100 Subject: [PATCH 35/73] Move processor error handling to configuration docs Signed-off-by: David Tuite --- docs/features/software-catalog/configuration.md | 7 +++++++ docs/integrations/github/discovery.md | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 1afdff418a..0f5dd9a765 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -37,6 +37,13 @@ The locations added through static configuration cannot be removed through the catalog locations API. To remove these locations, you must remove them from the configuration. +Syntax errors or other types of errors present in `catalog-info.yaml` files will +be logged for investigation. Errors do not cause processing to abort. + +When multiple `catalog-info.yaml` files with the same `metadata.name` property +are discovered, one will be processed and all others will be skipped. This +action is logged for further investigation. + ### Integration Processors Integrations may simply provide a mechanism to handle `url` location type for an diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 8d2ca8fb32..a578d0893d 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -52,13 +52,3 @@ Backstage to use the [github-apps plugin](../../plugins/github-apps.md). This is true for any method of adding GitHub entities to the catalog, but especially easy to hit with automatic discovery. - -## Error handling - -Syntax errors or other types of errors present in `catalog-info.yaml` files will -be logged for investigation and the importer will continue. Errors do not cause -the process to fail. - -When multiple `catalog-info.yaml` files with the same `metadata.name` property -are discovered, one will be skipped and the process will continue. This action -will be logged for later investigation. From 227439a7237aa084c82fb2b7a6cfd1aa528675fe Mon Sep 17 00:00:00 2001 From: Simon Knittel Date: Sat, 1 May 2021 13:40:11 +0200 Subject: [PATCH 36/73] Switch back to a single query again; Update tests and add changeset Signed-off-by: Simon Knittel --- .changeset/stupid-feet-reply.md | 5 + .../processors/github/github.test.ts | 2 +- .../src/ingestion/processors/github/github.ts | 98 ++++--------------- 3 files changed, 27 insertions(+), 78 deletions(-) create mode 100644 .changeset/stupid-feet-reply.md diff --git a/.changeset/stupid-feet-reply.md b/.changeset/stupid-feet-reply.md new file mode 100644 index 0000000000..d7213b1bdc --- /dev/null +++ b/.changeset/stupid-feet-reply.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Add support for non-organization accounts in GitHub Discovery diff --git a/plugins/catalog-backend/src/ingestion/processors/github/github.test.ts b/plugins/catalog-backend/src/ingestion/processors/github/github.test.ts index 15280b96b8..88bddc93fb 100644 --- a/plugins/catalog-backend/src/ingestion/processors/github/github.test.ts +++ b/plugins/catalog-backend/src/ingestion/processors/github/github.test.ts @@ -156,7 +156,7 @@ describe('github', () => { describe('getOrganizationRepositories', () => { it('read repositories', async () => { const input: QueryResponse = { - organization: { + repositoryOwner: { repositories: { nodes: [ { diff --git a/plugins/catalog-backend/src/ingestion/processors/github/github.ts b/plugins/catalog-backend/src/ingestion/processors/github/github.ts index f5230ce044..f6cfcb8901 100644 --- a/plugins/catalog-backend/src/ingestion/processors/github/github.ts +++ b/plugins/catalog-backend/src/ingestion/processors/github/github.ts @@ -20,8 +20,8 @@ import { graphql } from '@octokit/graphql'; // Graphql types export type QueryResponse = { - organization: Organization; - user: User; + organization?: Organization; + repositoryOwner?: Organization | User; }; export type Organization = { @@ -66,14 +66,6 @@ export type Connection = { nodes: T[]; }; -export type RepositoryOwnerType = { - __typename: 'Organization' | 'User'; -}; - -export type RepositoryOwnerResponse = { - repositoryOwner: RepositoryOwnerType | null; -}; - /** * Gets all the users out of a GitHub organization. * @@ -237,54 +229,28 @@ export async function getOrganizationRepositories( client: typeof graphql, org: string, ): Promise<{ repositories: Repository[] }> { - let query = ``; - - switch (await getLoginType(client, org)) { - case 'Organization': - query = ` - query repositories($org: String!, $cursor: String) { - organization(login: $org) { + const query = ` + query repositories($org: String!, $cursor: String) { + repositoryOwner(login: $org) { + login + repositories(first: 100, after: $cursor) { + nodes { name - repositories(first: 100, after: $cursor) { - nodes { - name - url - isArchived - } - pageInfo { - hasNextPage - endCursor - } - } + url + isArchived } - }`; - break; - - default: - query = ` - query repositories($org: String!, $cursor: String) { - user(login: $org) { - name - repositories(first: 100, after: $cursor) { - nodes { - name - url - isArchived - } - pageInfo { - hasNextPage - endCursor - } - } + pageInfo { + hasNextPage + endCursor } - }`; - break; - } + } + } + }`; const repositories = await queryWithPaging( client, query, - r => r.organization?.repositories || r.user?.repositories, + r => r.repositoryOwner?.repositories, x => x, { org }, ); @@ -362,16 +328,10 @@ export async function queryWithPaging< let cursor: string | undefined = undefined; for (let j = 0; j < 1000 /* just for sanity */; ++j) { - let response: Response; - - try { - response = await client(query, { - ...variables, - cursor, - }); - } catch (e) { - response = e.data; - } + const response: Response = await client(query, { + ...variables, + cursor, + }); const conn = connection(response); if (!conn) { @@ -391,19 +351,3 @@ export async function queryWithPaging< return result; } - -export async function getLoginType(client: typeof graphql, login: string) { - const query = ` - query repositoryOwner($login: String!) { - repositoryOwner(login: $login) { - __typename - } - }`; - - const response: RepositoryOwnerResponse = await client(query, { login }); - if (response.repositoryOwner === null) { - throw new Error(`Unknown repository owner for "${login}"`); - } - - return response.repositoryOwner.__typename; -} From 05687486777479e13dcfb636336498e086d78be2 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Sat, 1 May 2021 08:26:22 -0400 Subject: [PATCH 37/73] Add custom logo instructions Signed-off-by: Adam Harvey --- docs/getting-started/app-custom-theme.md | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/getting-started/app-custom-theme.md b/docs/getting-started/app-custom-theme.md index 181f541929..4dbc6bfa48 100644 --- a/docs/getting-started/app-custom-theme.md +++ b/docs/getting-started/app-custom-theme.md @@ -135,3 +135,31 @@ const themeOptions = createThemeOptions({ }, }); ``` + +## Custom Logo + +In addition to a custom theme, you can also customize the logo displayed at the +far top left of the site. + +In your frontend app, locate `src/components/Root/` folder. You'll find two +components: + +- `LogoFull.tsx` - A larger logo used when the Sidebar navigation is opened. +- `LogoIcon.tsx` - A smaller logo used when the sidebar navigation is closed. + +To replace the images, you can simply replace the relevant code in those +components with raw SVG definitions. + +You can also use another web image format such as PNG by importing it. To do +this, place your new image into a new subdirectory such as +`src/components/Root/logo/my-company-logo.png`, and then add this code: + +```jsx +import MyCustomLogoFull from './logo/my-company-logo.png'; + +//... + +const LogoFull = () => { + return ; +}; +``` From 550a5ff0b65173d6e150e1580c6ab259143d825b Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Sat, 1 May 2021 08:26:44 -0400 Subject: [PATCH 38/73] Reword personalized sentence Signed-off-by: Adam Harvey --- docs/features/software-catalog/configuration.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/features/software-catalog/configuration.md b/docs/features/software-catalog/configuration.md index 1afdff418a..b184bc85de 100644 --- a/docs/features/software-catalog/configuration.md +++ b/docs/features/software-catalog/configuration.md @@ -111,8 +111,7 @@ catalog: > deleting entities will not work in this mode.** A common use case for this configuration is when organizations have a remote -source that should be mirrored into backstage. If we want backstage to be a -mirror of this remote source we cannot allow users to also register entities -with e.g. +source that should be mirrored into Backstage. To make Backstage a mirror of +this remote source, users cannot also register new entities with e.g. the [catalog-import](https://github.com/backstage/backstage/tree/master/plugins/catalog-import) plugin. From 2dea4154dfad82622021ca6b88b066d3154d91e2 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Sat, 1 May 2021 08:27:03 -0400 Subject: [PATCH 39/73] Proper caps of Backstage Signed-off-by: Adam Harvey --- docs/features/software-templates/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/installation.md b/docs/features/software-templates/installation.md index 96eea3c750..c682ca6ddf 100644 --- a/docs/features/software-templates/installation.md +++ b/docs/features/software-templates/installation.md @@ -262,6 +262,6 @@ library. By default it will use the [spotify/backstage-cookiecutter](https://github.com/backstage/backstage/blob/37e35b910afc7d1270855aed0ec4718aba366c91/plugins/scaffolder-backend/scripts/Cookiecutter.dockerfile) docker image. -If you are running backstage from a Docker container and you want to avoid +If you are running Backstage from a Docker container and you want to avoid calling a container inside a container, you can set up Cookiecutter in your own image, this will use the local installation instead. From 6f3d98450fcad40d6703a962be67a4a745f6a29d Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Sat, 1 May 2021 08:28:34 -0400 Subject: [PATCH 40/73] Clarifications on usage Signed-off-by: Adam Harvey --- microsite/README.md | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/microsite/README.md b/microsite/README.md index 9589def3e3..285622f1f8 100644 --- a/microsite/README.md +++ b/microsite/README.md @@ -1,3 +1,9 @@ +# Backstage Documentation + +This folder holds the service and configuration that runs Backstage's documentation hosted at https://backstage.io. + +It pulls content in from the [root `/docs`](../docs/) folder and builds it into the resulting HTML web site. + This website was created with [Docusaurus](https://docusaurus.io/). # What's In This Document @@ -10,6 +16,8 @@ This website was created with [Docusaurus](https://docusaurus.io/). # Getting Started +Testing the web site locally is a great way to see what final website will look like after publishing, and is ideal for testing more complex changes, large updates to navigation, or complex page designs that may include special alignment, which may not otherwise be validated through continuous integration. + ## Installation ``` @@ -22,7 +30,7 @@ $ yarn install $ yarn start ``` -This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. +This command starts a local development server and opens up a browser window. Most content changes made to the `docs/` root folder are reflected live without having to restart the server. ## Build @@ -57,9 +65,9 @@ my-docusaurus/ siteConfig.js ``` -# Editing Content +## Editing Content -## Editing an existing docs page +### Editing an existing docs page Edit docs by navigating to `docs/` and editing the corresponding document: @@ -76,7 +84,7 @@ Edit me... For more information about docs, click [here](https://docusaurus.io/docs/en/navigation) -## Editing an existing blog post +### Editing an existing blog post Edit blog posts by navigating to `website/blog` and editing the corresponding post: @@ -93,9 +101,9 @@ Edit me... For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) -# Adding Content +## Adding Content -## Adding a new docs page to an existing sidebar +### Adding a new docs page to an existing sidebar 1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`: @@ -126,7 +134,7 @@ My new content here.. For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation) -## Adding a new blog post +### Adding a new blog post 1. Make sure there is a header link to your blog in `website/siteConfig.js`: @@ -157,7 +165,7 @@ Lorem Ipsum... For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog) -## Adding items to your site's top navigation bar +### Adding items to your site's top navigation bar 1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`: @@ -181,7 +189,7 @@ For more information about blog posts, click [here](https://docusaurus.io/docs/e For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation) -## Adding custom pages +### Adding custom pages 1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`: 1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element: @@ -199,11 +207,11 @@ For more information about the navigation bar, click [here](https://docusaurus.i } ``` -For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages). +Learn more about [Docusaurus custom pages](https://docusaurus.io/docs/en/custom-pages). -# Full Documentation +## Full Documentation -Full documentation can be found on the [website](https://docusaurus.io/). +Full documentation can be found on the [Docusaurus website](https://docusaurus.io/). ## Additional notes From b99ac3f6e1d29bc75d26a16edb2851784802109e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sun, 2 May 2021 22:13:05 +0200 Subject: [PATCH 41/73] Minor composability etc docs changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- docs/features/kubernetes/installation.md | 60 ++++++--------- .../features/software-catalog/installation.md | 2 + .../software-templates/installation.md | 2 + docs/features/techdocs/getting-started.md | 4 +- ...integrating-plugin-into-service-catalog.md | 2 +- docs/tutorials/switching-sqlite-postgres.md | 5 +- ...0-04-30-how-to-quickly-set-up-backstage.md | 14 +--- packages/backend-common/README.md | 2 + packages/backend/src/plugins/kubernetes.ts | 3 +- packages/cli/README.md | 4 +- packages/core-api/README.md | 4 +- packages/core/README.md | 4 +- packages/dev-utils/README.md | 4 +- packages/test-utils/README.md | 4 +- packages/theme/README.md | 4 +- plugins/api-docs/README.md | 10 +-- plugins/app-backend/README.md | 4 +- plugins/bitrise/README.md | 8 +- plugins/catalog-import/README.md | 4 +- plugins/circleci/README.md | 34 +++++---- plugins/cost-insights/README.md | 2 + .../contrib/aws-cost-explorer-api.md | 2 + plugins/fossa/README.md | 4 +- plugins/github-actions/README.md | 27 ++++--- plugins/github-deployments/README.md | 4 +- plugins/graphiql/README.md | 1 + plugins/jenkins/README.md | 40 +++++----- plugins/kafka-backend/README.md | 9 ++- plugins/kafka/README.md | 38 ++++------ plugins/lighthouse/README.md | 73 ++++++++----------- .../lighthouse/src/components/Intro/index.tsx | 3 +- plugins/pagerduty/README.md | 2 + plugins/register-component/README.md | 1 + plugins/rollbar/README.md | 12 ++- plugins/sentry/README.md | 4 +- plugins/sonarqube/README.md | 3 +- plugins/splunk-on-call/README.md | 2 + plugins/tech-radar/README.md | 5 +- .../docs/code/code-sample.md | 26 +++---- 39 files changed, 216 insertions(+), 220 deletions(-) diff --git a/docs/features/kubernetes/installation.md b/docs/features/kubernetes/installation.md index 10968b427c..36bb724be6 100644 --- a/docs/features/kubernetes/installation.md +++ b/docs/features/kubernetes/installation.md @@ -8,44 +8,36 @@ The Kubernetes feature is a plugin to Backstage, and it is exposed as a tab when viewing entities in the software catalog. If you haven't setup Backstage already, read the -[Getting Started](../../getting-started/index.md). +[Getting Started](../../getting-started/index.md) guide. ## Adding the Kubernetes frontend plugin -The first step is to add the frontend Kubernetes plugin to your Backstage -application. Navigate to your new Backstage application directory. And then to +The first step is to add the Kubernetes frontend plugin to your Backstage +application. Navigate to your new Backstage application directory, and then to your `packages/app` directory, and install the `@backstage/plugin-kubernetes` package. ```bash -cd my-backstage-app/ +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-kubernetes ``` Once the package has been installed, you need to import the plugin in your app -by adding the "Kubernetes" tab to the catalog entity page. In -`packages/app/src/components/catalog/EntityPage.tsx`, you'll add a router to get -to the tab, and add the tab itself. - -`EntityPage.tsx`: +by adding the "Kubernetes" tab to the respective catalog pages. ```tsx -import { Router as KubernetesRouter } from '@backstage/plugin-kubernetes'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { EntityKubernetesContent } from '@backstage/plugin-kubernetes'; -// ... - -const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( - - // ... - } - /> - // ... - -); +// You can add the tab to any number of pages, the service page is shown as an +// example here +const serviceEntityPage = ( + + {/* other tabs... */} + + + ``` That's it! But now, we need the Kubernetes Backend plugin for the frontend to @@ -57,17 +49,16 @@ Navigate to `packages/backend` of your Backstage app, and install the `@backstage/plugin-kubernetes-backend` package. ```bash -cd my-backstage-app/ +# From your Backstage root directory cd packages/backend yarn add @backstage/plugin-kubernetes-backend ``` Create a file called `kubernetes.ts` inside `packages/backend/src/plugins/` and -add the following - -`kubernetes.ts`: +add the following: ```typescript +// In packages/backend/src/plugins/kubernetes.ts import { createRouter } from '@backstage/plugin-kubernetes-backend'; import { PluginEnvironment } from '../types'; @@ -83,18 +74,15 @@ And import the plugin to `packages/backend/src/index.ts`. There are three lines of code you'll need to add, and they should be added near similar code in your existing Backstage backend. -`index.ts`: - ```typescript +// In packages/backend/src/index.ts import kubernetes from './plugins/kubernetes'; - // ... - -const kubernetesEnv = useHotMemoize(module, () => createEnv('kubernetes')); - -// ... - -apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv)); +async function main() { + // ... + const kubernetesEnv = useHotMemoize(module, () => createEnv('kubernetes')); + // ... + apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv)); ``` That's it! The Kubernetes frontend and backend have now been added to your diff --git a/docs/features/software-catalog/installation.md b/docs/features/software-catalog/installation.md index df473f886f..0b622fb093 100644 --- a/docs/features/software-catalog/installation.md +++ b/docs/features/software-catalog/installation.md @@ -18,6 +18,7 @@ The catalog frontend plugin should be installed in your `app` package, which is created as a part of `@backstage/create-app`. To install the package, run: ```bash +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-catalog ``` @@ -103,6 +104,7 @@ The catalog backend should be installed in your `backend` package, which is created as a part of `@backstage/create-app`. To install the package, run: ```bash +# From your Backstage root directory cd packages/backend yarn add @backstage/plugin-catalog-backend ``` diff --git a/docs/features/software-templates/installation.md b/docs/features/software-templates/installation.md index c682ca6ddf..5acaf0e499 100644 --- a/docs/features/software-templates/installation.md +++ b/docs/features/software-templates/installation.md @@ -20,6 +20,7 @@ The scaffolder frontend plugin should be installed in your `app` package, which is created as a part of `@backstage/create-app`. To install the package, run: ```bash +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-scaffolder ``` @@ -57,6 +58,7 @@ The scaffolder backend should be installed in your `backend` package, which is created as a part of `@backstage/create-app`. To install the package, run: ```bash +# From your Backstage root directory cd packages/backend yarn add @backstage/plugin-scaffolder-backend ``` diff --git a/docs/features/techdocs/getting-started.md b/docs/features/techdocs/getting-started.md index 223b276d68..520db2245c 100644 --- a/docs/features/techdocs/getting-started.md +++ b/docs/features/techdocs/getting-started.md @@ -22,7 +22,7 @@ Navigate to your new Backstage application directory. And then to your `packages/app` directory, and install the `@backstage/plugin-techdocs` package. ```bash -cd my-backstage-app/ +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-techdocs ``` @@ -54,7 +54,7 @@ Navigate to `packages/backend` of your Backstage app, and install the `@backstage/plugin-techdocs-backend` package. ```bash -cd my-backstage-app/ +# From your Backstage root directory cd packages/backend yarn add @backstage/plugin-techdocs-backend ``` diff --git a/docs/plugins/integrating-plugin-into-service-catalog.md b/docs/plugins/integrating-plugin-into-service-catalog.md index 01de779635..047b6f14e6 100644 --- a/docs/plugins/integrating-plugin-into-service-catalog.md +++ b/docs/plugins/integrating-plugin-into-service-catalog.md @@ -1,7 +1,7 @@ --- id: integrating-plugin-into-service-catalog title: Integrate into the Service Catalog -description: Documentation on How to integrate plugin into service catalog +description: How to integrate a plugin into service catalog --- > This is an advanced use case and currently is an experimental feature. Expect diff --git a/docs/tutorials/switching-sqlite-postgres.md b/docs/tutorials/switching-sqlite-postgres.md index a759b7dc49..fafd2ad586 100644 --- a/docs/tutorials/switching-sqlite-postgres.md +++ b/docs/tutorials/switching-sqlite-postgres.md @@ -17,11 +17,11 @@ switch between database backends. ## Install PostgreSQL -First, swap out SQLite for PostgreSQL in your `backend` package: +First, add PostgreSQL to your `backend` package: ```shell +# From your Backstage root directory cd packages/backend -yarn remove sqlite3 yarn add pg ``` @@ -46,7 +46,6 @@ backend: + #ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require) + #ca: # if you have a CA file and want to verify it you can uncomment this section + #$file: /ca/server.crt - ``` If you have an `app-config.local.yaml` for local development, a similar update diff --git a/microsite/blog/2020-04-30-how-to-quickly-set-up-backstage.md b/microsite/blog/2020-04-30-how-to-quickly-set-up-backstage.md index 65102c919f..7289878bc1 100644 --- a/microsite/blog/2020-04-30-how-to-quickly-set-up-backstage.md +++ b/microsite/blog/2020-04-30-how-to-quickly-set-up-backstage.md @@ -45,7 +45,7 @@ The only thing you need to do is to start the app: ```bash cd my-app -yarn start +yarn dev ``` And you are good to go! 👍 @@ -101,18 +101,12 @@ We provide a collection of public Backstage plugins (look for packages with the Install in your app’s package folder (`/packages/app`) with: ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin- ``` -Then add it to your app's `plugin.ts` file to import and register it: - -`/packages/app/src/plugin.ts`: - -```js -export { plugin as PluginName } from '@backstage/plugin-'; -``` - -A plugin registers its own `route` in the app — read the documentation for the specific plugin you are installing for more information on that. +After that, you inject the plugin into the application where you want it to be exposed. Please read the documentation for the specific plugin you are installing for more information. ### Creating an internal plugin diff --git a/packages/backend-common/README.md b/packages/backend-common/README.md index dc08d89416..dc69790bc3 100644 --- a/packages/backend-common/README.md +++ b/packages/backend-common/README.md @@ -8,6 +8,8 @@ error handling and similar. Add the library to your backend package: ```sh +# From your Backstage root directory +cd packages/backend yarn add @backstage/backend-common ``` diff --git a/packages/backend/src/plugins/kubernetes.ts b/packages/backend/src/plugins/kubernetes.ts index 131c5c8eee..7906765533 100644 --- a/packages/backend/src/plugins/kubernetes.ts +++ b/packages/backend/src/plugins/kubernetes.ts @@ -15,12 +15,11 @@ */ import { createRouter } from '@backstage/plugin-kubernetes-backend'; -import { Router } from 'express'; import { PluginEnvironment } from '../types'; export default async function createPlugin({ logger, config, -}: PluginEnvironment): Promise { +}: PluginEnvironment) { return await createRouter({ logger, config }); } diff --git a/packages/cli/README.md b/packages/cli/README.md index cd6ad8094e..eb5e0e461b 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -7,13 +7,13 @@ This package provides a CLI for developing Backstage plugins and apps. Install the package via npm or Yarn: ```sh -$ npm install --save @backstage/cli +npm install --save @backstage/cli ``` or ```sh -$ yarn add @backstage/cli +yarn add @backstage/cli ``` ## Development diff --git a/packages/core-api/README.md b/packages/core-api/README.md index f7b8b6c337..a4325a9c5d 100644 --- a/packages/core-api/README.md +++ b/packages/core-api/README.md @@ -7,13 +7,13 @@ This package provides the core API used by Backstage plugins and apps. Do not install this package directly, it is reexported by `@backstage/core`. Install that instead: ```sh -$ npm install --save @backstage/core +npm install --save @backstage/core ``` or ```sh -$ yarn add @backstage/core +yarn add @backstage/core ``` ## Documentation diff --git a/packages/core/README.md b/packages/core/README.md index 6d8519d46f..0f827d6074 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -7,13 +7,13 @@ This package provides the core API used by Backstage plugins and apps. Install the package via npm or Yarn: ```sh -$ npm install --save @backstage/core +npm install --save @backstage/core ``` or ```sh -$ yarn add @backstage/core +yarn add @backstage/core ``` ## Documentation diff --git a/packages/dev-utils/README.md b/packages/dev-utils/README.md index 4b08a5ca6d..85d961ad0b 100644 --- a/packages/dev-utils/README.md +++ b/packages/dev-utils/README.md @@ -9,13 +9,13 @@ This package provides utilities that help in developing plugins for Backstage, l Install the package via npm or Yarn: ```sh -$ npm install --save-dev @backstage/dev-utils +npm install --save-dev @backstage/dev-utils ``` or ```sh -$ yarn add -D @backstage/dev-utils +yarn add -D @backstage/dev-utils ``` ## Documentation diff --git a/packages/test-utils/README.md b/packages/test-utils/README.md index 0f95d4ab26..ace7339733 100644 --- a/packages/test-utils/README.md +++ b/packages/test-utils/README.md @@ -7,13 +7,13 @@ This package provides utilities that can be used to test plugins and apps for Ba Install the package via npm or Yarn: ```sh -$ npm install --save-dev @backstage/test-utils +npm install --save-dev @backstage/test-utils ``` or ```sh -$ yarn add -D @backstage/test-utils +yarn add -D @backstage/test-utils ``` ## Documentation diff --git a/packages/theme/README.md b/packages/theme/README.md index 9855d6730d..de94ff1623 100644 --- a/packages/theme/README.md +++ b/packages/theme/README.md @@ -7,13 +7,13 @@ This package provides the extended Material UI Theme(s) that power Backstage. Install the package via npm or Yarn: ```sh -$ npm install --save @backstage/theme +npm install --save @backstage/theme ``` or ```sh -$ yarn add @backstage/theme +yarn add @backstage/theme ``` ## Documentation diff --git a/plugins/api-docs/README.md b/plugins/api-docs/README.md index dac4b6ff4d..60d8986d9b 100644 --- a/plugins/api-docs/README.md +++ b/plugins/api-docs/README.md @@ -28,15 +28,15 @@ To link that a component provides or consumes an API, see the [`providesApis`](h 1. Install the API docs plugin ```bash -# packages/app - +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-api-docs ``` 2. Add the `ApiExplorerPage` extension to the app: ```tsx -// packages/app/src/App.tsx +// In packages/app/src/App.tsx import { ApiExplorerPage } from '@backstage/plugin-api-docs'; @@ -56,7 +56,7 @@ import { } from '@backstage/plugin-api-docs'; const apiPage = ( - + @@ -80,7 +80,7 @@ const apiPage = ( - + ); // ... diff --git a/plugins/app-backend/README.md b/plugins/app-backend/README.md index 2dc302accb..a35cecfb9c 100644 --- a/plugins/app-backend/README.md +++ b/plugins/app-backend/README.md @@ -7,7 +7,9 @@ This backend plugin can be installed to serve static content of a Backstage app. Add both this package and your local frontend app package as dependencies to your backend, for example ```bash -yarn add @backstage/plugin-app-backend example-app +# From your Backstage root directory +cd packages/backend +yarn add @backstage/plugin-app-backend app ``` By adding the app package as a dependency we ensure that it is built as part of the backend, and that it can be resolved at runtime. diff --git a/plugins/bitrise/README.md b/plugins/bitrise/README.md index 411db3198e..1add03df23 100644 --- a/plugins/bitrise/README.md +++ b/plugins/bitrise/README.md @@ -8,9 +8,9 @@ Welcome to the Bitrise plugin! ## Installation ```sh -# The plugin must be added in the app package -$ cd packages/app -$ yarn add @backstage/plugin-bitrise +# From your Backstage root directory +cd packages/app +yarn add @backstage/plugin-bitrise ``` Bitrise Plugin exposes an entity tab component named `EntityBitriseContent`. You can include it in the @@ -22,7 +22,7 @@ import { EntityBitriseContent } from '@backstage/plugin-bitrise'; // Farther down at the website declaration const websiteEntityPage = ( - + {/* Place the following section where you want the tab to appear */} diff --git a/plugins/catalog-import/README.md b/plugins/catalog-import/README.md index 5e773ad288..bad48a8486 100644 --- a/plugins/catalog-import/README.md +++ b/plugins/catalog-import/README.md @@ -18,8 +18,8 @@ Some features are not yet available for all supported Git providers. 1. Install the Catalog Import Plugin: ```bash -# packages/app - +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-catalog-import ``` diff --git a/plugins/circleci/README.md b/plugins/circleci/README.md index 868ae6e26a..c878c66e56 100644 --- a/plugins/circleci/README.md +++ b/plugins/circleci/README.md @@ -7,34 +7,35 @@ Website: [https://circleci.com/](https://circleci.com/) ## Setup -1. If you have standalone app (you didn't clone this repo), then do +1. If you have a standalone app (you didn't clone this repo), then do ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-circleci ``` -2. Add the `EntityCircleCIContent` extension to the entity page in the app: +2. Add the `EntityCircleCIContent` extension to the entity page in your app: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx -import { EntityCircleCIContent } from '@backstage/plugin-circleci'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { + EntityCircleCIContent, + isCircleCIAvailable, +} from '@backstage/plugin-circleci'; -// ... -const serviceEntityPage = ( - - ... - +// For example in the CI/CD section +const cicdContent = ( + + - - ... - -); + ``` 4. Add proxy config: ```yaml -// app-config.yaml +# In app-config.yaml proxy: '/circleci/api': target: https://circleci.com/api/v1.1 @@ -42,10 +43,11 @@ proxy: Circle-Token: ${CIRCLECI_AUTH_TOKEN} ``` -5. Get and provide `CIRCLECI_AUTH_TOKEN` as env variable (https://circleci.com/docs/api/#add-an-api-token) -6. Add `circleci.com/project-slug` annotation to your catalog-info.yaml file in format // (https://backstage.io/docs/architecture-decisions/adrs-adr002#format) +5. Get and provide a `CIRCLECI_AUTH_TOKEN` as an environment variable (see the [CircleCI docs](https://circleci.com/docs/api/#add-an-api-token)). +6. Add a `circleci.com/project-slug` annotation to your respective `catalog-info.yaml` files, on the format // (https://backstage.io/docs/architecture-decisions/adrs-adr002#format). ```yaml +# Example catalog-info.yaml entity definition file apiVersion: backstage.io/v1alpha1 kind: Component metadata: diff --git a/plugins/cost-insights/README.md b/plugins/cost-insights/README.md index f737c022f3..3fee89e77a 100644 --- a/plugins/cost-insights/README.md +++ b/plugins/cost-insights/README.md @@ -16,6 +16,8 @@ Learn more with the Backstage blog post [New Cost Insights plugin: The engineer' ## Install ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-cost-insights ``` diff --git a/plugins/cost-insights/contrib/aws-cost-explorer-api.md b/plugins/cost-insights/contrib/aws-cost-explorer-api.md index 10622b7917..d6c5250759 100644 --- a/plugins/cost-insights/contrib/aws-cost-explorer-api.md +++ b/plugins/cost-insights/contrib/aws-cost-explorer-api.md @@ -33,6 +33,8 @@ Cost Explorer permission policy: Install the AWS Cost Explorer SDK. The AWS docs recommend using the SDK over making calls to the API directly as it simplifies authentication and provides direct access to commands. ```bash +# From your Backstage root directory +cd packages/app yarn add @aws-sdk/client-cost-explorer ``` diff --git a/plugins/fossa/README.md b/plugins/fossa/README.md index 11f3e90e1c..6ca2e1a96f 100644 --- a/plugins/fossa/README.md +++ b/plugins/fossa/README.md @@ -9,8 +9,8 @@ The FOSSA Plugin displays code statistics from [FOSSA](https://fossa.com/). 1. Install the FOSSA Plugin: ```bash -# packages/app - +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-fossa ``` diff --git a/plugins/github-actions/README.md b/plugins/github-actions/README.md index 87c68839c1..d027368c8b 100644 --- a/plugins/github-actions/README.md +++ b/plugins/github-actions/README.md @@ -11,15 +11,15 @@ TBD ### Generic Requirements 1. Provide OAuth credentials: - 1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with callback URL set to `http://localhost:7000/api/auth/github`. - 2. Take Client ID and Client Secret from the newly created app's settings page and put them into `AUTH_GITHUB_CLIENT_ID` and `AUTH_GITHUB_CLIENT_SECRET` env variables. + 1. [Create an OAuth App](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/) with the callback URL set to `http://localhost:7000/api/auth/github`. + 2. Take the Client ID and Client Secret from the newly created app's settings page and put them into `AUTH_GITHUB_CLIENT_ID` and `AUTH_GITHUB_CLIENT_SECRET` environment variables. 2. Annotate your component with a correct GitHub Actions repository and owner: The annotation key is `github.com/project-slug`. Example: - ``` + ```yaml apiVersion: backstage.io/v1alpha1 kind: Component metadata: @@ -38,6 +38,7 @@ TBD 1. Install the plugin dependency in your Backstage app package: ```bash +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-github-actions ``` @@ -45,22 +46,24 @@ yarn add @backstage/plugin-github-actions 2. Add to the app `EntityPage` component: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx -import { EntityGithubActionsContent } from '@backstage/plugin-github-actions'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { + EntityGithubActionsContent, + isGithubActionsAvailable, +} from '@backstage/plugin-github-actions'; -// ... +// You can add the tab to any number of pages, the service page is shown as an +// example here const serviceEntityPage = ( - - ... + + {/* other tabs... */} - ... - -); ``` -2. Run the app with `yarn start` and the backend with `yarn --cwd packages/backend start`, navigate to `/github-actions/`. +3. Run the app with `yarn start` and the backend with `yarn start-backend`. + Then navigate to `/github-actions/` under any entity. ## Features diff --git a/plugins/github-deployments/README.md b/plugins/github-deployments/README.md index 1bb8846105..8284ceba56 100644 --- a/plugins/github-deployments/README.md +++ b/plugins/github-deployments/README.md @@ -13,8 +13,8 @@ The GitHub Deployments Plugin displays recent deployments from GitHub. 1. Install the GitHub Deployments Plugin. ```bash -# packages/app - +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-github-deployments ``` diff --git a/plugins/graphiql/README.md b/plugins/graphiql/README.md index 39372890d1..b95f055a56 100644 --- a/plugins/graphiql/README.md +++ b/plugins/graphiql/README.md @@ -12,6 +12,7 @@ By exposing GraphiQL as a plugin instead of a standalone app, it's possible to p Start out by installing the plugin in your Backstage app: ```bash +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-graphiql ``` diff --git a/plugins/jenkins/README.md b/plugins/jenkins/README.md index f406393190..69304cb847 100644 --- a/plugins/jenkins/README.md +++ b/plugins/jenkins/README.md @@ -11,25 +11,25 @@ Website: [https://jenkins.io/](https://jenkins.io/) 1. If you have a standalone app (you didn't clone this repo), then do ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-jenkins ``` 2. Add the `EntityJenkinsContent` extension to the entity page in the app: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx -import { EntityJenkinsContent } from '@backstage/plugin-circleci'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { EntityJenkinsContent } from '@backstage/plugin-jenkins'; -// ... +// You can add the tab to any number of pages, the service page is shown as an +// example here const serviceEntityPage = ( - - ... + + {/* other tabs... */} - ... - -); ``` 3. Add proxy configuration to `app-config.yaml` @@ -43,14 +43,18 @@ proxy: Authorization: Basic ${JENKINS_BASIC_AUTH_HEADER} ``` -4. Add an environment variable which contains the Jenkins credentials, (note: use an API token not your password). Here user is the name of the user created in Jenkins. +4. Add an environment variable which contains the Jenkins credentials (NOTE: + use an API token, not your password). Here `user` is the name of the user + created in Jenkins. ```shell export JENKINS_BASIC_AUTH_HEADER=$(echo -n user:api-token | base64) ``` -5. Run app with `yarn start` -6. Add the Jenkins folder annotation to your `catalog-info.yaml`, (note: currently this plugin only supports folders and Git SCM) +5. Run the app with `yarn start` + +6. Add the Jenkins folder annotation to your `catalog-info.yaml`, (NOTE: + currently this plugin only supports folders and Git SCM) ```yaml apiVersion: backstage.io/v1alpha1 @@ -68,11 +72,11 @@ spec: 7. Register your component -8. Click the component in the catalog you should now see Jenkins builds, and a last build result for your master build. +8. Click the component in the catalog. You should now see Jenkins builds, and a + last build result for your master build. -Note: - -If you are not using environment variable then you can directly type API token in app-config.yaml +Note: If you are not using environment variables, you can directly type the API +token into `app-config.yaml`. ```yaml proxy: @@ -83,7 +87,8 @@ proxy: Authorization: Basic YWRtaW46MTFlYzI1NmU0Mzg1MDFjM2Y1Yzc2Yjc1MWE3ZTQ3YWY4Mw== ``` -YWRtaW46MTFlYzI1NmU0Mzg1MDFjM2Y1Yzc2Yjc1MWE3ZTQ3YWY4Mw== is the base64 of user and it's API token e.g. admin:11ec256e438501c3f5c76b751a7e47af83 +The string starting with `YWR...` is the base64 encoding of the user and their +API token, e.g. `admin:11ec256e438501c3f5c76b751a7e47af83`. ## Features @@ -94,4 +99,5 @@ YWRtaW46MTFlYzI1NmU0Mzg1MDFjM2Y1Yzc2Yjc1MWE3ZTQ3YWY4Mw== is the base64 of user a ## Limitations - Only works with organization folder projects backed by GitHub -- No pagination support currently, limited to 50 projects - don't run this on a Jenkins with lots of builds +- No pagination support currently, limited to 50 projects - don't run this on a + Jenkins instance with lots of builds diff --git a/plugins/kafka-backend/README.md b/plugins/kafka-backend/README.md index 14914e5ba6..d18a232fa4 100644 --- a/plugins/kafka-backend/README.md +++ b/plugins/kafka-backend/README.md @@ -1,6 +1,7 @@ # Kafka Backend -This is the backend part of the Kafka plugin. It responds to Kafka requests from the frontend. +This is the backend part of the Kafka plugin. It responds to Kafka requests +from the frontend. ## Configuration @@ -16,7 +17,9 @@ A list of the brokers' host names and ports to connect to. ### `ssl` (optional) -Configure TLS connection to the Kafka cluster. The options are passed directly to [tls.connect] and used to create the TLS secure context. Normally these would include `key` and `cert`. +Configure TLS connection to the Kafka cluster. The options are passed directly +to [tls.connect] and used to create the TLS secure context. Normally these +would include `key` and `cert`. Example: @@ -39,7 +42,7 @@ kafka: clusters: - name: prod brokers: - - my-cluser:9092 + - my-cluster:9092 ssl: true sasl: mechanism: plain # or 'scram-sha-256' or 'scram-sha-512' diff --git a/plugins/kafka/README.md b/plugins/kafka/README.md index a2ea01cf7d..7da44ae9b6 100644 --- a/plugins/kafka/README.md +++ b/plugins/kafka/README.md @@ -7,7 +7,9 @@ 1. Run: ```bash -yarn add @backstage/plugin-kafka @backstage/plugin-kafka-backend +# From your Backstage root directory +yarn --cwd packages/app add @backstage/plugin-kafka +yarn --cwd packages/backend add @backstage/plugin-kafka-backend ``` 2. Add the plugin backend: @@ -29,41 +31,31 @@ export default async function createPlugin({ And then add to `packages/backend/src/index.ts`: ```js -// ... +// In packages/backend/src/index.ts import kafka from './plugins/kafka'; // ... async function main() { // ... const kafkaEnv = useHotMemoize(module, () => createEnv('kafka')); // ... - - const apiRouter = Router(); - // ... apiRouter.use('/kafka', await kafka(kafkaEnv)); - // ... ``` -3. Add the plugin frontend to `packages/app/src/plugin.ts`: - -```js -export { plugin as Kafka } from '@backstage/plugin-kafka'; -``` - -4. Register the plugin frontend router in `packages/app/src/components/catalog/EntityPage.tsx`: +3. Add the plugin as a tab to your service entities: ```jsx -import { Router as KafkaRouter } from '@backstage/plugin-kafka'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { EntityKafkaContent } from '@backstage/plugin-kafka'; -// Then, somewhere inside - -} -/>; +const serviceEntityPage = ( + + {/* other tabs... */} + + + ``` -5. Add broker configs for the backend in your `app-config.yaml` (see +4. Add broker configs for the backend in your `app-config.yaml` (see [kafka-backend](https://github.com/backstage/backstage/blob/master/plugins/kafka-backend/README.md) for more options): @@ -76,7 +68,7 @@ kafka: - localhost:9092 ``` -6. Add `kafka.apache.org/consumer-groups` annotation to your services: +5. Add the `kafka.apache.org/consumer-groups` annotation to your services: ```yaml apiVersion: backstage.io/v1alpha1 diff --git a/plugins/lighthouse/README.md b/plugins/lighthouse/README.md index 028547ea3e..06c9a1da12 100644 --- a/plugins/lighthouse/README.md +++ b/plugins/lighthouse/README.md @@ -28,20 +28,21 @@ _It's likely you will need to [enable CORS](https://developer.mozilla.org/en-US/ When you have an instance running that Backstage can hook into, first install the plugin into your app: ```sh -$ yarn add @backstage/plugin-lighthouse +# From your Backstage root directory +cd packages/app +yarn add @backstage/plugin-lighthouse ``` Modify your app routes in `App.tsx` to include the `LighthousePage` component exported from the plugin, for example: ```tsx -// At the top imports +// In packages/app/src/App.tsx import { LighthousePage } from '@backstage/plugin-lighthouse'; - - // ... - } /> - // ... -; +const routes = ( + + {/* ...other routes */} + } /> ``` Then configure the `lighthouse-audit-service` URL in your [`app-config.yaml`](https://github.com/backstage/backstage/blob/master/app-config.yaml). @@ -63,55 +64,45 @@ kind: Component metadata: # ... annotations: - # ... lighthouse.com/website-url: # A single website url e.g. https://backstage.io/ ``` > NOTE: The plugin only supports one website URL per component at this time. -Add a **Lighthouse tab** to the EntityPage: +Add a Lighthouse tab to the entity page: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx -import { EmbeddedRouter as LighthouseRouter } from '@backstage/plugin-lighthouse'; +// In packages/app/src/components/catalog/EntityPage.tsx +import { EntityLighthouseContent } from '@backstage/plugin-lighthouse'; -// ... -const WebsiteEntityPage = ({ entity }: { entity: Entity }) => ( - - // ... - } - /> - -); +const websiteEntityPage = ( + + {/* other tabs... */} + + + ``` -> NOTE: The embedded router renders page content without a header section allowing it to be rendered within a -> catalog plugin page. +> NOTE: The embedded router renders page content without a header section +> allowing it to be rendered within a catalog plugin page. Add a **Lighthouse card** to the overview tab on the EntityPage: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx +// In packages/app/src/components/catalog/EntityPage.tsx import { - LastLighthouseAuditCard, - isPluginApplicableToEntity as isLighthouseAvailable, + EntityLastLighthouseAuditCard, + isLighthouseAvailable, } from '@backstage/plugin-lighthouse'; -// ... - -const OverviewContent = ({ entity }: { entity: Entity }) => ( - - // ... - {isLighthouseAvailable(entity) && ( - - - - )} - -); +const overviewContent = ( + + {/* ...other content */} + + + + + + + ``` - -Link Lighthouse diff --git a/plugins/lighthouse/src/components/Intro/index.tsx b/plugins/lighthouse/src/components/Intro/index.tsx index a89518a5ed..6b0307f9ec 100644 --- a/plugins/lighthouse/src/components/Intro/index.tsx +++ b/plugins/lighthouse/src/components/Intro/index.tsx @@ -46,7 +46,8 @@ with the environment variable \`LAS_CORS\` set to \`true\`._ When you have an instance running that Backstage can hook into, first install the plugin into your app: \`\`\`sh -$ yarn add @backstage/plugin-lighthouse +cd packages/app +yarn add @backstage/plugin-lighthouse \`\`\` Modify your app routes in \`App.tsx\` to include the \`LighthousePage\` component exported from the plugin, for example: diff --git a/plugins/pagerduty/README.md b/plugins/pagerduty/README.md index 36f380fdd5..e1ec7f89c7 100644 --- a/plugins/pagerduty/README.md +++ b/plugins/pagerduty/README.md @@ -19,6 +19,8 @@ This plugin provides: Install the plugin: ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-pagerduty ``` diff --git a/plugins/register-component/README.md b/plugins/register-component/README.md index 9c5304385e..47db1a7a55 100644 --- a/plugins/register-component/README.md +++ b/plugins/register-component/README.md @@ -19,6 +19,7 @@ When installed it is accessible on [localhost:3000/register-component](localhost 1. Install plugin and its dependency `plugin-catalog` ```bash +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-register-component ``` diff --git a/plugins/rollbar/README.md b/plugins/rollbar/README.md index 3a33fe223c..bdf0541fa0 100644 --- a/plugins/rollbar/README.md +++ b/plugins/rollbar/README.md @@ -9,25 +9,23 @@ Website: [https://rollbar.com/](https://rollbar.com/) 2. If you have standalone app (you didn't clone this repo), then do ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-rollbar ``` 3. Add to the app `EntityPage` component: ```tsx -// packages/app/src/components/catalog/EntityPage.tsx +// In packages/app/src/components/catalog/EntityPage.tsx import { EntityRollbarContent } from '@backstage/plugin-rollbar'; -// ... const serviceEntityPage = ( - - ... + + {/* other tabs... */} - ... - -); ``` 4. Setup the `app-config.yaml` and account token environment variable diff --git a/plugins/sentry/README.md b/plugins/sentry/README.md index 9bdb2dc16d..e0c56e842c 100644 --- a/plugins/sentry/README.md +++ b/plugins/sentry/README.md @@ -9,8 +9,8 @@ The Sentry Plugin displays issues from [Sentry](https://sentry.io). 1. Install the Sentry Plugin: ```bash -# packages/app - +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-sentry ``` diff --git a/plugins/sonarqube/README.md b/plugins/sonarqube/README.md index 5c12832e57..d0251e91ef 100644 --- a/plugins/sonarqube/README.md +++ b/plugins/sonarqube/README.md @@ -9,7 +9,8 @@ The SonarQube Plugin displays code statistics from [SonarCloud](https://sonarclo 1. Install the SonarQube Plugin: ```bash -# packages/app +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-sonarqube ``` diff --git a/plugins/splunk-on-call/README.md b/plugins/splunk-on-call/README.md index 5c1dda33fc..33cfa091ca 100644 --- a/plugins/splunk-on-call/README.md +++ b/plugins/splunk-on-call/README.md @@ -20,6 +20,8 @@ This plugin provides: Install the plugin: ```bash +# From your Backstage root directory +cd packages/app yarn add @backstage/plugin-splunk-on-call ``` diff --git a/plugins/tech-radar/README.md b/plugins/tech-radar/README.md index 7f97f88ed4..814ab6cba5 100644 --- a/plugins/tech-radar/README.md +++ b/plugins/tech-radar/README.md @@ -26,6 +26,7 @@ The Tech Radar can be used in two ways: For either simple or advanced installations, you'll need to add the dependency using Yarn: ```sh +# From your Backstage root directory cd packages/app yarn add @backstage/plugin-tech-radar ``` @@ -35,12 +36,12 @@ yarn add @backstage/plugin-tech-radar Modify your app routes to include the Router component exported from the tech radar, for example: ```tsx -// in packages/app/src/App.tsx +// In packages/app/src/App.tsx import { TechRadarPage } from '@backstage/plugin-tech-radar'; const routes = ( - {/* ... */} + {/* ...other routes */} } diff --git a/plugins/techdocs-backend/examples/documented-component/docs/code/code-sample.md b/plugins/techdocs-backend/examples/documented-component/docs/code/code-sample.md index 9f8e1bd739..f41ab1d506 100644 --- a/plugins/techdocs-backend/examples/documented-component/docs/code/code-sample.md +++ b/plugins/techdocs-backend/examples/documented-component/docs/code/code-sample.md @@ -5,19 +5,19 @@ This page provides some sample code which may be used in your example component. This code uses TypeScript, and the Markdown code fence to wrap the code. ```typescript -const DefaultEntityPage = ({ entity }: { entity: Entity }) => ( - - } - /> - } - /> - +const serviceEntityPage = ( + + + + + + + + + + + + ); ``` From 8f276d072bf841b67ee9215db5f72ebd47dbefc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 May 2021 04:20:11 +0000 Subject: [PATCH 42/73] chore(deps): bump swagger-ui-react from 3.45.1 to 3.48.0 Bumps [swagger-ui-react](https://github.com/swagger-api/swagger-ui) from 3.45.1 to 3.48.0. - [Release notes](https://github.com/swagger-api/swagger-ui/releases) - [Commits](https://github.com/swagger-api/swagger-ui/compare/v3.45.1...v3.48.0) Signed-off-by: dependabot[bot] --- yarn.lock | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/yarn.lock b/yarn.lock index f24ce68740..ac1a9f27c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1608,10 +1608,10 @@ core-js "^2.6.5" regenerator-runtime "^0.13.4" -"@babel/runtime-corejs3@^7.10.2", "@babel/runtime-corejs3@^7.11.2", "@babel/runtime-corejs3@^7.13.10": - version "7.13.10" - resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.13.10.tgz#14c3f4c85de22ba88e8e86685d13e8861a82fe86" - integrity sha512-x/XYVQ1h684pp1mJwOV4CyvqZXqbc8CMsMGUnAbuc82ZCdv1U63w5RSUzgDSXQHG5Rps/kiksH6g2D5BuaKyXg== +"@babel/runtime-corejs3@^7.10.2", "@babel/runtime-corejs3@^7.11.2", "@babel/runtime-corejs3@^7.13.17": + version "7.14.0" + resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.14.0.tgz#6bf5fbc0b961f8e3202888cb2cd0fb7a0a9a3f66" + integrity sha512-0R0HTZWHLk6G8jIk0FtoX+AatCtKnswS98VhXwGImFc759PJRp4Tru0PQYZofyijTFUr+gT8Mu7sgXVJLQ0ceg== dependencies: core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" @@ -9677,10 +9677,10 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.5, classnames@^2.2.6: - version "2.2.6" - resolved "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== +classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" + integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== clean-css@^4.2.3: version "4.2.3" @@ -11832,10 +11832,10 @@ domhandler@^4.0.0: dependencies: domelementtype "^2.1.0" -dompurify@^2.0.12, dompurify@^2.1.1, dompurify@^2.2.7: - version "2.2.7" - resolved "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz#a5f055a2a471638680e779bd08fc334962d11fd8" - integrity sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg== +dompurify@^2.0.12, dompurify@^2.1.1, dompurify@^2.2.8: + version "2.2.8" + resolved "https://registry.npmjs.org/dompurify/-/dompurify-2.2.8.tgz#ce88e395f6d00b6dc53f80d6b2a6fdf5446873c6" + integrity sha512-9H0UL59EkDLgY3dUFjLV6IEUaHm5qp3mxSqWw7Yyx4Zhk2Jn2cmLe+CNPP3xy13zl8Bqg+0NehQzkdMoVhGRww== domutils@1.5.1: version "1.5.1" @@ -23583,12 +23583,7 @@ sentence-case@^3.0.4: tslib "^2.0.3" upper-case-first "^2.0.2" -serialize-error@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz#50b679d5635cdf84667bdc8e59af4e5b81d5f60a" - integrity sha1-ULZ51WNc34Rme9yOWa9OW4HV9go= - -serialize-error@^8.0.1: +serialize-error@^8.0.1, serialize-error@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/serialize-error/-/serialize-error-8.1.0.tgz#3a069970c712f78634942ddd50fbbc0eaebe2f67" integrity sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ== @@ -24859,10 +24854,10 @@ svgo@^1.0.0, svgo@^1.2.2: unquote "~1.1.1" util.promisify "~1.0.0" -swagger-client@^3.13.1: - version "3.13.1" - resolved "https://registry.npmjs.org/swagger-client/-/swagger-client-3.13.1.tgz#d2531ede4a498911aa084384e387e5008e7b6a70" - integrity sha512-Hmy4+wVVa3kveWzC7PIeUwiAY5qcYbm4XlC4uZ7e5kAePfB2cprXImiqrZHIzL+ndU0YTN7I+9w/ZayTisn3Jg== +swagger-client@^3.13.2: + version "3.13.2" + resolved "https://registry.npmjs.org/swagger-client/-/swagger-client-3.13.2.tgz#df1a1fe92e6db87ab5f76cee6381dcb7da1ad117" + integrity sha512-kamtyXtmbZiA2C5YTVqJYgoPJgzqtM5RbeP23Rt/YPYjMArTKZ2fjx1UTsI0aSbws0GluU5pVHiGp8YMciSUfw== dependencies: "@babel/runtime-corejs3" "^7.11.2" btoa "^1.2.1" @@ -24880,19 +24875,19 @@ swagger-client@^3.13.1: url "~0.11.0" swagger-ui-react@^3.37.2: - version "3.45.1" - resolved "https://registry.npmjs.org/swagger-ui-react/-/swagger-ui-react-3.45.1.tgz#6c8e551c5c1d443e7195acd9614f2f6bc4557daf" - integrity sha512-ATXMVIb5YaxxmHJdvPq1nnXxsJ1FCo02fQI2gExEtZCQkouMThZh50DRxdKYNae53Ovz3w8glxxwmsMuWtmKaQ== + version "3.48.0" + resolved "https://registry.npmjs.org/swagger-ui-react/-/swagger-ui-react-3.48.0.tgz#f53e1b7de5bc2628635a2d832e254043badb3a91" + integrity sha512-39cibLdJYeujP5CAzBg+LiNFyIuHomi4Blru/1hyFyiTkFx9yYGvcFpZrKFKq1Me4GSUCQJ1DzUyUMblo+VFcA== dependencies: - "@babel/runtime-corejs3" "^7.13.10" + "@babel/runtime-corejs3" "^7.13.17" "@braintree/sanitize-url" "^5.0.0" "@kyleshockey/object-assign-deep" "^0.4.2" "@kyleshockey/xml" "^1.0.2" base64-js "^1.5.1" - classnames "^2.2.6" + classnames "^2.3.1" css.escape "1.5.1" deep-extend "0.6.0" - dompurify "^2.2.7" + dompurify "^2.2.8" ieee754 "^1.2.1" immutable "^3.x.x" js-file-download "^0.4.12" @@ -24913,9 +24908,9 @@ swagger-ui-react@^3.37.2: redux-immutable "3.1.0" remarkable "^2.0.1" reselect "^4.0.0" - serialize-error "^2.1.0" + serialize-error "^8.1.0" sha.js "^2.4.11" - swagger-client "^3.13.1" + swagger-client "^3.13.2" url-parse "^1.5.1" xml-but-prettier "^1.0.1" zenscroll "^4.0.2" From e8438df861915f2944d6b6dbb41521665a629805 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 May 2021 04:44:57 +0000 Subject: [PATCH 43/73] chore(deps): bump @octokit/auth-app from 2.10.5 to 3.4.0 Bumps [@octokit/auth-app](https://github.com/octokit/auth-app.js) from 2.10.5 to 3.4.0. - [Release notes](https://github.com/octokit/auth-app.js/releases) - [Commits](https://github.com/octokit/auth-app.js/compare/v2.10.5...v3.4.0) Signed-off-by: dependabot[bot] --- packages/integration/package.json | 2 +- yarn.lock | 123 +++++++++++++++++++++--------- 2 files changed, 87 insertions(+), 38 deletions(-) diff --git a/packages/integration/package.json b/packages/integration/package.json index dcfae4ea05..797a2c0b48 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -33,7 +33,7 @@ "cross-fetch": "^3.0.6", "git-url-parse": "^11.4.4", "@octokit/rest": "^18.0.12", - "@octokit/auth-app": "^2.10.5", + "@octokit/auth-app": "^3.4.0", "luxon": "^1.25.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index f24ce68740..4d4549357c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3955,11 +3955,13 @@ puka "^1.0.1" read-package-json-fast "^2.0.1" -"@octokit/auth-app@^2.10.5": - version "2.10.5" - resolved "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-2.10.5.tgz#85d69cb96818f5da34bf0b81bb637d3675ad4e9a" - integrity sha512-6yXyjtcBWpuPYSdZN8z8IIjGSqkPmiJzdmCdod8at41ANB1FtaKbUIDL5+IkG+svv68NIYs+XORbhBRFXYB3bw== +"@octokit/auth-app@^3.4.0": + version "3.4.0" + resolved "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-3.4.0.tgz#af9f68512e7b8dd071b49e1470a1ddf88ff6a3a3" + integrity sha512-zBVgTnLJb0uoNMGCpcDkkAbPeavHX7oAjJkaDv2nqMmsXSsCw4AbUhjl99EtJQG/JqFY/kLFHM9330Wn0k70+g== dependencies: + "@octokit/auth-oauth-app" "^4.1.0" + "@octokit/auth-oauth-user" "^1.2.3" "@octokit/request" "^5.4.11" "@octokit/request-error" "^2.0.0" "@octokit/types" "^6.0.3" @@ -3969,6 +3971,41 @@ universal-github-app-jwt "^1.0.1" universal-user-agent "^6.0.0" +"@octokit/auth-oauth-app@^4.1.0": + version "4.1.2" + resolved "https://registry.npmjs.org/@octokit/auth-oauth-app/-/auth-oauth-app-4.1.2.tgz#bf3ff30c260e6e9f10b950386f279befb8fe907d" + integrity sha512-bdNGNRmuDJjKoHla3mUGtkk/xcxKngnQfBEnyk+7VwMqrABKvQB1wQRSrwSWkPPUX7Lcj2ttkPAPG7+iBkMRnw== + dependencies: + "@octokit/auth-oauth-device" "^3.1.1" + "@octokit/auth-oauth-user" "^1.2.1" + "@octokit/request" "^5.3.0" + "@octokit/types" "^6.0.3" + "@types/btoa-lite" "^1.0.0" + btoa-lite "^1.0.0" + universal-user-agent "^6.0.0" + +"@octokit/auth-oauth-device@^3.1.1": + version "3.1.1" + resolved "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-3.1.1.tgz#380499f9a850425e2c7bdeb62afc070181c536a9" + integrity sha512-ykDZROilszXZJ6pYdl6SZ15UZniCs0zDcKgwOZpMz3U0QDHPUhFGXjHToBCAIHwbncMu+jLt4/Nw4lq3FwAw/w== + dependencies: + "@octokit/oauth-methods" "^1.1.0" + "@octokit/request" "^5.4.14" + "@octokit/types" "^6.10.0" + universal-user-agent "^6.0.0" + +"@octokit/auth-oauth-user@^1.2.1", "@octokit/auth-oauth-user@^1.2.3": + version "1.2.4" + resolved "https://registry.npmjs.org/@octokit/auth-oauth-user/-/auth-oauth-user-1.2.4.tgz#3594eb7d40cb462240e7e90849781dfa0045aed5" + integrity sha512-efOajupCZBP1veqx5w59Qey0lIud1rDUgxTRjjkQDU3eOBmkAasY1pXemDsQwW0I85jb1P/gn2dMejedVxf9kw== + dependencies: + "@octokit/auth-oauth-device" "^3.1.1" + "@octokit/oauth-methods" "^1.1.0" + "@octokit/request" "^5.4.14" + "@octokit/types" "^6.12.2" + btoa-lite "^1.0.0" + universal-user-agent "^6.0.0" + "@octokit/auth-token@^2.4.4": version "2.4.4" resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.4.tgz#ee31c69b01d0378c12fd3ffe406030f3d94d3b56" @@ -4006,20 +4043,31 @@ "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" +"@octokit/oauth-authorization-url@^4.3.1": + version "4.3.1" + resolved "https://registry.npmjs.org/@octokit/oauth-authorization-url/-/oauth-authorization-url-4.3.1.tgz#008d09bf427a7f61c70b5283040d60a456011a51" + integrity sha512-sI/SOEAvzRhqdzj+kJl+2ifblRve2XU6ZB36Lq25Su8R31zE3GoKToSLh64nWFnKePNi2RrdcMm94UEIQZslOw== + +"@octokit/oauth-methods@^1.1.0": + version "1.2.2" + resolved "https://registry.npmjs.org/@octokit/oauth-methods/-/oauth-methods-1.2.2.tgz#3d98c548aa2ace36ad8d0ce6593fd49dcbe103cc" + integrity sha512-CFMUMn9DdPLMcpffhKgkwIIClfv0ZToJM4qcg4O0egCoHMYkVlxl22bBoo9qCnuF1U/xn871KEXuozKIX+bA2w== + dependencies: + "@octokit/oauth-authorization-url" "^4.3.1" + "@octokit/request" "^5.4.14" + "@octokit/request-error" "^2.0.5" + "@octokit/types" "^6.12.2" + btoa-lite "^1.0.0" + "@octokit/openapi-types@^2.2.0": version "2.2.0" resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-2.2.0.tgz#123e0438a0bc718ccdac3b5a2e69b3dd00daa85b" integrity sha512-274lNUDonw10kT8wHg8fCcUc1ZjZHbWv0/TbAwb0ojhBQqZYc1cQ/4yqTVTtPMDeZ//g7xVEYe/s3vURkRghPg== -"@octokit/openapi-types@^5.3.2": - version "5.3.2" - resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-5.3.2.tgz#b8ac43c5c3d00aef61a34cf744e315110c78deb4" - integrity sha512-NxF1yfYOUO92rCx3dwvA2onF30Vdlg7YUkMVXkeptqpzA3tRLplThhFleV/UKWFgh7rpKu1yYRbvNDUtzSopKA== - -"@octokit/openapi-types@^6.0.0": - version "6.0.0" - resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-6.0.0.tgz#7da8d7d5a72d3282c1a3ff9f951c8133a707480d" - integrity sha512-CnDdK7ivHkBtJYzWzZm7gEkanA7gKH6a09Eguz7flHw//GacPJLmkHA3f3N++MJmlxD1Fl+mB7B32EEpSCwztQ== +"@octokit/openapi-types@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-7.0.0.tgz#0f6992db9854af15eca77d71ab0ec7fad2f20411" + integrity sha512-gV/8DJhAL/04zjTI95a7FhQwS6jlEE0W/7xeYAzuArD0KVAVWDLP2f3vi98hs3HLTczxXdRK/mF0tRoQPpolEw== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" @@ -4054,27 +4102,25 @@ "@octokit/types" "^6.13.0" deprecation "^2.3.1" -"@octokit/request-error@^2.0.0": - version "2.0.2" - resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.2.tgz#0e76b83f5d8fdda1db99027ea5f617c2e6ba9ed0" - integrity sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw== +"@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5": + version "2.0.5" + resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.5.tgz#72cc91edc870281ad583a42619256b380c600143" + integrity sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg== dependencies: - "@octokit/types" "^5.0.1" + "@octokit/types" "^6.0.3" deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.3.0", "@octokit/request@^5.4.11", "@octokit/request@^5.4.12": - version "5.4.13" - resolved "https://registry.npmjs.org/@octokit/request/-/request-5.4.13.tgz#eec5987b3e96f984fc5f41967e001170c6d23a18" - integrity sha512-WcNRH5XPPtg7i1g9Da5U9dvZ6YbTffw9BN2rVezYiE7couoSyaRsw0e+Tl8uk1fArHE7Dn14U7YqUDy59WaqEw== +"@octokit/request@^5.3.0", "@octokit/request@^5.4.11", "@octokit/request@^5.4.12", "@octokit/request@^5.4.14": + version "5.4.15" + resolved "https://registry.npmjs.org/@octokit/request/-/request-5.4.15.tgz#829da413dc7dd3aa5e2cdbb1c7d0ebe1f146a128" + integrity sha512-6UnZfZzLwNhdLRreOtTkT9n57ZwulCve8q3IT/Z477vThu6snfdkBuhxnChpOKNGxcQ71ow561Qoa6uqLdPtag== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.0.0" - "@octokit/types" "^6.0.3" - deprecation "^2.0.0" + "@octokit/types" "^6.7.1" is-plain-object "^5.0.0" node-fetch "^2.6.1" - once "^1.4.0" universal-user-agent "^6.0.0" "@octokit/rest@^18.0.12", "@octokit/rest@^18.1.0": @@ -4104,19 +4150,12 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.12.2": - version "6.12.2" - resolved "https://registry.npmjs.org/@octokit/types/-/types-6.12.2.tgz#5b44add079a478b8eb27d78cf384cc47e4411362" - integrity sha512-kCkiN8scbCmSq+gwdJV0iLgHc0O/GTPY1/cffo9kECu1MvatLPh9E+qFhfRIktKfHEA6ZYvv6S1B4Wnv3bi3pA== +"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.13.0", "@octokit/types@^6.7.1", "@octokit/types@^6.8.2": + version "6.14.2" + resolved "https://registry.npmjs.org/@octokit/types/-/types-6.14.2.tgz#64c9457f38fb8522bdbba3c8cc814590a2d61bf5" + integrity sha512-wiQtW9ZSy4OvgQ09iQOdyXYNN60GqjCL/UdMsepDr1Gr0QzpW6irIKbH3REuAHXAhxkEk9/F2a3Gcs1P6kW5jA== dependencies: - "@octokit/openapi-types" "^5.3.2" - -"@octokit/types@^6.13.0", "@octokit/types@^6.8.2": - version "6.13.0" - resolved "https://registry.npmjs.org/@octokit/types/-/types-6.13.0.tgz#779e5b7566c8dde68f2f6273861dd2f0409480d0" - integrity sha512-W2J9qlVIU11jMwKHUp5/rbVUeErqelCsO5vW5PKNb7wAXQVUz87Rc+imjlEvpvbH8yUb+KHmv8NEjVZdsdpyxA== - dependencies: - "@octokit/openapi-types" "^6.0.0" + "@octokit/openapi-types" "^7.0.0" "@open-draft/until@^1.0.3": version "1.0.3" @@ -5711,6 +5750,11 @@ resolved "https://registry.npmjs.org/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw== +"@types/btoa-lite@^1.0.0": + version "1.0.0" + resolved "https://registry.npmjs.org/@types/btoa-lite/-/btoa-lite-1.0.0.tgz#e190a5a548e0b348adb0df9ac7fa5f1151c7cca4" + integrity sha512-wJsiX1tosQ+J5+bY5LrSahHxr2wT+uME5UDwdN1kg4frt40euqA+wzECkmq4t5QbveHiJepfdThgQrPw6KiSlg== + "@types/cacheable-request@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" @@ -9032,6 +9076,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +btoa-lite@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz#337766da15801210fdd956c22e9c6891ab9d0337" + integrity sha1-M3dm2hWAEhD92VbCLpxokaudAzc= + btoa@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73" From 1268d64f0e8d43f113db2080613816cfc4ff9634 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 May 2021 04:44:03 +0000 Subject: [PATCH 44/73] chore(deps): bump winston from 3.2.1 to 3.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [winston](https://github.com/winstonjs/winston) from 3.2.1 to 3.3.3. - [Release notes](https://github.com/winstonjs/winston/releases) - [Changelog](https://github.com/winstonjs/winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/winstonjs/winston/compare/3.2.1...v3.3.3) Signed-off-by: dependabot[bot] Signed-off-by: Fredrik Adelöw --- packages/backend-common/api-report.md | 3 +- yarn.lock | 99 +++++++++++++-------------- 2 files changed, 47 insertions(+), 55 deletions(-) diff --git a/packages/backend-common/api-report.md b/packages/backend-common/api-report.md index 58b9aa36d9..9969d0ea27 100644 --- a/packages/backend-common/api-report.md +++ b/packages/backend-common/api-report.md @@ -12,7 +12,6 @@ import cors from 'cors'; import Docker from 'dockerode'; import { ErrorRequestHandler } from 'express'; import express from 'express'; -import { Format } from 'logform'; import { GithubCredentialsProvider } from '@backstage/integration'; import { GitHubIntegration } from '@backstage/integration'; import { GitLabIntegration } from '@backstage/integration'; @@ -64,7 +63,7 @@ export class BitbucketUrlReader implements UrlReader { } // @public (undocumented) -export const coloredFormat: Format; +export const coloredFormat: winston.Logform.Format; // @public @deprecated export const createDatabase: typeof createDatabaseClient; diff --git a/yarn.lock b/yarn.lock index f24ce68740..50cdc9906a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1925,6 +1925,15 @@ debug "^3.1.0" lodash.once "^4.1.1" +"@dabh/diagnostics@^2.0.2": + version "2.0.2" + resolved "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" + integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== + dependencies: + colorspace "1.1.x" + enabled "2.0.x" + kuler "^2.0.0" + "@date-io/core@1.x", "@date-io/core@^1.3.13": version "1.3.13" resolved "https://registry.npmjs.org/@date-io/core/-/core-1.3.13.tgz#90c71da493f20204b7a972929cc5c482d078b3fa" @@ -8133,7 +8142,7 @@ async@^2.0.1, async@^2.6.1, async@^2.6.2: dependencies: lodash "^4.17.14" -async@^3.2.0: +async@^3.1.0, async@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== @@ -9993,11 +10002,6 @@ colorette@1.2.1, colorette@^1.2.1: resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b" integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== -colornames@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz#f8889030685c7c4ff9e2a559f5077eb76a816f96" - integrity sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y= - colors@^1.1.2, colors@^1.2.1: version "1.4.0" resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -11591,15 +11595,6 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -diagnostics@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz#cab6ac33df70c9d9a727490ae43ac995a769b22a" - integrity sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ== - dependencies: - colorspace "1.1.x" - enabled "1.0.x" - kuler "1.0.x" - dicer@0.3.0: version "0.3.0" resolved "https://registry.npmjs.org/dicer/-/dicer-0.3.0.tgz#eacd98b3bfbf92e8ab5c2fdb71aaac44bb06b872" @@ -12119,12 +12114,10 @@ emotion-theming@^10.0.19: "@emotion/weak-memoize" "0.2.5" hoist-non-react-statics "^3.3.0" -enabled@1.0.x: - version "1.0.2" - resolved "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz#965f6513d2c2d1c5f4652b64a2e3396467fc2f93" - integrity sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M= - dependencies: - env-variable "0.0.x" +enabled@2.0.x: + version "2.0.0" + resolved "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" + integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== encodeurl@~1.0.2: version "1.0.2" @@ -12190,11 +12183,6 @@ env-paths@^2.2.0: resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== -env-variable@0.0.x: - version "0.0.6" - resolved "https://registry.npmjs.org/env-variable/-/env-variable-0.0.6.tgz#74ab20b3786c545b62b4a4813ab8cf22726c9808" - integrity sha512-bHz59NlBbtS0NhftmR8+ExBEekE7br0e01jw+kk0NDro7TtZzBYZ5ScGPs3OmwnpyfHTHOtr1Y6uedCdrIldtg== - envinfo@^7.7.4: version "7.7.4" resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.7.4.tgz#c6311cdd38a0e86808c1c9343f667e4267c4a320" @@ -13491,6 +13479,11 @@ fn-name@~3.0.0: resolved "https://registry.npmjs.org/fn-name/-/fn-name-3.0.0.tgz#0596707f635929634d791f452309ab41558e3c5c" integrity sha512-eNMNr5exLoavuAMhIUVsOKF79SWd/zG104ef6sxBTSw+cZc6BXdQXDvYcGvp0VbxVVSp1XDUNoz7mg1xMtSznA== +fn.name@1.x.x: + version "1.1.0" + resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" + integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== + follow-redirects@^1.0.0, follow-redirects@^1.10.0: version "1.13.0" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" @@ -17341,12 +17334,10 @@ knex@^0.95.1: tarn "^3.0.1" tildify "2.0.0" -kuler@1.0.x: - version "1.0.1" - resolved "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz#ef7c784f36c9fb6e16dd3150d152677b2b0228a6" - integrity sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ== - dependencies: - colornames "^1.1.1" +kuler@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" + integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A== language-subtag-registry@~0.3.2: version "0.3.21" @@ -17946,7 +17937,7 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -logform@^2.1.1: +logform@^2.1.1, logform@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz#40f036d19161fc76b68ab50fdc7fe495544492f2" integrity sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg== @@ -19823,10 +19814,12 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -one-time@0.0.4: - version "0.0.4" - resolved "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz#f8cdf77884826fe4dff93e3a9cc37b1e4480742e" - integrity sha1-+M33eISCb+Tf+T46nMN7HkSAdC4= +one-time@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45" + integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g== + dependencies: + fn.name "1.x.x" onetime@^1.0.0: version "1.1.0" @@ -22590,7 +22583,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@^2.3.7, readable-stream@~2.3.6: version "2.3.7" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -26786,28 +26779,28 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -winston-transport@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz#df68c0c202482c448d9b47313c07304c2d7c2c66" - integrity sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A== +winston-transport@^4.4.0: + version "4.4.0" + resolved "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59" + integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== dependencies: - readable-stream "^2.3.6" + readable-stream "^2.3.7" triple-beam "^1.2.0" winston@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz#63061377976c73584028be2490a1846055f77f07" - integrity sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw== + version "3.3.3" + resolved "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz#ae6172042cafb29786afa3d09c8ff833ab7c9170" + integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw== dependencies: - async "^2.6.1" - diagnostics "^1.1.1" - is-stream "^1.1.0" - logform "^2.1.1" - one-time "0.0.4" - readable-stream "^3.1.1" + "@dabh/diagnostics" "^2.0.2" + async "^3.1.0" + is-stream "^2.0.0" + logform "^2.2.0" + one-time "^1.0.0" + readable-stream "^3.4.0" stack-trace "0.0.x" triple-beam "^1.3.0" - winston-transport "^4.3.0" + winston-transport "^4.4.0" word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" From 38ca0516827020389256018d0074fdc6305da053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 3 May 2021 11:15:22 +0200 Subject: [PATCH 45/73] The default `@octokit/rest` dependency was bumped to `"^18.5.3"`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/five-knives-flash.md | 10 +++++ packages/app/package.json | 2 +- packages/backend-common/package.json | 2 +- packages/backend/package.json | 2 +- .../packages/backend/package.json.hbs | 2 +- packages/integration/package.json | 2 +- plugins/catalog-import/package.json | 2 +- plugins/github-actions/package.json | 2 +- .../WorkflowRunDetails/WorkflowRunDetails.tsx | 6 +-- plugins/scaffolder-backend/package.json | 2 +- yarn.lock | 40 +++++-------------- 11 files changed, 32 insertions(+), 40 deletions(-) create mode 100644 .changeset/five-knives-flash.md diff --git a/.changeset/five-knives-flash.md b/.changeset/five-knives-flash.md new file mode 100644 index 0000000000..9076f6f456 --- /dev/null +++ b/.changeset/five-knives-flash.md @@ -0,0 +1,10 @@ +--- +'@backstage/backend-common': patch +'@backstage/create-app': patch +'@backstage/integration': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-github-actions': patch +'@backstage/plugin-scaffolder-backend': patch +--- + +The default `@octokit/rest` dependency was bumped to `"^18.5.3"`. diff --git a/packages/app/package.json b/packages/app/package.json index 402d09ade4..fb1ea02699 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -39,7 +39,7 @@ "@backstage/theme": "^0.2.6", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "@roadiehq/backstage-plugin-buildkite": "^1.0.0", "@roadiehq/backstage-plugin-github-insights": "^1.0.0", "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.0", diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 998ac475d9..64e3137f7c 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -35,7 +35,7 @@ "@backstage/errors": "^0.1.1", "@backstage/integration": "^0.5.1", "@google-cloud/storage": "^5.8.0", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "@types/cors": "^2.8.6", "@types/dockerode": "^3.2.1", "@types/express": "^4.17.6", diff --git a/packages/backend/package.json b/packages/backend/package.json index 440ceca8e5..0422088d64 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -47,7 +47,7 @@ "@backstage/plugin-techdocs-backend": "^0.7.0", "@backstage/plugin-todo-backend": "^0.1.3", "@gitbeaker/node": "^28.0.2", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "azure-devops-node-api": "^10.1.1", "dockerode": "^3.2.1", "example-app": "^0.2.25", diff --git a/packages/create-app/templates/default-app/packages/backend/package.json.hbs b/packages/create-app/templates/default-app/packages/backend/package.json.hbs index 138bcaec8d..e2b5b04a60 100644 --- a/packages/create-app/templates/default-app/packages/backend/package.json.hbs +++ b/packages/create-app/templates/default-app/packages/backend/package.json.hbs @@ -29,7 +29,7 @@ "@backstage/plugin-scaffolder-backend": "^{{version '@backstage/plugin-scaffolder-backend'}}", "@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}", "@gitbeaker/node": "^28.0.2", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "dockerode": "^3.2.1", "express": "^4.17.1", "express-promise-router": "^4.1.0", diff --git a/packages/integration/package.json b/packages/integration/package.json index 797a2c0b48..b7c8bee957 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -32,7 +32,7 @@ "@backstage/config": "^0.1.2", "cross-fetch": "^3.0.6", "git-url-parse": "^11.4.4", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "@octokit/auth-app": "^3.4.0", "luxon": "^1.25.0" }, diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index ca540fe8be..ccc2dd24a7 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -40,7 +40,7 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "@types/react": "^16.9", "git-url-parse": "^11.4.4", "js-base64": "^3.6.0", diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json index 2c26061cf3..89b569bd95 100644 --- a/plugins/github-actions/package.json +++ b/plugins/github-actions/package.json @@ -40,7 +40,7 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "moment": "^2.27.0", "react": "^16.13.1", "react-dom": "^16.13.1", diff --git a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx index 38d84a4b6d..0624438ffe 100644 --- a/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx +++ b/plugins/github-actions/src/components/WorkflowRunDetails/WorkflowRunDetails.tsx @@ -202,13 +202,13 @@ export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => { Message - {details.value?.head_commit.message} + {details.value?.head_commit?.message} Commit ID - {details.value?.head_commit.id} + {details.value?.head_commit?.id} @@ -231,7 +231,7 @@ export const WorkflowRunDetails = ({ entity }: { entity: Entity }) => { Author - {`${details.value?.head_commit.author?.name} (${details.value?.head_commit.author?.email})`} + {`${details.value?.head_commit?.author?.name} (${details.value?.head_commit?.author?.email})`} diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 355bed4de0..bbeeecceb0 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -37,7 +37,7 @@ "@backstage/integration": "^0.5.1", "@gitbeaker/core": "^28.0.2", "@gitbeaker/node": "^28.0.2", - "@octokit/rest": "^18.0.12", + "@octokit/rest": "^18.5.3", "@types/dockerode": "^3.2.1", "@types/express": "^4.17.6", "@types/git-url-parse": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 4d4549357c..61abdf1b85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4086,20 +4086,12 @@ resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz#394d59ec734cd2f122431fbaf05099861ece3c44" integrity sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg== -"@octokit/plugin-rest-endpoint-methods@4.13.5": - version "4.13.5" - resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.13.5.tgz#ad76285b82fe05fbb4adf2774a9c887f3534a880" - integrity sha512-kYKcWkFm4Ldk8bZai2RVEP1z97k1C/Ay2FN9FNTBg7JIyKoiiJjks4OtT6cuKeZX39tqa+C3J9xeYc6G+6g8uQ== +"@octokit/plugin-rest-endpoint-methods@5.0.1": + version "5.0.1" + resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.1.tgz#631b8d4edc6798b03489911252a25f2a4e58c594" + integrity sha512-vvWbPtPqLyIzJ7A4IPdTl+8IeuKAwMJ4LjvmqWOOdfSuqWQYZXq2CEd0hsnkidff2YfKlguzujHs/reBdAx8Sg== dependencies: - "@octokit/types" "^6.12.2" - deprecation "^2.3.1" - -"@octokit/plugin-rest-endpoint-methods@5.0.0": - version "5.0.0" - resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.0.0.tgz#cf2cdeb24ea829c31688216a5b165010b61f9a98" - integrity sha512-Jc7CLNUueIshXT+HWt6T+M0sySPjF32mSFQAK7UfAg8qGeRI6OM1GSBxDLwbXjkqy2NVdnqCedJcP1nC785JYg== - dependencies: - "@octokit/types" "^6.13.0" + "@octokit/types" "^6.13.1" deprecation "^2.3.1" "@octokit/request-error@^2.0.0", "@octokit/request-error@^2.0.5": @@ -4123,25 +4115,15 @@ node-fetch "^2.6.1" universal-user-agent "^6.0.0" -"@octokit/rest@^18.0.12", "@octokit/rest@^18.1.0": - version "18.3.5" - resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.3.5.tgz#a89903d46e0b4273bd3234674ec2777a651d68ab" - integrity sha512-ZPeRms3WhWxQBEvoIh0zzf8xdU2FX0Capa7+lTca8YHmRsO3QNJzf1H3PcuKKsfgp91/xVDRtX91sTe1kexlbw== +"@octokit/rest@^18.1.0", "@octokit/rest@^18.1.1", "@octokit/rest@^18.5.3": + version "18.5.3" + resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.5.3.tgz#6a2e6006a87ebbc34079c419258dd29ec9ff659d" + integrity sha512-KPAsUCr1DOdLVbZJgGNuE/QVLWEaVBpFQwDAz/2Cnya6uW2wJ/P5RVGk0itx7yyN1aGa8uXm2pri4umEqG1JBA== dependencies: "@octokit/core" "^3.2.3" "@octokit/plugin-paginate-rest" "^2.6.2" "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "4.13.5" - -"@octokit/rest@^18.1.1": - version "18.5.2" - resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.5.2.tgz#0369e554b7076e3749005147be94c661c7a5a74b" - integrity sha512-Kz03XYfKS0yYdi61BkL9/aJ0pP2A/WK5vF/syhu9/kY30J8He3P68hv9GRpn8bULFx2K0A9MEErn4v3QEdbZcw== - dependencies: - "@octokit/core" "^3.2.3" - "@octokit/plugin-paginate-rest" "^2.6.2" - "@octokit/plugin-request-log" "^1.0.2" - "@octokit/plugin-rest-endpoint-methods" "5.0.0" + "@octokit/plugin-rest-endpoint-methods" "5.0.1" "@octokit/types@^5.0.0", "@octokit/types@^5.0.1": version "5.5.0" @@ -4150,7 +4132,7 @@ dependencies: "@types/node" ">= 8" -"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.13.0", "@octokit/types@^6.7.1", "@octokit/types@^6.8.2": +"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.10.0", "@octokit/types@^6.12.2", "@octokit/types@^6.13.0", "@octokit/types@^6.13.1", "@octokit/types@^6.7.1", "@octokit/types@^6.8.2": version "6.14.2" resolved "https://registry.npmjs.org/@octokit/types/-/types-6.14.2.tgz#64c9457f38fb8522bdbba3c8cc814590a2d61bf5" integrity sha512-wiQtW9ZSy4OvgQ09iQOdyXYNN60GqjCL/UdMsepDr1Gr0QzpW6irIKbH3REuAHXAhxkEk9/F2a3Gcs1P6kW5jA== From 81c54d1f25255af82a4060d5d71ea61f7f51379d Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 12:07:48 +0100 Subject: [PATCH 46/73] Fetch useRelatedEntities in batches Rather than making a request per relation, filter multiple relations in a single request. To avoid the query string getting very large, make multiple requests on bacthes of 100 relations. Signed-off-by: Will Sewell --- .changeset/friendly-readers-promise.md | 5 ++++ .../src/hooks/useRelatedEntities.ts | 30 ++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 .changeset/friendly-readers-promise.md diff --git a/.changeset/friendly-readers-promise.md b/.changeset/friendly-readers-promise.md new file mode 100644 index 0000000000..30607d5db2 --- /dev/null +++ b/.changeset/friendly-readers-promise.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-react': patch +--- + +Fetch relations in batches in `useRelatedEntities` diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index baf6cf5fc7..15182d3c2f 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -18,6 +18,8 @@ import { useApi } from '@backstage/core'; import { useAsync } from 'react-use'; import { catalogApiRef } from '../api'; +const BATCH_SIZE = 100; + export function useRelatedEntities( entity: Entity, { type, kind }: { type?: string; kind?: string }, @@ -40,16 +42,28 @@ export function useRelatedEntities( return []; } - // TODO: This code could be more efficient if there was an endpoint in the - // backend that either returns the relations of entity (filtered by type) - // or if there is a way to perform a batch request by entity name. However, - // such an implementation would probably be better placed in the graphql API. + // Make requests in separate batches to limit query string size + // (there is a `filter` param for each relation) + const relationBatches = []; + for (let i = 0; i < relations.length; i += BATCH_SIZE) { + relationBatches.push(relations.slice(i, i + BATCH_SIZE)); + } + const results = await Promise.all( - relations?.map(r => catalogApi.getEntityByName(r.target)), + relationBatches.map(batch => { + return catalogApi.getEntities({ + filter: batch.map(({ target }) => { + return { + kind: target.kind, + 'metadata.name': target.name, + 'metadata.namespace': target.namespace, + }; + }), + }); + }), ); - // Skip entities that where not found, for example if a relation references - // an entity that doesn't exist. - return results.filter(e => e) as Entity[]; + + return results.map(r => r.items).flat(); }, [entity, type]); return { From f65adcde73a392ffae0fc58a1efeb25ef8a698d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 3 May 2021 13:25:12 +0200 Subject: [PATCH 47/73] Fix most of the yarn install transitive dependency warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/flat-keys-happen.md | 6 ++++++ packages/cli/package.json | 1 + packages/core/package.json | 1 + packages/storybook/package.json | 4 +++- yarn.lock | 25 +++++++++++++++---------- 5 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 .changeset/flat-keys-happen.md diff --git a/.changeset/flat-keys-happen.md b/.changeset/flat-keys-happen.md new file mode 100644 index 0000000000..ce01f86bcf --- /dev/null +++ b/.changeset/flat-keys-happen.md @@ -0,0 +1,6 @@ +--- +'@backstage/cli': patch +'@backstage/core': patch +--- + +Fix some transitive dependency warnings in yarn diff --git a/packages/cli/package.json b/packages/cli/package.json index 1110efefe6..46e99b762b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -86,6 +86,7 @@ "lodash": "^4.17.19", "mini-css-extract-plugin": "^0.9.0", "ora": "^5.3.0", + "postcss": "^8.1.0", "raw-loader": "^4.0.1", "react": "^16.0.0", "react-dev-utils": "^11.0.4", diff --git a/packages/core/package.json b/packages/core/package.json index 59391e122a..d2a8f96679 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -48,6 +48,7 @@ "d3-shape": "^2.0.0", "d3-zoom": "^2.0.0", "dagre": "^0.8.5", + "history": "^5.0.0", "immer": "^9.0.1", "lodash": "^4.17.15", "material-table": "^1.69.1", diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 01aabac0de..4a4c1431c5 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -14,7 +14,9 @@ ] }, "dependencies": { - "@backstage/theme": "^0.2.0" + "@backstage/theme": "^0.2.0", + "react": "^16.12.0", + "react-dom": "^16.12.0" }, "devDependencies": { "@storybook/addon-actions": "^6.1.11", diff --git a/yarn.lock b/yarn.lock index 548c404f0f..d3f45a3efd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10002,6 +10002,11 @@ colorette@1.2.1, colorette@^1.2.1: resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b" integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== +colorette@^1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" + integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== + colors@^1.1.2, colors@^1.2.1: version "1.4.0" resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -19070,10 +19075,10 @@ nanoid@^2.1.0: resolved "https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== -nanoid@^3.1.20: - version "3.1.20" - resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788" - integrity sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw== +nanoid@^3.1.22: + version "3.1.22" + resolved "https://registry.npmjs.org/nanoid/-/nanoid-3.1.22.tgz#b35f8fb7d151990a8aebd5aa5015c03cf726f844" + integrity sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ== nanomatch@^1.2.9: version "1.2.13" @@ -21295,13 +21300,13 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.0.2, postcss-value-parser@^ source-map "^0.6.1" supports-color "^6.1.0" -postcss@^8.0.2: - version "8.2.6" - resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.6.tgz#5d69a974543b45f87e464bc4c3e392a97d6be9fe" - integrity sha512-xpB8qYxgPuly166AGlpRjUdEYtmOWx2iCwGmrv4vqZL9YPVviDVPZPRXxnXr6xPZOdxQ9lp3ZBFCRgWJ7LE3Sg== +postcss@^8.0.2, postcss@^8.1.0: + version "8.2.13" + resolved "https://registry.npmjs.org/postcss/-/postcss-8.2.13.tgz#dbe043e26e3c068e45113b1ed6375d2d37e2129f" + integrity sha512-FCE5xLH+hjbzRdpbRb1IMCvPv9yZx2QnDarBEYSN0N0HYk+TcXsEhwdFcFb+SRWOKzKGErhIEbBK2ogyLdTtfQ== dependencies: - colorette "^1.2.1" - nanoid "^3.1.20" + colorette "^1.2.2" + nanoid "^3.1.22" source-map "^0.6.1" postgres-array@~1.0.0: From e763b7b156c0b67ff7c7faa1d55e444414553b4d Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 13:36:22 +0100 Subject: [PATCH 48/73] Reduce batch size to 20 Signed-off-by: Will Sewell --- plugins/catalog-react/src/hooks/useRelatedEntities.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index 15182d3c2f..5649a90f52 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -18,7 +18,7 @@ import { useApi } from '@backstage/core'; import { useAsync } from 'react-use'; import { catalogApiRef } from '../api'; -const BATCH_SIZE = 100; +const BATCH_SIZE = 20; export function useRelatedEntities( entity: Entity, From 33c21766a9b2b80ba02f550be58b7d60a6205119 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 15:54:37 +0100 Subject: [PATCH 49/73] Add lodash to catalog-react Signed-off-by: Will Sewell --- plugins/catalog-react/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 91201a49a1..57a9479a3c 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -33,6 +33,7 @@ "@backstage/core": "^0.7.3", "@material-ui/core": "^4.11.0", "@types/react": "^16.9", + "lodash": "^4.17.15", "react": "^16.13.1", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", From cf3faccd846835da5883b66687750b4666b40ea0 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 15:58:33 +0100 Subject: [PATCH 50/73] Use lodash `chunk` to create batches Signed-off-by: Will Sewell --- plugins/catalog-react/src/hooks/useRelatedEntities.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index 5649a90f52..25d96626d7 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -15,6 +15,7 @@ */ import { Entity } from '@backstage/catalog-model'; import { useApi } from '@backstage/core'; +import { chunk } from 'lodash'; import { useAsync } from 'react-use'; import { catalogApiRef } from '../api'; @@ -44,10 +45,7 @@ export function useRelatedEntities( // Make requests in separate batches to limit query string size // (there is a `filter` param for each relation) - const relationBatches = []; - for (let i = 0; i < relations.length; i += BATCH_SIZE) { - relationBatches.push(relations.slice(i, i + BATCH_SIZE)); - } + const relationBatches = chunk(relations, BATCH_SIZE); const results = await Promise.all( relationBatches.map(batch => { From f852f7381c625a9f025d7102d334322ee9568f51 Mon Sep 17 00:00:00 2001 From: Oliver Sand Date: Mon, 3 May 2021 17:23:14 +0200 Subject: [PATCH 51/73] Revert "Add support for json schema to API docs" Signed-off-by: Oliver Sand --- .changeset/six-mayflies-peel.md | 5 - packages/catalog-model/examples/all-apis.yaml | 1 - .../examples/apis/config-schema-api.yaml | 11 - plugins/api-docs/README.md | 1 - plugins/api-docs/dev/index.tsx | 15 - .../api-docs/dev/jsonschema-example-api.yaml | 32 - plugins/api-docs/package.json | 3 - .../ApiDefinitionCard/ApiDefinitionWidget.tsx | 9 - .../JsonSchemaDefinitionWidget.test.tsx | 61 - .../JsonSchemaDefinitionWidget.tsx | 50 - .../JsonSchemaDefinitionWidget/index.ts | 17 - plugins/api-docs/src/components/index.ts | 1 - yarn.lock | 1038 +---------------- 13 files changed, 6 insertions(+), 1238 deletions(-) delete mode 100644 .changeset/six-mayflies-peel.md delete mode 100644 packages/catalog-model/examples/apis/config-schema-api.yaml delete mode 100644 plugins/api-docs/dev/jsonschema-example-api.yaml delete mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx delete mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx delete mode 100644 plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts diff --git a/.changeset/six-mayflies-peel.md b/.changeset/six-mayflies-peel.md deleted file mode 100644 index 9d022bca0a..0000000000 --- a/.changeset/six-mayflies-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-api-docs': patch ---- - -Add support for displaying JSON schemas. diff --git a/packages/catalog-model/examples/all-apis.yaml b/packages/catalog-model/examples/all-apis.yaml index 8ec9203b28..e23f1b3656 100644 --- a/packages/catalog-model/examples/all-apis.yaml +++ b/packages/catalog-model/examples/all-apis.yaml @@ -5,7 +5,6 @@ metadata: description: A collection of all Backstage example APIs spec: targets: - - ./apis/config-schema-api.yaml - ./apis/hello-world-api.yaml - ./apis/petstore-api.yaml - ./apis/spotify-api.yaml diff --git a/packages/catalog-model/examples/apis/config-schema-api.yaml b/packages/catalog-model/examples/apis/config-schema-api.yaml deleted file mode 100644 index 4bd8976614..0000000000 --- a/packages/catalog-model/examples/apis/config-schema-api.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: API -metadata: - name: config-schema - description: A Backstage config schemas. -spec: - type: jsonschema - lifecycle: production - owner: team-a - definition: - $text: https://github.com/backstage/backstage/blob/master/plugins/config-schema/dev/example-schema.json diff --git a/plugins/api-docs/README.md b/plugins/api-docs/README.md index 1a05256704..60d8986d9b 100644 --- a/plugins/api-docs/README.md +++ b/plugins/api-docs/README.md @@ -15,7 +15,6 @@ Right now, the following API formats are supported: - [OpenAPI](https://swagger.io/specification/) 2 & 3 - [AsyncAPI](https://www.asyncapi.com/docs/specifications/latest/) - [GraphQL](https://graphql.org/learn/schema/) -- [JSON Schema](https://json-schema.org/) Other formats are displayed as plain text, but this can easily be extended. diff --git a/plugins/api-docs/dev/index.tsx b/plugins/api-docs/dev/index.tsx index d51d3a714c..fbfab37f5b 100644 --- a/plugins/api-docs/dev/index.tsx +++ b/plugins/api-docs/dev/index.tsx @@ -27,7 +27,6 @@ import { } from '../src'; import asyncapiApiEntity from './asyncapi-example-api.yaml'; import graphqlApiEntity from './graphql-example-api.yaml'; -import jsonschemaApiEntity from './jsonschema-example-api.yaml'; import openapiApiEntity from './openapi-example-api.yaml'; import otherApiEntity from './other-example-api.yaml'; @@ -42,7 +41,6 @@ createDevApp() items: [ openapiApiEntity, asyncapiApiEntity, - jsonschemaApiEntity, graphqlApiEntity, otherApiEntity, ], @@ -89,19 +87,6 @@ createDevApp() ), }) - .addPage({ - title: 'JSON Schema', - element: ( - -
- - - - - - - ), - }) .addPage({ title: 'GraphQL', element: ( diff --git a/plugins/api-docs/dev/jsonschema-example-api.yaml b/plugins/api-docs/dev/jsonschema-example-api.yaml deleted file mode 100644 index a34b4f9a49..0000000000 --- a/plugins/api-docs/dev/jsonschema-example-api.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: backstage.io/v1alpha1 -kind: API -metadata: - name: persons - description: Person dataset -spec: - type: jsonschema - lifecycle: experimental - owner: team-c - # From https://json-schema.org/learn/miscellaneous-examples.html - definition: | - { - "$id": "https://example.com/person.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Person", - "type": "object", - "properties": { - "firstName": { - "type": "string", - "description": "The person's first name." - }, - "lastName": { - "type": "string", - "description": "The person's last name." - }, - "age": { - "description": "Age in years which must be equal to or greater than zero.", - "type": "integer", - "minimum": 0 - } - } - } diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index be5d5186d2..5c9f9ca7ee 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -38,9 +38,6 @@ "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", - "@stoplight/json-schema-viewer": "^4.0.0-beta.16", - "@stoplight/mosaic": "^1.0.0-beta.46", - "@stoplight/reporter": "^1.10.0", "@types/react": "^16.9", "graphiql": "^1.0.0-alpha.10", "graphql": "^15.3.0", diff --git a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx index fc23c338ee..360404af40 100644 --- a/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx +++ b/plugins/api-docs/src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx @@ -16,7 +16,6 @@ import React from 'react'; import { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget'; import { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget'; -import { JsonSchemaDefinitionWidget } from '../JsonSchemaDefinitionWidget'; import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget'; export type ApiDefinitionWidget = { @@ -52,13 +51,5 @@ export function defaultDefinitionWidgets(): ApiDefinitionWidget[] { ), }, - { - type: 'jsonschema', - title: 'JSON Schema', - rawLanguage: 'json', - component: definition => ( - - ), - }, ]; } diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx deleted file mode 100644 index b4077e6ea2..0000000000 --- a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.test.tsx +++ /dev/null @@ -1,61 +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 { renderInTestApp } from '@backstage/test-utils'; -import React from 'react'; -import { JsonSchemaDefinitionWidget } from './JsonSchemaDefinitionWidget'; - -describe('', () => { - it('renders json schema', async () => { - // From https://json-schema.org/learn/miscellaneous-examples.html - const definition = ` -{ - "$id": "https://example.com/person.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Person", - "type": "object", - "properties": { - "firstName": { - "type": "string", - "description": "The person's first name." - }, - "lastName": { - "type": "string", - "description": "The person's last name." - }, - "age": { - "description": "Age in years which must be equal to or greater than zero.", - "type": "integer", - "minimum": 0 - } - } -} - `; - const { getByText } = await renderInTestApp( - , - ); - - expect(getByText(/lastName/i)).toBeInTheDocument(); - expect(getByText(/The person's last name./i)).toBeInTheDocument(); - }); - - it('renders error if definition is missing', async () => { - const { getByText } = await renderInTestApp( - , - ); - expect(getByText(/No schema defined/i)).toBeInTheDocument(); - }); -}); diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx deleted file mode 100644 index ea8ac652c8..0000000000 --- a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/JsonSchemaDefinitionWidget.tsx +++ /dev/null @@ -1,50 +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 { useTheme } from '@material-ui/core'; -import { JsonSchemaViewer } from '@stoplight/json-schema-viewer'; -import { injectStyles, useThemeStore } from '@stoplight/mosaic'; -import React, { useMemo } from 'react'; -import { useEffectOnce } from 'react-use'; - -injectStyles(); - -type Props = { - definition: any; -}; - -export const JsonSchemaDefinitionWidget = ({ definition }: Props) => { - const schema = useMemo(() => JSON.parse(definition), [definition]); - const theme = useTheme(); - const themeStore = useThemeStore(); - - useEffectOnce(() => { - themeStore.setColor('background', theme.palette.background.paper); - themeStore.setColor('text', theme.palette.text.primary); - themeStore.setColor('primary', theme.palette.primary.main); - themeStore.setColor('success', theme.palette.success.main); - themeStore.setColor('warning', theme.palette.warning.main); - themeStore.setColor('danger', theme.palette.error.main); - themeStore.setMode(theme.palette.type); - }); - return ( - - ); -}; diff --git a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts b/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts deleted file mode 100644 index 47d2619ec2..0000000000 --- a/plugins/api-docs/src/components/JsonSchemaDefinitionWidget/index.ts +++ /dev/null @@ -1,17 +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. - */ - -export { JsonSchemaDefinitionWidget } from './JsonSchemaDefinitionWidget'; diff --git a/plugins/api-docs/src/components/index.ts b/plugins/api-docs/src/components/index.ts index afac37dc31..cfd985f47c 100644 --- a/plugins/api-docs/src/components/index.ts +++ b/plugins/api-docs/src/components/index.ts @@ -20,4 +20,3 @@ export * from './AsyncApiDefinitionWidget'; export * from './ComponentsCards'; export * from './OpenApiDefinitionWidget'; export * from './PlainApiDefinitionWidget'; -export * from './JsonSchemaDefinitionWidget'; diff --git a/yarn.lock b/yarn.lock index 7a58a86325..8cb2ddd221 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,24 +2,6 @@ # yarn lockfile v1 -"@amplitude/types@^1.5.4": - version "1.5.4" - resolved "https://registry.npmjs.org/@amplitude/types/-/types-1.5.4.tgz#7fcbcbfb321d794b6367596cd950a92c752431d1" - integrity sha512-+e+wqlO5E4lNTM19lATf+lJldV+VD2RGzrDEy45cPEtfpXxHJUHwhfOKZkKg/zlx+YAubcpNhWLm2NSPpHUs9A== - -"@amplitude/ua-parser-js@0.7.24": - version "0.7.24" - resolved "https://registry.npmjs.org/@amplitude/ua-parser-js/-/ua-parser-js-0.7.24.tgz#2ce605af7d2c38d4a01313fb2385df55fbbd69aa" - integrity sha512-VbQuJymJ20WEw0HtI2np7EdC3NJGUWi8+Xdbc7uk8WfMIF308T0howpzkQ3JFMN7ejnrcSM/OyNGveeE3TP3TA== - -"@amplitude/utils@^1.0.5": - version "1.5.4" - resolved "https://registry.npmjs.org/@amplitude/utils/-/utils-1.5.4.tgz#457e847d751522ac8dd910037667d780ef501642" - integrity sha512-VAd/ibhwBBeL8pKqCz8tjCnSx8epOvUa+Je6sA3AB4R8855xl+bdrDjYwMmOWOILvEH3Pltq2jVJCE2thBoFdQ== - dependencies: - "@amplitude/types" "^1.5.4" - tslib "^1.9.3" - "@apidevtools/json-schema-ref-parser@^9.0.6": version "9.0.6" resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#5d9000a3ac1fd25404da886da6b266adcd99cf1c" @@ -1641,13 +1623,6 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.13.17", "@babel/runtime@^7.6.2": - version "7.13.17" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.17.tgz#8966d1fc9593bf848602f0662d6b4d0069e3a7ec" - integrity sha512-NCdgJEelPTSh+FEFylhnP1ylq848l1z9t9N0j1Lfbcw0+KXGjsTvUmkxy+voLLXB5SOKMbLLx4jxYliGrYQseA== - dependencies: - regenerator-runtime "^0.13.4" - "@babel/template@^7.10.4", "@babel/template@^7.12.13", "@babel/template@^7.3.3": version "7.12.13" resolved "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz#530265be8a2589dbb37523844c5bcb55947fb327" @@ -2111,32 +2086,6 @@ dependencies: yaml-ast-parser "0.0.43" -"@fortawesome/fontawesome-common-types@^0.2.35": - version "0.2.35" - resolved "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.35.tgz#01dd3d054da07a00b764d78748df20daf2b317e9" - integrity sha512-IHUfxSEDS9dDGqYwIW7wTN6tn/O8E0n5PcAHz9cAaBoZw6UpG20IG/YM3NNLaGPwPqgjBAFjIURzqoQs3rrtuw== - -"@fortawesome/fontawesome-svg-core@^1.2.35": - version "1.2.35" - resolved "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.35.tgz#85aea8c25645fcec88d35f2eb1045c38d3e65cff" - integrity sha512-uLEXifXIL7hnh2sNZQrIJWNol7cTVIzwI+4qcBIq9QWaZqUblm0IDrtSqbNg+3SQf8SMGHkiSigD++rHmCHjBg== - dependencies: - "@fortawesome/fontawesome-common-types" "^0.2.35" - -"@fortawesome/free-solid-svg-icons@^5.15.2", "@fortawesome/free-solid-svg-icons@^5.15.3": - version "5.15.3" - resolved "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.3.tgz#52eebe354f60dc77e0bde934ffc5c75ffd04f9d8" - integrity sha512-XPeeu1IlGYqz4VWGRAT5ukNMd4VHUEEJ7ysZ7pSSgaEtNvSo+FLurybGJVmiqkQdK50OkSja2bfZXOeyMGRD8Q== - dependencies: - "@fortawesome/fontawesome-common-types" "^0.2.35" - -"@fortawesome/react-fontawesome@^0.1.14": - version "0.1.14" - resolved "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.14.tgz#bf28875c3935b69ce2dc620e1060b217a47f64ca" - integrity sha512-4wqNb0gRLVaBm/h+lGe8UfPPivcbuJ6ecI4hIgW0LjI7kzpYB9FkN0L9apbVzg+lsBdcTf0AlBtODjcSX5mmKA== - dependencies: - prop-types "^15.7.2" - "@gitbeaker/core@^28.0.2", "@gitbeaker/core@^28.2.0": version "28.2.0" resolved "https://registry.npmjs.org/@gitbeaker/core/-/core-28.2.0.tgz#87e6f789faf55d726f75d05e470020e4bbb8e08c" @@ -2793,21 +2742,6 @@ resolved "https://registry.npmjs.org/@icons/material/-/material-0.2.4.tgz#e90c9f71768b3736e76d7dd6783fc6c2afa88bc8" integrity sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw== -"@internationalized/message@3.0.0-alpha.0": - version "3.0.0-alpha.0" - resolved "https://registry.npmjs.org/@internationalized/message/-/message-3.0.0-alpha.0.tgz#83015e2057d2b6b5034a3e23983b1e051f9d9e36" - integrity sha512-NT2eiVq5f5z7Yi9Hmchb8GAGYjEpYbYcD4u/Oxo5XG9XFbrnz7zNvrJJlzuQ+2jPozabq6pFKurqaFmM49DYUg== - dependencies: - "@babel/runtime" "^7.6.2" - intl-messageformat "^2.2.0" - -"@internationalized/number@3.0.0-alpha.0": - version "3.0.0-alpha.0" - resolved "https://registry.npmjs.org/@internationalized/number/-/number-3.0.0-alpha.0.tgz#27190fbc1d73a24ac96dfafdfe7aa4e520090eed" - integrity sha512-8aOD2I3HmEscIZO/cm1jkcrYMSmRPhoW9G1OsuQb4Ge/Y9HsJVGB9otTylUEXJUmoXi/eD8Mr1gx3+0FLCM4eA== - dependencies: - "@babel/runtime" "^7.6.2" - "@istanbuljs/load-nyc-config@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b" @@ -4329,445 +4263,6 @@ prop-types "^15.6.1" react-lifecycles-compat "^3.0.4" -"@react-aria/button@~3.3.1": - version "3.3.1" - resolved "https://registry.npmjs.org/@react-aria/button/-/button-3.3.1.tgz#f180ffa95e3e822b7da4937421cf8280dd17af17" - integrity sha512-LXNuo0L79AhYqnxV+Y3J3xt7hPcmCVCEpZaC/dBzovR1MLunrdpk3QAXsRt3tqza1XvoqdvNhNHQm1Z1kyBTUg== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/focus" "^3.2.2" - "@react-aria/i18n" "^3.3.0" - "@react-aria/interactions" "^3.3.3" - "@react-aria/utils" "^3.6.0" - "@react-stately/toggle" "^3.2.1" - "@react-types/button" "^3.3.1" - -"@react-aria/dialog@~3.1.2": - version "3.1.2" - resolved "https://registry.npmjs.org/@react-aria/dialog/-/dialog-3.1.2.tgz#868970e7fdaa6ddb91a0d8d5b492778607d417fd" - integrity sha512-CUHzLdcKxnQ1IpbJOJ3BIDe762QoTOFXZfDAheNiTi24ym85w7KkW7dnfJDK2+J5RY15c5KWooOZvTaBmIJ7Xw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/focus" "^3.2.2" - "@react-aria/utils" "^3.3.0" - "@react-stately/overlays" "^3.1.1" - "@react-types/dialog" "^3.3.0" - -"@react-aria/focus@^3.2.2", "@react-aria/focus@^3.2.3", "@react-aria/focus@^3.2.4", "@react-aria/focus@~3.2.4": - version "3.2.4" - resolved "https://registry.npmjs.org/@react-aria/focus/-/focus-3.2.4.tgz#86c4fbde51a7cae414407b2d421fb5b311cd62f5" - integrity sha512-qoJoUDSriI7RCRq3L7yDOPtFZfquyjLA9d2pOJzvMx1F6dEqfNCaycyIg9lHykHXXhShgrXwfpyGTXoSUQpmtw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/interactions" "^3.3.4" - "@react-aria/utils" "^3.7.0" - "@react-types/shared" "^3.5.0" - clsx "^1.1.1" - -"@react-aria/i18n@^3.3.0": - version "3.3.0" - resolved "https://registry.npmjs.org/@react-aria/i18n/-/i18n-3.3.0.tgz#7f92ae81f6536b19b17b89c0991ddb6c10f2512a" - integrity sha512-8KYk0tQiEf9Kd9xdF4cKliP1169WSIryKFnZgnm9dvZl96TyfDK1xJpZQy58XjRdbS/H45CKydFmMcZEElu3BQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@internationalized/message" "3.0.0-alpha.0" - "@internationalized/number" "3.0.0-alpha.0" - "@react-aria/ssr" "^3.0.1" - "@react-aria/utils" "^3.6.0" - "@react-types/shared" "^3.4.0" - -"@react-aria/interactions@^3.2.1", "@react-aria/interactions@^3.3.3", "@react-aria/interactions@^3.3.4", "@react-aria/interactions@~3.3.4": - version "3.3.4" - resolved "https://registry.npmjs.org/@react-aria/interactions/-/interactions-3.3.4.tgz#a5b3a87f886cf0f4e28cbd13fbe02c7efb4f1e2e" - integrity sha512-WzT9aIRWvLZvZvuwNKKUkZzeomZgIrquAtwgRYGWbjSbrYPOT9B3w/GBEWZDYUG0c1K8NkIEAxTX0e+QI+tqAA== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/utils" "^3.7.0" - "@react-types/shared" "^3.5.0" - -"@react-aria/label@^3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-aria/label/-/label-3.1.1.tgz#03dc5c4813cd1f51760ba48783c186c2eeda1189" - integrity sha512-9kZKJonYSXeY6hZULZrsujAb6uXDGEy8qPq0tjTVoTA3+gx26LOmLCLgvHFtxUK1e4s99rHmaSPdOtq5qu3EVQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/utils" "^3.3.0" - "@react-types/label" "^3.2.1" - "@react-types/shared" "^3.2.1" - -"@react-aria/listbox@~3.2.4": - version "3.2.4" - resolved "https://registry.npmjs.org/@react-aria/listbox/-/listbox-3.2.4.tgz#3162e47d64e1f6cd8fdfe45766cb88c3852a525d" - integrity sha512-IYs4oS2wzWVcWEtKG57zZLZI507WlDy24wuzymwgFxxIRXDVaBsSMOs7+uE7N1P4fLOa1yAlv170AvKDDbIJ2g== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/interactions" "^3.3.3" - "@react-aria/label" "^3.1.1" - "@react-aria/selection" "^3.3.2" - "@react-aria/utils" "^3.6.0" - "@react-stately/collections" "^3.3.0" - "@react-stately/list" "^3.2.2" - "@react-types/listbox" "^3.1.1" - "@react-types/shared" "^3.4.0" - -"@react-aria/menu@^3.2.0": - version "3.2.0" - resolved "https://registry.npmjs.org/@react-aria/menu/-/menu-3.2.0.tgz#cd9417105b3230f1c34ddddddb31a95f462393e2" - integrity sha512-CFgC82ZO/LjJtMhDUJFdE3+PV0jS88LK9CCr6w11ggp+U3Q2fPXPdkAVeEB3cJn4KI0TRCBgE+4EneIzdTEgcw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/interactions" "^3.3.4" - "@react-aria/overlays" "^3.6.2" - "@react-aria/selection" "^3.4.0" - "@react-aria/utils" "^3.7.0" - "@react-stately/collections" "^3.3.1" - "@react-stately/menu" "^3.2.1" - "@react-stately/tree" "^3.1.3" - "@react-types/button" "^3.3.1" - "@react-types/menu" "^3.1.1" - "@react-types/shared" "^3.5.0" - -"@react-aria/overlays@^3.6.1", "@react-aria/overlays@^3.6.2", "@react-aria/overlays@~3.6.2": - version "3.6.2" - resolved "https://registry.npmjs.org/@react-aria/overlays/-/overlays-3.6.2.tgz#0a9fcb7426d4321dc80ee636282228eb7be83a84" - integrity sha512-6f9o1fypGcB/VcprvoDm5280glaiAp/9RZeNPP+HPXE5MxpQIzFDJCzTrSezAUYNkueh/KNMpUxOUUgytloScQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/i18n" "^3.3.0" - "@react-aria/interactions" "^3.3.4" - "@react-aria/utils" "^3.7.0" - "@react-aria/visually-hidden" "^3.2.1" - "@react-stately/overlays" "^3.1.1" - "@react-types/button" "^3.3.1" - "@react-types/overlays" "^3.4.0" - dom-helpers "^3.3.1" - -"@react-aria/select@~3.3.1": - version "3.3.1" - resolved "https://registry.npmjs.org/@react-aria/select/-/select-3.3.1.tgz#cfa694ff4b2020846e08b58f6f0a489f0d2b24ff" - integrity sha512-E/EZ4SKf8P5EMVznCmTjfa9y1cR6L+WIzXHTFAlwrmmIzNirHSipbFp6LpJzoByqd0p9IKxhBdxqFP92url0Qg== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/i18n" "^3.3.0" - "@react-aria/interactions" "^3.3.4" - "@react-aria/label" "^3.1.1" - "@react-aria/menu" "^3.2.0" - "@react-aria/selection" "^3.4.0" - "@react-aria/utils" "^3.7.0" - "@react-aria/visually-hidden" "^3.2.1" - "@react-stately/select" "^3.1.1" - "@react-types/button" "^3.3.1" - "@react-types/select" "^3.2.0" - "@react-types/shared" "^3.5.0" - -"@react-aria/selection@^3.3.2", "@react-aria/selection@^3.4.0": - version "3.4.0" - resolved "https://registry.npmjs.org/@react-aria/selection/-/selection-3.4.0.tgz#abd7aa5435f504e314a72122f2bcaef43b06fa78" - integrity sha512-ddxiB9zhy8JEkG4+DElSMNrSKxRI3RQKyOwQf4i3omqXj8bMH1XJesFwbdGNmR/zrbzXvr35ln9y3S0WS+4ClA== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/focus" "^3.2.4" - "@react-aria/i18n" "^3.3.0" - "@react-aria/interactions" "^3.3.4" - "@react-aria/utils" "^3.7.0" - "@react-stately/collections" "^3.3.1" - "@react-stately/selection" "^3.4.0" - "@react-types/shared" "^3.5.0" - -"@react-aria/separator@~3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-aria/separator/-/separator-3.1.1.tgz#bfcd71bb5ab50dc04a7f307b84bd77955f08002f" - integrity sha512-VbiqQsTtKKMjvMcPVWgTbDHzx7qMP3VFC+y9cEVajicMwRoO4bn7kJgcSzainXpWx70bhT5RW1mt84fzxMF+Lg== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/utils" "^3.3.0" - "@react-types/shared" "^3.2.1" - -"@react-aria/ssr@^3.0.1", "@react-aria/ssr@~3.0.1": - version "3.0.1" - resolved "https://registry.npmjs.org/@react-aria/ssr/-/ssr-3.0.1.tgz#5f7c111f9ecd184b8f6140139703c1ee552dca30" - integrity sha512-rweMNcSkUO4YkcmgFIoZFvgPyHN2P9DOjq3VOHnZ8SG3Y4TTvSY6Iv90KgzeEfmWCUqqt65FYH4JgrpGNToEMw== - dependencies: - "@babel/runtime" "^7.6.2" - -"@react-aria/tooltip@~3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-aria/tooltip/-/tooltip-3.1.1.tgz#e0dfdd9e51b581563f684927249d70e1bad761e3" - integrity sha512-wTszWN6lG3A9Ofdrhv1vG9aOmoqzuUZCbG9ZbXZ9+RtiOMwP/WnuSLWXcMH+KaWYpaImy7h1MDfOgHeaPxCbag== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/focus" "^3.2.3" - "@react-aria/interactions" "^3.3.3" - "@react-aria/overlays" "^3.6.1" - "@react-aria/utils" "^3.6.0" - "@react-stately/tooltip" "^3.0.2" - "@react-types/shared" "^3.4.0" - "@react-types/tooltip" "^3.1.1" - -"@react-aria/utils@^3.3.0", "@react-aria/utils@^3.6.0", "@react-aria/utils@^3.7.0", "@react-aria/utils@~3.7.0": - version "3.7.0" - resolved "https://registry.npmjs.org/@react-aria/utils/-/utils-3.7.0.tgz#0aab1f682e9f1781cfadd2dd1ef9494bfaca0cbf" - integrity sha512-sMCdX0eF+4B05I+SX9V/NzI1/fD45vabi0dNyJhbSu2xNI82VIYgPcMBDjGU83NJSnjY969R3/JbbLjBrtKUgA== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/ssr" "^3.0.1" - "@react-stately/utils" "^3.2.0" - "@react-types/shared" "^3.5.0" - clsx "^1.1.1" - -"@react-aria/visually-hidden@^3.2.1": - version "3.2.1" - resolved "https://registry.npmjs.org/@react-aria/visually-hidden/-/visually-hidden-3.2.1.tgz#c022c562346140a473242448045add59269a74fd" - integrity sha512-ba7bQD09MuzUghtPyrQoXHgQnRRfOu039roVKPz2em9gHD0Wy4ap2UPwlzx35KzNq6FdCzMDZeSZHSnUWlzKnw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/interactions" "^3.2.1" - "@react-aria/utils" "^3.3.0" - clsx "^1.1.1" - -"@react-hook/debounce@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@react-hook/debounce/-/debounce-3.0.0.tgz#9eea8b5d81d4cb67cd72dd8657b3ff724afc7cad" - integrity sha512-ir/kPrSfAzY12Gre0sOHkZ2rkEmM4fS5M5zFxCi4BnCeXh2nvx9Ujd+U4IGpKCuPA+EQD0pg1eK2NGLvfWejag== - dependencies: - "@react-hook/latest" "^1.0.2" - -"@react-hook/event@^1.2.1": - version "1.2.3" - resolved "https://registry.npmjs.org/@react-hook/event/-/event-1.2.3.tgz#cfe86d5cf36f53e85b367ff619990d001b5c82ae" - integrity sha512-WMBwLnYY2rubLeecsi4skl1imfx0oiXTgazV/1ByPT6WkmLvxUao3hC+mxps5D/+JK4Fq3uG9OWU/dn5jMtXyg== - dependencies: - "@react-hook/passive-layout-effect" "^1.2.0" - -"@react-hook/latest@^1.0.2": - version "1.0.3" - resolved "https://registry.npmjs.org/@react-hook/latest/-/latest-1.0.3.tgz#c2d1d0b0af8b69ec6e2b3a2412ba0768ac82db80" - integrity sha512-dy6duzl+JnAZcDbNTfmaP3xHiKtbXYOaz3G51MGVljh548Y8MWzTr+PHLOfvpypEVW9zwvl+VyKjbWKEVbV1Rg== - -"@react-hook/passive-layout-effect@^1.2.0": - version "1.2.1" - resolved "https://registry.npmjs.org/@react-hook/passive-layout-effect/-/passive-layout-effect-1.2.1.tgz#c06dac2d011f36d61259aa1c6df4f0d5e28bc55e" - integrity sha512-IwEphTD75liO8g+6taS+4oqz+nnroocNfWVHWz7j+N+ZO2vYrc6PV1q7GQhuahL0IOR7JccFTsFKQ/mb6iZWAg== - -"@react-hook/resize-observer@^1.1.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@react-hook/resize-observer/-/resize-observer-1.2.0.tgz#a44b385d998f4ab33aa9481a43c4ac33af21f7d7" - integrity sha512-7Cpy0aaZ3xXlSabQ43aZcfgzwYSidrshEKGDqpfvdx7pHnGDGskr8m1Ajb6yamJUSdTRgqCemYQcwouCqMmZoQ== - dependencies: - "@react-hook/latest" "^1.0.2" - "@react-hook/passive-layout-effect" "^1.2.0" - "@types/raf-schd" "^4.0.0" - raf-schd "^4.0.2" - resize-observer-polyfill "^1.5.1" - -"@react-hook/size@^2.1.1": - version "2.1.1" - resolved "https://registry.npmjs.org/@react-hook/size/-/size-2.1.1.tgz#10d3fb5bc61e128f0d7924714a925a04c992ed1f" - integrity sha512-QtHDsrvz8p4cai2UKxBpzk0r/uM63UyhmozTVChaDHJsVpN5/7A2yu8wuGyNhExdeCYMclLM21QjY1dyqpGbuQ== - dependencies: - "@react-hook/passive-layout-effect" "^1.2.0" - "@react-hook/resize-observer" "^1.1.0" - -"@react-hook/throttle@^2.2.0": - version "2.2.0" - resolved "https://registry.npmjs.org/@react-hook/throttle/-/throttle-2.2.0.tgz#d0402714a06e1ba0bc1da1fdf5c3c5cd0e08d45a" - integrity sha512-LJ5eg+yMV8lXtqK3lR+OtOZ2WH/EfWvuiEEu0M3bhR7dZRfTyEJKxH1oK9uyBxiXPtWXiQggWbZirMCXam51tg== - dependencies: - "@react-hook/latest" "^1.0.2" - -"@react-hook/window-size@^3.0.7": - version "3.0.7" - resolved "https://registry.npmjs.org/@react-hook/window-size/-/window-size-3.0.7.tgz#00d176e7a8eb55814e161eae34aae20afbcbe35d" - integrity sha512-bK5ed/jN+cxy0s1jt2CelCnUt7jZRseUvPQ22ZJkUl/QDOsD+7CA/6wcqC3c0QweM/fPBRP6uI56TJ48SnlVww== - dependencies: - "@react-hook/debounce" "^3.0.0" - "@react-hook/event" "^1.2.1" - "@react-hook/throttle" "^2.2.0" - -"@react-spectrum/utils@~3.5.1": - version "3.5.1" - resolved "https://registry.npmjs.org/@react-spectrum/utils/-/utils-3.5.1.tgz#dd733913e30e0ed59c6bdae430531283b4cdcc96" - integrity sha512-lSdxCtshkj9dsi9sGcem6s9lak2XT55uyZGZr2S3w6iwm3aS7OlJNoT/4xtUFGW3t1bF2oxNngHX6eLl+quFyw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-aria/i18n" "^3.3.0" - "@react-aria/ssr" "^3.0.1" - "@react-aria/utils" "^3.6.0" - "@react-types/shared" "^3.4.0" - clsx "^1.1.1" - -"@react-stately/collections@^3.2.1", "@react-stately/collections@^3.3.0", "@react-stately/collections@^3.3.1": - version "3.3.1" - resolved "https://registry.npmjs.org/@react-stately/collections/-/collections-3.3.1.tgz#683acf6e7a4e9ea174e1cf82a13bb8175ba0a1a0" - integrity sha512-bBiOj0hszFpCbk9KhSm04Jo87GAODm8kA52uFiGAO99yb2ypO+UTFYseBExFQ59cV7b++UMCfdJe/+Ymv9RALg== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-types/shared" "^3.5.0" - -"@react-stately/list@^3.2.1", "@react-stately/list@^3.2.2": - version "3.2.2" - resolved "https://registry.npmjs.org/@react-stately/list/-/list-3.2.2.tgz#fb368cc7678503179202d11aef0ef8d48d1cbf12" - integrity sha512-8sJvy0cUhllhUMadYjX1qKmTxAWMRGxkvZpU/6reOEChlvibjAwbn2paoR8yZ+ppieeQOBe+AAYTl53gK8fKDA== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/collections" "^3.3.0" - "@react-stately/selection" "^3.2.1" - "@react-stately/utils" "^3.1.1" - "@react-types/shared" "^3.2.1" - -"@react-stately/menu@^3.2.1": - version "3.2.1" - resolved "https://registry.npmjs.org/@react-stately/menu/-/menu-3.2.1.tgz#314646217e5dd49fa1da6886d33f485d44d6f0dd" - integrity sha512-8cpCynynjjn3qWNzrZMJEpsdk4tkXK9q3Xaw0ADqVym/NC/wPU3P3cqL4HY+ETar01tS2x8K23qYHbOZz0cQtQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/overlays" "^3.1.1" - "@react-stately/utils" "^3.1.1" - "@react-types/menu" "^3.1.1" - "@react-types/shared" "^3.2.1" - -"@react-stately/overlays@^3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-stately/overlays/-/overlays-3.1.1.tgz#6c1a393b77148184f7b1df22ece832d694d5a8b4" - integrity sha512-79YYXvmWKflezNPhc4fvXA1rDZurZvvEJcmbStNlR5Ryrnk/sQiOQCoVWooi2M4glSMT3UOTvD7YEnXxARcuIQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/utils" "^3.1.1" - "@react-types/overlays" "^3.2.1" - -"@react-stately/select@^3.1.1", "@react-stately/select@~3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-stately/select/-/select-3.1.1.tgz#f49602ee7fc71f14550360bfa7c5becab58ac877" - integrity sha512-cl63nW66IJPsn9WQjKvghAIFKdFKuU1txx4zdEGY9tcwB/Yc+bgniLGOOTExJqN/RdPW9uBny5jjWcc4OQXyJA== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/collections" "^3.2.1" - "@react-stately/list" "^3.2.1" - "@react-stately/menu" "^3.2.1" - "@react-stately/selection" "^3.2.1" - "@react-stately/utils" "^3.1.1" - "@react-types/select" "^3.1.1" - "@react-types/shared" "^3.2.1" - -"@react-stately/selection@^3.2.1", "@react-stately/selection@^3.4.0": - version "3.4.0" - resolved "https://registry.npmjs.org/@react-stately/selection/-/selection-3.4.0.tgz#795134e17b59f21cc4979b30179bccdfc2e3b9c1" - integrity sha512-5RV9f1Tm4WSTDguL1iizYcgzeWiK6Qe2EZ03zaaE9gm5UyyIrEPQD4WW9Semio2cUF8IFuWLaOvRCk+un7p53Q== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/collections" "^3.3.1" - "@react-stately/utils" "^3.1.1" - "@react-types/shared" "^3.5.0" - -"@react-stately/toggle@^3.2.1": - version "3.2.1" - resolved "https://registry.npmjs.org/@react-stately/toggle/-/toggle-3.2.1.tgz#8b10b5eb99c3c4df2c36d17a5f23b77773ed7722" - integrity sha512-gZVuJ8OYoATUoXzdprsyx6O1w3wCrN+J0KnjhrjjKTrBG68n3pZH0p6dM0XpsaCzlSv0UgNa4fhHS3dYfr/ovw== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/utils" "^3.1.1" - "@react-types/checkbox" "^3.2.1" - "@react-types/shared" "^3.2.1" - -"@react-stately/tooltip@^3.0.2", "@react-stately/tooltip@~3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@react-stately/tooltip/-/tooltip-3.0.3.tgz#577fbf3cca39db7047ec2d77ddc03a56c454a82a" - integrity sha512-N98S8ccHEpgbgM6wIMZwqz37s8IQTa+5nPr8eVnIs5wqwdnAARFjvckr2okOGwaksofp1wtpcYbnNrIBwexJOg== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/overlays" "^3.1.1" - "@react-stately/utils" "^3.2.0" - "@react-types/tooltip" "^3.1.1" - -"@react-stately/tree@^3.1.3": - version "3.1.3" - resolved "https://registry.npmjs.org/@react-stately/tree/-/tree-3.1.3.tgz#5ceb1aa3793836a503253ddd47fc9227ac59c7b4" - integrity sha512-xwM2C3ppd8yJfduwgff7Gl2bNPMVeF4K65InFJZNVx5JLKFF6DJLAPTORAHLpCN+AoB8bY4sRK3V5fNBVpz0oQ== - dependencies: - "@babel/runtime" "^7.6.2" - "@react-stately/collections" "^3.3.1" - "@react-stately/selection" "^3.4.0" - "@react-stately/utils" "^3.1.1" - "@react-types/shared" "^3.5.0" - -"@react-stately/utils@^3.1.1", "@react-stately/utils@^3.2.0": - version "3.2.0" - resolved "https://registry.npmjs.org/@react-stately/utils/-/utils-3.2.0.tgz#0b90a70fee3236025ad8bed1f0e3555d5fc10296" - integrity sha512-vVBJvHVLnQySgqZ7OfP3ngDdwfGscJDsSD3WcN5ntHiT3JlZ5bksQReDkJEs20SFu2ST4w/0K7O4m97SbuMl2Q== - dependencies: - "@babel/runtime" "^7.6.2" - -"@react-types/button@^3.3.1": - version "3.3.1" - resolved "https://registry.npmjs.org/@react-types/button/-/button-3.3.1.tgz#4bdd325bc7df19c33911af256f63eae91e2a452e" - integrity sha512-xKLGSzGfsDBMe0SM7icOLNmzW38sdNSDSGMdrTLd3ygxb6pXY/LlcTdx7Sq28hdW8XL/ikFAnoQeS1VLXZHj7w== - dependencies: - "@react-types/shared" "^3.4.0" - -"@react-types/checkbox@^3.2.1": - version "3.2.2" - resolved "https://registry.npmjs.org/@react-types/checkbox/-/checkbox-3.2.2.tgz#7182d44a533e2ffd2c9118372cbc2c33b006eb18" - integrity sha512-WAAqLdjf6GUWjsMN5NaFMFumOtGTq+3+48CpM0ah2L+qmhMdj1s4gvHDerhls6u4ovRK/7zhg7XK+qQwcYVqMg== - dependencies: - "@react-types/shared" "^3.4.0" - -"@react-types/dialog@^3.3.0": - version "3.3.0" - resolved "https://registry.npmjs.org/@react-types/dialog/-/dialog-3.3.0.tgz#60a2b53f250ee082b53aef9340c80f1afe654bc7" - integrity sha512-63Vsr/UOZiaajlNDQUgWDi6v3EMenV1f8Cwh+L4lcyIJnbC6WeC2VEV3ld/TYVC0U58SQ0k7u2EIyHkWjc5kdQ== - dependencies: - "@react-types/overlays" "^3.2.1" - "@react-types/shared" "^3.2.1" - -"@react-types/label@^3.2.1": - version "3.4.0" - resolved "https://registry.npmjs.org/@react-types/label/-/label-3.4.0.tgz#6023dc9dd0146324ead52e08540cd60e57a3e27f" - integrity sha512-l84ysm1dcjL/5qVk9iN74z+/Ul0999XqnwTu6aTbuwAXqMk2sTU45eK2Yp/FJ7YWeflcF1vsomTkjMkX0BHKMw== - dependencies: - "@react-types/shared" "^3.4.0" - -"@react-types/listbox@^3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-types/listbox/-/listbox-3.1.1.tgz#b896303ccb87123cf59ee2c089953d7928497c9b" - integrity sha512-HAljfdpbyLoJL9iwqz7Fw9MOmRwfzODeN+sr5ncE0eXJxnRBFhb5LjbjAN1dUBrKFBkv3etGlYu5HvX+PJjpew== - dependencies: - "@react-types/shared" "^3.2.1" - -"@react-types/menu@^3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-types/menu/-/menu-3.1.1.tgz#e5aa52ac07c083243540dd5da0790a85fd1628c6" - integrity sha512-/xZWp4/3P/8dKFAGuzxz8IccSXvJH0TmHIk2/xnj2Eyw9152IfutIpOda3iswhjrx1LEkzUgdJ8bCdiebgg6QQ== - dependencies: - "@react-types/overlays" "^3.2.1" - "@react-types/shared" "^3.2.1" - -"@react-types/overlays@^3.2.1", "@react-types/overlays@^3.4.0": - version "3.4.0" - resolved "https://registry.npmjs.org/@react-types/overlays/-/overlays-3.4.0.tgz#3c4619906bb12e3697e770b59c2090bb18da25bd" - integrity sha512-ddiMB6JXR7acQnRFEL2/6SSdBropmNrcAFk3qFCfovuVZh6STYhPmoAgj06mJFDoAD63pxayysfPG2EvLl2yAw== - dependencies: - "@react-types/shared" "^3.3.0" - -"@react-types/select@^3.1.1", "@react-types/select@^3.2.0": - version "3.2.0" - resolved "https://registry.npmjs.org/@react-types/select/-/select-3.2.0.tgz#31b9e0f94fc24f053f4a1f073e174ffd59bac055" - integrity sha512-9vYhQWr1iB+3KWTZ1RxS2xZq0n0CJfsTRbEr0akLrtE/pRLC4O4l8RMFD49HyX0fShvz1FStmxTE2x7k8yVc4w== - dependencies: - "@react-types/shared" "^3.4.0" - -"@react-types/shared@^3.2.1", "@react-types/shared@^3.3.0", "@react-types/shared@^3.4.0", "@react-types/shared@^3.5.0": - version "3.5.0" - resolved "https://registry.npmjs.org/@react-types/shared/-/shared-3.5.0.tgz#dbc90e8fe711967e66d6f3ce0e17d34b24bd6283" - integrity sha512-997Me7AegwJOI10ye/Q5ds6fT+VBc6XcsXYzPqOD+HIbyL1kUQNDF/VoO37ib7KEH8jXH9aceoX9blz3Q1QcpA== - -"@react-types/tooltip@^3.1.1": - version "3.1.1" - resolved "https://registry.npmjs.org/@react-types/tooltip/-/tooltip-3.1.1.tgz#7d45a4dd8c57c422a1a2dcb03b6c043e7481c3ca" - integrity sha512-18gM2Co9tzCDfN0tEdfboD18sXDtD6YiKctd8HQ8tBiRO4IF1ce9ubKe6++Lj+38GQPq7GWFFoUiS1WArTWIHA== - dependencies: - "@react-types/overlays" "^3.4.0" - "@react-types/shared" "^3.4.0" - "@rjsf/core@^2.4.0": version "2.5.1" resolved "https://registry.npmjs.org/@rjsf/core/-/core-2.5.1.tgz#95a842d22bab5f83929662fcd73739108e9f5cbb" @@ -4975,179 +4470,6 @@ dependencies: any-observable "^0.3.0" -"@sentry/apm@5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/apm/-/apm-5.13.2.tgz#3a0809912426f52e19b1f4a603e99423a0ac8fb9" - integrity sha512-Pv6PRVkcmmYYIT422gXm968F8YQyf5uN1RSHOFBjWsxI3Ke/uRgeEdIVKPDo78GklBfETyRN6GyLEZ555jRe6g== - dependencies: - "@sentry/browser" "5.13.2" - "@sentry/hub" "5.13.2" - "@sentry/minimal" "5.13.2" - "@sentry/types" "5.13.2" - "@sentry/utils" "5.13.2" - tslib "^1.9.3" - -"@sentry/apm@5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/apm/-/apm-5.19.2.tgz#369fdcbc9fa5db992f707b24f3165e106a277cf7" - integrity sha512-V7p5niqG/Nn1OSMAyreChiIrQFYzFHKADKNaDEvIXqC4hxFnMG8lPRqEFJH49fNjsFBFfIG9iY1rO1ZFg3S42Q== - dependencies: - "@sentry/browser" "5.19.2" - "@sentry/hub" "5.19.2" - "@sentry/minimal" "5.19.2" - "@sentry/types" "5.19.2" - "@sentry/utils" "5.19.2" - tslib "^1.9.3" - -"@sentry/browser@5.13.2", "@sentry/browser@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/browser/-/browser-5.13.2.tgz#fcca630c8c80447ba8392803d4e4450fd2231b92" - integrity sha512-4MeauHs8Rf1c2FF6n84wrvA4LexEL1K/Tg3r+1vigItiqyyyYBx1sPjHGZeKeilgBi+6IEV5O8sy30QIrA/NsQ== - dependencies: - "@sentry/core" "5.13.2" - "@sentry/types" "5.13.2" - "@sentry/utils" "5.13.2" - tslib "^1.9.3" - -"@sentry/browser@5.19.2", "@sentry/browser@~5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/browser/-/browser-5.19.2.tgz#8bad445b8d1efd50e6510bb43b3018b941f6e5cb" - integrity sha512-o6Z532n+0N5ANDzgR9GN+Q6CU7zVlIJvBEW234rBiB+ZZj6XwTLS1dD+JexGr8lCo8PeXI2rypKcj1jUGLVW8w== - dependencies: - "@sentry/core" "5.19.2" - "@sentry/types" "5.19.2" - "@sentry/utils" "5.19.2" - tslib "^1.9.3" - -"@sentry/core@5.13.2", "@sentry/core@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/core/-/core-5.13.2.tgz#d89e199beef612d0a01e5c4df4e0bb7efcb72c74" - integrity sha512-iB7CQSt9e0EJhSmcNOCjzJ/u7E7qYJ3mI3h44GO83n7VOmxBXKSvtUl9FpKFypbWrsdrDz8HihLgAZZoMLWpPA== - dependencies: - "@sentry/hub" "5.13.2" - "@sentry/minimal" "5.13.2" - "@sentry/types" "5.13.2" - "@sentry/utils" "5.13.2" - tslib "^1.9.3" - -"@sentry/core@5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/core/-/core-5.19.2.tgz#99a64ef0e55230fc02a083c48fa07ada85de4929" - integrity sha512-sfbBsVXpA0WYJUichz5IhvqKD8xJUfQvsszrTsUKa7PQAMAboOmuh6bo8KquaVQnAZyZWZU08UduvlSV3tA7tw== - dependencies: - "@sentry/hub" "5.19.2" - "@sentry/minimal" "5.19.2" - "@sentry/types" "5.19.2" - "@sentry/utils" "5.19.2" - tslib "^1.9.3" - -"@sentry/electron@~1.3.0": - version "1.3.2" - resolved "https://registry.npmjs.org/@sentry/electron/-/electron-1.3.2.tgz#83c40943f2fad5e72c77dadf524fd59d1a773e3f" - integrity sha512-fhD6cF7Jy0AXAVNHrUnxhzK5d/reXpzRcp5Ggnr+IRoijGe7rsq/AlOX8KhLS6SmQdI/XXb3F7fxHdItBV9+7w== - dependencies: - "@sentry/browser" "~5.13.2" - "@sentry/core" "~5.13.2" - "@sentry/minimal" "~5.13.2" - "@sentry/node" "~5.13.2" - "@sentry/types" "~5.13.2" - "@sentry/utils" "~5.13.2" - electron-fetch "^1.4.0" - form-data "2.5.1" - util.promisify "1.0.1" - -"@sentry/hub@5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.13.2.tgz#875a5ba983d6ada5caae5b6b4decd0257ef5cdb7" - integrity sha512-/U7yq3DTuRz8SRpZVKAaenW9sD2F5wbj12kDVPxPnGspyqhy0wBWKs9j0YJfBiDXMKOwp3HX964O3ygtwjnfAw== - dependencies: - "@sentry/types" "5.13.2" - "@sentry/utils" "5.13.2" - tslib "^1.9.3" - -"@sentry/hub@5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.19.2.tgz#ab7f3d2d253c3441b2833a530b17c6de2418b2c7" - integrity sha512-2KkEYX4q9TDCOiaVEo2kQ1W0IXyZxJxZtIjDdFQyes9T4ubYlKHAbvCjTxHSQv37lDO4t7sOIApWG9rlkHzlEA== - dependencies: - "@sentry/types" "5.19.2" - "@sentry/utils" "5.19.2" - tslib "^1.9.3" - -"@sentry/minimal@5.13.2", "@sentry/minimal@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.13.2.tgz#e42e33dc74fc935f8857d1a43a528afd741640fd" - integrity sha512-VV0eA3HgrnN3mac1XVPpSCLukYsU+QxegbmpnZ8UL8eIQSZ/ZikYxagDNlZbdnmXHUpOEUeag2gxVntSCo5UcA== - dependencies: - "@sentry/hub" "5.13.2" - "@sentry/types" "5.13.2" - tslib "^1.9.3" - -"@sentry/minimal@5.19.2", "@sentry/minimal@~5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.19.2.tgz#0fc2fdf9911a0cb31b52f7ccad061b74785724a3" - integrity sha512-rApEOkjy+ZmkeqEItgFvUFxe5l+dht9AumuUzq74pWp+HJqxxv9IVTusKppBsE1adjtmyhwK4O3Wr8qyc75xlw== - dependencies: - "@sentry/hub" "5.19.2" - "@sentry/types" "5.19.2" - tslib "^1.9.3" - -"@sentry/node@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/node/-/node-5.13.2.tgz#3be5608e00fb3fe1b813ad8365073a465d19f5f6" - integrity sha512-LwNOUvc0+28jYfI0o4HmkDTEYdY3dWvSCnL5zggO12buon7Wc+jirXZbEQAx84HlXu7sGSjtKCTzUQOphv7sPw== - dependencies: - "@sentry/apm" "5.13.2" - "@sentry/core" "5.13.2" - "@sentry/hub" "5.13.2" - "@sentry/types" "5.13.2" - "@sentry/utils" "5.13.2" - cookie "^0.3.1" - https-proxy-agent "^4.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/node@~5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/node/-/node-5.19.2.tgz#8c1c2f6c983c3d8b25143e5b99c4b6cc745125ec" - integrity sha512-gbww3iTWkdvYIAhOmULbv8znKwkIpklGJ0SPtAh0orUMuaa0lVht+6HQIhRgeXp50lMzNaYC3fuzkbFfYgpS7A== - dependencies: - "@sentry/apm" "5.19.2" - "@sentry/core" "5.19.2" - "@sentry/hub" "5.19.2" - "@sentry/types" "5.19.2" - "@sentry/utils" "5.19.2" - cookie "^0.3.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" - -"@sentry/types@5.13.2", "@sentry/types@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/types/-/types-5.13.2.tgz#8e68c31f8fb99b4074374bff13ed01035b373d8c" - integrity sha512-mgAEQyc77PYBnAjnslSXUz6aKgDlunlg2c2qSK/ivKlEkTgTWWW/dE76++qVdrqM8SupnqQoiXyPDL0wUNdB3g== - -"@sentry/types@5.19.2", "@sentry/types@~5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/types/-/types-5.19.2.tgz#ead586f0b64b91c396d3521b938ca25f7b59d655" - integrity sha512-O6zkW8oM1qK5Uma9+B/UMlmlm9/gkw9MooqycWuEhIaKfDBj/yVbwb/UTiJmNkGc5VJQo0v1uXUZZQt6/Xq1GA== - -"@sentry/utils@5.13.2", "@sentry/utils@~5.13.2": - version "5.13.2" - resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.13.2.tgz#441594f4f9412bfd1690739ce986bf3a49687806" - integrity sha512-LwPQl6WRMKEnd16kg35HS3yE+VhBc8vN4+BBIlrgs7X0aoT+AbEd/sQLMisDgxNboCF44Ho3RCKtztiPb9blqg== - dependencies: - "@sentry/types" "5.13.2" - tslib "^1.9.3" - -"@sentry/utils@5.19.2": - version "5.19.2" - resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.19.2.tgz#f2819d9de5abc33173019e81955904247e4a8246" - integrity sha512-gEPkC0CJwvIWqcTcPSdIzqJkJa9N5vZzUZyBvdu1oiyJu7MfazpJEvj3whfJMysSfXJQxoJ+a1IPrA73VY23VA== - dependencies: - "@sentry/types" "5.19.2" - tslib "^1.9.3" - "@sideway/address@^4.1.0": version "4.1.1" resolved "https://registry.npmjs.org/@sideway/address/-/address-4.1.1.tgz#9e321e74310963fdf8eebfbee09c7bd69972de4d" @@ -5216,168 +4538,6 @@ resolved "https://registry.npmjs.org/@spotify/prettier-config/-/prettier-config-9.0.0.tgz#7b562d56573c6fc0094446fbc92b22bc318945dc" integrity sha512-In1q0tIiqTYKAGe3KOHDcFDdZRFISyQeSeipeTHGfki23ebHRZcjxvqj5SSdBkw65D4VpSREMi0s9i5iJiMcTw== -"@stoplight/beaver-logger@^4.0.12": - version "4.0.12" - resolved "https://registry.npmjs.org/@stoplight/beaver-logger/-/beaver-logger-4.0.12.tgz#f754d2f20b4728f5e96fdec574729988e4fb0c2d" - integrity sha512-VPSqZ706GaAB/7VcXcKvzaxaKwHmr2jUNcn0mTvhR3dwglmDEsqoKRvzTxH+Zu1VUIRjdcy9zmU7mSfjKjPt7Q== - dependencies: - belter "^1.0.17" - zalgo-promise "^1.0.26" - -"@stoplight/json-schema-merge-allof@^0.7.5": - version "0.7.6" - resolved "https://registry.npmjs.org/@stoplight/json-schema-merge-allof/-/json-schema-merge-allof-0.7.6.tgz#39efac12a497ed29a06ae48e0141885634a045a4" - integrity sha512-xLbJC2VOd9AxO1VvvgyP/mWOqZbeg6mLpYzlzU4egDTTIrTsSqtv+yFakpPciuuMlOmJU/KzZK9C5AbMgE+VgQ== - dependencies: - compute-lcm "^1.1.0" - json-schema-compare "^0.2.2" - lodash "^4.17.4" - -"@stoplight/json-schema-tree@^2.0.0": - version "2.0.0" - resolved "https://registry.npmjs.org/@stoplight/json-schema-tree/-/json-schema-tree-2.0.0.tgz#00d54cb6aa2a791c34be91fc30cc92e6d448258c" - integrity sha512-vnzcb0TC07xh89lAVGjBTJ2CWvCqmDJDIs3u+gvgvjDPY86CQ0Wl4D2Cmb0iuqd986aiDPc8vDQf1N0dSq5+9A== - dependencies: - "@stoplight/json" "^3.12.0" - "@stoplight/json-schema-merge-allof" "^0.7.5" - "@stoplight/lifecycle" "^2.3.2" - "@types/json-schema" "^7.0.7" - magic-error "^0.0.0" - -"@stoplight/json-schema-viewer@^4.0.0-beta.16": - version "4.0.0-beta.16" - resolved "https://registry.npmjs.org/@stoplight/json-schema-viewer/-/json-schema-viewer-4.0.0-beta.16.tgz#8f55debcb1e84ddcd6f55012ed52712560beaca5" - integrity sha512-f6GijfWi15maRQH4J/ulc8tFpoc+ejGeckiIH+USTLPd7fmGiIU5wINbJSVbLJ5Hccky8wraxlCzfdRuck84Jw== - dependencies: - "@fortawesome/free-solid-svg-icons" "^5.15.2" - "@stoplight/json" "^3.10.0" - "@stoplight/json-schema-tree" "^2.0.0" - "@stoplight/mosaic" "1.0.0-beta.46" - "@stoplight/react-error-boundary" "^1.0.0" - "@types/json-schema" "^7.0.7" - classnames "^2.2.6" - lodash "^4.17.19" - -"@stoplight/json@^3.10.0", "@stoplight/json@^3.12.0": - version "3.12.0" - resolved "https://registry.npmjs.org/@stoplight/json/-/json-3.12.0.tgz#26c8d32da78eac6a760ba2c9cca6ae717dc417b4" - integrity sha512-c0bvFOGICk8QWIat72Td2GG6Bdvq/6O2jQcDZ8rEjh56YOdC/YPn1S8ihKu3AntJCtvqC9eTfadWBqkNK9HAjw== - dependencies: - "@stoplight/ordered-object-literal" "^1.0.1" - "@stoplight/types" "^11.9.0" - jsonc-parser "~2.2.1" - lodash "^4.17.15" - safe-stable-stringify "^1.1" - -"@stoplight/lifecycle@^2.3.2": - version "2.3.2" - resolved "https://registry.npmjs.org/@stoplight/lifecycle/-/lifecycle-2.3.2.tgz#d61dff9ba20648241432e2daaef547214dc8976e" - integrity sha512-v0u8p27FA/eg04b4z6QXw4s0NeeFcRzyvseBW0+k/q4jtpg7EhVCqy42EbbbU43NTNDpIeQ81OcvkFz+6CYshw== - dependencies: - wolfy87-eventemitter "~5.2.8" - -"@stoplight/mosaic@1.0.0-beta.46": - version "1.0.0-beta.46" - resolved "https://registry.npmjs.org/@stoplight/mosaic/-/mosaic-1.0.0-beta.46.tgz#35fa3c9aebdb3c3535d1d8dd53cc52f1b2b1f5db" - integrity sha512-GlGLb2RzvzS7CQpq006c6eZhe7tIgRvDIt/nYqx+FXJEh0M045I2EObstdbyQt/sL7Zw5lae3uxiQ/1j8FqkRA== - dependencies: - "@fortawesome/fontawesome-svg-core" "^1.2.35" - "@fortawesome/free-solid-svg-icons" "^5.15.3" - "@fortawesome/react-fontawesome" "^0.1.14" - "@react-aria/button" "~3.3.1" - "@react-aria/dialog" "~3.1.2" - "@react-aria/focus" "~3.2.4" - "@react-aria/interactions" "~3.3.4" - "@react-aria/listbox" "~3.2.4" - "@react-aria/overlays" "~3.6.2" - "@react-aria/select" "~3.3.1" - "@react-aria/separator" "~3.1.1" - "@react-aria/ssr" "~3.0.1" - "@react-aria/tooltip" "~3.1.1" - "@react-aria/utils" "~3.7.0" - "@react-hook/size" "^2.1.1" - "@react-hook/window-size" "^3.0.7" - "@react-spectrum/utils" "~3.5.1" - "@react-stately/select" "~3.1.1" - "@react-stately/tooltip" "~3.0.3" - clsx "^1.1.1" - copy-to-clipboard "^3.3.1" - deepmerge "^4.2.2" - lodash.get "^4.4.2" - polished "^4.1.1" - reakit "npm:@stoplight/reakit@~1.3.5" - ts-keycode-enum "^1.0.6" - tslib "^2.1.0" - zustand "^3.3.3" - -"@stoplight/mosaic@^1.0.0-beta.46": - version "1.0.0-beta.47" - resolved "https://registry.npmjs.org/@stoplight/mosaic/-/mosaic-1.0.0-beta.47.tgz#6b212163af3ab7fb981dee75785f1b967299171e" - integrity sha512-Rp6aXslPB0X2hqj8MFmbYSWUvSjo/ResDFNQoMHD1BCBGw0nTmlcPZaQDKQApUFQrDBzih+OGRKTk0mGxrTP3A== - dependencies: - "@fortawesome/fontawesome-svg-core" "^1.2.35" - "@fortawesome/free-solid-svg-icons" "^5.15.3" - "@fortawesome/react-fontawesome" "^0.1.14" - "@react-aria/button" "~3.3.1" - "@react-aria/dialog" "~3.1.2" - "@react-aria/focus" "~3.2.4" - "@react-aria/interactions" "~3.3.4" - "@react-aria/listbox" "~3.2.4" - "@react-aria/overlays" "~3.6.2" - "@react-aria/select" "~3.3.1" - "@react-aria/separator" "~3.1.1" - "@react-aria/ssr" "~3.0.1" - "@react-aria/tooltip" "~3.1.1" - "@react-aria/utils" "~3.7.0" - "@react-hook/size" "^2.1.1" - "@react-hook/window-size" "^3.0.7" - "@react-spectrum/utils" "~3.5.1" - "@react-stately/select" "~3.1.1" - "@react-stately/tooltip" "~3.0.3" - clsx "^1.1.1" - copy-to-clipboard "^3.3.1" - deepmerge "^4.2.2" - lodash.get "^4.4.2" - polished "^4.1.1" - reakit "npm:@stoplight/reakit@~1.3.5" - ts-keycode-enum "^1.0.6" - tslib "^2.1.0" - zustand "^3.3.3" - -"@stoplight/ordered-object-literal@^1.0.1": - version "1.0.2" - resolved "https://registry.npmjs.org/@stoplight/ordered-object-literal/-/ordered-object-literal-1.0.2.tgz#2a88a5ebc8b68b54837ac9a9ae7b779cdd862062" - integrity sha512-0ZMS/9sNU3kVo/6RF3eAv7MK9DY8WLjiVJB/tVyfF2lhr2R4kqh534jZ0PlrFB9CRXrdndzn1DbX6ihKZXft2w== - -"@stoplight/react-error-boundary@^1.0.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@stoplight/react-error-boundary/-/react-error-boundary-1.1.0.tgz#9b0fb5d0538abbf9a416723b90f5b776bf68a75d" - integrity sha512-z/1gDVQAafqYuJksL212F1DXHSr604KDqAspZwbC+kWVqCsddQBmXzwI4Lqqem4wHbNGeVZYk3svW+sILX/PUQ== - dependencies: - "@stoplight/types" "^11.9.0" - -"@stoplight/reporter@^1.10.0": - version "1.10.0" - resolved "https://registry.npmjs.org/@stoplight/reporter/-/reporter-1.10.0.tgz#cbb58a7842422178ff56410e3f009517a474a5ba" - integrity sha512-XdHIT+TwS00rEhsEClCddrACZCqxK+sh/R2EBFuXBTbWMIwujoWVTLPxEwhVkfm2JF57pK3jzULOFxEnNRnmpQ== - dependencies: - "@sentry/browser" "~5.19.2" - "@sentry/electron" "~1.3.0" - "@sentry/minimal" "~5.19.2" - "@sentry/node" "~5.19.2" - "@sentry/types" "~5.19.2" - "@stoplight/beaver-logger" "^4.0.12" - "@types/amplitude-js" "^5.11.0" - amplitude-js "^7.1.0" - -"@stoplight/types@^11.9.0": - version "11.10.0" - resolved "https://registry.npmjs.org/@stoplight/types/-/types-11.10.0.tgz#60bbee770526f4de9cd1c613c7ab84c4e4674126" - integrity sha512-ffHD9i4UHS8Gsg7Ar8pKjI9B4kq7MRekE7tCROFGcFDzQhfRx9T92AduoLAtP/010XNYq23yDKpLBRPIEk8+xg== - dependencies: - "@types/json-schema" "^7.0.4" - utility-types "^3.10.0" - "@storybook/addon-actions@^6.1.11": version "6.1.17" resolved "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-6.1.17.tgz#9d32336284738cefa69b99acafa4b132d5533600" @@ -6501,11 +5661,6 @@ dependencies: "@types/node" "*" -"@types/amplitude-js@^5.11.0": - version "5.11.1" - resolved "https://registry.npmjs.org/@types/amplitude-js/-/amplitude-js-5.11.1.tgz#4883aa6f484530df3557de8683ff4529fcb7ec65" - integrity sha512-2BAZ8sMlOq4t0zC5LEBRL551u/kJPr+BTOe9OUtFT7J1U4Kgm+gHYmV4nYwq9sZnNj6MisCllKiiL27WEur7Sw== - "@types/anymatch@*": version "1.3.1" resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a" @@ -7091,11 +6246,6 @@ resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0" integrity sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw== -"@types/json-schema@^7.0.7": - version "7.0.7" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad" - integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA== - "@types/json-stable-stringify@^1.0.32": version "1.0.32" resolved "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.32.tgz#121f6917c4389db3923640b2e68de5fa64dda88e" @@ -7417,11 +6567,6 @@ resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.4.tgz#a59e851c1ba16c0513ea123830dd639a0a15cb6a" integrity sha512-+wYo+L6ZF6BMoEjtf8zB2esQsqdV6WsjRK/GP9WOgLPrq87PbNWgIxS76dS5uvl/QXtHGakZmwTznIfcPXcKlQ== -"@types/raf-schd@^4.0.0": - version "4.0.1" - resolved "https://registry.npmjs.org/@types/raf-schd/-/raf-schd-4.0.1.tgz#1f9e03736f277fe9c7b82102bf18570a6ee19f82" - integrity sha512-Ha+EnKHFIh9EKW0/XZJPUd3EGDFisEvauaBd4VVCRPKeOqUxNEc9TodiY2Zhk33XCgzJucoFEcaoNcBAPHTQ2A== - "@types/raf@^3.4.0": version "3.4.0" resolved "https://registry.npmjs.org/@types/raf/-/raf-3.4.0.tgz#2b72cbd55405e071f1c4d29992638e022b20acc2" @@ -8308,11 +7453,6 @@ address@1.1.2, address@^1.0.1: resolved "https://registry.npmjs.org/address/-/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" integrity sha512-aT6camzM4xEA54YVJYSqxz1kv4IHnQZRtThJJHhUMRExaU5spC7jX5ugSwTaTgJliIgs4VhZOk7htClvQ/LmRA== -agent-base@5: - version "5.1.1" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" - integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== - agent-base@6: version "6.0.1" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz#808007e4e5867decb0ab6ab2f928fbdb5a596db4" @@ -8402,16 +7542,6 @@ alphanum-sort@^1.0.0: resolved "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= -amplitude-js@^7.1.0: - version "7.4.4" - resolved "https://registry.npmjs.org/amplitude-js/-/amplitude-js-7.4.4.tgz#1abd76f96a44ebdbf90e7371b37d071010deffe6" - integrity sha512-3Ojj1draRcXvfxi5P+Ye/6Y4roxtf1lQEjczcLDnHU9vxbPtT4fDblC9+cdJy7XmlJkGoq+KvnItlWfLuHV9GQ== - dependencies: - "@amplitude/ua-parser-js" "0.7.24" - "@amplitude/utils" "^1.0.5" - blueimp-md5 "^2.10.0" - query-string "5" - anafanafo@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/anafanafo/-/anafanafo-1.0.0.tgz#2e67190aed5dc67f5f0043b710146e7276c1afb8" @@ -9620,15 +8750,6 @@ before-after-hook@^2.1.0: resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -belter@^1.0.17: - version "1.0.165" - resolved "https://registry.npmjs.org/belter/-/belter-1.0.165.tgz#8bc32f0f30b94b67b80a63727b1584acd69942f0" - integrity sha512-TVOfXtLTTU3yyORjiYD2s9+fnTdxZp69KtR3pSDquLrdtK3OUmypgukVL+pIbcE6VMc85FRoFR48gybNZ2zHZQ== - dependencies: - cross-domain-safe-weakmap "^1" - cross-domain-utils "^2" - zalgo-promise "^1" - better-opn@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/better-opn/-/better-opn-2.0.0.tgz#c70d198e51164bdc220306a28a885d9ac7a14c44" @@ -9724,11 +8845,6 @@ bluebird@~3.4.1: resolved "https://registry.npmjs.org/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -blueimp-md5@^2.10.0: - version "2.18.0" - resolved "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.18.0.tgz#1152be1335f0c6b3911ed9e36db54f3e6ac52935" - integrity sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q== - bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" @@ -9750,11 +8866,6 @@ body-parser@1.19.0, body-parser@^1.18.3: raw-body "2.4.0" type-is "~1.6.17" -body-scroll-lock@^3.1.5: - version "3.1.5" - resolved "https://registry.npmjs.org/body-scroll-lock/-/body-scroll-lock-3.1.5.tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec" - integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg== - bonjour@^3.5.0: version "3.5.0" resolved "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5" @@ -10792,7 +9903,7 @@ clone@^1.0.2: resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -clsx@^1.0.1, clsx@^1.0.2, clsx@^1.0.4, clsx@^1.1.0, clsx@^1.1.1: +clsx@^1.0.1, clsx@^1.0.2, clsx@^1.0.4, clsx@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== @@ -11332,11 +10443,6 @@ cookie@0.4.0: resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== -cookie@^0.3.1: - version "0.3.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" - integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s= - cookie@^0.4.1, cookie@~0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" @@ -11539,20 +10645,6 @@ create-require@^1.1.0: resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-domain-safe-weakmap@^1: - version "1.0.28" - resolved "https://registry.npmjs.org/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.28.tgz#d6c3c5af954340ce5f9d4ee5f3c38dba9513a165" - integrity sha512-gfQiQYSdWr9cYFVpmzp+b6MyTnefefDHr+fvm+JVv20hQxetV5J6chZOAusrpM/kFpTTbVDnHCziBFaREvgc0Q== - dependencies: - cross-domain-utils "^2.0.0" - -cross-domain-utils@^2, cross-domain-utils@^2.0.0: - version "2.0.34" - resolved "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.34.tgz#3f8dc8d82a5434213787433f17b76f51c316e382" - integrity sha512-ke4PirGRXwEElEmE/7k5aCvCW+EqbgseT7AOObzFfaVnOLuEVN9SjVWoOfS/qAT0rDPn3ggmNDW6mguMBy4HgA== - dependencies: - zalgo-promise "^1.0.11" - cross-env@^7.0.0: version "7.0.3" resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -12679,7 +11771,7 @@ dom-converter@^0.2: dependencies: utila "~0.4" -dom-helpers@^3.3.1, dom-helpers@^3.4.0: +dom-helpers@^3.4.0: version "3.4.0" resolved "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8" integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA== @@ -12969,13 +12061,6 @@ ejs@^3.1.2: dependencies: jake "^10.6.1" -electron-fetch@^1.4.0: - version "1.7.3" - resolved "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.3.tgz#06cf363d7f64073ec00a37e9949ec9d29ce6b08a" - integrity sha512-1AVMaxrHXTTMqd7EK0MGWusdqNr07Rpj8Th6bG4at0oNgIi/1LBwa9CjT/0Zy+M0k/tSJPS04nFxHj0SXDVgVw== - dependencies: - encoding "^0.1.13" - electron-to-chromium@^1.3.378: version "1.3.509" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.509.tgz#830fcb89cd66dc2984d18d794973b99e3f00584c" @@ -13075,7 +12160,7 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -encoding@^0.1.12, encoding@^0.1.13: +encoding@^0.1.12: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -14494,7 +13579,7 @@ fork-ts-checker-webpack-plugin@4.1.6, fork-ts-checker-webpack-plugin@^4.0.5, for tapable "^1.0.0" worker-rpc "^0.1.0" -form-data@2.5.1, form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: +form-data@^2.3.1, form-data@^2.3.2, form-data@^2.5.0: version "2.5.1" resolved "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz#f2cbec57b5e59e23716e128fe44d4e5dd23895f4" integrity sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA== @@ -16039,14 +15124,6 @@ https-proxy-agent@^2.2.1: agent-base "^4.3.0" debug "^3.1.0" -https-proxy-agent@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" - integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== - dependencies: - agent-base "5" - debug "4" - https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" @@ -16439,18 +15516,6 @@ interpret@^2.0.0, interpret@^2.2.0: resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9" integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== -intl-messageformat-parser@1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" - integrity sha1-tD1FqXRoytvkQzHXS7Ho3qRPwHU= - -intl-messageformat@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" - integrity sha1-NFvNRt5jC3aDMwwuUhd/9eq0hPw= - dependencies: - intl-messageformat-parser "1.4.0" - invariant@^2.0.0, invariant@^2.2.2, invariant@^2.2.3, invariant@^2.2.4: version "2.2.4" resolved "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -17991,11 +17056,6 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -jsonc-parser@~2.2.1: - version "2.2.1" - resolved "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" - integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== - jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -18762,7 +17822,7 @@ lodash.flattendeep@^4.0.0: resolved "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= -lodash.get@^4, lodash.get@^4.0.0, lodash.get@^4.4.2: +lodash.get@^4, lodash.get@^4.0.0: version "4.4.2" resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= @@ -19027,11 +18087,6 @@ lru-queue@^0.1.0: dependencies: es5-ext "~0.10.2" -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" - integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - lunr@^2.3.9: version "2.3.9" resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -19057,11 +18112,6 @@ macos-release@^2.2.0: resolved "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== -magic-error@^0.0.0: - version "0.0.0" - resolved "https://registry.npmjs.org/magic-error/-/magic-error-0.0.0.tgz#f8630c98c55764b4851601901fdcb63428758b7d" - integrity sha512-ZMU3ylGOb/YQEpJo0XtAXbPGmKJtwzc3cuOHPrKgosV8AAc6db8dlQYLe0cp64P3BxkYZGoUvkvdNR5JM78beA== - magic-string@^0.25.7: version "0.25.7" resolved "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -21860,13 +20910,6 @@ polished@^3.4.4: dependencies: "@babel/runtime" "^7.9.2" -polished@^4.1.1: - version "4.1.2" - resolved "https://registry.npmjs.org/polished/-/polished-4.1.2.tgz#c04fcc203e287e2d866e9cfcaf102dae1c01a816" - integrity sha512-jq4t3PJUpVRcveC53nnbEX35VyQI05x3tniwp26WFdm1dwaNUBHAi5awa/roBlwQxx1uRhwNSYeAi/aMbfiJCQ== - dependencies: - "@babel/runtime" "^7.13.17" - popper.js@1.16.1-lts: version "1.16.1-lts" resolved "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1-lts.tgz#cf6847b807da3799d80ee3d6d2f90df8a3f50b05" @@ -22717,15 +21760,6 @@ qs@~6.5.2: resolved "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -query-string@5: - version "5.1.1" - resolved "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb" - integrity sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw== - dependencies: - decode-uri-component "^0.2.0" - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - query-string@^4.1.0: version "4.3.4" resolved "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" @@ -23640,36 +22674,6 @@ readdirp@~3.5.0: dependencies: picomatch "^2.2.1" -reakit-system@^0.15.1: - version "0.15.1" - resolved "https://registry.npmjs.org/reakit-system/-/reakit-system-0.15.1.tgz#bf5cc7a03f60a817373bc9cbb4a689c1f4100547" - integrity sha512-PkqfAyEohtcEu/gUvKriCv42NywDtUgvocEN3147BI45dOFAB89nrT7wRIbIcKJiUT598F+JlPXAZZVLWhc1Kg== - dependencies: - reakit-utils "^0.15.1" - -reakit-utils@^0.15.1: - version "0.15.1" - resolved "https://registry.npmjs.org/reakit-utils/-/reakit-utils-0.15.1.tgz#797f0a43f6a1dbc22d161224d5d2272e287dbfe3" - integrity sha512-6cZgKGvOkAMQgkwU9jdYbHfkuIN1Pr+vwcB19plLvcTfVN0Or10JhIuj9X+JaPZyI7ydqTDFaKNdUcDP69o/+Q== - -reakit-warning@^0.6.1: - version "0.6.1" - resolved "https://registry.npmjs.org/reakit-warning/-/reakit-warning-0.6.1.tgz#dba33bb8866aebe30e67ac433ead707d16d38a36" - integrity sha512-poFUV0EyxB+CcV9uTNBAFmcgsnR2DzAbOTkld4Ul+QOKSeEHZB3b3+MoZQgcYHmbvG19Na1uWaM7ES+/Eyr8tQ== - dependencies: - reakit-utils "^0.15.1" - -"reakit@npm:@stoplight/reakit@~1.3.5": - version "1.3.5" - resolved "https://registry.npmjs.org/@stoplight/reakit/-/reakit-1.3.5.tgz#0c1a1ae89a92de98413d3723b993c05d943bd56b" - integrity sha512-/Con1m4eSaztckgnEPckNPMkAIcOCYku60mANTGScevY9wYk56V2L6vpv6HR4r8gsFCl4S/CVoNCVMxkxi/pGw== - dependencies: - "@popperjs/core" "^2.5.4" - body-scroll-lock "^3.1.5" - reakit-system "^0.15.1" - reakit-utils "^0.15.1" - reakit-warning "^0.6.1" - recharts-scale@^0.4.2: version "0.4.3" resolved "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.3.tgz#040b4f638ed687a530357292ecac880578384b59" @@ -24414,11 +23418,6 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -safe-stable-stringify@^1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" - integrity sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw== - "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -26567,11 +25566,6 @@ ts-jest@^26.4.3: semver "7.x" yargs-parser "20.x" -ts-keycode-enum@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/ts-keycode-enum/-/ts-keycode-enum-1.0.6.tgz#aeefd1c2fc7b0557f86a0e696e300905bbb4c1c1" - integrity sha512-DF8+Cf/FJJnPRxwz8agCoDelQXKZWQOS/gnnwx01nZ106tPJdB3BgJ9QTtLwXgR82D8O+nTjuZzWgf0Rg4vuRA== - ts-loader@^8.0.17: version "8.0.17" resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.17.tgz#98f2ccff9130074f4079fd89b946b4c637b1f2fc" @@ -27250,7 +26244,7 @@ util.promisify@1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util.promisify@1.0.1, util.promisify@^1.0.0, util.promisify@~1.0.0: +util.promisify@^1.0.0, util.promisify@~1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz#6baf7774b80eeb0f7520d8b81d07982a59abbaee" integrity sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA== @@ -27279,11 +26273,6 @@ utila@^0.4.0, utila@~0.4: resolved "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= -utility-types@^3.10.0: - version "3.10.0" - resolved "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" - integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== - utils-merge@1.0.1, utils-merge@1.x.x: version "1.0.1" resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -27844,11 +26833,6 @@ winston@^3.2.1: triple-beam "^1.3.0" winston-transport "^4.4.0" -wolfy87-eventemitter@~5.2.8: - version "5.2.9" - resolved "https://registry.npmjs.org/wolfy87-eventemitter/-/wolfy87-eventemitter-5.2.9.tgz#e879f770b30fbb6512a8afbb330c388591099c2a" - integrity sha512-P+6vtWyuDw+MB01X7UeF8TaHBvbCovf4HPEMF/SV7BdDc1SMTiBy13SRD71lQh4ExFTG1d/WNzDGDCyOKSMblw== - word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -28308,11 +27292,6 @@ z-schema@~3.18.3: optionalDependencies: commander "^2.7.1" -zalgo-promise@^1, zalgo-promise@^1.0.11, zalgo-promise@^1.0.26: - version "1.0.46" - resolved "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.46.tgz#325988d75d0be4cd63a266bad5e18f8f6cd85675" - integrity sha512-tzPpQRqaQQavxl17TY98nznvmr+judUg3My7ugsUcRDbdqisYOE2z79HNNDgXnyX3eA0mf2bMOJrqHptt00npg== - zen-observable-ts@^0.8.21: version "0.8.21" resolved "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" @@ -28358,11 +27337,6 @@ zombie@^6.1.4: tough-cookie "^2.3.4" ws "^6.1.2" -zustand@^3.3.3: - version "3.4.2" - resolved "https://registry.npmjs.org/zustand/-/zustand-3.4.2.tgz#22f0e0503a364672c6e3bb83399e69479bcea9b2" - integrity sha512-/v0RRbzi8NNyiXf7vw2eizPfJaTlTbXNM3fjQ6xF+qr5Xc0cF0ypaa0ARLOvyaKsGx/q2p5azVhfGxl4uHK0Ag== - zwitch@^1.0.0: version "1.0.5" resolved "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" From 9314a859267a1a974ba4bfff74e31bcd86d9e1c5 Mon Sep 17 00:00:00 2001 From: jrusso1020 Date: Mon, 3 May 2021 09:21:55 -0600 Subject: [PATCH 52/73] Close eventstreams upon completion Previously we were not closing eventSource's upon completion which lead to stale eventstream calls persisting across a session in the scaffolder. This calls eventSource.close() properly in order to clean up an eventStream once we get completion event Signed-off-by: jrusso1020 --- .changeset/tame-masks-juggle.md | 5 +++++ plugins/scaffolder/src/api.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/tame-masks-juggle.md diff --git a/.changeset/tame-masks-juggle.md b/.changeset/tame-masks-juggle.md new file mode 100644 index 0000000000..91ee43945a --- /dev/null +++ b/.changeset/tame-masks-juggle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Close eventSource upon completion of a scaffolder task diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index 6caa2a4446..0c5eb2b268 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -214,6 +214,7 @@ export class ScaffolderClient implements ScaffolderApi { subscriber.error(ex); } } + eventSource.close(); subscriber.complete(); }); eventSource.addEventListener('error', event => { From fd9822432d86b47a62a6a156c04a64dbf44d7785 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 17:21:57 +0100 Subject: [PATCH 53/73] Group relations by kind and namespace Signed-off-by: Will Sewell --- .../src/hooks/useRelatedEntities.ts | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/plugins/catalog-react/src/hooks/useRelatedEntities.ts b/plugins/catalog-react/src/hooks/useRelatedEntities.ts index 25d96626d7..b47d941ff6 100644 --- a/plugins/catalog-react/src/hooks/useRelatedEntities.ts +++ b/plugins/catalog-react/src/hooks/useRelatedEntities.ts @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Entity } from '@backstage/catalog-model'; +import { Entity, EntityRelation } from '@backstage/catalog-model'; import { useApi } from '@backstage/core'; -import { chunk } from 'lodash'; +import { chunk, groupBy } from 'lodash'; import { useAsync } from 'react-use'; import { catalogApiRef } from '../api'; @@ -43,25 +43,50 @@ export function useRelatedEntities( return []; } - // Make requests in separate batches to limit query string size - // (there is a `filter` param for each relation) - const relationBatches = chunk(relations, BATCH_SIZE); + // Group the relations by kind and namespace to reduce the size of the request query string. + // Without this grouping, the kind and namespace would need to be specified for each relation, e.g. + // `filter=kind=component,namespace=default,name=example1&filter=kind=component,namespace=default,name=example2` + // with grouping, we can generate a query a string like + // `filter=kind=component,namespace=default,name=example1,example2` + const relationsByKindAndNamespace: EntityRelation[][] = Object.values( + groupBy(relations, ({ target }) => { + return `${target.kind}:${target.namespace}`.toLowerCase(); + }), + ); + + // Split the names within each group into batches to further reduce the query string length. + const batchedRelationsByKindAndNamespace: { + kind: string; + namespace: string; + nameBatches: string[][]; + }[] = []; + for (const rs of relationsByKindAndNamespace) { + batchedRelationsByKindAndNamespace.push({ + // All relations in a group have the same kind and namespace, so its arbitrary which we pick + kind: rs[0].target.kind, + namespace: rs[0].target.namespace, + nameBatches: chunk( + rs.map(r => r.target.name), + BATCH_SIZE, + ), + }); + } const results = await Promise.all( - relationBatches.map(batch => { - return catalogApi.getEntities({ - filter: batch.map(({ target }) => { - return { - kind: target.kind, - 'metadata.name': target.name, - 'metadata.namespace': target.namespace, - }; - }), + batchedRelationsByKindAndNamespace.flatMap(rs => { + return rs.nameBatches.map(names => { + return catalogApi.getEntities({ + filter: { + kind: rs.kind, + 'metadata.namespace': rs.namespace, + 'metadata.name': names, + }, + }); }); }), ); - return results.map(r => r.items).flat(); + return results.flatMap(r => r.items); }, [entity, type]); return { From 4ca6998aad9767db9ccadea9a6d3a9651b5c74b1 Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Tue, 4 May 2021 02:34:24 +0200 Subject: [PATCH 54/73] Remove deprecated condition Signed-off-by: Erik Larsson --- .../src/reader/transformers/addGitFeedbackLink.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts index 5d45946238..0fc25d8cf3 100644 --- a/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts +++ b/plugins/techdocs/src/reader/transformers/addGitFeedbackLink.ts @@ -34,20 +34,12 @@ export const addGitFeedbackLink = ( if (!sourceAnchor || !sourceAnchor.href) { return dom; } - let gitHost = ''; const sourceURL = new URL(sourceAnchor.href); const integration = scmIntegrationsApi.byUrl(sourceURL); // don't show if can't identify edit link hostname as a gitlab/github hosting - if (integration?.type === 'github' || sourceURL.origin.includes('github')) { - gitHost = 'github'; - } else if ( - integration?.type === 'gitlab' || - sourceURL.origin.includes('gitlab') - ) { - gitHost = 'gitlab'; - } else { + if (integration?.type !== 'github' && integration?.type !== 'gitlab') { return dom; } @@ -61,7 +53,7 @@ export const addGitFeedbackLink = ( const repoPath = sourceURL.pathname.split('/').slice(0, 3).join('/'); const feedbackLink = sourceAnchor.cloneNode() as HTMLAnchorElement; - switch (gitHost) { + switch (integration?.type) { case 'gitlab': feedbackLink.href = `${sourceURL.origin}${repoPath}/issues/new?issue[title]=${issueTitle}&issue[description]=${issueDesc}`; break; From a3b310b7267c2ebe2d5a75c4c5e0c45da2d78fe1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 04:22:50 +0000 Subject: [PATCH 55/73] chore(deps): bump core-js from 3.11.0 to 3.11.2 Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.11.0 to 3.11.2. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.11.2/packages/core-js) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8cb2ddd221..411c911199 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10491,9 +10491,9 @@ core-js-pure@^3.0.0, core-js-pure@^3.0.1: integrity sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw== core-js@3, core-js@^3.0.1, core-js@^3.0.4, core-js@^3.5.0, core-js@^3.6.0, core-js@^3.6.5: - version "3.11.0" - resolved "https://registry.npmjs.org/core-js/-/core-js-3.11.0.tgz#05dac6aa70c0a4ad842261f8957b961d36eb8926" - integrity sha512-bd79DPpx+1Ilh9+30aT5O1sgpQd4Ttg8oqkqi51ZzhedMM1omD2e6IOF48Z/DzDCZ2svp49tN/3vneTK6ZBkXw== + version "3.11.2" + resolved "https://registry.npmjs.org/core-js/-/core-js-3.11.2.tgz#af087a43373fc6e72942917c4a4c3de43ed574d6" + integrity sha512-3tfrrO1JpJSYGKnd9LKTBPqgUES/UYiCzMKeqwR1+jF16q4kD1BY2NvqkfuzXwQ6+CIWm55V9cjD7PQd+hijdw== core-js@^2.4.0, core-js@^2.5.7, core-js@^2.6.10, core-js@^2.6.5: version "2.6.11" From 878a19f7a548c3ede499612660f615d424d1d947 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 04:26:07 +0000 Subject: [PATCH 56/73] chore(deps): bump @types/ldapjs from 1.0.9 to 1.0.10 Bumps [@types/ldapjs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ldapjs) from 1.0.9 to 1.0.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ldapjs) Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8cb2ddd221..e2cba1dfa4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6303,9 +6303,9 @@ "@types/node" "*" "@types/ldapjs@^1.0.9": - version "1.0.9" - resolved "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-1.0.9.tgz#1224192d14cc5ab5218fcea72ebb04489c52cb95" - integrity sha512-3PvY7Drp1zoLbcGlothCAkoc5o6Jp9KvUPwHadlHyKp3yPvyeIh7w2zQc9UXMzgDRkoeGXUEODtbEs5XCh9ZyA== + version "1.0.10" + resolved "https://registry.npmjs.org/@types/ldapjs/-/ldapjs-1.0.10.tgz#bac705c9e154b97d69496b5213cc28dbe9715a37" + integrity sha512-AMkMxkK/wjYtWebNH2O+rARfo7scBpW3T23g6zmGCwDgbyDbR79XWpcSqhPWdU+fChaF+I3dVyl9X2dT1CyI9w== dependencies: "@types/node" "*" From 81b609f01049ef8902bd47c405eabc33460731e1 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 30 Apr 2021 09:55:44 +0200 Subject: [PATCH 57/73] chore: test for getProcessableEntities Signed-off-by: Johan Haals --- .../DefaultProcessingDatabase.test.ts | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts index d76bd74260..ae17746799 100644 --- a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts +++ b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts @@ -514,4 +514,48 @@ describe('Default Processing Database', () => { }); }); }); + + describe('getProcessableEntities', () => { + it('should return entities to process', async () => { + const entity = JSON.stringify({ + apiVersion: '1.0.0', + metadata: { + name: 'xyz', + }, + kind: 'Location', + } as Entity); + await db('refresh_state').insert({ + entity_id: '2', + entity_ref: 'location:default/new-root', + unprocessed_entity: entity, + errors: '', + next_update_at: '2019-01-01 23:00:00', + last_discovery_at: 'now()', + }); + await db('refresh_state').insert({ + entity_id: '1', + entity_ref: 'location:default/foobar', + unprocessed_entity: entity, + errors: '', + next_update_at: '2042-01-01 23:00:00', + last_discovery_at: 'now()', + }); + + await processingDatabase.transaction(async tx => { + // request two items but only one can be processed. + const result = await processingDatabase.getProcessableEntities(tx, { + processBatchSize: 2, + }); + expect(result.items.length).toEqual(1); + expect(result.items[0].entityRef).toEqual('location:default/new-root'); + + // should not return the same item as there's nothing left to process. + await expect( + processingDatabase.getProcessableEntities(tx, { + processBatchSize: 2, + }), + ).resolves.toEqual({ items: [] }); + }); + }); + }); }); From f0f77473e0a75b45014e8a40ae5dd0d989f8eda6 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 29 Apr 2021 17:51:42 +0200 Subject: [PATCH 58/73] chore: add some more tests for TransactionValue Signed-off-by: blam --- .../src/next/Context/TransactionValue.test.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 plugins/catalog-backend/src/next/Context/TransactionValue.test.ts diff --git a/plugins/catalog-backend/src/next/Context/TransactionValue.test.ts b/plugins/catalog-backend/src/next/Context/TransactionValue.test.ts new file mode 100644 index 0000000000..97e554d0f6 --- /dev/null +++ b/plugins/catalog-backend/src/next/Context/TransactionValue.test.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2021 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 { TransactionValue } from './TransactionValue'; +import { Knex } from 'knex'; +import { BackgroundContext } from './BackgroundContext'; + +describe('TransactionValue Context', () => { + it('should be able to store tx values and retrieve them from a context', () => { + const tx = {} as Knex.Transaction; + const ctx = new BackgroundContext(); + + const nextCtx = TransactionValue.in(ctx, tx); + + expect(TransactionValue.from(nextCtx)).toBe(tx); + }); + + it('should throw when there is no tx value in the context', () => { + const ctx = new BackgroundContext(); + + expect(() => TransactionValue.from(ctx)).toThrow( + /No transaction available in context/, + ); + }); +}); From 8ecfa8e1ed494906068cbe52849d45b126309d20 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 30 Apr 2021 09:53:52 +0200 Subject: [PATCH 59/73] chore: added some moar tests for ProcessingDatabase Signed-off-by: blam --- .../DefaultProcessingDatabase.test.ts | 266 +++++++++++------- .../database/DefaultProcessingDatabase.ts | 1 + 2 files changed, 170 insertions(+), 97 deletions(-) diff --git a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts index ae17746799..46545771c0 100644 --- a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts +++ b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts @@ -23,15 +23,26 @@ import { DefaultProcessingDatabase, } from './DefaultProcessingDatabase'; -import { Entity, EntityRelationSpec } from '@backstage/catalog-model'; +import { Entity, stringifyEntityRef } from '@backstage/catalog-model'; import * as uuid from 'uuid'; import { getVoidLogger } from '@backstage/backend-common'; +import { JsonObject } from '@backstage/config'; describe('Default Processing Database', () => { let db: Knex; let processingDatabase: DefaultProcessingDatabase; const logger = getVoidLogger(); + const insertRefRow = async (ref: DbRefreshStateReferencesRow) => { + return db('refresh_state_references').insert( + ref, + ); + }; + + const insertRefreshStateRow = async (ref: DbRefreshStateRow) => { + await db('refresh_state').insert(ref); + }; + beforeEach(async () => { db = await DatabaseManager.createTestDatabaseConnection(); await DatabaseManager.createDatabase(db); @@ -39,17 +50,160 @@ describe('Default Processing Database', () => { processingDatabase = new DefaultProcessingDatabase(db, logger); }); - describe('replaceUnprocessedEntities', () => { - const insertRefRow = async (ref: DbRefreshStateReferencesRow) => { - return db('refresh_state_references').insert( - ref, + describe('updateProcessedEntity', () => { + let id: string; + let processedEntity: Entity; + + beforeEach(() => { + id = uuid.v4(); + processedEntity = { + apiVersion: '1', + kind: 'Location', + metadata: { + name: 'fakelocation', + }, + spec: { + type: 'url', + target: 'somethingelse', + }, + }; + }); + + it('fails when there is no processing state for the entity', async () => { + await processingDatabase.transaction(async tx => { + await expect(() => + processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity, + state: new Map(), + relations: [], + deferredEntities: [], + }), + ).rejects.toThrow(`Processing state not found for ${id}`); + }); + }); + + it('updates the refresh state entry with the cache, processed entity and errors', async () => { + await insertRefreshStateRow({ + entity_id: id, + entity_ref: 'location:default/fakelocation', + unprocessed_entity: '{}', + processed_entity: '{}', + errors: '', + next_update_at: 'now()', + last_discovery_at: 'now()', + }); + + const state = new Map(); + state.set('hello', { t: 'something' }); + + await processingDatabase.transaction(tx => + processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity, + state, + relations: [], + deferredEntities: [], + errors: 'something broke', + }), ); - }; - const insertRefreshStateRow = async (ref: DbRefreshStateRow) => { - await db('refresh_state').insert(ref); - }; + const [entity] = await db('refresh_state').select(); + expect(entity.processed_entity).toEqual(JSON.stringify(processedEntity)); + expect(entity.cache).toEqual(JSON.stringify(state)); + expect(entity.errors).toEqual('something broke'); + }); + + it('removes old relations and stores the new relationships', async () => { + await insertRefreshStateRow({ + entity_id: id, + entity_ref: 'location:default/fakelocation', + unprocessed_entity: '{}', + processed_entity: '{}', + errors: '', + next_update_at: 'now()', + last_discovery_at: 'now()', + }); + + const relations = [ + { + source: { + kind: 'Component', + namespace: 'Default', + name: 'foo', + }, + target: { + kind: 'Component', + namespace: 'Default', + name: 'foo', + }, + type: 'memberOf', + }, + ]; + + await processingDatabase.transaction(tx => + processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity, + state: new Map(), + relations: relations, + deferredEntities: [], + }), + ); + + const [savedRelations] = await db('relations') + .where({ originating_entity_id: id }) + .select(); + + expect(savedRelations).toEqual({ + originating_entity_id: id, + source_entity_ref: 'component:default/foo', + type: 'memberOf', + target_entity_ref: 'component:default/foo', + }); + }); + + it('adds deferred entities to the the refresh_state table to be picked up later', async () => { + await insertRefreshStateRow({ + entity_id: id, + entity_ref: 'location:default/fakelocation', + unprocessed_entity: '{}', + processed_entity: '{}', + errors: '', + next_update_at: 'now()', + last_discovery_at: 'now()', + }); + + const deferredEntities = [ + { + apiVersion: '1', + kind: 'Location', + metadata: { + name: 'next', + }, + }, + ]; + + await processingDatabase.transaction(tx => + processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity, + state: new Map(), + relations: [], + deferredEntities, + }), + ); + + const refreshStateEntries = await db('refresh_state') + .where({ entity_ref: stringifyEntityRef(deferredEntities[0]) }) + .select(); + + expect(refreshStateEntries).toHaveLength(1); + }); + }); + + describe('replaceUnprocessedEntities', () => { const createLocations = async (entityRefs: string[]) => { for (const ref of entityRefs) { await insertRefreshStateRow({ @@ -101,8 +255,8 @@ describe('Default Processing Database', () => { target_entity_ref: 'location:default/root-2', }); - await processingDatabase.transaction(async tx => { - await processingDatabase.replaceUnprocessedEntities(tx, { + await processingDatabase.transaction(tx => + processingDatabase.replaceUnprocessedEntities(tx, { type: 'full', sourceKey: 'config', items: [ @@ -114,8 +268,8 @@ describe('Default Processing Database', () => { kind: 'Location', } as Entity, ], - }); - }); + }), + ); const currentRefreshState = await db( 'refresh_state', @@ -431,90 +585,6 @@ describe('Default Processing Database', () => { }); }); - describe('updateProcessedEntity', () => { - it('should throw if the entity does not exist', async () => { - await processingDatabase.transaction(async tx => { - await expect( - processingDatabase.updateProcessedEntity(tx, { - id: '9', - processedEntity: { - apiVersion: '1.0.0', - metadata: { - name: 'new-root', - }, - kind: 'Location', - } as Entity, - deferredEntities: [], - relations: [], - }), - ).rejects.toThrow('Processing state not found for 9'); - }); - }); - - it('should update a processed entity', async () => { - await db('refresh_state').insert({ - entity_id: '321', - entity_ref: 'location:default/new-root', - unprocessed_entity: '', - errors: '', - next_update_at: 'now()', - last_discovery_at: 'now()', - }); - - const deferredEntity = { - apiVersion: '1.0.0', - metadata: { - name: 'deferred', - }, - kind: 'Location', - } as Entity; - - const relation: EntityRelationSpec = { - source: { - kind: 'Component', - namespace: 'Default', - name: 'foo', - }, - target: { - kind: 'Component', - namespace: 'Default', - name: 'foo', - }, - type: 'url', - }; - - await processingDatabase.transaction(async tx => { - await processingDatabase.updateProcessedEntity(tx, { - id: '321', - processedEntity: { - apiVersion: '1.0.0', - metadata: { - name: 'new-root', - }, - kind: 'Location', - } as Entity, - deferredEntities: [deferredEntity], - relations: [relation], - }); - }); - - const deferredResult = await db('refresh_state') - .where({ entity_ref: 'location:default/deferred' }) - .select(); - expect(deferredResult.length).toBe(1); - - const [relations] = await db('relations') - .where({ originating_entity_id: '321' }) - .select(); - expect(relations).toEqual({ - originating_entity_id: '321', - source_entity_ref: 'component:default/foo', - type: 'url', - target_entity_ref: 'component:default/foo', - }); - }); - }); - describe('getProcessableEntities', () => { it('should return entities to process', async () => { const entity = JSON.stringify({ @@ -524,6 +594,7 @@ describe('Default Processing Database', () => { }, kind: 'Location', } as Entity); + await db('refresh_state').insert({ entity_id: '2', entity_ref: 'location:default/new-root', @@ -532,6 +603,7 @@ describe('Default Processing Database', () => { next_update_at: '2019-01-01 23:00:00', last_discovery_at: 'now()', }); + await db('refresh_state').insert({ entity_id: '1', entity_ref: 'location:default/foobar', diff --git a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts index dc5e6036f5..984e7776ea 100644 --- a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts +++ b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts @@ -87,6 +87,7 @@ export class DefaultProcessingDatabase implements ProcessingDatabase { .update({ processed_entity: JSON.stringify(processedEntity), cache: JSON.stringify(state), + // TODO: should this also be JSON stringfy? errors, }) .where('entity_id', id); From 45ca6c76992fa8f86e9977222f54cdbb46a89247 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 10:53:36 +0200 Subject: [PATCH 60/73] Refactor StateManager into the ProcessingEngine And add some tests Co-authored-by: Ben Lambert Signed-off-by: Johan Haals --- packages/backend/src/plugins/catalog.ts | 2 +- .../DefaultCatalogProcessingEngine.test.ts | 95 +++++++++++++++ .../next/DefaultCatalogProcessingEngine.ts | 112 ++++++++++-------- .../src/next/DefaultProcessingStateManager.ts | 69 ----------- .../src/next/NextCatalogBuilder.ts | 5 +- plugins/catalog-backend/src/next/types.ts | 34 ------ 6 files changed, 160 insertions(+), 157 deletions(-) create mode 100644 plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts delete mode 100644 plugins/catalog-backend/src/next/DefaultProcessingStateManager.ts diff --git a/packages/backend/src/plugins/catalog.ts b/packages/backend/src/plugins/catalog.ts index e58d8cd3eb..7651836e2a 100644 --- a/packages/backend/src/plugins/catalog.ts +++ b/packages/backend/src/plugins/catalog.ts @@ -42,7 +42,7 @@ export default async function createPlugin( } = await builder.build(); // TODO(jhaals): run and manage in background. - processingEngine.start(); + await processingEngine.start(); return await createRouter({ entitiesCatalog, diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts new file mode 100644 index 0000000000..68ae8150d1 --- /dev/null +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts @@ -0,0 +1,95 @@ +/* + * Copyright 2021 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 { DefaultProcessingDatabase } from './database/DefaultProcessingDatabase'; + +import { DefaultCatalogProcessingEngine } from './DefaultCatalogProcessingEngine'; +import { Stitcher } from './Stitcher'; +import { CatalogProcessingOrchestrator } from './types'; + +describe('DefaultCatalogProcessingEngine', () => { + const db = ({ + transaction: jest.fn(), + getProcessableEntities: jest.fn(), + updateProcessedEntity: jest.fn(), + } as unknown) as jest.Mocked; + const orchestrator: jest.Mocked = { + process: jest.fn(), + }; + const stitcher = ({ + stitch: jest.fn(), + } as unknown) as jest.Mocked; + + beforeEach(() => { + jest.resetAllMocks(); + }); + it('should process stuff', async () => { + orchestrator.process.mockResolvedValue({ + ok: true, + completedEntity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + relations: [], + errors: [], + deferredEntities: [], + state: new Map(), + }); + const engine = new DefaultCatalogProcessingEngine( + getVoidLogger(), + [], + db, + orchestrator, + stitcher, + ); + + db.transaction.mockImplementation(cb => cb((() => {}) as any)); + + db.getProcessableEntities + .mockImplementation(async () => { + await engine.stop(); + return { items: [] }; + }) + .mockResolvedValueOnce({ + items: [ + { + entityRef: 'foo', + id: '1', + unprocessedEntity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + state: new Map(), + nextUpdateAt: '', + lastDiscoveryAt: '', + }, + ], + }); + + await engine.start(); + await new Promise(resolve => setTimeout(resolve, 1)); + expect(orchestrator.process).toBeCalledTimes(1); + expect(orchestrator.process).toBeCalledWith({ + entity: { apiVersion: '1', kind: 'Location', metadata: { name: 'test' } }, + state: expect.anything(), + }); + + await engine.stop(); + }); +}); diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts index e724fe79d8..c8c49e4bd9 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts @@ -16,6 +16,7 @@ import { stringifyEntityRef } from '@backstage/catalog-model'; import { Logger } from 'winston'; +import { ProcessingDatabase } from './database/types'; import { Stitcher } from './Stitcher'; import { CatalogProcessingEngine, @@ -23,44 +24,46 @@ import { EntityProvider, EntityProviderConnection, EntityProviderMutation, - ProcessingStateManager, } from './types'; class Connection implements EntityProviderConnection { constructor( private readonly config: { - stateManager: ProcessingStateManager; + processingDatabase: ProcessingDatabase; id: string; }, ) {} async applyMutation(mutation: EntityProviderMutation): Promise { + const db = this.config.processingDatabase; if (mutation.type === 'full') { - await this.config.stateManager.replaceProcessingItems({ - sourceKey: this.config.id, - type: 'full', - items: mutation.entities, + db.transaction(async tx => { + await db.replaceUnprocessedEntities(tx, { + sourceKey: this.config.id, + type: 'full', + items: mutation.entities, + }); }); - return; } - - await this.config.stateManager.replaceProcessingItems({ - sourceKey: this.config.id, - type: 'delta', - added: mutation.added, - removed: mutation.removed, + db.transaction(async tx => { + await db.replaceUnprocessedEntities(tx, { + sourceKey: this.config.id, + type: 'delta', + added: mutation.added, + removed: mutation.removed, + }); }); } } export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { - private running: boolean = false; + private running = false; constructor( private readonly logger: Logger, private readonly entityProviders: EntityProvider[], - private readonly stateManager: ProcessingStateManager, + private readonly processingDatabase: ProcessingDatabase, private readonly orchestrator: CatalogProcessingOrchestrator, private readonly stitcher: Stitcher, ) {} @@ -69,51 +72,60 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { for (const provider of this.entityProviders) { await provider.connect( new Connection({ - stateManager: this.stateManager, + processingDatabase: this.processingDatabase, id: provider.getProviderName(), }), ); } - this.running = true; + this.run(); + } + private async run() { while (this.running) { - const { - id, - entity, - state: initialState, - } = await this.stateManager.getNextProcessingItem(); - - const result = await this.orchestrator.process({ - entity, - state: initialState, + const { items } = await this.processingDatabase.transaction(async tx => { + return this.processingDatabase.getProcessableEntities(tx, { + processBatchSize: 1, + }); }); - for (const error of result.errors) { - this.logger.warn(error.message); + if (items.length) { + const { id, state, unprocessedEntity } = items[0]; + + const result = await this.orchestrator.process({ + entity: unprocessedEntity, + state, + }); + for (const error of result.errors) { + this.logger.warn(error.message); + } + if (!result.ok) { + return; + } + + result.completedEntity.metadata.uid = id; + await this.processingDatabase.transaction(async tx => { + await this.processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity: result.completedEntity, + state: result.state, + errors: JSON.stringify(result.errors), + relations: result.relations, + deferredEntities: result.deferredEntities, + }); + }); + + const setOfThingsToStitch = new Set([ + stringifyEntityRef(result.completedEntity), + ...result.relations.map(relation => + stringifyEntityRef(relation.source), + ), + ]); + await this.stitcher.stitch(setOfThingsToStitch); + } else { + // Wait one second before fetching next item. + await new Promise(resolve => setTimeout(resolve, 1000)); } - - if (!result.ok) { - return; - } - - result.completedEntity.metadata.uid = id; - await this.stateManager.setProcessingItemResult({ - id, - entity: result.completedEntity, - state: result.state, - errors: result.errors, - relations: result.relations, - deferredEntities: result.deferredEntities, - }); - - const setOfThingsToStitch = new Set([ - stringifyEntityRef(result.completedEntity), - ...result.relations.map(relation => - stringifyEntityRef(relation.source), - ), - ]); - await this.stitcher.stitch(setOfThingsToStitch); } } diff --git a/plugins/catalog-backend/src/next/DefaultProcessingStateManager.ts b/plugins/catalog-backend/src/next/DefaultProcessingStateManager.ts deleted file mode 100644 index 9c1d20ae9c..0000000000 --- a/plugins/catalog-backend/src/next/DefaultProcessingStateManager.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2021 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 { ProcessingDatabase } from './database/types'; -import { - ProcessingItem, - ProcessingItemResult, - ProcessingStateManager, - ReplaceProcessingItemsRequest, -} from './types'; - -export class DefaultProcessingStateManager implements ProcessingStateManager { - constructor(private readonly db: ProcessingDatabase) {} - - replaceProcessingItems( - request: ReplaceProcessingItemsRequest, - ): Promise { - return this.db.transaction(async tx => { - await this.db.replaceUnprocessedEntities(tx, request); - }); - } - - async setProcessingItemResult(result: ProcessingItemResult) { - return this.db.transaction(async tx => { - await this.db.updateProcessedEntity(tx, { - id: result.id, - processedEntity: result.entity, - errors: JSON.stringify(result.errors), - state: result.state, - relations: result.relations, - deferredEntities: result.deferredEntities, - }); - }); - } - - async getNextProcessingItem(): Promise { - for (;;) { - const { items } = await this.db.transaction(async tx => { - return this.db.getProcessableEntities(tx, { - processBatchSize: 1, - }); - }); - - if (items.length) { - const { id, state, unprocessedEntity } = items[0]; - return { - id, - entity: unprocessedEntity, - state, - }; - } - - await new Promise(resolve => setTimeout(resolve, 1000)); - } - } -} diff --git a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts index 10500fdc15..dc09013964 100644 --- a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts +++ b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts @@ -69,7 +69,6 @@ import { DefaultProcessingDatabase } from './database/DefaultProcessingDatabase' import { DefaultCatalogProcessingEngine } from './DefaultCatalogProcessingEngine'; import { DefaultCatalogProcessingOrchestrator } from './DefaultCatalogProcessingOrchestrator'; import { DefaultLocationStore } from './DefaultLocationStore'; -import { DefaultProcessingStateManager } from './DefaultProcessingStateManager'; import { NextEntitiesCatalog } from './NextEntitiesCatalog'; import { Stitcher } from './Stitcher'; @@ -252,7 +251,7 @@ export class NextCatalogBuilder { const db = new CommonDatabase(dbClient, logger); const processingDatabase = new DefaultProcessingDatabase(dbClient, logger); - const stateManager = new DefaultProcessingStateManager(processingDatabase); + // const stateManager = new DefaultProcessingStateManager(processingDatabase); const integrations = ScmIntegrations.fromConfig(config); const orchestrator = new DefaultCatalogProcessingOrchestrator({ processors, @@ -269,7 +268,7 @@ export class NextCatalogBuilder { const processingEngine = new DefaultCatalogProcessingEngine( logger, [locationStore, configLocationProvider], - stateManager, + processingDatabase, orchestrator, stitcher, ); diff --git a/plugins/catalog-backend/src/next/types.ts b/plugins/catalog-backend/src/next/types.ts index 202576fddd..410066eafd 100644 --- a/plugins/catalog-backend/src/next/types.ts +++ b/plugins/catalog-backend/src/next/types.ts @@ -80,37 +80,3 @@ export type EntityProcessingResult = export interface CatalogProcessingOrchestrator { process(request: EntityProcessingRequest): Promise; } - -export type ProcessingItemResult = { - id: string; - entity: Entity; - state: Map; - errors: Error[]; - relations: EntityRelationSpec[]; - deferredEntities: Entity[]; -}; - -export type ProcessingItem = { - id: string; - entity: Entity; - state: Map; -}; - -export type ReplaceProcessingItemsRequest = - | { - sourceKey: string; - items: Entity[]; - type: 'full'; - } - | { - sourceKey: string; - added: Entity[]; - removed: Entity[]; - type: 'delta'; - }; - -export interface ProcessingStateManager { - setProcessingItemResult(result: ProcessingItemResult): Promise; - getNextProcessingItem(): Promise; - replaceProcessingItems(request: ReplaceProcessingItemsRequest): Promise; -} From 0bd4dfa9d2c1de30ab54a038393466b7b3b59d8a Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 13:52:05 +0200 Subject: [PATCH 61/73] Fix review comments Signed-off-by: Johan Haals --- .../DefaultProcessingDatabase.test.ts | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts index 46545771c0..7a0094dbf0 100644 --- a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts +++ b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.test.ts @@ -89,9 +89,9 @@ describe('Default Processing Database', () => { entity_ref: 'location:default/fakelocation', unprocessed_entity: '{}', processed_entity: '{}', - errors: '', - next_update_at: 'now()', - last_discovery_at: 'now()', + errors: '[]', + next_update_at: '2021-04-01 13:37:00', + last_discovery_at: '2021-04-01 13:37:00', }); const state = new Map(); @@ -104,15 +104,17 @@ describe('Default Processing Database', () => { state, relations: [], deferredEntities: [], - errors: 'something broke', + errors: "['something broke']", }), ); - const [entity] = await db('refresh_state').select(); - - expect(entity.processed_entity).toEqual(JSON.stringify(processedEntity)); - expect(entity.cache).toEqual(JSON.stringify(state)); - expect(entity.errors).toEqual('something broke'); + const entities = await db('refresh_state').select(); + expect(entities.length).toBe(1); + expect(entities[0].processed_entity).toEqual( + JSON.stringify(processedEntity), + ); + expect(entities[0].cache).toEqual(JSON.stringify(state)); + expect(entities[0].errors).toEqual("['something broke']"); }); it('removes old relations and stores the new relationships', async () => { @@ -121,9 +123,9 @@ describe('Default Processing Database', () => { entity_ref: 'location:default/fakelocation', unprocessed_entity: '{}', processed_entity: '{}', - errors: '', - next_update_at: 'now()', - last_discovery_at: 'now()', + errors: '[]', + next_update_at: '2021-04-01 13:37:00', + last_discovery_at: '2021-04-01 13:37:00', }); const relations = [ @@ -152,11 +154,11 @@ describe('Default Processing Database', () => { }), ); - const [savedRelations] = await db('relations') + const savedRelations = await db('relations') .where({ originating_entity_id: id }) .select(); - - expect(savedRelations).toEqual({ + expect(savedRelations.length).toBe(1); + expect(savedRelations[0]).toEqual({ originating_entity_id: id, source_entity_ref: 'component:default/foo', type: 'memberOf', @@ -170,9 +172,9 @@ describe('Default Processing Database', () => { entity_ref: 'location:default/fakelocation', unprocessed_entity: '{}', processed_entity: '{}', - errors: '', - next_update_at: 'now()', - last_discovery_at: 'now()', + errors: '[]', + next_update_at: '2021-04-01 13:37:00', + last_discovery_at: '2021-04-01 13:37:00', }); const deferredEntities = [ @@ -211,9 +213,9 @@ describe('Default Processing Database', () => { entity_ref: ref, unprocessed_entity: '{}', processed_entity: '{}', - errors: '', - next_update_at: 'now()', - last_discovery_at: 'now()', + errors: '[]', + next_update_at: '2021-04-01 13:37:00', + last_discovery_at: '2021-04-01 13:37:00', }); } }; @@ -588,29 +590,29 @@ describe('Default Processing Database', () => { describe('getProcessableEntities', () => { it('should return entities to process', async () => { const entity = JSON.stringify({ + kind: 'Location', apiVersion: '1.0.0', metadata: { name: 'xyz', }, - kind: 'Location', } as Entity); await db('refresh_state').insert({ entity_id: '2', entity_ref: 'location:default/new-root', unprocessed_entity: entity, - errors: '', + errors: '[]', next_update_at: '2019-01-01 23:00:00', - last_discovery_at: 'now()', + last_discovery_at: '2021-04-01 13:37:00', }); await db('refresh_state').insert({ entity_id: '1', entity_ref: 'location:default/foobar', unprocessed_entity: entity, - errors: '', + errors: '[]', next_update_at: '2042-01-01 23:00:00', - last_discovery_at: 'now()', + last_discovery_at: '2021-04-01 13:37:00', }); await processingDatabase.transaction(async tx => { From 852b6bec95871b735cf2aacec3b8228a329dc7c0 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 14:13:25 +0200 Subject: [PATCH 62/73] Wrap test in waitForExpect Signed-off-by: Johan Haals --- plugins/catalog-backend/package.json | 3 ++- .../next/DefaultCatalogProcessingEngine.test.ts | 17 +++++++++++------ yarn.lock | 16 +++++++++++++--- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index 7649067a44..99df0acd09 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -73,7 +73,8 @@ "@types/yup": "^0.29.8", "msw": "^0.21.2", "sqlite3": "^5.0.0", - "supertest": "^6.1.3" + "supertest": "^6.1.3", + "wait-for-expect": "^3.0.2" }, "files": [ "dist", diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts index 68ae8150d1..b6363a697d 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts @@ -20,6 +20,7 @@ import { DefaultProcessingDatabase } from './database/DefaultProcessingDatabase' import { DefaultCatalogProcessingEngine } from './DefaultCatalogProcessingEngine'; import { Stitcher } from './Stitcher'; import { CatalogProcessingOrchestrator } from './types'; +import waitForExpect from 'wait-for-expect'; describe('DefaultCatalogProcessingEngine', () => { const db = ({ @@ -83,13 +84,17 @@ describe('DefaultCatalogProcessingEngine', () => { }); await engine.start(); - await new Promise(resolve => setTimeout(resolve, 1)); - expect(orchestrator.process).toBeCalledTimes(1); - expect(orchestrator.process).toBeCalledWith({ - entity: { apiVersion: '1', kind: 'Location', metadata: { name: 'test' } }, - state: expect.anything(), + await waitForExpect(() => { + expect(orchestrator.process).toBeCalledTimes(1); + expect(orchestrator.process).toBeCalledWith({ + entity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + state: expect.anything(), + }); }); - await engine.stop(); }); }); diff --git a/yarn.lock b/yarn.lock index bffef20f24..4d3c45ab5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14482,7 +14482,7 @@ graphql-extensions@^0.12.8: apollo-server-env "^3.0.0" apollo-server-types "^0.6.3" -graphql-language-service-interface@2.8.2, graphql-language-service-interface@^2.8.2: +graphql-language-service-interface@^2.8.2: version "2.8.2" resolved "https://registry.npmjs.org/graphql-language-service-interface/-/graphql-language-service-interface-2.8.2.tgz#b3bb2aef7eaf0dff0b4ea419fa412c5f66fa268b" integrity sha512-otbOQmhgkAJU1QJgQkMztNku6SbJLu/uodoFOYOOtJsizTjrMs93vkYaHCcYnLA3oi1Goj27XcHjMnRCYQOZXQ== @@ -14492,7 +14492,7 @@ graphql-language-service-interface@2.8.2, graphql-language-service-interface@^2. graphql-language-service-utils "^2.5.1" vscode-languageserver-types "^3.15.1" -graphql-language-service-parser@1.9.0, graphql-language-service-parser@^1.9.0: +graphql-language-service-parser@^1.9.0: version "1.9.0" resolved "https://registry.npmjs.org/graphql-language-service-parser/-/graphql-language-service-parser-1.9.0.tgz#79af21294119a0a7e81b6b994a1af36833bab724" integrity sha512-B5xPZLbBmIp0kHvpY1Z35I5DtPoDK9wGxQVRDIzcBaiIvAmlTrDvjo3bu7vKREdjFbYKvWNgrEWENuprMbF17Q== @@ -25796,11 +25796,16 @@ typescript-json-schema@^0.49.0: typescript "^4.1.3" yargs "^16.2.0" -typescript@^4.0.3, typescript@^4.1.3, typescript@~4.1.3: +typescript@^4.0.3, typescript@^4.1.3: version "4.2.3" resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3" integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw== +typescript@~4.1.3: + version "4.1.5" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" + integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== + ua-parser-js@^0.7.18: version "0.7.21" resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" @@ -26444,6 +26449,11 @@ w3c-xmlserializer@^2.0.0: dependencies: xml-name-validator "^3.0.0" +wait-for-expect@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/wait-for-expect/-/wait-for-expect-3.0.2.tgz#d2f14b2f7b778c9b82144109c8fa89ceaadaa463" + integrity sha512-cfS1+DZxuav1aBYbaO/kE06EOS8yRw7qOFoD3XtjTkYvCvh3zUvNST8DXK/nPaeqIzIv3P3kL3lRJn8iwOiSag== + wait-on@5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/wait-on/-/wait-on-5.3.0.tgz#584e17d4b3fe7b46ac2b9f8e5e102c005c2776c7" From fe84fb2fdcb355ad2e63c83d09add0b8ef9f1bc2 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 14:14:57 +0200 Subject: [PATCH 63/73] Await transactions Signed-off-by: Johan Haals --- .../src/next/DefaultCatalogProcessingEngine.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts index c8c49e4bd9..6bee54f153 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts @@ -37,7 +37,7 @@ class Connection implements EntityProviderConnection { async applyMutation(mutation: EntityProviderMutation): Promise { const db = this.config.processingDatabase; if (mutation.type === 'full') { - db.transaction(async tx => { + await db.transaction(async tx => { await db.replaceUnprocessedEntities(tx, { sourceKey: this.config.id, type: 'full', @@ -46,7 +46,7 @@ class Connection implements EntityProviderConnection { }); return; } - db.transaction(async tx => { + await db.transaction(async tx => { await db.replaceUnprocessedEntities(tx, { sourceKey: this.config.id, type: 'delta', From e9d61bcbeba2d202be39b456e3ed46640ad1a91c Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 14:30:40 +0200 Subject: [PATCH 64/73] Ensure that processing continues despite errors Co-authored-by: Ben Lambert Signed-off-by: Johan Haals --- .../DefaultCatalogProcessingEngine.test.ts | 61 ++++++++++++ .../next/DefaultCatalogProcessingEngine.ts | 97 +++++++++++-------- 2 files changed, 118 insertions(+), 40 deletions(-) diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts index b6363a697d..376af6e748 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.test.ts @@ -97,4 +97,65 @@ describe('DefaultCatalogProcessingEngine', () => { }); await engine.stop(); }); + + it('should process stuff even if the first attempt fail', async () => { + orchestrator.process.mockResolvedValue({ + ok: true, + completedEntity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + relations: [], + errors: [], + deferredEntities: [], + state: new Map(), + }); + const engine = new DefaultCatalogProcessingEngine( + getVoidLogger(), + [], + db, + orchestrator, + stitcher, + ); + + db.transaction.mockImplementation(cb => cb((() => {}) as any)); + + db.getProcessableEntities + .mockImplementation(async () => { + await engine.stop(); + return { items: [] }; + }) + .mockRejectedValueOnce(new Error('I FAILED')) + .mockResolvedValueOnce({ + items: [ + { + entityRef: 'foo', + id: '1', + unprocessedEntity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + state: new Map(), + nextUpdateAt: '', + lastDiscoveryAt: '', + }, + ], + }); + + await engine.start(); + await waitForExpect(() => { + expect(orchestrator.process).toBeCalledTimes(1); + expect(orchestrator.process).toBeCalledWith({ + entity: { + apiVersion: '1', + kind: 'Location', + metadata: { name: 'test' }, + }, + state: expect.anything(), + }); + }); + await engine.stop(); + }); }); diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts index 6bee54f153..877c3075aa 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts @@ -83,52 +83,69 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { private async run() { while (this.running) { - const { items } = await this.processingDatabase.transaction(async tx => { - return this.processingDatabase.getProcessableEntities(tx, { - processBatchSize: 1, + try { + // TODO: We want to disconnect the queue popping and message processing + // so that if the queue popping fails we exponentially back off in order to give the DB room to sort itself out. + await this.process(); + } catch (e) { + this.logger.warn('Processing failed with:', e); + // TODO: this can be a little smarter as mentioned in the above comment. + // But for now, if something fails, wait a brief time to pick up the next message. + await this.wait(); + } + } + } + + private async process() { + const { items } = await this.processingDatabase.transaction(async tx => { + return this.processingDatabase.getProcessableEntities(tx, { + processBatchSize: 1, + }); + }); + + if (items.length) { + const { id, state, unprocessedEntity } = items[0]; + + const result = await this.orchestrator.process({ + entity: unprocessedEntity, + state, + }); + for (const error of result.errors) { + this.logger.warn(error.message); + } + if (!result.ok) { + return; + } + + result.completedEntity.metadata.uid = id; + await this.processingDatabase.transaction(async tx => { + await this.processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity: result.completedEntity, + state: result.state, + errors: JSON.stringify(result.errors), + relations: result.relations, + deferredEntities: result.deferredEntities, }); }); - if (items.length) { - const { id, state, unprocessedEntity } = items[0]; - - const result = await this.orchestrator.process({ - entity: unprocessedEntity, - state, - }); - for (const error of result.errors) { - this.logger.warn(error.message); - } - if (!result.ok) { - return; - } - - result.completedEntity.metadata.uid = id; - await this.processingDatabase.transaction(async tx => { - await this.processingDatabase.updateProcessedEntity(tx, { - id, - processedEntity: result.completedEntity, - state: result.state, - errors: JSON.stringify(result.errors), - relations: result.relations, - deferredEntities: result.deferredEntities, - }); - }); - - const setOfThingsToStitch = new Set([ - stringifyEntityRef(result.completedEntity), - ...result.relations.map(relation => - stringifyEntityRef(relation.source), - ), - ]); - await this.stitcher.stitch(setOfThingsToStitch); - } else { - // Wait one second before fetching next item. - await new Promise(resolve => setTimeout(resolve, 1000)); - } + const setOfThingsToStitch = new Set([ + stringifyEntityRef(result.completedEntity), + ...result.relations.map(relation => + stringifyEntityRef(relation.source), + ), + ]); + await this.stitcher.stitch(setOfThingsToStitch); + } else { + // No items to process, wait and try again. + await this.wait(); } } + private async wait() { + await new Promise(resolve => setTimeout(resolve, 1000)); + } + async stop() { this.running = false; } From cd33a8cd26b95182eedc8e274a61686f00fbc9bb Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 14:42:06 +0200 Subject: [PATCH 65/73] Reduce if block Signed-off-by: Johan Haals --- .../next/DefaultCatalogProcessingEngine.ts | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts index 877c3075aa..55cb8e2029 100644 --- a/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts +++ b/plugins/catalog-backend/src/next/DefaultCatalogProcessingEngine.ts @@ -103,43 +103,42 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { }); }); - if (items.length) { - const { id, state, unprocessedEntity } = items[0]; - - const result = await this.orchestrator.process({ - entity: unprocessedEntity, - state, - }); - for (const error of result.errors) { - this.logger.warn(error.message); - } - if (!result.ok) { - return; - } - - result.completedEntity.metadata.uid = id; - await this.processingDatabase.transaction(async tx => { - await this.processingDatabase.updateProcessedEntity(tx, { - id, - processedEntity: result.completedEntity, - state: result.state, - errors: JSON.stringify(result.errors), - relations: result.relations, - deferredEntities: result.deferredEntities, - }); - }); - - const setOfThingsToStitch = new Set([ - stringifyEntityRef(result.completedEntity), - ...result.relations.map(relation => - stringifyEntityRef(relation.source), - ), - ]); - await this.stitcher.stitch(setOfThingsToStitch); - } else { + if (!items.length) { // No items to process, wait and try again. await this.wait(); + return; } + + const { id, state, unprocessedEntity } = items[0]; + + const result = await this.orchestrator.process({ + entity: unprocessedEntity, + state, + }); + for (const error of result.errors) { + this.logger.warn(error.message); + } + if (!result.ok) { + return; + } + + result.completedEntity.metadata.uid = id; + await this.processingDatabase.transaction(async tx => { + await this.processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity: result.completedEntity, + state: result.state, + errors: JSON.stringify(result.errors), + relations: result.relations, + deferredEntities: result.deferredEntities, + }); + }); + + const setOfThingsToStitch = new Set([ + stringifyEntityRef(result.completedEntity), + ...result.relations.map(relation => stringifyEntityRef(relation.source)), + ]); + await this.stitcher.stitch(setOfThingsToStitch); } private async wait() { From cb10731dfa13c558e68ed3a85dc8e107c32a770b Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 14:54:57 +0200 Subject: [PATCH 66/73] Drop references to deleted code Signed-off-by: Johan Haals --- plugins/catalog-backend/src/next/NextCatalogBuilder.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts index dc09013964..0158cc9fc9 100644 --- a/plugins/catalog-backend/src/next/NextCatalogBuilder.ts +++ b/plugins/catalog-backend/src/next/NextCatalogBuilder.ts @@ -251,7 +251,6 @@ export class NextCatalogBuilder { const db = new CommonDatabase(dbClient, logger); const processingDatabase = new DefaultProcessingDatabase(dbClient, logger); - // const stateManager = new DefaultProcessingStateManager(processingDatabase); const integrations = ScmIntegrations.fromConfig(config); const orchestrator = new DefaultCatalogProcessingOrchestrator({ processors, From 641d36b148b1dab696ce144611f9d97466aef4d9 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 3 May 2021 15:47:30 +0200 Subject: [PATCH 67/73] chore: delete todo comment Signed-off-by: Johan Haals --- .../src/next/database/DefaultProcessingDatabase.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts index 984e7776ea..dc5e6036f5 100644 --- a/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts +++ b/plugins/catalog-backend/src/next/database/DefaultProcessingDatabase.ts @@ -87,7 +87,6 @@ export class DefaultProcessingDatabase implements ProcessingDatabase { .update({ processed_entity: JSON.stringify(processedEntity), cache: JSON.stringify(state), - // TODO: should this also be JSON stringfy? errors, }) .where('entity_id', id); From bfe77a9dbdea852780b6b1ead6aa1bb0d3e7615b Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Tue, 4 May 2021 09:41:06 +0200 Subject: [PATCH 68/73] fix yarn lock Signed-off-by: Johan Haals --- yarn.lock | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4d3c45ab5e..f778b2d5cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14482,7 +14482,7 @@ graphql-extensions@^0.12.8: apollo-server-env "^3.0.0" apollo-server-types "^0.6.3" -graphql-language-service-interface@^2.8.2: +graphql-language-service-interface@2.8.2, graphql-language-service-interface@^2.8.2: version "2.8.2" resolved "https://registry.npmjs.org/graphql-language-service-interface/-/graphql-language-service-interface-2.8.2.tgz#b3bb2aef7eaf0dff0b4ea419fa412c5f66fa268b" integrity sha512-otbOQmhgkAJU1QJgQkMztNku6SbJLu/uodoFOYOOtJsizTjrMs93vkYaHCcYnLA3oi1Goj27XcHjMnRCYQOZXQ== @@ -14492,7 +14492,7 @@ graphql-language-service-interface@^2.8.2: graphql-language-service-utils "^2.5.1" vscode-languageserver-types "^3.15.1" -graphql-language-service-parser@^1.9.0: +graphql-language-service-parser@1.9.0, graphql-language-service-parser@^1.9.0: version "1.9.0" resolved "https://registry.npmjs.org/graphql-language-service-parser/-/graphql-language-service-parser-1.9.0.tgz#79af21294119a0a7e81b6b994a1af36833bab724" integrity sha512-B5xPZLbBmIp0kHvpY1Z35I5DtPoDK9wGxQVRDIzcBaiIvAmlTrDvjo3bu7vKREdjFbYKvWNgrEWENuprMbF17Q== @@ -25796,16 +25796,11 @@ typescript-json-schema@^0.49.0: typescript "^4.1.3" yargs "^16.2.0" -typescript@^4.0.3, typescript@^4.1.3: +typescript@^4.0.3, typescript@^4.1.3, typescript@~4.1.3: version "4.2.3" resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3" integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw== -typescript@~4.1.3: - version "4.1.5" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.1.5.tgz#123a3b214aaff3be32926f0d8f1f6e704eb89a72" - integrity sha512-6OSu9PTIzmn9TCDiovULTnET6BgXtDYL4Gg4szY+cGsc3JP1dQL8qvE8kShTRx1NIw4Q9IBHlwODjkjWEtMUyA== - ua-parser-js@^0.7.18: version "0.7.21" resolved "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz#853cf9ce93f642f67174273cc34565ae6f308777" From 4dcab641852281818cabc669c0cb693c975efde2 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Mon, 3 May 2021 18:49:15 +0100 Subject: [PATCH 69/73] Update test mocks to expect call to `getEntities` Signed-off-by: Will Sewell --- .../ApisCards/ConsumedApisCard.test.tsx | 20 +++++++++++-------- .../components/ApisCards/HasApisCard.test.tsx | 20 +++++++++++-------- .../ApisCards/ProvidedApisCard.test.tsx | 20 +++++++++++-------- .../ConsumingComponentsCard.test.tsx | 20 +++++++++++-------- .../ProvidingComponentsCard.test.tsx | 20 +++++++++++-------- .../HasComponentsCard.test.tsx | 20 +++++++++++-------- .../HasSubcomponentsCard.test.tsx | 20 +++++++++++-------- .../HasSystemsCard/HasSystemsCard.test.tsx | 20 +++++++++++-------- 8 files changed, 96 insertions(+), 64 deletions(-) diff --git a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx index b157e898ca..fa956cd042 100644 --- a/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ConsumedApisCard.test.tsx @@ -96,14 +96,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'API', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'API', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx index 5db3ec2b48..e721f6e918 100644 --- a/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/HasApisCard.test.tsx @@ -96,14 +96,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'API', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'API', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx index bb9b2e60d9..67d95605e4 100644 --- a/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx +++ b/plugins/api-docs/src/components/ApisCards/ProvidedApisCard.test.tsx @@ -96,14 +96,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'API', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'API', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx index 7944b3f90a..104b360ff6 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ConsumingComponentsCard.test.tsx @@ -101,14 +101,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'Component', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'Component', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx index ab1751b9ba..c7c6bacc84 100644 --- a/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx +++ b/plugins/api-docs/src/components/ComponentsCards/ProvidingComponentsCard.test.tsx @@ -101,14 +101,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'Component', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'Component', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx b/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx index 58df0a53f8..8e0a61b05a 100644 --- a/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx +++ b/plugins/catalog/src/components/HasComponentsCard/HasComponentsCard.test.tsx @@ -91,14 +91,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'Component', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'Component', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx b/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx index 79b69d35ff..9ad69c9a0c 100644 --- a/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx +++ b/plugins/catalog/src/components/HasSubcomponentsCard/HasSubcomponentsCard.test.tsx @@ -91,14 +91,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'Component', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'Component', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( diff --git a/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx b/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx index 08923a59c8..9b7fb0adae 100644 --- a/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx +++ b/plugins/catalog/src/components/HasSystemsCard/HasSystemsCard.test.tsx @@ -89,14 +89,18 @@ describe('', () => { }, ], }; - catalogApi.getEntityByName.mockResolvedValue({ - apiVersion: 'v1', - kind: 'System', - metadata: { - name: 'target-name', - namespace: 'my-namespace', - }, - spec: {}, + catalogApi.getEntities.mockResolvedValue({ + items: [ + { + apiVersion: 'v1', + kind: 'System', + metadata: { + name: 'target-name', + namespace: 'my-namespace', + }, + spec: {}, + }, + ], }); const { getByText } = await renderInTestApp( From 75c8cec394fff82850d53e5e8f729c5dd1211f40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 04:20:01 +0000 Subject: [PATCH 70/73] chore(deps): bump jsonschema from 1.2.7 to 1.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [jsonschema](https://github.com/tdegrunt/jsonschema) from 1.2.7 to 1.4.0. - [Release notes](https://github.com/tdegrunt/jsonschema/releases) - [Commits](https://github.com/tdegrunt/jsonschema/compare/v1.2.7...v1.4.0) Signed-off-by: dependabot[bot] Signed-off-by: Fredrik Adelöw --- .changeset/small-sheep-smoke.md | 5 +++++ .../scaffolder-backend/src/scaffolder/tasks/TaskWorker.ts | 7 ++++--- yarn.lock | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .changeset/small-sheep-smoke.md diff --git a/.changeset/small-sheep-smoke.md b/.changeset/small-sheep-smoke.md new file mode 100644 index 0000000000..9cff7591ee --- /dev/null +++ b/.changeset/small-sheep-smoke.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +bump jsonschema from 1.2.7 to 1.4.0 diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/TaskWorker.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/TaskWorker.ts index 9e4deab31a..1d0d5ad3a3 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/TaskWorker.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/TaskWorker.ts @@ -143,9 +143,10 @@ export class TaskWorker { }); if (action.schema?.input) { - const validateResult = validateJsonSchema(input, action.schema, { - propertyName: 'input', - }); + const validateResult = validateJsonSchema( + input, + action.schema.input, + ); if (!validateResult.valid) { const errors = validateResult.errors.join(', '); throw new InputError( diff --git a/yarn.lock b/yarn.lock index 8cb2ddd221..b7bff9836d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17100,9 +17100,9 @@ jsonpointer@^4.0.1: integrity sha1-T9kss04OnbPInIYi7PUfm5eMbLk= jsonschema@^1.2.6: - version "1.2.7" - resolved "https://registry.npmjs.org/jsonschema/-/jsonschema-1.2.7.tgz#4e6d6dc4d83dc80707055ba22c00ec6152c0e6e9" - integrity sha512-3dFMg9hmI9LdHag/BRIhMefCfbq1hicvYMy8YhZQorAdzOzWz7NjniSpn39yjpzUAMIWtGyyZuH2KNBloH7ZLw== + version "1.4.0" + resolved "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2" + integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw== jsonwebtoken@^8.5.1: version "8.5.1" From c199090e31bbf2b03c09697725e2a673e1afde05 Mon Sep 17 00:00:00 2001 From: Marco Crivellaro Date: Tue, 4 May 2021 12:03:52 +0100 Subject: [PATCH 71/73] adding steps to enable plantuml support in github workflow Signed-off-by: Marco Crivellaro --- docs/features/techdocs/configuring-ci-cd.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/features/techdocs/configuring-ci-cd.md b/docs/features/techdocs/configuring-ci-cd.md index a9844ef528..0dec7ec24e 100644 --- a/docs/features/techdocs/configuring-ci-cd.md +++ b/docs/features/techdocs/configuring-ci-cd.md @@ -148,6 +148,23 @@ jobs: - uses: actions/setup-node@v2 - uses: actions/setup-python@v2 + # the 2 steps below can be removed if you aren't using plantuml in your documentation + - name: setup java + uses: actions/setup-java@v2 + with: + distribution: 'zulu' + java-version: '11' + - name: download, validate, install plantuml and its dependencies + run: | + curl -o plantuml.jar -L http://sourceforge.net/projects/plantuml/files/plantuml.1.2021.4.jar/download + echo "be498123d20eaea95a94b174d770ef94adfdca18 plantuml.jar" | sha1sum -c - + mv plantuml.jar /opt/plantuml.jar + mkdir -p "$HOME/.local/bin" + echo $'#!/bin/sh\n\njava -jar '/opt/plantuml.jar' ${@}' >> "$HOME/.local/bin/plantuml" + chmod +x "$HOME/.local/bin/plantuml" + echo "$HOME/.local/bin" >> $GITHUB_PATH + sudo apt-get install -y graphviz + - name: Install techdocs-cli run: sudo npm install -g @techdocs/cli From 84d6ee9e867cf3fd30bda8ba35fe2a66bc51d074 Mon Sep 17 00:00:00 2001 From: Ben Lambert Date: Tue, 4 May 2021 14:33:36 +0200 Subject: [PATCH 72/73] Update small-sheep-smoke.md Signed-off-by: blam --- .changeset/small-sheep-smoke.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/small-sheep-smoke.md b/.changeset/small-sheep-smoke.md index 9cff7591ee..fd917159d3 100644 --- a/.changeset/small-sheep-smoke.md +++ b/.changeset/small-sheep-smoke.md @@ -2,4 +2,4 @@ '@backstage/plugin-scaffolder-backend': patch --- -bump jsonschema from 1.2.7 to 1.4.0 +bump `jsonschema` from 1.2.7 to 1.4.0 From c19c97a92caaf67620145a61d43aeecd31f2ef98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 May 2021 04:46:22 +0000 Subject: [PATCH 73/73] chore(deps-dev): bump @types/react-dev-utils from 9.0.4 to 9.0.5 Bumps [@types/react-dev-utils](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dev-utils) from 9.0.4 to 9.0.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dev-utils) Signed-off-by: dependabot[bot] --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index e2ecf9b7c3..23cf3b2fd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6601,14 +6601,14 @@ "@types/reactcss" "*" "@types/react-dev-utils@^9.0.4": - version "9.0.4" - resolved "https://registry.npmjs.org/@types/react-dev-utils/-/react-dev-utils-9.0.4.tgz#3e4bee79b7536777cef219427ab1d38adc24f3f2" - integrity sha512-8cv9rAeSP1EmyRQAbZ/i6uYtai1VoKHGSBwDyCLM82wCkqoh3WPjJgI1pfi2kiLc0C5hNU7DLo7/c4hylfHLWg== + version "9.0.5" + resolved "https://registry.npmjs.org/@types/react-dev-utils/-/react-dev-utils-9.0.5.tgz#3265699edaba0078256d91b7793f98c4fb9bf6cf" + integrity sha512-uUsdRdc4LU1WQrfw3htnRIRchyOOsBnmnByK6H3oZMBdjmeyH1f7Cfy64YixQ3T3Dzy5gwGilcJVSDyOFjVBWQ== dependencies: "@types/eslint" "*" "@types/express" "*" "@types/html-webpack-plugin" "*" - "@types/webpack" "*" + "@types/webpack" "^4" "@types/webpack-dev-server" "*" "@types/react-dom@^16.9.8":