({
+ id: 'y',
+});
+
+function Verifier() {
+ const holder = useApiHolder();
+ const x = holder.get(xApiRef);
+ const y = holder.get(yApiRef);
+
+ return (
+
+ {x ? (
+
+ x={x.a},{x.b}
+
+ ) : (
+ no x
+ )}
+ {y ? y={y} : no y}
+
+ );
+}
+
+describe('TestApiProvider', () => {
+ it('should provide APIs', () => {
+ render(
+
+
+ ,
+ );
+ expect(screen.getByText('x=a,3')).toBeInTheDocument();
+ expect(screen.getByText('y=y')).toBeInTheDocument();
+ });
+
+ it('should provide partial APIs', () => {
+ render(
+
+
+ ,
+ );
+ expect(screen.getByText('x=a,')).toBeInTheDocument();
+ expect(screen.getByText('no y')).toBeInTheDocument();
+ });
+
+ it('should require partial implementations to still match types', () => {
+ render(
+ // @ts-expect-error
+
+
+ ,
+ );
+ expect(screen.getByText('x=3,')).toBeInTheDocument();
+ expect(screen.getByText('no y')).toBeInTheDocument();
+ });
+
+ it('should allow empty APIs', () => {
+ render(
+
+
+ ,
+ );
+ expect(screen.getByText('no x')).toBeInTheDocument();
+ expect(screen.getByText('no y')).toBeInTheDocument();
+ });
+});
+
+describe('TestApiRegistry', () => {
+ it('should be created with APIs', () => {
+ const x = { a: 'a', b: 3 };
+ const y = 'y';
+ const registry = TestApiRegistry.from([xApiRef, x], [yApiRef, y]);
+
+ expect(registry.get(xApiRef)).toBe(x);
+ expect(registry.get(yApiRef)).toBe(y);
+ });
+
+ it('should allow partial implementations', () => {
+ const x = { a: 'a' };
+ const registry = TestApiRegistry.from([xApiRef, x]);
+
+ expect(registry.get(xApiRef)).toBe(x);
+ expect(registry.get(yApiRef)).toBeUndefined();
+ });
+
+ it('should require partial implementations to match types', () => {
+ const x = { a: 2 };
+ // @ts-expect-error
+ const registry = TestApiRegistry.from([xApiRef, x]);
+
+ expect(registry.get(xApiRef)).toBe(x);
+ expect(registry.get(yApiRef)).toBeUndefined();
+ });
+
+ it('should prefer last duplicate API that was provided', () => {
+ const x1 = { a: 'a' };
+ const x2 = { a: 's' };
+ const x3 = { a: 'd' };
+ const registry = TestApiRegistry.from(
+ [xApiRef, x1],
+ [xApiRef, x2],
+ [xApiRef, x3],
+ );
+
+ expect(registry.get(xApiRef)).toBe(x3);
+ });
+});
diff --git a/packages/test-utils/src/testUtils/TestApiProvider.tsx b/packages/test-utils/src/testUtils/TestApiProvider.tsx
new file mode 100644
index 0000000000..b1499b0cde
--- /dev/null
+++ b/packages/test-utils/src/testUtils/TestApiProvider.tsx
@@ -0,0 +1,130 @@
+/*
+ * 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 React, { ReactNode } from 'react';
+import { ApiProvider } from '@backstage/core-app-api';
+import { ApiRef, ApiHolder } from '@backstage/core-plugin-api';
+
+/** @ignore */
+type TestApiProviderPropsApiPair = TApi extends infer TImpl
+ ? readonly [ApiRef, Partial]
+ : never;
+
+/** @ignore */
+type TestApiProviderPropsApiPairs = {
+ [TIndex in keyof TApiPairs]: TestApiProviderPropsApiPair;
+};
+
+/**
+ * Properties for the {@link TestApiProvider} component.
+ *
+ * @public
+ */
+export type TestApiProviderProps = {
+ apis: readonly [...TestApiProviderPropsApiPairs];
+ children: ReactNode;
+};
+
+/**
+ * The `TestApiRegistry` is an {@link @backstage/core-plugin-api#ApiHolder} implementation
+ * that is particularly well suited for development and test environments such as
+ * unit tests, storybooks, and isolated plugin development setups.
+ *
+ * @public
+ */
+export class TestApiRegistry implements ApiHolder {
+ /**
+ * Creates a new {@link TestApiRegistry} with a list of API implementation pairs.
+ *
+ * Similar to the {@link TestApiProvider}, there is no need to provide a full
+ * implementation of each API, it's enough to implement the methods that are tested.
+ *
+ * @example
+ * ```ts
+ * const apis = TestApiRegistry.from(
+ * [configApiRef, new ConfigReader({})],
+ * [identityApiRef, { getUserId: () => 'tester' }],
+ * );
+ * ```
+ *
+ * @public
+ * @param apis - A list of pairs mapping an ApiRef to its respective implementation.
+ */
+ static from(
+ ...apis: readonly [...TestApiProviderPropsApiPairs]
+ ) {
+ return new TestApiRegistry(
+ new Map(apis.map(([api, impl]) => [api.id, impl])),
+ );
+ }
+
+ private constructor(private readonly apis: Map) {}
+
+ /**
+ * Returns an implementation of the API.
+ *
+ * @public
+ */
+ get(api: ApiRef): T | undefined {
+ return this.apis.get(api.id) as T | undefined;
+ }
+}
+
+/**
+ * The `TestApiProvider` is a Utility API context provider that is particularly
+ * well suited for development and test environments such as unit tests, storybooks,
+ * and isolated plugin development setups.
+ *
+ * It lets you provide any number of API implementations, without necessarily
+ * having to fully implement each of the APIs.
+ *
+ * A migration from `ApiRegistry` and `ApiProvider` might look like this, from:
+ *
+ * ```tsx
+ * renderInTestApp(
+ *
+ * {...}
+ *
+ * )
+ * ```
+ *
+ * To the following:
+ *
+ * ```tsx
+ * renderInTestApp(
+ *
+ * {...}
+ *
+ * )
+ * ```
+ *
+ * Note that the cast to `IdentityApi` is no longer needed as long as the mock API
+ * implements a subset of the `IdentityApi`.
+ *
+ * @public
+ **/
+export const TestApiProvider = ({
+ apis,
+ children,
+}: TestApiProviderProps) => {
+ return (
+
+ );
+};
diff --git a/packages/test-utils/src/testUtils/index.tsx b/packages/test-utils/src/testUtils/index.tsx
index 7d93d606cc..c778c5c837 100644
--- a/packages/test-utils/src/testUtils/index.tsx
+++ b/packages/test-utils/src/testUtils/index.tsx
@@ -22,3 +22,5 @@ export * from './msw';
export * from './Keyboard';
export * from './logCollector';
export * from './testingLibrary';
+export { TestApiProvider, TestApiRegistry } from './TestApiProvider';
+export type { TestApiProviderProps } from './TestApiProvider';
diff --git a/packages/theme/package.json b/packages/theme/package.json
index d9e89c969f..28a05af98d 100644
--- a/packages/theme/package.json
+++ b/packages/theme/package.json
@@ -31,7 +31,7 @@
"@material-ui/core": "^4.12.2"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2"
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist"
diff --git a/packages/types/package.json b/packages/types/package.json
index 8632422a25..197d51b061 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -31,7 +31,7 @@
},
"dependencies": {},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/zen-observable": "^0.8.0",
"zen-observable": "^0.8.15"
},
diff --git a/packages/version-bridge/package.json b/packages/version-bridge/package.json
index 7cc0b56a34..35a6e8f71d 100644
--- a/packages/version-bridge/package.json
+++ b/packages/version-bridge/package.json
@@ -33,7 +33,7 @@
"react": "^16.12.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2"
diff --git a/plugins/allure/CHANGELOG.md b/plugins/allure/CHANGELOG.md
index 3de49b9b74..f769b6e133 100644
--- a/plugins/allure/CHANGELOG.md
+++ b/plugins/allure/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-allure
+## 0.1.7
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.6
### Patch Changes
diff --git a/plugins/allure/package.json b/plugins/allure/package.json
index b157795eec..9efe6132e8 100644
--- a/plugins/allure/package.json
+++ b/plugins/allure/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-allure",
"description": "A Backstage plugin that integrates with Allure",
- "version": "0.1.6",
+ "version": "0.1.7",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,10 +22,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -36,10 +36,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/allure/src/plugin.ts b/plugins/allure/src/plugin.ts
index f5ca7beeb3..a2eaa06a38 100644
--- a/plugins/allure/src/plugin.ts
+++ b/plugins/allure/src/plugin.ts
@@ -23,7 +23,7 @@ import {
import { AllureApiClient, allureApiRef } from './api';
export const allureRouteRef = createRouteRef({
- title: 'allure-report',
+ id: 'allure',
});
export const allurePlugin = createPlugin({
diff --git a/plugins/analytics-module-ga/CHANGELOG.md b/plugins/analytics-module-ga/CHANGELOG.md
index a59bcb6351..acc5c235f9 100644
--- a/plugins/analytics-module-ga/CHANGELOG.md
+++ b/plugins/analytics-module-ga/CHANGELOG.md
@@ -1,5 +1,13 @@
# @backstage/plugin-analytics-module-ga
+## 0.1.3
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.2
### Patch Changes
diff --git a/plugins/analytics-module-ga/package.json b/plugins/analytics-module-ga/package.json
index 4970f50c04..e0a32960c5 100644
--- a/plugins/analytics-module-ga/package.json
+++ b/plugins/analytics-module-ga/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-analytics-module-ga",
- "version": "0.1.2",
+ "version": "0.1.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,8 +22,8 @@
},
"dependencies": {
"@backstage/config": "^0.1.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -34,10 +34,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/api-docs/CHANGELOG.md b/plugins/api-docs/CHANGELOG.md
index 78f4b08bd7..0b0bd4890c 100644
--- a/plugins/api-docs/CHANGELOG.md
+++ b/plugins/api-docs/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-api-docs
+## 0.6.14
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/plugin-catalog@0.7.3
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.6.13
### Patch Changes
diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json
index 61ae26c776..a4aa15c419 100644
--- a/plugins/api-docs/package.json
+++ b/plugins/api-docs/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-api-docs",
"description": "A Backstage plugin that helps represent API entities in the frontend",
- "version": "0.6.13",
+ "version": "0.6.14",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,11 +31,11 @@
},
"dependencies": {
"@asyncapi/react-component": "^0.23.0",
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog": "^0.7.2",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog": "^0.7.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -53,10 +53,10 @@
"swagger-ui-react": "^4.0.0-rc.3"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/api-docs/src/routes.ts b/plugins/api-docs/src/routes.ts
index ab976dbf18..b7c152889e 100644
--- a/plugins/api-docs/src/routes.ts
+++ b/plugins/api-docs/src/routes.ts
@@ -19,12 +19,8 @@ import {
createRouteRef,
} from '@backstage/core-plugin-api';
-const NoIcon = () => null;
-
export const rootRoute = createRouteRef({
- icon: NoIcon,
- path: '/api-docs',
- title: 'APIs',
+ id: 'api-docs',
});
export const createComponentRouteRef = createExternalRouteRef({
diff --git a/plugins/app-backend/CHANGELOG.md b/plugins/app-backend/CHANGELOG.md
index 0658b10ebb..a58b028049 100644
--- a/plugins/app-backend/CHANGELOG.md
+++ b/plugins/app-backend/CHANGELOG.md
@@ -1,5 +1,13 @@
# @backstage/plugin-app-backend
+## 0.3.19
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/config-loader@0.8.0
+ - @backstage/backend-common@0.9.10
+
## 0.3.18
### Patch Changes
diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json
index d989457c79..ebb0393192 100644
--- a/plugins/app-backend/package.json
+++ b/plugins/app-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-app-backend",
"description": "A Backstage backend plugin that serves the Backstage frontend app",
- "version": "0.3.18",
+ "version": "0.3.19",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,8 +30,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.8",
- "@backstage/config-loader": "^0.7.1",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/config-loader": "^0.8.0",
"@backstage/config": "^0.1.11",
"@backstage/types": "^0.1.1",
"@types/express": "^4.17.6",
@@ -42,7 +42,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.1",
+ "@backstage/cli": "^0.9.0",
"@backstage/types": "^0.1.1",
"@types/supertest": "^2.0.8",
"msw": "^0.35.0",
diff --git a/plugins/auth-backend/CHANGELOG.md b/plugins/auth-backend/CHANGELOG.md
index a11f561986..5dc0cdb861 100644
--- a/plugins/auth-backend/CHANGELOG.md
+++ b/plugins/auth-backend/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-auth-backend
+## 0.4.8
+
+### Patch Changes
+
+- 892c1d9202: Update OAuthAdapter to create identity.token from identity.idToken if it does not exist, and prevent overwrites to identity.toke. Update login page commonProvider to prefer .token over .idToken
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/backend-common@0.9.10
+ - @backstage/test-utils@0.1.22
+
## 0.4.7
### Patch Changes
diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json
index e9ec29970b..3a9e8102eb 100644
--- a/plugins/auth-backend/package.json
+++ b/plugins/auth-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-auth-backend",
"description": "A Backstage backend plugin that handles authentication",
- "version": "0.4.7",
+ "version": "0.4.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,12 +30,12 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/test-utils": "^0.1.22",
"@google-cloud/firestore": "^4.15.1",
"@types/express": "^4.17.6",
"@types/passport": "^1.0.3",
@@ -73,7 +73,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
+ "@backstage/cli": "^0.9.0",
"@types/body-parser": "^1.19.0",
"@types/cookie-parser": "^1.4.2",
"@types/express-session": "^1.17.2",
diff --git a/plugins/azure-devops-backend/CHANGELOG.md b/plugins/azure-devops-backend/CHANGELOG.md
index d2fe981eb0..06fc4833c4 100644
--- a/plugins/azure-devops-backend/CHANGELOG.md
+++ b/plugins/azure-devops-backend/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-azure-devops-backend
+## 0.2.1
+
+### Patch Changes
+
+- 2b5ccd2964: Improved Date handling for the Azure DevOps set of plugins by using strings and letting the frontend handle the conversion to DateTime
+- Updated dependencies
+ - @backstage/backend-common@0.9.10
+ - @backstage/plugin-azure-devops-common@0.1.0
+
## 0.2.0
### Minor Changes
diff --git a/plugins/azure-devops-backend/package.json b/plugins/azure-devops-backend/package.json
index 901ad0b960..6d213cbce6 100644
--- a/plugins/azure-devops-backend/package.json
+++ b/plugins/azure-devops-backend/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops-backend",
- "version": "0.2.0",
+ "version": "0.2.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -20,9 +20,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/config": "^0.1.11",
- "@backstage/plugin-azure-devops-common": "^0.0.2",
+ "@backstage/plugin-azure-devops-common": "^0.1.0",
"@types/express": "^4.17.6",
"azure-devops-node-api": "^11.0.1",
"express": "^4.17.1",
@@ -31,7 +31,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"supertest": "^4.0.2",
"msw": "^0.35.0"
diff --git a/plugins/azure-devops-common/CHANGELOG.md b/plugins/azure-devops-common/CHANGELOG.md
index b414cd3ce6..4a834fb068 100644
--- a/plugins/azure-devops-common/CHANGELOG.md
+++ b/plugins/azure-devops-common/CHANGELOG.md
@@ -1,5 +1,11 @@
# @backstage/plugin-azure-devops-common
+## 0.1.0
+
+### Minor Changes
+
+- 2b5ccd2964: Improved Date handling for the Azure DevOps set of plugins by using strings and letting the frontend handle the conversion to DateTime
+
## 0.0.2
### Patch Changes
diff --git a/plugins/azure-devops-common/package.json b/plugins/azure-devops-common/package.json
index a1ddddcbe0..fe9df644b1 100644
--- a/plugins/azure-devops-common/package.json
+++ b/plugins/azure-devops-common/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops-common",
- "version": "0.0.2",
+ "version": "0.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2"
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist"
diff --git a/plugins/azure-devops/CHANGELOG.md b/plugins/azure-devops/CHANGELOG.md
index 2f75f64236..0bcd9bc686 100644
--- a/plugins/azure-devops/CHANGELOG.md
+++ b/plugins/azure-devops/CHANGELOG.md
@@ -1,5 +1,19 @@
# @backstage/plugin-azure-devops
+## 0.1.4
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- b5eac957f2: Added entity view for Azure Repo Pull Requests
+- 2b5ccd2964: Improved Date handling for the Azure DevOps set of plugins by using strings and letting the frontend handle the conversion to DateTime
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/plugin-azure-devops-common@0.1.0
+
## 0.1.3
### Patch Changes
diff --git a/plugins/azure-devops/README.md b/plugins/azure-devops/README.md
index 47a0c4debd..7b39dae443 100644
--- a/plugins/azure-devops/README.md
+++ b/plugins/azure-devops/README.md
@@ -6,10 +6,16 @@ Website: [https://dev.azure.com/](https://dev.azure.com/)
### Azure Pipelines
-Lists the top _n_ builds for a given repository where _n_ is a configurable value
+Lists the top _n_ builds for a given Azure Repo where _n_ is a configurable value

+### Azure Repos
+
+Lists the top _n_ Active, Completed, or Abandoned Pull Requests for a given repository where _n_ is a configurable value
+
+
+
## Setup
The following sections will help you get the Azure DevOps plugin setup and running
@@ -69,14 +75,55 @@ To get the Azure Pipelines component working you'll need to do the following two
// ...
- // Set defaultLimit to the max number of builds you would like to be able to see
- // the default if not set is 10
// ...
```
+**Notes:**
+
+- The `if` prop is optional on the `EntitySwitch.Case`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
+- The `defaultLimit` property on the `EntityAzurePipelinesContent` will set the max number of Builds you would like to see, if not set this will default to 10
+
+### Azure Repos Component
+
+To get the Azure Repos component working you'll need to do the following two steps:
+
+1. First we need to add the @backstage/plugin-azure-devops package to your frontend app:
+
+ ```bash
+ # From your Backstage root directory
+ cd packages/app
+ yarn add @backstage/plugin-azure-devops
+ ```
+
+2. Second we need to add the `EntityAzurePullRequestsContent` extension to the entity page in your app:
+
+ ```tsx
+ // In packages/app/src/components/catalog/EntityPage.tsx
+ import {
+ EntityAzurePullRequestsContent,
+ isAzureDevOpsAvailable,
+ } from '@backstage/plugin-azure-devops';
+
+ // For example in the Service section
+ const serviceEntityPage = (
+
+ // ...
+
+
+
+ // ...
+
+ ```
+
+**Notes:**
+
+- You'll need to add the `EntityLayout.Route` above from step 2 to all the entity sections you want to see Pull Requests in. For example if you wanted to see Pull Requests when looking at Website entities then you would need to add this to the `websiteEntityPage` section.
+- The `if` prop is optional on the `EntityLayout.Route`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
+- The `defaultLimit` property on the `EntityAzurePullRequestsContent` will set the max number of Pull Requests you would like to see, if not set this will default to 10
+
## Limitations
- Currently multiple organizations are not supported
diff --git a/plugins/azure-devops/api-report.md b/plugins/azure-devops/api-report.md
index fbe28c179c..ab659534c1 100644
--- a/plugins/azure-devops/api-report.md
+++ b/plugins/azure-devops/api-report.md
@@ -7,17 +7,11 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
-import { RouteRef } from '@backstage/core-plugin-api';
// Warning: (ae-missing-release-tag) "azureDevOpsPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const azureDevOpsPlugin: BackstagePlugin<
- {
- entityContent: RouteRef;
- },
- {}
->;
+export const azureDevOpsPlugin: BackstagePlugin<{}, {}>;
// Warning: (ae-missing-release-tag) "EntityAzurePipelinesContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -28,6 +22,15 @@ export const EntityAzurePipelinesContent: ({
defaultLimit?: number | undefined;
}) => JSX.Element;
+// Warning: (ae-missing-release-tag) "EntityAzurePullRequestsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
+//
+// @public (undocumented)
+export const EntityAzurePullRequestsContent: ({
+ defaultLimit,
+}: {
+ defaultLimit?: number | undefined;
+}) => JSX.Element;
+
// Warning: (ae-missing-release-tag) "isAzureDevOpsAvailable" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
diff --git a/plugins/azure-devops/docs/azure-devops-builds.png b/plugins/azure-devops/docs/azure-devops-builds.png
index 4788a185ed..6ff93dc7e4 100644
Binary files a/plugins/azure-devops/docs/azure-devops-builds.png and b/plugins/azure-devops/docs/azure-devops-builds.png differ
diff --git a/plugins/azure-devops/docs/azure-devops-pull-requests.png b/plugins/azure-devops/docs/azure-devops-pull-requests.png
new file mode 100644
index 0000000000..ce1b2a4267
Binary files /dev/null and b/plugins/azure-devops/docs/azure-devops-pull-requests.png differ
diff --git a/plugins/azure-devops/package.json b/plugins/azure-devops/package.json
index 235304c9fa..9d235b0641 100644
--- a/plugins/azure-devops/package.json
+++ b/plugins/azure-devops/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops",
- "version": "0.1.3",
+ "version": "0.1.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -27,16 +27,17 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
- "@backstage/plugin-azure-devops-common": "^0.0.2",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/plugin-azure-devops-common": "^0.1.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
+ "humanize-duration": "^3.27.0",
"luxon": "^2.0.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
@@ -44,10 +45,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/azure-devops/src/api/AzureDevOpsApi.ts b/plugins/azure-devops/src/api/AzureDevOpsApi.ts
index 05377b0b7b..90d291b25d 100644
--- a/plugins/azure-devops/src/api/AzureDevOpsApi.ts
+++ b/plugins/azure-devops/src/api/AzureDevOpsApi.ts
@@ -15,6 +15,8 @@
*/
import {
+ PullRequest,
+ PullRequestOptions,
RepoBuild,
RepoBuildOptions,
} from '@backstage/plugin-azure-devops-common';
@@ -33,4 +35,10 @@ export interface AzureDevOpsApi {
repoName: string,
options?: RepoBuildOptions,
): Promise<{ items: RepoBuild[] }>;
+
+ getPullRequests(
+ projectName: string,
+ repoName: string,
+ options?: PullRequestOptions,
+ ): Promise<{ items: PullRequest[] }>;
}
diff --git a/plugins/azure-devops/src/api/AzureDevOpsClient.ts b/plugins/azure-devops/src/api/AzureDevOpsClient.ts
index 4fd4e781c4..cbcc496725 100644
--- a/plugins/azure-devops/src/api/AzureDevOpsClient.ts
+++ b/plugins/azure-devops/src/api/AzureDevOpsClient.ts
@@ -16,6 +16,8 @@
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
import {
+ PullRequest,
+ PullRequestOptions,
RepoBuild,
RepoBuildOptions,
} from '@backstage/plugin-azure-devops-common';
@@ -35,14 +37,40 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
this.identityApi = options.identityApi;
}
- async getRepoBuilds(
+ public async getRepoBuilds(
projectName: string,
repoName: string,
options?: RepoBuildOptions,
): Promise<{ items: RepoBuild[] }> {
- const items = await this.get(
- `repo-builds/${projectName}/${repoName}?top=${options?.top}`,
- );
+ const queryString = new URLSearchParams();
+ if (options?.top) {
+ queryString.append('top', options.top.toString());
+ }
+ const urlSegment = `repo-builds/${encodeURIComponent(
+ projectName,
+ )}/${encodeURIComponent(repoName)}?${queryString}`;
+
+ const items = await this.get(urlSegment);
+ return { items };
+ }
+
+ public async getPullRequests(
+ projectName: string,
+ repoName: string,
+ options?: PullRequestOptions,
+ ): Promise<{ items: PullRequest[] }> {
+ const queryString = new URLSearchParams();
+ if (options?.top) {
+ queryString.append('top', options.top.toString());
+ }
+ if (options?.status) {
+ queryString.append('status', options.status.toString());
+ }
+ const urlSegment = `pull-requests/${encodeURIComponent(
+ projectName,
+ )}/${encodeURIComponent(repoName)}?${queryString}`;
+
+ const items = await this.get(urlSegment);
return { items };
}
diff --git a/plugins/azure-devops/src/components/AzurePipelinesIcon/AzurePipelinesIcon.tsx b/plugins/azure-devops/src/components/AzurePipelinesIcon/AzurePipelinesIcon.tsx
new file mode 100644
index 0000000000..bd19331f6e
--- /dev/null
+++ b/plugins/azure-devops/src/components/AzurePipelinesIcon/AzurePipelinesIcon.tsx
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { SvgIcon, SvgIconProps } from '@material-ui/core';
+
+import React from 'react';
+
+export const AzurePipelinesIcon = (props: SvgIconProps) => (
+
+
+
+
+);
diff --git a/plugins/azure-devops/src/components/AzurePipelinesIcon/index.ts b/plugins/azure-devops/src/components/AzurePipelinesIcon/index.ts
new file mode 100644
index 0000000000..4eb161f7bc
--- /dev/null
+++ b/plugins/azure-devops/src/components/AzurePipelinesIcon/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { AzurePipelinesIcon } from './AzurePipelinesIcon';
diff --git a/plugins/azure-devops/src/components/AzurePullRequestsIcon/AzurePullRequestsIcon.tsx b/plugins/azure-devops/src/components/AzurePullRequestsIcon/AzurePullRequestsIcon.tsx
new file mode 100644
index 0000000000..bb4cb8c081
--- /dev/null
+++ b/plugins/azure-devops/src/components/AzurePullRequestsIcon/AzurePullRequestsIcon.tsx
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { SvgIcon, SvgIconProps } from '@material-ui/core';
+
+import React from 'react';
+
+export const AzurePullRequestsIcon = (props: SvgIconProps) => (
+
+
+
+
+
+
+
+);
diff --git a/plugins/azure-devops/src/components/AzurePullRequestsIcon/index.ts b/plugins/azure-devops/src/components/AzurePullRequestsIcon/index.ts
new file mode 100644
index 0000000000..1f49119b4b
--- /dev/null
+++ b/plugins/azure-devops/src/components/AzurePullRequestsIcon/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { AzurePullRequestsIcon } from './AzurePullRequestsIcon';
diff --git a/plugins/azure-devops/src/components/BuildTable/BuildTable.tsx b/plugins/azure-devops/src/components/BuildTable/BuildTable.tsx
index c16c836393..463bf15d78 100644
--- a/plugins/azure-devops/src/components/BuildTable/BuildTable.tsx
+++ b/plugins/azure-devops/src/components/BuildTable/BuildTable.tsx
@@ -33,8 +33,10 @@ import {
TableColumn,
} from '@backstage/core-components';
+import { AzurePipelinesIcon } from '../AzurePipelinesIcon';
import { DateTime } from 'luxon';
import React from 'react';
+import { getDurationFromDates } from '../../utils/getDurationFromDates';
export const getBuildResultComponent = (result: number | undefined) => {
switch (result) {
@@ -144,6 +146,18 @@ const columns: TableColumn[] = [
),
},
+ {
+ title: 'Duration',
+ field: 'queueTime',
+ width: 'auto',
+ render: (row: Partial) => (
+
+
+ {getDurationFromDates(row.startTime, row.finishTime)}
+
+
+ ),
+ },
{
title: 'Age',
field: 'queueTime',
@@ -181,7 +195,13 @@ export const BuildTable = ({ items, loading, error }: BuildTableProps) => {
pageSize: 5,
showEmptyDataSourceMessage: !loading,
}}
- title={`Builds (${items ? items.length : 0})`}
+ title={
+
+
+
+ Azure Pipelines - Builds ({items ? items.length : 0})
+
+ }
data={items ?? []}
/>
);
diff --git a/plugins/azure-devops/src/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.tsx b/plugins/azure-devops/src/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.tsx
new file mode 100644
index 0000000000..3d1a3ef77a
--- /dev/null
+++ b/plugins/azure-devops/src/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.tsx
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { PullRequestTable } from '../PullRequestTable/PullRequestTable';
+import React from 'react';
+
+export const EntityPageAzurePullRequests = ({
+ defaultLimit,
+}: {
+ defaultLimit?: number;
+}) => {
+ return ;
+};
diff --git a/plugins/azure-devops/src/components/EntityPageAzurePullRequests/index.ts b/plugins/azure-devops/src/components/EntityPageAzurePullRequests/index.ts
new file mode 100644
index 0000000000..2ec6c5bf04
--- /dev/null
+++ b/plugins/azure-devops/src/components/EntityPageAzurePullRequests/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { EntityPageAzurePullRequests } from './EntityPageAzurePullRequests';
diff --git a/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.tsx b/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.tsx
new file mode 100644
index 0000000000..f516bfb0e5
--- /dev/null
+++ b/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.tsx
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Button, ButtonGroup } from '@material-ui/core';
+
+import { PullRequestStatus } from '@backstage/plugin-azure-devops-common';
+import React from 'react';
+
+export const PullRequestStatusButtonGroup = ({
+ status,
+ setStatus,
+}: {
+ status: PullRequestStatus;
+ setStatus: (pullRequestStatus: PullRequestStatus) => void;
+}) => {
+ return (
+
+
+
+
+
+ );
+};
diff --git a/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/index.ts b/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/index.ts
new file mode 100644
index 0000000000..10a667803a
--- /dev/null
+++ b/plugins/azure-devops/src/components/PullRequestStatusButtonGroup/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { PullRequestStatusButtonGroup } from './PullRequestStatusButtonGroup';
diff --git a/plugins/azure-devops/src/components/PullRequestTable/PullRequestTable.tsx b/plugins/azure-devops/src/components/PullRequestTable/PullRequestTable.tsx
new file mode 100644
index 0000000000..4365b796bc
--- /dev/null
+++ b/plugins/azure-devops/src/components/PullRequestTable/PullRequestTable.tsx
@@ -0,0 +1,139 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Box, Chip } from '@material-ui/core';
+import {
+ Link,
+ ResponseErrorPanel,
+ Table,
+ TableColumn,
+} from '@backstage/core-components';
+import {
+ PullRequest,
+ PullRequestStatus,
+} from '@backstage/plugin-azure-devops-common';
+import React, { useState } from 'react';
+
+import { AzurePullRequestsIcon } from '../AzurePullRequestsIcon';
+import { DateTime } from 'luxon';
+import { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup';
+import { useEntity } from '@backstage/plugin-catalog-react';
+import { usePullRequests } from '../../hooks/usePullRequests';
+
+const columns: TableColumn[] = [
+ {
+ title: 'ID',
+ field: 'pullRequestId',
+ highlight: false,
+ width: 'auto',
+ },
+ {
+ title: 'Title',
+ field: 'title',
+ width: 'auto',
+ render: (row: Partial) => (
+
+ {row.title}
+ {row.isDraft && (
+
+
+
+ )}
+
+ ),
+ },
+ {
+ title: 'Source',
+ field: 'sourceRefName',
+ width: 'auto',
+ },
+ {
+ title: 'Target',
+ field: 'targetRefName',
+ width: 'auto',
+ },
+ {
+ title: 'Created By',
+ field: 'createdBy',
+ width: 'auto',
+ },
+ {
+ title: 'Created',
+ field: 'creationDate',
+ width: 'auto',
+ render: (row: Partial) =>
+ (row.creationDate
+ ? DateTime.fromISO(row.creationDate)
+ : DateTime.now()
+ ).toRelative(),
+ },
+];
+
+type PullRequestTableProps = {
+ defaultLimit?: number;
+};
+
+export const PullRequestTable = ({ defaultLimit }: PullRequestTableProps) => {
+ const [pullRequestStatusState, setPullRequestStatusState] =
+ useState(PullRequestStatus.Active);
+ const { entity } = useEntity();
+
+ const { items, loading, error } = usePullRequests(
+ entity,
+ defaultLimit,
+ pullRequestStatusState,
+ );
+
+ if (error) {
+ return (
+
+
+
+ );
+ }
+
+ return (
+
+
+
+ Azure Repos - Pull Requests ({items ? items.length : 0})
+
+
+
+
+ }
+ data={items ?? []}
+ />
+ );
+};
diff --git a/plugins/azure-devops/src/components/PullRequestTable/index.ts b/plugins/azure-devops/src/components/PullRequestTable/index.ts
new file mode 100644
index 0000000000..956e8afa2d
--- /dev/null
+++ b/plugins/azure-devops/src/components/PullRequestTable/index.ts
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export { PullRequestTable } from './PullRequestTable';
diff --git a/plugins/azure-devops/src/hooks/usePullRequests.ts b/plugins/azure-devops/src/hooks/usePullRequests.ts
new file mode 100644
index 0000000000..178bf0495f
--- /dev/null
+++ b/plugins/azure-devops/src/hooks/usePullRequests.ts
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {
+ PullRequest,
+ PullRequestOptions,
+ PullRequestStatus,
+} from '@backstage/plugin-azure-devops-common';
+
+import { AZURE_DEVOPS_DEFAULT_TOP } from '../constants';
+import { Entity } from '@backstage/catalog-model';
+import { azureDevOpsApiRef } from '../api';
+import { useApi } from '@backstage/core-plugin-api';
+import { useAsync } from 'react-use';
+import { useProjectRepoFromEntity } from './useProjectRepoFromEntity';
+
+export function usePullRequests(
+ entity: Entity,
+ defaultLimit?: number,
+ requestedStatus?: PullRequestStatus,
+): {
+ items?: PullRequest[];
+ loading: boolean;
+ error?: Error;
+} {
+ const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
+ const status = requestedStatus ?? PullRequestStatus.Active;
+ const options: PullRequestOptions = {
+ top,
+ status,
+ };
+
+ const api = useApi(azureDevOpsApiRef);
+ const { project, repo } = useProjectRepoFromEntity(entity);
+
+ const { value, loading, error } = useAsync(() => {
+ return api.getPullRequests(project, repo, options);
+ }, [api, project, repo, top, status]);
+
+ return {
+ items: value?.items,
+ loading,
+ error,
+ };
+}
diff --git a/plugins/azure-devops/src/index.ts b/plugins/azure-devops/src/index.ts
index 71d3b654fe..4da533b534 100644
--- a/plugins/azure-devops/src/index.ts
+++ b/plugins/azure-devops/src/index.ts
@@ -16,5 +16,6 @@
export {
azureDevOpsPlugin,
EntityAzurePipelinesContent,
+ EntityAzurePullRequestsContent,
isAzureDevOpsAvailable,
} from './plugin';
diff --git a/plugins/azure-devops/src/plugin.ts b/plugins/azure-devops/src/plugin.ts
index ab6d816460..7a5f80d0d3 100644
--- a/plugins/azure-devops/src/plugin.ts
+++ b/plugins/azure-devops/src/plugin.ts
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+import {
+ azurePipelinesEntityContentRouteRef,
+ azurePullRequestsEntityContentRouteRef,
+} from './routes';
import {
createApiFactory,
createPlugin,
@@ -26,7 +30,6 @@ import { AZURE_DEVOPS_ANNOTATION } from './constants';
import { AzureDevOpsClient } from './api/AzureDevOpsClient';
import { Entity } from '@backstage/catalog-model';
import { azureDevOpsApiRef } from './api/AzureDevOpsApi';
-import { azureDevOpsRouteRef } from './routes';
export const isAzureDevOpsAvailable = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_ANNOTATION]);
@@ -41,9 +44,6 @@ export const azureDevOpsPlugin = createPlugin({
new AzureDevOpsClient({ discoveryApi, identityApi }),
}),
],
- routes: {
- entityContent: azureDevOpsRouteRef,
- },
});
export const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
@@ -53,6 +53,17 @@ export const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(
import('./components/EntityPageAzurePipelines').then(
m => m.EntityPageAzurePipelines,
),
- mountPoint: azureDevOpsRouteRef,
+ mountPoint: azurePipelinesEntityContentRouteRef,
+ }),
+);
+
+export const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(
+ createRoutableExtension({
+ name: 'EntityAzurePullRequestsContent',
+ component: () =>
+ import('./components/EntityPageAzurePullRequests').then(
+ m => m.EntityPageAzurePullRequests,
+ ),
+ mountPoint: azurePullRequestsEntityContentRouteRef,
}),
);
diff --git a/plugins/azure-devops/src/routes.ts b/plugins/azure-devops/src/routes.ts
index 81f4b48fda..7a4adea33e 100644
--- a/plugins/azure-devops/src/routes.ts
+++ b/plugins/azure-devops/src/routes.ts
@@ -13,8 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
import { createRouteRef } from '@backstage/core-plugin-api';
-export const azureDevOpsRouteRef = createRouteRef({
- title: 'azure-devops',
+export const azurePipelinesEntityContentRouteRef = createRouteRef({
+ id: 'azure-pipelines-entity-content',
+});
+
+export const azurePullRequestsEntityContentRouteRef = createRouteRef({
+ id: 'azure-pull-requests-entity-content',
});
diff --git a/plugins/azure-devops/src/utils/getDurationFromDates.test.ts b/plugins/azure-devops/src/utils/getDurationFromDates.test.ts
new file mode 100644
index 0000000000..fac0e917d0
--- /dev/null
+++ b/plugins/azure-devops/src/utils/getDurationFromDates.test.ts
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { getDurationFromDates } from './getDurationFromDates';
+
+describe('getDurationFromDates', () => {
+ beforeAll(() => {
+ jest.useFakeTimers('modern');
+ jest.setSystemTime(new Date('2021-10-15T09:45:25.0000000Z'));
+ });
+
+ afterAll(() => {
+ jest.useRealTimers();
+ });
+
+ describe('getDurationFromDates with valid startTime and valid finishTime', () => {
+ it('should return empty result', () => {
+ const startTime = '2021-10-15T09:30:00.0000000Z';
+ const finishTime = '2021-10-15T11:00:00.0000000Z';
+
+ const result = getDurationFromDates(startTime, finishTime);
+
+ expect(result).toEqual('1h, 30m');
+ });
+ });
+
+ describe('getDurationFromDates with valid startTime and undefined finishTime', () => {
+ it('should return empty result', () => {
+ const startTime = '2021-10-15T09:30:00.0000000Z';
+
+ const result = getDurationFromDates(startTime, undefined);
+
+ expect(result).toEqual('15m, 25s');
+ });
+ });
+
+ describe('getDurationFromDates with undefined startTime and valid finishTime', () => {
+ it('should return empty result', () => {
+ const finishTime = '2021-10-15T11:00:00.0000000Z';
+
+ const result = getDurationFromDates(undefined, finishTime);
+
+ expect(result).toEqual('');
+ });
+ });
+
+ describe('getDurationFromDates with undefined startTime and undefined finishTime', () => {
+ it('should return empty result', () => {
+ const result = getDurationFromDates(undefined, undefined);
+
+ expect(result).toEqual('');
+ });
+ });
+});
diff --git a/plugins/azure-devops/src/utils/getDurationFromDates.ts b/plugins/azure-devops/src/utils/getDurationFromDates.ts
new file mode 100644
index 0000000000..789849f975
--- /dev/null
+++ b/plugins/azure-devops/src/utils/getDurationFromDates.ts
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { DateTime, Interval } from 'luxon';
+import humanizeDuration from 'humanize-duration';
+
+export const getDurationFromDates = (
+ startTime?: string,
+ finishTime?: string,
+): string => {
+ if (!startTime || (!startTime && !finishTime)) {
+ return '';
+ }
+
+ const start = DateTime.fromISO(startTime);
+ const finish = finishTime ? DateTime.fromISO(finishTime) : DateTime.now();
+
+ const formatted = Interval.fromDateTimes(start, finish)
+ .toDuration()
+ .valueOf();
+
+ const shortEnglishHumanizer = humanizeDuration.humanizer({
+ language: 'shortEn',
+ languages: {
+ shortEn: {
+ y: () => 'y',
+ mo: () => 'mo',
+ w: () => 'w',
+ d: () => 'd',
+ h: () => 'h',
+ m: () => 'm',
+ s: () => 's',
+ ms: () => 'ms',
+ },
+ },
+ });
+
+ return shortEnglishHumanizer(formatted, {
+ largest: 2,
+ round: true,
+ spacer: '',
+ });
+};
diff --git a/plugins/badges-backend/package.json b/plugins/badges-backend/package.json
index 51a181612a..2186c8d52e 100644
--- a/plugins/badges-backend/package.json
+++ b/plugins/badges-backend/package.json
@@ -31,9 +31,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@types/express": "^4.17.6",
@@ -46,7 +46,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.3"
},
diff --git a/plugins/badges/CHANGELOG.md b/plugins/badges/CHANGELOG.md
index 3a6ed61717..44bc597d0a 100644
--- a/plugins/badges/CHANGELOG.md
+++ b/plugins/badges/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-badges
+## 0.2.14
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.13
### Patch Changes
diff --git a/plugins/badges/package.json b/plugins/badges/package.json
index 0c792808bc..4d02d64237 100644
--- a/plugins/badges/package.json
+++ b/plugins/badges/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-badges",
"description": "A Backstage plugin that generates README badges for your entities",
- "version": "0.2.13",
+ "version": "0.2.14",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -27,11 +27,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -42,10 +42,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/badges/src/api/BadgesClient.ts b/plugins/badges/src/api/BadgesClient.ts
index d81b042ce5..432a485a6b 100644
--- a/plugins/badges/src/api/BadgesClient.ts
+++ b/plugins/badges/src/api/BadgesClient.ts
@@ -17,7 +17,6 @@
import { generatePath } from 'react-router';
import { ResponseError } from '@backstage/errors';
import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model';
-import { entityRoute } from '@backstage/plugin-catalog-react';
import { BadgesApi, BadgeSpec } from './types';
import { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';
@@ -53,7 +52,7 @@ export class BadgesClient implements BadgesApi {
private async getEntityBadgeSpecsUrl(entity: Entity): Promise {
const routeParams = this.getEntityRouteParams(entity);
- const path = generatePath(entityRoute.path, routeParams);
+ const path = generatePath(`:kind/:namespace/:name`, routeParams);
return `${await this.discoveryApi.getBaseUrl(
'badges',
)}/entity/${path}/badge-specs`;
diff --git a/plugins/bazaar-backend/CHANGELOG.md b/plugins/bazaar-backend/CHANGELOG.md
new file mode 100644
index 0000000000..88e646b5e3
--- /dev/null
+++ b/plugins/bazaar-backend/CHANGELOG.md
@@ -0,0 +1,10 @@
+# @backstage/plugin-bazaar-backend
+
+## 0.1.2
+
+### Patch Changes
+
+- f6ba309d9e: A Bazaar project has been extended with the following fields: size, start date (optional), end date (optional) and a responsible person.
+- Updated dependencies
+ - @backstage/backend-common@0.9.10
+ - @backstage/backend-test-utils@0.1.9
diff --git a/plugins/bazaar-backend/package.json b/plugins/bazaar-backend/package.json
index a9ac0153b8..a6610493e2 100644
--- a/plugins/bazaar-backend/package.json
+++ b/plugins/bazaar-backend/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar-backend",
- "version": "0.1.1",
+ "version": "0.1.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -20,8 +20,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/backend-test-utils": "^0.1.8",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/backend-test-utils": "^0.1.9",
"@backstage/config": "^0.1.5",
"@types/express": "^4.17.6",
"express": "^4.17.1",
@@ -31,7 +31,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0"
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist",
diff --git a/plugins/bazaar/CHANGELOG.md b/plugins/bazaar/CHANGELOG.md
index 731f62b9e9..8988bf5d62 100644
--- a/plugins/bazaar/CHANGELOG.md
+++ b/plugins/bazaar/CHANGELOG.md
@@ -1,5 +1,19 @@
# @backstage/plugin-bazaar
+## 0.1.4
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- f6ba309d9e: A Bazaar project has been extended with the following fields: size, start date (optional), end date (optional) and a responsible person.
+- Updated dependencies
+ - @backstage/plugin-catalog@0.7.3
+ - @backstage/cli@0.9.0
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.3
### Patch Changes
diff --git a/plugins/bazaar/package.json b/plugins/bazaar/package.json
index 094741bf36..fd07a3b5c7 100644
--- a/plugins/bazaar/package.json
+++ b/plugins/bazaar/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar",
- "version": "0.1.3",
+ "version": "0.1.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,12 +21,12 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/cli": "^0.8.2",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog": "^0.7.2",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog": "^0.7.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -41,8 +41,8 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/dev-utils": "^0.2.12",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/dev-utils": "^0.2.13",
"@testing-library/jest-dom": "^5.10.1",
"cross-fetch": "^3.0.6"
},
diff --git a/plugins/bazaar/src/routes.ts b/plugins/bazaar/src/routes.ts
index a3cc88d86f..9e4a8fb218 100644
--- a/plugins/bazaar/src/routes.ts
+++ b/plugins/bazaar/src/routes.ts
@@ -17,5 +17,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'bazaar',
+ id: 'bazaar',
});
diff --git a/plugins/bitrise/CHANGELOG.md b/plugins/bitrise/CHANGELOG.md
index 7e364ca294..874cbe2c6c 100644
--- a/plugins/bitrise/CHANGELOG.md
+++ b/plugins/bitrise/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-bitrise
+## 0.1.17
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.16
### Patch Changes
diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json
index 5ebfd453a2..92cd9693e1 100644
--- a/plugins/bitrise/package.json
+++ b/plugins/bitrise/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-bitrise",
"description": "A Backstage plugin that integrates towards Bitrise",
- "version": "0.1.16",
+ "version": "0.1.17",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,10 +21,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -39,10 +39,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/catalog-backend-module-ldap/package.json b/plugins/catalog-backend-module-ldap/package.json
index a8c3b71345..5e3cec24d9 100644
--- a/plugins/catalog-backend-module-ldap/package.json
+++ b/plugins/catalog-backend-module-ldap/package.json
@@ -29,10 +29,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
- "@backstage/plugin-catalog-backend": "^0.17.2",
+ "@backstage/plugin-catalog-backend": "^0.17.4",
"@backstage/types": "^0.1.1",
"@types/ldapjs": "^2.2.0",
"ldapjs": "^2.2.0",
@@ -40,7 +40,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.1",
+ "@backstage/cli": "^0.9.0",
"@types/lodash": "^4.14.151"
},
"files": [
diff --git a/plugins/catalog-backend-module-msgraph/package.json b/plugins/catalog-backend-module-msgraph/package.json
index b3c9494f78..222f56b022 100644
--- a/plugins/catalog-backend-module-msgraph/package.json
+++ b/plugins/catalog-backend-module-msgraph/package.json
@@ -30,9 +30,9 @@
},
"dependencies": {
"@azure/msal-node": "^1.1.0",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
- "@backstage/plugin-catalog-backend": "^0.17.3",
+ "@backstage/plugin-catalog-backend": "^0.17.4",
"@microsoft/microsoft-graph-types": "^2.6.0",
"cross-fetch": "^3.0.6",
"lodash": "^4.17.21",
@@ -41,9 +41,9 @@
"qs": "^6.9.4"
},
"devDependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/cli": "^0.8.2",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
"@types/lodash": "^4.14.151",
"msw": "^0.35.0"
},
diff --git a/plugins/catalog-backend/CHANGELOG.md b/plugins/catalog-backend/CHANGELOG.md
index abb50a345c..92b57f3483 100644
--- a/plugins/catalog-backend/CHANGELOG.md
+++ b/plugins/catalog-backend/CHANGELOG.md
@@ -1,5 +1,21 @@
# @backstage/plugin-catalog-backend
+## 0.17.4
+
+### Patch Changes
+
+- 5d2a7303bd: This fixes a bug where locations couldn't be added unless the processing engine is started.
+ It's now possible to run the catalog backend without starting the processing engine and still allowing locations registrations.
+
+ This is done by refactor the `EntityProvider.connect` to happen outside the engine.
+
+- 06934f2f52: Adjust entity query construction to ensure sub-queries are always isolated from one another.
+- b90fc74d70: adds getDefaultProcessor method to CatalogBuilder
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/backend-common@0.9.10
+
## 0.17.3
### Patch Changes
diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md
index 6660912dda..5008cf02f1 100644
--- a/plugins/catalog-backend/api-report.md
+++ b/plugins/catalog-backend/api-report.md
@@ -846,8 +846,7 @@ export type EntitiesResponse = {
// @public
export type EntitiesSearchFilter = {
key: string;
- matchValueIn?: string[];
- matchValueExists?: boolean;
+ values?: string[];
};
// Warning: (ae-missing-release-tag) "entity" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -877,6 +876,9 @@ export type EntityFilter =
| {
anyOf: EntityFilter[];
}
+ | {
+ not: EntityFilter;
+ }
| EntitiesSearchFilter;
// Warning: (ae-missing-release-tag) "EntityPagination" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -1546,9 +1548,9 @@ export class UrlReaderProcessor implements CatalogProcessor {
// Warnings were encountered during analysis:
//
-// src/catalog/types.d.ts:97:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
-// src/catalog/types.d.ts:98:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
-// src/catalog/types.d.ts:99:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
+// src/catalog/types.d.ts:94:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
+// src/catalog/types.d.ts:95:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
+// src/catalog/types.d.ts:96:8 - (tsdoc-param-tag-with-invalid-name) The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
// src/ingestion/processors/GithubMultiOrgReaderProcessor.d.ts:23:9 - (ae-forgotten-export) The symbol "GithubMultiOrgConfig" needs to be exported by the entry point index.d.ts
// src/ingestion/types.d.ts:8:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/legacy/database/types.d.ts:98:8 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json
index f13ff2d66c..a9a35d5858 100644
--- a/plugins/catalog-backend/package.json
+++ b/plugins/catalog-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend",
"description": "The Backstage backend plugin that provides the Backstage catalog",
- "version": "0.17.3",
+ "version": "0.17.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,9 +30,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
@@ -62,9 +62,9 @@
"yup": "^0.32.9"
},
"devDependencies": {
- "@backstage/backend-test-utils": "^0.1.8",
- "@backstage/cli": "^0.8.2",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/backend-test-utils": "^0.1.9",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
"@types/core-js": "^2.5.4",
"@types/git-url-parse": "^9.0.0",
"@types/lodash": "^4.14.151",
diff --git a/plugins/catalog-backend/src/catalog/types.ts b/plugins/catalog-backend/src/catalog/types.ts
index df693bfd42..2a18783679 100644
--- a/plugins/catalog-backend/src/catalog/types.ts
+++ b/plugins/catalog-backend/src/catalog/types.ts
@@ -25,6 +25,7 @@ import { Entity, EntityRelationSpec } from '@backstage/catalog-model';
export type EntityFilter =
| { allOf: EntityFilter[] }
| { anyOf: EntityFilter[] }
+ | { not: EntityFilter }
| EntitiesSearchFilter;
/**
@@ -50,16 +51,10 @@ export type EntitiesSearchFilter = {
/**
* Match on plain equality of values.
*
- * If undefined, this factor is not taken into account. Otherwise, match on
- * values that are equal to any of the given array items. Matches are always
- * case insensitive.
+ * Match on values that are equal to any of the given array items. Matches are
+ * always case insensitive.
*/
- matchValueIn?: string[];
-
- /**
- * Match on existence of key.
- */
- matchValueExists?: boolean;
+ values?: string[];
};
export type PageInfo =
diff --git a/plugins/catalog-backend/src/legacy/database/CommonDatabase.test.ts b/plugins/catalog-backend/src/legacy/database/CommonDatabase.test.ts
index ca2e6c2934..8b72b470a6 100644
--- a/plugins/catalog-backend/src/legacy/database/CommonDatabase.test.ts
+++ b/plugins/catalog-backend/src/legacy/database/CommonDatabase.test.ts
@@ -536,9 +536,7 @@ describe('CommonDatabase', () => {
filter: {
anyOf: [
{
- allOf: [
- { key: 'metadata.annotations.foo', matchValueExists: true },
- ],
+ allOf: [{ key: 'metadata.annotations.foo' }],
},
],
},
@@ -558,30 +556,6 @@ describe('CommonDatabase', () => {
},
]),
);
-
- const nonExistRows = await db.transaction(async tx =>
- db.entities(tx, {
- filter: {
- anyOf: [
- {
- allOf: [
- { key: 'metadata.annotations.foo', matchValueExists: false },
- ],
- },
- ],
- },
- }),
- );
-
- expect(nonExistRows.entities.length).toEqual(1);
- expect(nonExistRows.entities).toEqual(
- expect.arrayContaining([
- {
- locationId: undefined,
- entity: expect.objectContaining({ kind: 'k3' }),
- },
- ]),
- );
});
});
diff --git a/plugins/catalog-backend/src/legacy/database/CommonDatabase.ts b/plugins/catalog-backend/src/legacy/database/CommonDatabase.ts
index 6a150f7583..3ea8696437 100644
--- a/plugins/catalog-backend/src/legacy/database/CommonDatabase.ts
+++ b/plugins/catalog-backend/src/legacy/database/CommonDatabase.ts
@@ -224,7 +224,8 @@ export class CommonDatabase implements Database {
if (
request?.filter &&
(request.filter.hasOwnProperty('key') ||
- request.filter.hasOwnProperty('allOf'))
+ request.filter.hasOwnProperty('allOf') ||
+ request.filter.hasOwnProperty('not'))
) {
throw new Error(
'Filters for the legacy CommonDatabase must obey the { anyOf: [{ allOf: [] }] } format.',
@@ -236,13 +237,14 @@ export class CommonDatabase implements Database {
for (const filter of singleFilter.allOf) {
if (
filter.hasOwnProperty('anyOf') ||
- filter.hasOwnProperty('allOf')
+ filter.hasOwnProperty('allOf') ||
+ filter.hasOwnProperty('not')
) {
throw new Error(
'Nested filters are not supported in the legacy CommonDatabase',
);
}
- const { key, matchValueIn, matchValueExists } = filter;
+ const { key, values } = filter;
// NOTE(freben): This used to be a set of OUTER JOIN, which may seem to
// make a lot of sense. However, it had abysmal performance on sqlite
// when datasets grew large, so we're using IN instead.
@@ -250,24 +252,19 @@ export class CommonDatabase implements Database {
.select('entity_id')
.where(function keyFilter() {
this.andWhere({ key: key.toLowerCase() });
- if (matchValueExists !== false && matchValueIn) {
- if (matchValueIn.length === 1) {
- this.andWhere({ value: matchValueIn[0].toLowerCase() });
- } else if (matchValueIn.length > 1) {
+ if (values) {
+ if (values.length === 1) {
+ this.andWhere({ value: values[0].toLowerCase() });
+ } else if (values.length > 1) {
this.andWhere(
'value',
'in',
- matchValueIn.map(v => v.toLowerCase()),
+ values.map(v => v.toLowerCase()),
);
}
}
});
- // Explicitly evaluate matchValueExists as a boolean since it may be undefined
- this.andWhere(
- 'id',
- matchValueExists === false ? 'not in' : 'in',
- matchQuery,
- );
+ this.andWhere('id', 'in', matchQuery);
}
});
}
diff --git a/plugins/catalog-backend/src/legacy/service/router.test.ts b/plugins/catalog-backend/src/legacy/service/router.test.ts
index edc7d852ac..0ff5a44ed0 100644
--- a/plugins/catalog-backend/src/legacy/service/router.test.ts
+++ b/plugins/catalog-backend/src/legacy/service/router.test.ts
@@ -115,11 +115,11 @@ describe('createRouter readonly disabled', () => {
anyOf: [
{
allOf: [
- { key: 'a', matchValueIn: ['1', '2'] },
- { key: 'b', matchValueIn: ['3'] },
+ { key: 'a', values: ['1', '2'] },
+ { key: 'b', values: ['3'] },
],
},
- { allOf: [{ key: 'c', matchValueIn: ['4'] }] },
+ { allOf: [{ key: 'c', values: ['4'] }] },
],
},
});
diff --git a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.test.ts b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.test.ts
index 6b55b8b9eb..b93ee758d7 100644
--- a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.test.ts
+++ b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.test.ts
@@ -61,7 +61,6 @@ describe('DefaultCatalogProcessingEngine', () => {
});
const engine = new DefaultCatalogProcessingEngine(
getVoidLogger(),
- [],
db,
orchestrator,
stitcher,
@@ -123,7 +122,6 @@ describe('DefaultCatalogProcessingEngine', () => {
});
const engine = new DefaultCatalogProcessingEngine(
getVoidLogger(),
- [],
db,
orchestrator,
stitcher,
@@ -201,7 +199,6 @@ describe('DefaultCatalogProcessingEngine', () => {
const engine = new DefaultCatalogProcessingEngine(
getVoidLogger(),
- [],
db,
orchestrator,
stitcher,
@@ -273,7 +270,6 @@ describe('DefaultCatalogProcessingEngine', () => {
const engine = new DefaultCatalogProcessingEngine(
getVoidLogger(),
- [],
db,
orchestrator,
stitcher,
diff --git a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts
index 1ce32a01e1..fb42af778b 100644
--- a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts
+++ b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts
@@ -14,11 +14,7 @@
* limitations under the License.
*/
-import {
- Entity,
- entityEnvelopeSchemaValidator,
- stringifyEntityRef,
-} from '@backstage/catalog-model';
+import { stringifyEntityRef } from '@backstage/catalog-model';
import { assertError, serializeError } from '@backstage/errors';
import { Hash } from 'crypto';
import stableStringify from 'fast-json-stable-stringify';
@@ -32,68 +28,15 @@ import {
} from '../processing/types';
import { Stitcher } from '../stitching/Stitcher';
import { startTaskPipeline } from './TaskPipeline';
-import {
- EntityProvider,
- EntityProviderConnection,
- EntityProviderMutation,
-} from '../providers/types';
const CACHE_TTL = 5;
-class Connection implements EntityProviderConnection {
- readonly validateEntityEnvelope = entityEnvelopeSchemaValidator();
-
- constructor(
- private readonly config: {
- id: string;
- processingDatabase: ProcessingDatabase;
- },
- ) {}
-
- async applyMutation(mutation: EntityProviderMutation): Promise {
- const db = this.config.processingDatabase;
-
- if (mutation.type === 'full') {
- this.check(mutation.entities.map(e => e.entity));
- await db.transaction(async tx => {
- await db.replaceUnprocessedEntities(tx, {
- sourceKey: this.config.id,
- type: 'full',
- items: mutation.entities,
- });
- });
- } else if (mutation.type === 'delta') {
- this.check(mutation.added.map(e => e.entity));
- this.check(mutation.removed.map(e => e.entity));
- await db.transaction(async tx => {
- await db.replaceUnprocessedEntities(tx, {
- sourceKey: this.config.id,
- type: 'delta',
- added: mutation.added,
- removed: mutation.removed,
- });
- });
- }
- }
-
- private check(entities: Entity[]) {
- for (const entity of entities) {
- try {
- this.validateEntityEnvelope(entity);
- } catch (e) {
- throw new TypeError(`Malformed entity envelope, ${e}`);
- }
- }
- }
-}
-
export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine {
private readonly tracker = progressTracker();
private stopFunc?: () => void;
constructor(
private readonly logger: Logger,
- private readonly entityProviders: EntityProvider[],
private readonly processingDatabase: ProcessingDatabase,
private readonly orchestrator: CatalogProcessingOrchestrator,
private readonly stitcher: Stitcher,
@@ -106,15 +49,6 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine {
throw new Error('Processing engine is already started');
}
- for (const provider of this.entityProviders) {
- await provider.connect(
- new Connection({
- id: provider.getProviderName(),
- processingDatabase: this.processingDatabase,
- }),
- );
- }
-
this.stopFunc = startTaskPipeline({
lowWatermark: 5,
highWatermark: 10,
diff --git a/plugins/catalog-backend/src/processing/connectEntityProviders.ts b/plugins/catalog-backend/src/processing/connectEntityProviders.ts
new file mode 100644
index 0000000000..02bdc2aee3
--- /dev/null
+++ b/plugins/catalog-backend/src/processing/connectEntityProviders.ts
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {
+ Entity,
+ entityEnvelopeSchemaValidator,
+} from '@backstage/catalog-model';
+import { ProcessingDatabase } from '../database/types';
+import {
+ EntityProvider,
+ EntityProviderConnection,
+ EntityProviderMutation,
+} from '../providers/types';
+
+class Connection implements EntityProviderConnection {
+ readonly validateEntityEnvelope = entityEnvelopeSchemaValidator();
+
+ constructor(
+ private readonly config: {
+ id: string;
+ processingDatabase: ProcessingDatabase;
+ },
+ ) {}
+
+ async applyMutation(mutation: EntityProviderMutation): Promise {
+ const db = this.config.processingDatabase;
+
+ if (mutation.type === 'full') {
+ this.check(mutation.entities.map(e => e.entity));
+ await db.transaction(async tx => {
+ await db.replaceUnprocessedEntities(tx, {
+ sourceKey: this.config.id,
+ type: 'full',
+ items: mutation.entities,
+ });
+ });
+ } else if (mutation.type === 'delta') {
+ this.check(mutation.added.map(e => e.entity));
+ this.check(mutation.removed.map(e => e.entity));
+ await db.transaction(async tx => {
+ await db.replaceUnprocessedEntities(tx, {
+ sourceKey: this.config.id,
+ type: 'delta',
+ added: mutation.added,
+ removed: mutation.removed,
+ });
+ });
+ }
+ }
+
+ private check(entities: Entity[]) {
+ for (const entity of entities) {
+ try {
+ this.validateEntityEnvelope(entity);
+ } catch (e) {
+ throw new TypeError(`Malformed entity envelope, ${e}`);
+ }
+ }
+ }
+}
+
+export async function connectEntityProviders(
+ db: ProcessingDatabase,
+ providers: EntityProvider[],
+) {
+ await Promise.all(
+ providers.map(async provider => {
+ const connection = new Connection({
+ id: provider.getProviderName(),
+ processingDatabase: db,
+ });
+ return provider.connect(connection);
+ }),
+ );
+}
diff --git a/plugins/catalog-backend/src/service/DefaultRefreshService.test.ts b/plugins/catalog-backend/src/service/DefaultRefreshService.test.ts
index 0ea475a528..1876e59f95 100644
--- a/plugins/catalog-backend/src/service/DefaultRefreshService.test.ts
+++ b/plugins/catalog-backend/src/service/DefaultRefreshService.test.ts
@@ -103,7 +103,6 @@ describe('Refresh integration', () => {
const engine = new DefaultCatalogProcessingEngine(
defaultLogger,
- [],
db,
{
async process(request: EntityProcessingRequest) {
diff --git a/plugins/catalog-backend/src/service/NextCatalogBuilder.ts b/plugins/catalog-backend/src/service/NextCatalogBuilder.ts
index bbda6f070c..eed420cd53 100644
--- a/plugins/catalog-backend/src/service/NextCatalogBuilder.ts
+++ b/plugins/catalog-backend/src/service/NextCatalogBuilder.ts
@@ -80,6 +80,7 @@ import { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules';
import { Config } from '@backstage/config';
import { Logger } from 'winston';
import { LocationService } from './types';
+import { connectEntityProviders } from '../processing/connectEntityProviders';
export type CatalogEnvironment = {
logger: Logger;
@@ -364,7 +365,6 @@ export class NextCatalogBuilder {
const processingEngine = new DefaultCatalogProcessingEngine(
logger,
- entityProviders,
processingDatabase,
orchestrator,
stitcher,
@@ -390,6 +390,8 @@ export class NextCatalogBuilder {
config,
});
+ await connectEntityProviders(processingDatabase, entityProviders);
+
return {
entitiesCatalog,
locationsCatalog,
diff --git a/plugins/catalog-backend/src/service/NextEntitiesCatalog.test.ts b/plugins/catalog-backend/src/service/NextEntitiesCatalog.test.ts
index 32d5fa843e..ee86e78c6b 100644
--- a/plugins/catalog-backend/src/service/NextEntitiesCatalog.test.ts
+++ b/plugins/catalog-backend/src/service/NextEntitiesCatalog.test.ts
@@ -282,7 +282,6 @@ describe('NextEntitiesCatalog', () => {
const testFilter = {
key: 'spec.test',
- matchValueExists: true,
};
const request = { filter: testFilter };
const { entities } = await catalog.entities(request);
@@ -293,7 +292,42 @@ describe('NextEntitiesCatalog', () => {
);
it.each(databases.eachSupportedId())(
- 'should return correct entity for nested filter',
+ 'should return correct entity for negation filter',
+ async databaseId => {
+ const { knex } = await createDatabase(databaseId);
+ const entity1: Entity = {
+ apiVersion: 'a',
+ kind: 'k',
+ metadata: { name: 'one' },
+ spec: {},
+ };
+ const entity2: Entity = {
+ apiVersion: 'a',
+ kind: 'k',
+ metadata: { name: 'two' },
+ spec: {
+ test: 'test value',
+ },
+ };
+ await addEntityToSearch(knex, entity1);
+ await addEntityToSearch(knex, entity2);
+ const catalog = new NextEntitiesCatalog(knex);
+
+ const testFilter = {
+ not: {
+ key: 'spec.test',
+ },
+ };
+ const request = { filter: testFilter };
+ const { entities } = await catalog.entities(request);
+
+ expect(entities.length).toBe(1);
+ expect(entities[0]).toEqual(entity1);
+ },
+ );
+
+ it.each(databases.eachSupportedId())(
+ 'should return correct entities for nested filter',
async databaseId => {
const { knex } = await createDatabase(databaseId);
const entity1: Entity = {
@@ -328,24 +362,27 @@ describe('NextEntitiesCatalog', () => {
const testFilter1 = {
key: 'metadata.org',
- matchValueExists: true,
- matchValueIn: ['b'],
+ values: ['b'],
};
const testFilter2 = {
key: 'metadata.desc',
- matchValueExists: true,
};
const testFilter3 = {
key: 'metadata.color',
- matchValueExists: true,
- matchValueIn: ['blue'],
+ values: ['blue'],
+ };
+ const testFilter4 = {
+ not: {
+ key: 'metadata.color',
+ values: ['red'],
+ },
};
const request = {
filter: {
allOf: [
testFilter1,
{
- anyOf: [testFilter2, testFilter3],
+ anyOf: [testFilter2, testFilter3, testFilter4],
},
],
},
@@ -357,5 +394,46 @@ describe('NextEntitiesCatalog', () => {
expect(entities).toContainEqual(entity4);
},
);
+
+ it.each(databases.eachSupportedId())(
+ 'should return correct entities for complex negation filter',
+ async databaseId => {
+ const { knex } = await createDatabase(databaseId);
+ const entity1: Entity = {
+ apiVersion: 'a',
+ kind: 'k',
+ metadata: { name: 'one', org: 'a', desc: 'description' },
+ spec: {},
+ };
+ const entity2: Entity = {
+ apiVersion: 'a',
+ kind: 'k',
+ metadata: { name: 'two', org: 'b', desc: 'description' },
+ spec: {},
+ };
+ await addEntityToSearch(knex, entity1);
+ await addEntityToSearch(knex, entity2);
+ const catalog = new NextEntitiesCatalog(knex);
+
+ const testFilter1 = {
+ key: 'metadata.org',
+ values: ['b'],
+ };
+ const testFilter2 = {
+ key: 'metadata.desc',
+ };
+ const request = {
+ filter: {
+ not: {
+ allOf: [testFilter1, testFilter2],
+ },
+ },
+ };
+ const { entities } = await catalog.entities(request);
+
+ expect(entities.length).toBe(1);
+ expect(entities).toContainEqual(entity1);
+ },
+ );
});
});
diff --git a/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts b/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts
index 1c615f862a..8c2de9d7c1 100644
--- a/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts
+++ b/plugins/catalog-backend/src/service/NextEntitiesCatalog.ts
@@ -78,33 +78,29 @@ function stringifyPagination(input: { limit: number; offset: number }) {
function addCondition(
queryBuilder: Knex.QueryBuilder,
db: Knex,
- { key, matchValueIn, matchValueExists }: EntitiesSearchFilter,
+ filter: EntitiesSearchFilter,
+ negate: boolean = false,
) {
// NOTE(freben): This used to be a set of OUTER JOIN, which may seem to
// make a lot of sense. However, it had abysmal performance on sqlite
// when datasets grew large, so we're using IN instead.
const matchQuery = db('search')
.select('entity_id')
- .where(function keyFilter() {
- this.andWhere({ key: key.toLowerCase() });
- if (matchValueExists !== false && matchValueIn) {
- if (matchValueIn.length === 1) {
- this.andWhere({ value: matchValueIn[0].toLowerCase() });
- } else if (matchValueIn.length > 1) {
+ .where({ key: filter.key.toLowerCase() })
+ .andWhere(function keyFilter() {
+ if (filter.values) {
+ if (filter.values.length === 1) {
+ this.where({ value: filter.values[0].toLowerCase() });
+ } else if (filter.values.length > 1) {
this.andWhere(
'value',
'in',
- matchValueIn.map(v => v.toLowerCase()),
+ filter.values.map(v => v.toLowerCase()),
);
}
}
});
- // Explicitly evaluate matchValueExists as a boolean since it may be undefined
- queryBuilder.andWhere(
- 'entity_id',
- matchValueExists === false ? 'not in' : 'in',
- matchQuery,
- );
+ queryBuilder.andWhere('entity_id', negate ? 'not in' : 'in', matchQuery);
}
function isEntitiesSearchFilter(
@@ -113,46 +109,45 @@ function isEntitiesSearchFilter(
return filter.hasOwnProperty('key');
}
-function isAndEntityFilter(
- filter: { allOf: EntityFilter[] } | EntityFilter,
-): filter is { allOf: EntityFilter[] } {
- return filter.hasOwnProperty('allOf');
-}
-
function isOrEntityFilter(
filter: { anyOf: EntityFilter[] } | EntityFilter,
): filter is { anyOf: EntityFilter[] } {
return filter.hasOwnProperty('anyOf');
}
+function isNegationEntityFilter(
+ filter: { not: EntityFilter } | EntityFilter,
+): filter is { not: EntityFilter } {
+ return filter.hasOwnProperty('not');
+}
+
function parseFilter(
filter: EntityFilter,
query: Knex.QueryBuilder,
db: Knex,
+ negate: boolean = false,
): Knex.QueryBuilder {
if (isEntitiesSearchFilter(filter)) {
return query.andWhere(function filterFunction() {
- addCondition(this, db, filter);
+ addCondition(this, db, filter, negate);
});
}
- if (isOrEntityFilter(filter)) {
- return query.andWhere(function filterFunction() {
+ if (isNegationEntityFilter(filter)) {
+ return parseFilter(filter.not, query, db, !negate);
+ }
+
+ return query[negate ? 'andWhereNot' : 'andWhere'](function filterFunction() {
+ if (isOrEntityFilter(filter)) {
for (const subFilter of filter.anyOf ?? []) {
this.orWhere(subQuery => parseFilter(subFilter, subQuery, db));
}
- });
- }
-
- if (isAndEntityFilter(filter)) {
- return query.andWhere(function filterFunction() {
+ } else {
for (const subFilter of filter.allOf ?? []) {
this.andWhere(subQuery => parseFilter(subFilter, subQuery, db));
}
- });
- }
-
- return query;
+ }
+ });
}
export class NextEntitiesCatalog implements EntitiesCatalog {
diff --git a/plugins/catalog-backend/src/service/NextRouter.test.ts b/plugins/catalog-backend/src/service/NextRouter.test.ts
index 57911c74fb..6bc4481425 100644
--- a/plugins/catalog-backend/src/service/NextRouter.test.ts
+++ b/plugins/catalog-backend/src/service/NextRouter.test.ts
@@ -104,11 +104,11 @@ describe('createNextRouter readonly disabled', () => {
anyOf: [
{
allOf: [
- { key: 'a', matchValueIn: ['1', '2'] },
- { key: 'b', matchValueIn: ['3'] },
+ { key: 'a', values: ['1', '2'] },
+ { key: 'b', values: ['3'] },
],
},
- { allOf: [{ key: 'c', matchValueIn: ['4'] }] },
+ { allOf: [{ key: 'c', values: ['4'] }] },
],
},
});
diff --git a/plugins/catalog-backend/src/service/request/basicEntityFilter.ts b/plugins/catalog-backend/src/service/request/basicEntityFilter.ts
index 1cf9ca95f0..36448e0304 100644
--- a/plugins/catalog-backend/src/service/request/basicEntityFilter.ts
+++ b/plugins/catalog-backend/src/service/request/basicEntityFilter.ts
@@ -30,9 +30,9 @@ export function basicEntityFilter(
const f =
key in filtersByKey
? filtersByKey[key]
- : (filtersByKey[key] = { key, matchValueIn: [] });
+ : (filtersByKey[key] = { key, values: [] });
- f.matchValueIn!.push(...values);
+ f.values!.push(...values);
}
return { anyOf: [{ allOf: Object.values(filtersByKey) }] };
diff --git a/plugins/catalog-backend/src/service/request/parseEntityFilterParams.test.ts b/plugins/catalog-backend/src/service/request/parseEntityFilterParams.test.ts
index fc22a638de..f9fc596cb9 100644
--- a/plugins/catalog-backend/src/service/request/parseEntityFilterParams.test.ts
+++ b/plugins/catalog-backend/src/service/request/parseEntityFilterParams.test.ts
@@ -28,7 +28,7 @@ describe('parseEntityFilterParams', () => {
it('supports single-string format', () => {
const result = parseEntityFilterParams({ filter: 'a=1' })!;
expect(result).toEqual({
- anyOf: [{ allOf: [{ key: 'a', matchValueIn: ['1'] }] }],
+ anyOf: [{ allOf: [{ key: 'a', values: ['1'] }] }],
});
});
@@ -38,8 +38,8 @@ describe('parseEntityFilterParams', () => {
});
expect(result).toEqual({
anyOf: [
- { allOf: [{ key: 'a', matchValueIn: ['1'] }] },
- { allOf: [{ key: 'b', matchValueIn: ['2'] }] },
+ { allOf: [{ key: 'a', values: ['1'] }] },
+ { allOf: [{ key: 'b', values: ['2'] }] },
],
});
});
@@ -50,11 +50,11 @@ describe('parseEntityFilterParams', () => {
});
expect(result).toEqual({
anyOf: [
- { allOf: [{ key: 'a', matchValueIn: ['1'] }] },
+ { allOf: [{ key: 'a', values: ['1'] }] },
{
allOf: [
- { key: 'b', matchValueIn: ['2', '3'] },
- { key: 'c', matchValueIn: ['4'] },
+ { key: 'b', values: ['2', '3'] },
+ { key: 'c', values: ['4'] },
],
},
],
@@ -70,17 +70,17 @@ describe('parseEntityFilterString', () => {
it('works for the happy path', () => {
expect(parseEntityFilterString('')).toBeUndefined();
expect(parseEntityFilterString('a=1,b=2,a=3,c,d=')).toEqual([
- { key: 'a', matchValueIn: ['1', '3'] },
- { key: 'b', matchValueIn: ['2'] },
- { key: 'c', matchValueExists: true },
- { key: 'd', matchValueIn: [''] },
+ { key: 'a', values: ['1', '3'] },
+ { key: 'b', values: ['2'] },
+ { key: 'c' },
+ { key: 'd', values: [''] },
]);
});
it('trims values', () => {
expect(parseEntityFilterString(' a = 1 , b = 2 , a = 3 ')).toEqual([
- { key: 'a', matchValueIn: ['1', '3'] },
- { key: 'b', matchValueIn: ['2'] },
+ { key: 'a', values: ['1', '3'] },
+ { key: 'b', values: ['2'] },
]);
});
diff --git a/plugins/catalog-backend/src/service/request/parseEntityFilterParams.ts b/plugins/catalog-backend/src/service/request/parseEntityFilterParams.ts
index 452958b7ae..1ea5d44b2c 100644
--- a/plugins/catalog-backend/src/service/request/parseEntityFilterParams.ts
+++ b/plugins/catalog-backend/src/service/request/parseEntityFilterParams.ts
@@ -75,11 +75,9 @@ export function parseEntityFilterString(
const f =
key in filtersByKey ? filtersByKey[key] : (filtersByKey[key] = { key });
- if (value === undefined) {
- f.matchValueExists = true;
- } else {
- f.matchValueIn = f.matchValueIn || [];
- f.matchValueIn.push(value);
+ if (value !== undefined) {
+ f.values = f.values || [];
+ f.values.push(value);
}
}
diff --git a/plugins/catalog-graph/CHANGELOG.md b/plugins/catalog-graph/CHANGELOG.md
index a156be8fe0..c107a4e758 100644
--- a/plugins/catalog-graph/CHANGELOG.md
+++ b/plugins/catalog-graph/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-catalog-graph
+## 0.2.2
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.1
### Patch Changes
diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json
index e58d66b1f2..13869cfd38 100644
--- a/plugins/catalog-graph/package.json
+++ b/plugins/catalog-graph/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-graph",
- "version": "0.2.1",
+ "version": "0.2.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,11 +21,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -41,10 +41,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/catalog-graph/src/routes.ts b/plugins/catalog-graph/src/routes.ts
index 9f8372c7a5..3bca6ce411 100644
--- a/plugins/catalog-graph/src/routes.ts
+++ b/plugins/catalog-graph/src/routes.ts
@@ -24,8 +24,7 @@ import {
* @public
*/
export const catalogGraphRouteRef = createRouteRef({
- path: '/catalog-graph',
- title: 'Catalog Graph',
+ id: 'catalog-graph',
});
/**
diff --git a/plugins/catalog-graphql/package.json b/plugins/catalog-graphql/package.json
index 5df4f9ba5c..a7070a1634 100644
--- a/plugins/catalog-graphql/package.json
+++ b/plugins/catalog-graphql/package.json
@@ -31,7 +31,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/types": "^0.1.1",
"@graphql-modules/core": "^0.7.17",
@@ -43,8 +43,8 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.1",
- "@backstage/test-utils": "^0.1.20",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
"@graphql-codegen/cli": "^1.21.3",
"@graphql-codegen/typescript": "^1.17.7",
"@graphql-codegen/typescript-resolvers": "^1.17.7",
diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md
index d06f38698b..6397718fd7 100644
--- a/plugins/catalog-import/CHANGELOG.md
+++ b/plugins/catalog-import/CHANGELOG.md
@@ -1,5 +1,18 @@
# @backstage/plugin-catalog-import
+## 0.7.4
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/integration-react@0.1.14
+
## 0.7.3
### Patch Changes
diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json
index 242231bf81..933a84f13e 100644
--- a/plugins/catalog-import/package.json
+++ b/plugins/catalog-import/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-import",
"description": "A Backstage plugin the helps you import entities into your catalog",
- "version": "0.7.3",
+ "version": "0.7.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,14 +31,14 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.8",
- "@backstage/integration-react": "^0.1.12",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/integration-react": "^0.1.14",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
@@ -55,10 +55,10 @@
"yaml": "^1.10.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/catalog-import/src/plugin.ts b/plugins/catalog-import/src/plugin.ts
index d7493edcca..52c1929dce 100644
--- a/plugins/catalog-import/src/plugin.ts
+++ b/plugins/catalog-import/src/plugin.ts
@@ -31,8 +31,7 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react';
import { catalogImportApiRef, CatalogImportClient } from './api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'catalog-import',
+ id: 'catalog-import',
});
export const catalogImportPlugin = createPlugin({
diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md
index 79dfa5e72a..e6d00b2f8f 100644
--- a/plugins/catalog-react/CHANGELOG.md
+++ b/plugins/catalog-react/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-catalog-react
+## 0.6.4
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/core-app-api@0.1.21
+
## 0.6.3
### Patch Changes
diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json
index 9778163391..2ae853650a 100644
--- a/plugins/catalog-react/package.json
+++ b/plugins/catalog-react/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-react",
"description": "A frontend library that helps other Backstage plugins interact with the catalog",
- "version": "0.6.3",
+ "version": "0.6.4",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,11 +29,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.6",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-app-api": "^0.1.21",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
"@backstage/types": "^0.1.1",
@@ -51,8 +51,8 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/catalog-react/src/routes.ts b/plugins/catalog-react/src/routes.ts
index 42f394ef61..f29d52f08a 100644
--- a/plugins/catalog-react/src/routes.ts
+++ b/plugins/catalog-react/src/routes.ts
@@ -17,22 +17,18 @@
import { Entity, ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model';
import { createRouteRef } from '@backstage/core-plugin-api';
-const NoIcon = () => null;
-
// TODO(Rugvip): Move these route refs back to the catalog plugin once we're all ported to using external routes
export const rootRoute = createRouteRef({
- icon: NoIcon,
- path: '',
- title: 'Catalog',
+ id: 'catalog',
});
+
export const catalogRouteRef = rootRoute;
export const entityRoute = createRouteRef({
- icon: NoIcon,
- path: ':namespace/:kind/:name/*',
- title: 'Entity',
+ id: 'catalog:entity',
params: ['namespace', 'kind', 'name'],
});
+
export const entityRouteRef = entityRoute;
// Utility function to get suitable route params for entityRoute, given an
diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md
index 0030f702ec..7fda738d32 100644
--- a/plugins/catalog/CHANGELOG.md
+++ b/plugins/catalog/CHANGELOG.md
@@ -1,5 +1,20 @@
# @backstage/plugin-catalog
+## 0.7.3
+
+### Patch Changes
+
+- 38d6df6bb9: Remove the "View Api" icon in the AboutCard, as the information is misleading for some users and is
+ duplicated in the tabs above.
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/integration-react@0.1.14
+
## 0.7.2
### Patch Changes
diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json
index 9697741dde..ddee20c488 100644
--- a/plugins/catalog/package.json
+++ b/plugins/catalog/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog",
"description": "The Backstage plugin for browsing the Backstage catalog",
- "version": "0.7.2",
+ "version": "0.7.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,13 +31,13 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
- "@backstage/integration-react": "^0.1.12",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/integration-react": "^0.1.14",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -51,10 +51,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/catalog/src/components/Router.tsx b/plugins/catalog/src/components/Router.tsx
index 9116c0b551..2a0eacf074 100644
--- a/plugins/catalog/src/components/Router.tsx
+++ b/plugins/catalog/src/components/Router.tsx
@@ -16,8 +16,6 @@
import { ENTITY_DEFAULT_NAMESPACE } from '@backstage/catalog-model';
import {
AsyncEntityProvider,
- entityRoute,
- rootRoute,
useEntity,
useEntityFromUrl,
} from '@backstage/plugin-catalog-react';
@@ -87,9 +85,9 @@ export const Router = ({
EntityPage?: ComponentType;
}) => (
- } />
+ } />
diff --git a/plugins/circleci/CHANGELOG.md b/plugins/circleci/CHANGELOG.md
index 78cd6d9711..18e227627b 100644
--- a/plugins/circleci/CHANGELOG.md
+++ b/plugins/circleci/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-circleci
+## 0.2.29
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.28
### Patch Changes
diff --git a/plugins/circleci/api-report.md b/plugins/circleci/api-report.md
index 25d4af0923..bb4334c0f9 100644
--- a/plugins/circleci/api-report.md
+++ b/plugins/circleci/api-report.md
@@ -16,7 +16,9 @@ import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { GitType } from 'circleci-api';
import { Me } from 'circleci-api';
+import { PathParams } from '@backstage/core-plugin-api';
import { RouteRef } from '@backstage/core-plugin-api';
+import { SubRouteRef } from '@backstage/core-plugin-api';
export { BuildStepAction };
@@ -68,7 +70,7 @@ export const circleCIApiRef: ApiRef;
// Warning: (ae-missing-release-tag) "circleCIBuildRouteRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
-export const circleCIBuildRouteRef: RouteRef;
+export const circleCIBuildRouteRef: SubRouteRef>;
// Warning: (ae-missing-release-tag) "circleCIPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
diff --git a/plugins/circleci/package.json b/plugins/circleci/package.json
index c57d19ea00..7228044f4f 100644
--- a/plugins/circleci/package.json
+++ b/plugins/circleci/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-circleci",
"description": "A Backstage plugin that integrates towards Circle CI",
- "version": "0.2.28",
+ "version": "0.2.29",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,10 +32,10 @@
"postpack": "backstage-cli postpack"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -52,10 +52,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx
index b33e1b40cc..53cbc754cf 100644
--- a/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx
+++ b/plugins/circleci/src/components/BuildsPage/lib/CITable/CITable.tsx
@@ -26,7 +26,7 @@ import {
import RetryIcon from '@material-ui/icons/Replay';
import GitHubIcon from '@material-ui/icons/GitHub';
import LaunchIcon from '@material-ui/icons/Launch';
-import { Link as RouterLink, generatePath } from 'react-router-dom';
+import { Link as RouterLink } from 'react-router-dom';
import { durationHumanized, relativeTimeTo } from '../../../../util';
import { circleCIBuildRouteRef } from '../../../../route-refs';
import {
@@ -38,6 +38,7 @@ import {
Table,
TableColumn,
} from '@backstage/core-components';
+import { useRouteRef } from '@backstage/core-plugin-api';
export type CITableBuildInfo = {
id: string;
@@ -144,16 +145,24 @@ const generatedColumns: TableColumn[] = [
field: 'buildName',
highlight: true,
width: '20%',
- render: (row: Partial) => (
-
- {row.buildName ? row.buildName : row?.workflow?.name}
-
- ),
+ render: (row: Partial) => {
+ const LinkWrapper = () => {
+ const routeLink = useRouteRef(circleCIBuildRouteRef);
+
+ return (
+
+ {row.buildName ? row.buildName : row?.workflow?.name}
+
+ );
+ };
+
+ return ;
+ },
},
{
title: 'Job',
diff --git a/plugins/circleci/src/components/Router.tsx b/plugins/circleci/src/components/Router.tsx
index 1bc13d6327..5aa8dd9df9 100644
--- a/plugins/circleci/src/components/Router.tsx
+++ b/plugins/circleci/src/components/Router.tsx
@@ -16,7 +16,7 @@
import React from 'react';
import { Routes, Route } from 'react-router';
-import { circleCIRouteRef, circleCIBuildRouteRef } from '../route-refs';
+import { circleCIBuildRouteRef } from '../route-refs';
import { BuildWithStepsPage } from './BuildWithStepsPage/';
import { BuildsPage } from './BuildsPage';
import { CIRCLECI_ANNOTATION } from '../constants';
@@ -41,9 +41,9 @@ export const Router = (_props: Props) => {
return (
- } />
+ } />
}
/>
diff --git a/plugins/circleci/src/route-refs.tsx b/plugins/circleci/src/route-refs.tsx
index 197fab4a7b..e8579b9f0d 100644
--- a/plugins/circleci/src/route-refs.tsx
+++ b/plugins/circleci/src/route-refs.tsx
@@ -14,30 +14,14 @@
* limitations under the License.
*/
-import React from 'react';
-import { SvgIcon, SvgIconProps } from '@material-ui/core';
-import { createRouteRef } from '@backstage/core-plugin-api';
-
-const CircleCIIcon = (props: SvgIconProps) => (
-
-
-
-);
+import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
export const circleCIRouteRef = createRouteRef({
- icon: CircleCIIcon,
- path: '',
- title: 'CircleCI | All builds',
+ id: 'circle-ci',
});
-export const circleCIBuildRouteRef = createRouteRef({
- path: ':buildId',
- title: 'CircleCI | Build info',
+export const circleCIBuildRouteRef = createSubRouteRef({
+ id: 'circle-ci/build',
+ parent: circleCIRouteRef,
+ path: '/:buildId',
});
diff --git a/plugins/cloudbuild/CHANGELOG.md b/plugins/cloudbuild/CHANGELOG.md
index dfd17e9908..735f5d2167 100644
--- a/plugins/cloudbuild/CHANGELOG.md
+++ b/plugins/cloudbuild/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-cloudbuild
+## 0.2.28
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.27
### Patch Changes
diff --git a/plugins/cloudbuild/package.json b/plugins/cloudbuild/package.json
index 6521816f73..4125a8c82e 100644
--- a/plugins/cloudbuild/package.json
+++ b/plugins/cloudbuild/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cloudbuild",
"description": "A Backstage plugin that integrates towards Google Cloud Build",
- "version": "0.2.27",
+ "version": "0.2.28",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -49,10 +49,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/cloudbuild/src/components/Router.tsx b/plugins/cloudbuild/src/components/Router.tsx
index f9b9a8974f..bdeae7e8fd 100644
--- a/plugins/cloudbuild/src/components/Router.tsx
+++ b/plugins/cloudbuild/src/components/Router.tsx
@@ -17,7 +17,7 @@ import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Routes, Route } from 'react-router';
-import { rootRouteRef, buildRouteRef } from '../routes';
+import { buildRouteRef } from '../routes';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
import { CLOUDBUILD_ANNOTATION } from './useProjectName';
@@ -40,15 +40,11 @@ export const Router = (_props: Props) => {
}
return (
+ } />
}
- />
- }
/>
- )
);
};
diff --git a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.test.tsx b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.test.tsx
index ac28c5bedf..0152f9d964 100644
--- a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.test.tsx
+++ b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.test.tsx
@@ -18,6 +18,7 @@ import { renderInTestApp } from '@backstage/test-utils';
import React from 'react';
import { WorkflowRunsTableView } from './WorkflowRunsTable';
import { WorkflowRun } from '../useWorkflowRuns';
+import { rootRouteRef } from '../../routes';
describe('', () => {
let runs: WorkflowRun[] = [];
@@ -56,6 +57,7 @@ describe('', () => {
runs={runs}
total={runs.length}
/>,
+ { mountedRoutes: { '/': rootRouteRef } },
);
expect(getByTestId('cell-source')).toHaveAttribute('href', '/run_id_1');
@@ -74,6 +76,7 @@ describe('', () => {
runs={runs}
total={runs.length}
/>,
+ { mountedRoutes: { '/': rootRouteRef } },
);
expect(getByTestId('cell-created')).toHaveTextContent(
@@ -94,6 +97,7 @@ describe('', () => {
runs={runs}
total={runs.length}
/>,
+ { mountedRoutes: { '/': rootRouteRef } },
);
const rerunActionElement = getByTestId('action-rerun');
diff --git a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
index 0d00347183..d79d481cd4 100644
--- a/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
+++ b/plugins/cloudbuild/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
@@ -17,7 +17,7 @@ import React from 'react';
import { Link, Typography, Box, IconButton, Tooltip } from '@material-ui/core';
import RetryIcon from '@material-ui/icons/Replay';
import GoogleIcon from '@material-ui/icons/CloudCircle';
-import { Link as RouterLink, generatePath } from 'react-router-dom';
+import { Link as RouterLink } from 'react-router-dom';
import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import SyncIcon from '@material-ui/icons/Sync';
@@ -26,6 +26,7 @@ import { Entity } from '@backstage/catalog-model';
import { buildRouteRef } from '../../routes';
import { DateTime } from 'luxon';
import { Table, TableColumn } from '@backstage/core-components';
+import { useRouteRef } from '@backstage/core-plugin-api';
const generatedColumns: TableColumn[] = [
{
@@ -54,15 +55,22 @@ const generatedColumns: TableColumn[] = [
field: 'source',
highlight: true,
width: '200px',
- render: (row: Partial) => (
-
- {row.message}
-
- ),
+ render: (row: Partial) => {
+ const LinkWrapper = () => {
+ const routeLink = useRouteRef(buildRouteRef);
+ return (
+
+ {row.message}
+
+ );
+ };
+
+ return ;
+ },
},
{
title: 'Ref',
diff --git a/plugins/cloudbuild/src/routes.ts b/plugins/cloudbuild/src/routes.ts
index 5e3525c529..3737e6948f 100644
--- a/plugins/cloudbuild/src/routes.ts
+++ b/plugins/cloudbuild/src/routes.ts
@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { createRouteRef } from '@backstage/core-plugin-api';
+import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'Google Cloudbuild',
+ id: 'cloudbuild',
});
-export const buildRouteRef = createRouteRef({
- path: ':id',
- title: 'Cloudbuild Run',
+export const buildRouteRef = createSubRouteRef({
+ id: 'cloudbuild/run',
+ path: '/:id',
+ parent: rootRouteRef,
});
diff --git a/plugins/code-coverage-backend/package.json b/plugins/code-coverage-backend/package.json
index 53d52a9246..90320d0e41 100644
--- a/plugins/code-coverage-backend/package.json
+++ b/plugins/code-coverage-backend/package.json
@@ -20,9 +20,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.8",
@@ -37,7 +37,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/express-xml-bodyparser": "^0.3.2",
"@types/supertest": "^2.0.8",
"msw": "^0.35.0",
diff --git a/plugins/code-coverage/CHANGELOG.md b/plugins/code-coverage/CHANGELOG.md
index 572e0f7800..b5b413b9d2 100644
--- a/plugins/code-coverage/CHANGELOG.md
+++ b/plugins/code-coverage/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-code-coverage
+## 0.1.18
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.17
### Patch Changes
diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json
index 0d6e998b69..e5b51e90b4 100644
--- a/plugins/code-coverage/package.json
+++ b/plugins/code-coverage/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-code-coverage",
"description": "A Backstage plugin that helps you keep track of your code coverage",
- "version": "0.1.17",
+ "version": "0.1.18",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,12 +21,12 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -42,10 +42,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/code-coverage/src/routes.ts b/plugins/code-coverage/src/routes.ts
index bf600ab92e..0f590a53b8 100644
--- a/plugins/code-coverage/src/routes.ts
+++ b/plugins/code-coverage/src/routes.ts
@@ -16,5 +16,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'code-coverage',
+ id: 'code-coverage',
});
diff --git a/plugins/config-schema/CHANGELOG.md b/plugins/config-schema/CHANGELOG.md
index c8372532f6..ca889ebdbd 100644
--- a/plugins/config-schema/CHANGELOG.md
+++ b/plugins/config-schema/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-config-schema
+## 0.1.13
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.12
### Patch Changes
diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json
index 0708115270..c9abbc7e4e 100644
--- a/plugins/config-schema/package.json
+++ b/plugins/config-schema/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-config-schema",
"description": "A Backstage plugin that lets you browse the configuration schema of your app",
- "version": "0.1.12",
+ "version": "0.1.13",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,8 +22,8 @@
},
"dependencies": {
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
"@backstage/theme": "^0.2.13",
"@backstage/types": "^0.1.1",
@@ -37,10 +37,10 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/config-schema/src/api/StaticSchemaLoader.ts b/plugins/config-schema/src/api/StaticSchemaLoader.ts
index 48a125f38e..71eae63376 100644
--- a/plugins/config-schema/src/api/StaticSchemaLoader.ts
+++ b/plugins/config-schema/src/api/StaticSchemaLoader.ts
@@ -49,7 +49,7 @@ export class StaticSchemaLoader implements ConfigSchemaApi {
return undefined;
}
- throw ResponseError.fromResponse(res);
+ throw await ResponseError.fromResponse(res);
}
return await res.json();
diff --git a/plugins/config-schema/src/routes.ts b/plugins/config-schema/src/routes.ts
index ebbbdd129c..043301bca1 100644
--- a/plugins/config-schema/src/routes.ts
+++ b/plugins/config-schema/src/routes.ts
@@ -16,5 +16,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'config-schema',
+ id: 'config-schema',
});
diff --git a/plugins/cost-insights/CHANGELOG.md b/plugins/cost-insights/CHANGELOG.md
index 8a7b07af3b..7096af37c6 100644
--- a/plugins/cost-insights/CHANGELOG.md
+++ b/plugins/cost-insights/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-cost-insights
+## 0.11.11
+
+### Patch Changes
+
+- 4576f82858: Fixed generation of sample data in the example Cost Insights client
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.11.10
### Patch Changes
diff --git a/plugins/cost-insights/package.json b/plugins/cost-insights/package.json
index 064b24bd0c..da9ba8b1f6 100644
--- a/plugins/cost-insights/package.json
+++ b/plugins/cost-insights/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-cost-insights",
"description": "A Backstage plugin that helps you keep track of your cloud spend",
- "version": "0.11.10",
+ "version": "0.11.11",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,8 +32,8 @@
},
"dependencies": {
"@backstage/config": "^0.1.10",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -55,10 +55,10 @@
"yup": "^0.32.9"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/cost-insights/src/plugin.ts b/plugins/cost-insights/src/plugin.ts
index cf54dbd957..1714c5fbd5 100644
--- a/plugins/cost-insights/src/plugin.ts
+++ b/plugins/cost-insights/src/plugin.ts
@@ -21,18 +21,15 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/cost-insights',
- title: 'Cost Insights',
+ id: 'cost-insights',
});
export const projectGrowthAlertRef = createRouteRef({
- path: '/cost-insights/investigating-growth',
- title: 'Investigating Growth',
+ id: 'cost-insights:investigating-growth',
});
export const unlabeledDataflowAlertRef = createRouteRef({
- path: '/cost-insights/labeling-jobs',
- title: 'Labeling Dataflow Jobs',
+ id: 'cost-insights:labeling-jobs',
});
export const costInsightsPlugin = createPlugin({
diff --git a/plugins/explore-react/CHANGELOG.md b/plugins/explore-react/CHANGELOG.md
index 4af81f6d8b..0560527f80 100644
--- a/plugins/explore-react/CHANGELOG.md
+++ b/plugins/explore-react/CHANGELOG.md
@@ -1,5 +1,12 @@
# @backstage/plugin-explore-react
+## 0.0.7
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/core-plugin-api@0.2.0
+
## 0.0.6
### Patch Changes
diff --git a/plugins/explore-react/package.json b/plugins/explore-react/package.json
index 1dfd24dff8..a67f8b6892 100644
--- a/plugins/explore-react/package.json
+++ b/plugins/explore-react/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-explore-react",
"description": "A frontend library for Backstage plugins that want to interact with the explore plugin",
- "version": "0.0.6",
+ "version": "0.0.7",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,12 +29,12 @@
"postpack": "backstage-cli postpack"
},
"dependencies": {
- "@backstage/core-plugin-api": "^0.1.11"
+ "@backstage/core-plugin-api": "^0.2.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
- "@backstage/dev-utils": "^0.2.0",
- "@backstage/test-utils": "^0.1.14",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/explore/CHANGELOG.md b/plugins/explore/CHANGELOG.md
index f051691dc5..73117d7f32 100644
--- a/plugins/explore/CHANGELOG.md
+++ b/plugins/explore/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-explore
+## 0.3.21
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/plugin-explore-react@0.0.7
+
## 0.3.20
### Patch Changes
diff --git a/plugins/explore/package.json b/plugins/explore/package.json
index 30890c7176..d9945edc51 100644
--- a/plugins/explore/package.json
+++ b/plugins/explore/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-explore",
"description": "A Backstage plugin for building an exploration page of your software ecosystem",
- "version": "0.3.20",
+ "version": "0.3.21",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,11 +31,11 @@
"start": "backstage-cli plugin:serve"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
- "@backstage/plugin-explore-react": "^0.0.6",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
+ "@backstage/plugin-explore-react": "^0.0.7",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -49,10 +49,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/explore/src/routes.ts b/plugins/explore/src/routes.ts
index 783d334749..d3a94ea4cd 100644
--- a/plugins/explore/src/routes.ts
+++ b/plugins/explore/src/routes.ts
@@ -19,11 +19,8 @@ import {
createRouteRef,
} from '@backstage/core-plugin-api';
-const NoIcon = () => null;
-
export const exploreRouteRef = createRouteRef({
- icon: NoIcon,
- title: 'Explore',
+ id: 'explore',
});
export const catalogEntityRouteRef = createExternalRouteRef({
diff --git a/plugins/firehydrant/CHANGELOG.md b/plugins/firehydrant/CHANGELOG.md
index 2343eb1c2e..b137ed1f73 100644
--- a/plugins/firehydrant/CHANGELOG.md
+++ b/plugins/firehydrant/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-firehydrant
+## 0.1.8
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.7
### Patch Changes
diff --git a/plugins/firehydrant/package.json b/plugins/firehydrant/package.json
index 4e3fbdd3c8..f332efc150 100644
--- a/plugins/firehydrant/package.json
+++ b/plugins/firehydrant/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-firehydrant",
"description": "A Backstage plugin that integrates towards FireHydrant",
- "version": "0.1.7",
+ "version": "0.1.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -22,9 +22,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -35,10 +35,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/firehydrant/src/routes.ts b/plugins/firehydrant/src/routes.ts
index eb2f8b6375..e1e3831f95 100644
--- a/plugins/firehydrant/src/routes.ts
+++ b/plugins/firehydrant/src/routes.ts
@@ -16,5 +16,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'firehydrant',
+ id: 'firehydrant',
});
diff --git a/plugins/fossa/CHANGELOG.md b/plugins/fossa/CHANGELOG.md
index f422dfbe41..af99e13c4a 100644
--- a/plugins/fossa/CHANGELOG.md
+++ b/plugins/fossa/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-fossa
+## 0.2.22
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.21
### Patch Changes
diff --git a/plugins/fossa/package.json b/plugins/fossa/package.json
index 94528a3126..cc0b486d60 100644
--- a/plugins/fossa/package.json
+++ b/plugins/fossa/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-fossa",
"description": "A Backstage plugin that integrates towards FOSSA",
- "version": "0.2.21",
+ "version": "0.2.22",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,11 +32,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -49,10 +49,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/gcp-projects/CHANGELOG.md b/plugins/gcp-projects/CHANGELOG.md
index 28c40f6221..ac8dd570a6 100644
--- a/plugins/gcp-projects/CHANGELOG.md
+++ b/plugins/gcp-projects/CHANGELOG.md
@@ -1,5 +1,30 @@
# @backstage/plugin-gcp-projects
+## 0.3.9
+
+### Patch Changes
+
+- 741bcb168e: UI updates to GCP-projects plugin
+
+ Adds the following to the project list page:
+
+ - pagination
+ - filtering
+ - sorting
+ - rows per page
+ - show/hide columns
+
+ Makes breadcrumb a link back to project list for the project details and new project views.
+
+ In project list page, updates New project button to use RouterLink instead of `href` to avoid login prompt.
+
+ In project details view, links to project details and logs now work, clicking on these will open the project or logs in GCP in new tab.
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.8
### Patch Changes
diff --git a/plugins/gcp-projects/package.json b/plugins/gcp-projects/package.json
index 471b9d80f1..cd1c3ac4a1 100644
--- a/plugins/gcp-projects/package.json
+++ b/plugins/gcp-projects/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-gcp-projects",
"description": "A Backstage plugin that helps you manage projects in GCP",
- "version": "0.3.8",
+ "version": "0.3.9",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,8 +31,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,10 +43,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/gcp-projects/src/routes.ts b/plugins/gcp-projects/src/routes.ts
index 2d302a178d..f527393f5a 100644
--- a/plugins/gcp-projects/src/routes.ts
+++ b/plugins/gcp-projects/src/routes.ts
@@ -17,14 +17,11 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/gcp-projects',
- title: 'GCP Projects',
+ id: 'gcp-projects',
});
export const projectRouteRef = createRouteRef({
- path: '/gcp-projects/project',
- title: 'GCP Project Page',
+ id: 'gcp-projects:project',
});
export const newProjectRouteRef = createRouteRef({
- path: '/gcp-projects/new',
- title: 'GCP Project Page',
+ id: 'gcp-projects:new',
});
diff --git a/plugins/git-release-manager/CHANGELOG.md b/plugins/git-release-manager/CHANGELOG.md
index 72bcf87b2a..1c627ab086 100644
--- a/plugins/git-release-manager/CHANGELOG.md
+++ b/plugins/git-release-manager/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-git-release-manager
+## 0.3.3
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.2
### Patch Changes
diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json
index b1b2c11732..7f7ff6184d 100644
--- a/plugins/git-release-manager/package.json
+++ b/plugins/git-release-manager/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-git-release-manager",
"description": "A Backstage plugin that helps you manage releases in git",
- "version": "0.3.2",
+ "version": "0.3.3",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,8 +21,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/integration": "^0.6.8",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
@@ -39,10 +39,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/git-release-manager/src/routes.ts b/plugins/git-release-manager/src/routes.ts
index 01e4cdf7ff..c4b157892a 100644
--- a/plugins/git-release-manager/src/routes.ts
+++ b/plugins/git-release-manager/src/routes.ts
@@ -17,5 +17,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'git-release-manager',
+ id: 'git-release-manager',
});
diff --git a/plugins/github-actions/CHANGELOG.md b/plugins/github-actions/CHANGELOG.md
index c8fce8e501..5eed309d68 100644
--- a/plugins/github-actions/CHANGELOG.md
+++ b/plugins/github-actions/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-github-actions
+## 0.4.24
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.4.23
### Patch Changes
diff --git a/plugins/github-actions/package.json b/plugins/github-actions/package.json
index 1a4079a5ca..ae7f32be1f 100644
--- a/plugins/github-actions/package.json
+++ b/plugins/github-actions/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-github-actions",
"description": "A Backstage plugin that integrates towards GitHub Actions",
- "version": "0.4.23",
+ "version": "0.4.24",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -33,11 +33,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/integration": "^0.6.8",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -52,10 +52,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/github-actions/src/components/Router.tsx b/plugins/github-actions/src/components/Router.tsx
index cbf29d1d9d..ea07213c45 100644
--- a/plugins/github-actions/src/components/Router.tsx
+++ b/plugins/github-actions/src/components/Router.tsx
@@ -17,7 +17,7 @@ import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Routes, Route } from 'react-router';
-import { rootRouteRef, buildRouteRef } from '../routes';
+import { buildRouteRef } from '../routes';
import { WorkflowRunDetails } from './WorkflowRunDetails';
import { WorkflowRunsTable } from './WorkflowRunsTable';
import { GITHUB_ACTIONS_ANNOTATION } from './useProjectName';
@@ -41,12 +41,9 @@ export const Router = (_props: Props) => {
}
return (
+ } />
}
- />
- }
/>
)
diff --git a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
index 51f26bf5d7..2506613e0c 100644
--- a/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
+++ b/plugins/github-actions/src/components/WorkflowRunsTable/WorkflowRunsTable.tsx
@@ -24,7 +24,7 @@ import {
} from '@material-ui/core';
import RetryIcon from '@material-ui/icons/Replay';
import GitHubIcon from '@material-ui/icons/GitHub';
-import { Link as RouterLink, generatePath } from 'react-router-dom';
+import { Link as RouterLink } from 'react-router-dom';
import { useWorkflowRuns, WorkflowRun } from '../useWorkflowRuns';
import { WorkflowRunStatus } from '../WorkflowRunStatus';
import SyncIcon from '@material-ui/icons/Sync';
@@ -34,7 +34,7 @@ import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { EmptyState, Table, TableColumn } from '@backstage/core-components';
-import { configApiRef, useApi } from '@backstage/core-plugin-api';
+import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';
const generatedColumns: TableColumn[] = [
{
@@ -47,14 +47,18 @@ const generatedColumns: TableColumn[] = [
title: 'Message',
field: 'message',
highlight: true,
- render: (row: Partial) => (
-
- {row.message}
-
- ),
+ render: (row: Partial) => {
+ const LinkWrapper = () => {
+ const routeLink = useRouteRef(buildRouteRef);
+ return (
+
+ {row.message}
+
+ );
+ };
+
+ return ;
+ },
},
{
title: 'Source',
diff --git a/plugins/github-actions/src/routes.ts b/plugins/github-actions/src/routes.ts
index 6e1d8a885a..8e854fad45 100644
--- a/plugins/github-actions/src/routes.ts
+++ b/plugins/github-actions/src/routes.ts
@@ -14,15 +14,14 @@
* limitations under the License.
*/
-import { createRouteRef } from '@backstage/core-plugin-api';
+import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'GitHub Actions',
+ id: 'github-actions',
});
-export const buildRouteRef = createRouteRef({
- path: ':id',
- params: ['id'],
- title: 'GitHub Actions Workflow Run',
+export const buildRouteRef = createSubRouteRef({
+ id: 'github-actions/build',
+ path: '/:id',
+ parent: rootRouteRef,
});
diff --git a/plugins/github-deployments/CHANGELOG.md b/plugins/github-deployments/CHANGELOG.md
index 5259ea11b2..701b167135 100644
--- a/plugins/github-deployments/CHANGELOG.md
+++ b/plugins/github-deployments/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-github-deployments
+## 0.1.21
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/integration-react@0.1.14
+
## 0.1.20
### Patch Changes
diff --git a/plugins/github-deployments/package.json b/plugins/github-deployments/package.json
index 78061951f5..062113a8ef 100644
--- a/plugins/github-deployments/package.json
+++ b/plugins/github-deployments/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-github-deployments",
"description": "A Backstage plugin that integrates towards GitHub Deployments",
- "version": "0.1.20",
+ "version": "0.1.21",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,13 +21,13 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.8",
- "@backstage/integration-react": "^0.1.12",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/integration-react": "^0.1.14",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -39,10 +39,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/gitops-profiles/CHANGELOG.md b/plugins/gitops-profiles/CHANGELOG.md
index 08f256cdb5..42f3533d31 100644
--- a/plugins/gitops-profiles/CHANGELOG.md
+++ b/plugins/gitops-profiles/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-gitops-profiles
+## 0.3.9
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.8
### Patch Changes
diff --git a/plugins/gitops-profiles/package.json b/plugins/gitops-profiles/package.json
index c290599c2c..dfbd6297cf 100644
--- a/plugins/gitops-profiles/package.json
+++ b/plugins/gitops-profiles/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-gitops-profiles",
"description": "A Backstage plugin that helps you manage GitOps profiles",
- "version": "0.3.8",
+ "version": "0.3.9",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,8 +32,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -44,10 +44,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/gitops-profiles/src/routes.ts b/plugins/gitops-profiles/src/routes.ts
index d57edcca2c..b79e5686d2 100644
--- a/plugins/gitops-profiles/src/routes.ts
+++ b/plugins/gitops-profiles/src/routes.ts
@@ -16,23 +16,15 @@
import { createRouteRef } from '@backstage/core-plugin-api';
-const NoIcon = () => null;
-
export const gitOpsClusterListRoute = createRouteRef({
- icon: NoIcon,
- path: '/gitops-clusters',
- title: 'GitOps Clusters',
+ id: 'gitops-clusters',
});
export const gitOpsClusterDetailsRoute = createRouteRef({
- icon: NoIcon,
- path: '/gitops-cluster/:owner/:repo',
- title: 'GitOps Cluster details',
+ id: 'gitops-cluster:details',
params: ['owner', 'repo'],
});
export const gitOpsClusterCreateRoute = createRouteRef({
- icon: NoIcon,
- path: '/gitops-cluster-create',
- title: 'GitOps Cluster create',
+ id: 'gitops-cluster:create',
});
diff --git a/plugins/graphiql/CHANGELOG.md b/plugins/graphiql/CHANGELOG.md
index aa58dbd332..f6c8b9fde8 100644
--- a/plugins/graphiql/CHANGELOG.md
+++ b/plugins/graphiql/CHANGELOG.md
@@ -1,5 +1,13 @@
# @backstage/plugin-graphiql
+## 0.2.21
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.20
### Patch Changes
diff --git a/plugins/graphiql/package.json b/plugins/graphiql/package.json
index df1ad6f887..5c72a4c728 100644
--- a/plugins/graphiql/package.json
+++ b/plugins/graphiql/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-graphiql",
"description": "Backstage plugin for browsing GraphQL APIs",
- "version": "0.2.20",
+ "version": "0.2.21",
"private": false,
"publishConfig": {
"access": "public",
@@ -31,8 +31,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -44,10 +44,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/graphql-backend/package.json b/plugins/graphql-backend/package.json
index 9d90dd8782..335545021e 100644
--- a/plugins/graphql-backend/package.json
+++ b/plugins/graphql-backend/package.json
@@ -31,7 +31,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/config": "^0.1.8",
"@backstage/plugin-catalog-graphql": "^0.2.12",
"@graphql-modules/core": "^0.7.17",
@@ -47,7 +47,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"eslint-plugin-graphql": "^4.0.0",
"msw": "^0.35.0",
diff --git a/plugins/home/CHANGELOG.md b/plugins/home/CHANGELOG.md
index 06beb827a6..09e379a625 100644
--- a/plugins/home/CHANGELOG.md
+++ b/plugins/home/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-home
+## 0.4.6
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.4.5
### Patch Changes
diff --git a/plugins/home/package.json b/plugins/home/package.json
index 8020d7af03..ef13ce3a00 100644
--- a/plugins/home/package.json
+++ b/plugins/home/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-home",
"description": "A Backstage plugin that helps you build a home page",
- "version": "0.4.5",
+ "version": "0.4.6",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,8 +21,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -35,10 +35,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/home/src/routes.ts b/plugins/home/src/routes.ts
index 2c641d8433..7b6b47215b 100644
--- a/plugins/home/src/routes.ts
+++ b/plugins/home/src/routes.ts
@@ -16,5 +16,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'home',
+ id: 'home',
});
diff --git a/plugins/ilert/CHANGELOG.md b/plugins/ilert/CHANGELOG.md
index f43f2add09..1bff4b22ef 100644
--- a/plugins/ilert/CHANGELOG.md
+++ b/plugins/ilert/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-ilert
+## 0.1.17
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.16
### Patch Changes
diff --git a/plugins/ilert/package.json b/plugins/ilert/package.json
index 69c4025181..6011dd4f46 100644
--- a/plugins/ilert/package.json
+++ b/plugins/ilert/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-ilert",
"description": "A Backstage plugin that integrates towards iLert",
- "version": "0.1.16",
+ "version": "0.1.17",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,11 +21,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@date-io/luxon": "1.x",
"@material-ui/core": "^4.12.2",
@@ -39,10 +39,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/ilert/src/route-refs.tsx b/plugins/ilert/src/route-refs.tsx
index 97d11df98a..8a3d53001d 100644
--- a/plugins/ilert/src/route-refs.tsx
+++ b/plugins/ilert/src/route-refs.tsx
@@ -14,11 +14,8 @@
* limitations under the License.
*/
-import ILertIcon from './assets/ilert.icon.svg';
import { createRouteRef } from '@backstage/core-plugin-api';
export const iLertRouteRef = createRouteRef({
- icon: ILertIcon,
- path: '/ilert',
- title: 'iLert',
+ id: 'ilert',
});
diff --git a/plugins/jenkins-backend/package.json b/plugins/jenkins-backend/package.json
index 7049fc0a32..ac9efb3ffd 100644
--- a/plugins/jenkins-backend/package.json
+++ b/plugins/jenkins-backend/package.json
@@ -22,9 +22,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@types/express": "^4.17.6",
"cross-fetch": "^3.0.6",
@@ -35,7 +35,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
+ "@backstage/cli": "^0.9.0",
"@types/jenkins": "^0.23.1",
"@types/supertest": "^2.0.8",
"msw": "^0.35.0",
diff --git a/plugins/jenkins/CHANGELOG.md b/plugins/jenkins/CHANGELOG.md
index 84db4728bc..369676b195 100644
--- a/plugins/jenkins/CHANGELOG.md
+++ b/plugins/jenkins/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-jenkins
+## 0.5.12
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.5.11
### Patch Changes
diff --git a/plugins/jenkins/package.json b/plugins/jenkins/package.json
index 80d8b40322..4456b15284 100644
--- a/plugins/jenkins/package.json
+++ b/plugins/jenkins/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-jenkins",
"description": "A Backstage plugin that integrates towards Jenkins",
- "version": "0.5.11",
+ "version": "0.5.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,10 +32,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx
index ee17df8533..39187fe859 100644
--- a/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx
+++ b/plugins/jenkins/src/components/BuildsPage/lib/CITable/CITable.tsx
@@ -17,12 +17,13 @@ import React from 'react';
import { Box, IconButton, Link, Typography, Tooltip } from '@material-ui/core';
import RetryIcon from '@material-ui/icons/Replay';
import JenkinsLogo from '../../../../assets/JenkinsLogo.svg';
-import { generatePath, Link as RouterLink } from 'react-router-dom';
+import { Link as RouterLink } from 'react-router-dom';
import { JenkinsRunStatus } from '../Status';
import { useBuilds } from '../../../useBuilds';
import { buildRouteRef } from '../../../../plugin';
import { Table, TableColumn } from '@backstage/core-components';
import { Project } from '../../../../api/JenkinsApi';
+import { useRouteRef } from '@backstage/core-plugin-api';
const FailCount = ({ count }: { count: number }): JSX.Element | null => {
if (count !== 0) {
@@ -91,28 +92,33 @@ const generatedColumns: TableColumn[] = [
field: 'fullName',
highlight: true,
render: (row: Partial) => {
- if (!row.fullName || !row.lastBuild?.number) {
- return (
- <>
- {row.fullName ||
- row.fullDisplayName ||
- row.displayName ||
- 'Unknown'}
- >
- );
- }
+ const LinkWrapper = () => {
+ const routeLink = useRouteRef(buildRouteRef);
+ if (!row.fullName || !row.lastBuild?.number) {
+ return (
+ <>
+ {row.fullName ||
+ row.fullDisplayName ||
+ row.displayName ||
+ 'Unknown'}
+ >
+ );
+ }
- return (
-
- {row.fullDisplayName}
-
- );
+ return (
+
+ {row.fullDisplayName}
+
+ );
+ };
+
+ return ;
},
},
{
diff --git a/plugins/jenkins/src/components/Router.tsx b/plugins/jenkins/src/components/Router.tsx
index 35b769e9d9..0d38fe009a 100644
--- a/plugins/jenkins/src/components/Router.tsx
+++ b/plugins/jenkins/src/components/Router.tsx
@@ -19,7 +19,7 @@ import { useEntity } from '@backstage/plugin-catalog-react';
import React from 'react';
import { Route, Routes } from 'react-router';
import { JENKINS_ANNOTATION, LEGACY_JENKINS_ANNOTATION } from '../constants';
-import { buildRouteRef, rootRouteRef } from '../plugin';
+import { buildRouteRef } from '../plugin';
import { CITable } from './BuildsPage/lib/CITable';
import { DetailedViewPage } from './BuildWithStepsPage/';
@@ -41,7 +41,7 @@ export const Router = (_props: Props) => {
return (
- } />
+ } />
} />
);
diff --git a/plugins/jenkins/src/plugin.ts b/plugins/jenkins/src/plugin.ts
index d445a8cfb1..c32c9b50d1 100644
--- a/plugins/jenkins/src/plugin.ts
+++ b/plugins/jenkins/src/plugin.ts
@@ -20,20 +20,20 @@ import {
createPlugin,
createRoutableExtension,
createRouteRef,
+ createSubRouteRef,
discoveryApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { JenkinsClient, jenkinsApiRef } from './api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'Jenkins',
+ id: 'jenkins',
});
-export const buildRouteRef = createRouteRef({
- path: 'build/:jobFullName/:buildNumber',
- params: ['jobFullName', 'buildNumber'],
- title: 'Jenkins build',
+export const buildRouteRef = createSubRouteRef({
+ id: 'jenkins/builds',
+ path: '/builds/:jobFullName/:buildNumber',
+ parent: rootRouteRef,
});
export const jenkinsPlugin = createPlugin({
diff --git a/plugins/kafka-backend/CHANGELOG.md b/plugins/kafka-backend/CHANGELOG.md
index 88111cd1de..482c1f75b1 100644
--- a/plugins/kafka-backend/CHANGELOG.md
+++ b/plugins/kafka-backend/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-kafka-backend
+## 0.2.11
+
+### Patch Changes
+
+- 9145449220: Update Kafka configuration types
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/backend-common@0.9.10
+
## 0.2.10
### Patch Changes
diff --git a/plugins/kafka-backend/package.json b/plugins/kafka-backend/package.json
index e271decc8b..dea803890f 100644
--- a/plugins/kafka-backend/package.json
+++ b/plugins/kafka-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-kafka-backend",
"description": "A Backstage backend plugin that integrates towards Kafka",
- "version": "0.2.10",
+ "version": "0.2.11",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,8 +32,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@types/express": "^4.17.6",
@@ -44,7 +44,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/jest-when": "^2.7.2",
"@types/lodash": "^4.14.151",
"jest-when": "^3.1.0",
diff --git a/plugins/kafka/CHANGELOG.md b/plugins/kafka/CHANGELOG.md
index 2fe42565da..33ec4bd95a 100644
--- a/plugins/kafka/CHANGELOG.md
+++ b/plugins/kafka/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-kafka
+## 0.2.21
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.20
### Patch Changes
diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json
index 888c79db59..a6fbe36e99 100644
--- a/plugins/kafka/package.json
+++ b/plugins/kafka/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-kafka",
"description": "A Backstage plugin that integrates towards Kafka",
- "version": "0.2.20",
+ "version": "0.2.21",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,10 +21,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -35,10 +35,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/kafka/src/Router.tsx b/plugins/kafka/src/Router.tsx
index 977c71712e..c63019253b 100644
--- a/plugins/kafka/src/Router.tsx
+++ b/plugins/kafka/src/Router.tsx
@@ -18,7 +18,6 @@ import { Entity } from '@backstage/catalog-model';
import React from 'react';
import { Route, Routes } from 'react-router';
import { useEntity } from '@backstage/plugin-catalog-react';
-import { rootCatalogKafkaRouteRef } from './plugin';
import { KAFKA_CONSUMER_GROUP_ANNOTATION } from './constants';
import { KafkaTopicsForConsumer } from './components/ConsumerGroupOffsets/ConsumerGroupOffsets';
import { MissingAnnotationEmptyState } from '@backstage/core-components';
@@ -44,10 +43,7 @@ export const Router = (_props: Props) => {
return (
- }
- />
+ } />
);
};
diff --git a/plugins/kafka/src/plugin.ts b/plugins/kafka/src/plugin.ts
index 539b0a0fda..0c345cdabc 100644
--- a/plugins/kafka/src/plugin.ts
+++ b/plugins/kafka/src/plugin.ts
@@ -25,8 +25,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootCatalogKafkaRouteRef = createRouteRef({
- path: '*',
- title: 'Kafka',
+ id: 'kafka',
});
export const kafkaPlugin = createPlugin({
diff --git a/plugins/kubernetes-backend/package.json b/plugins/kubernetes-backend/package.json
index be2903dff5..4edc7b238a 100644
--- a/plugins/kubernetes-backend/package.json
+++ b/plugins/kubernetes-backend/package.json
@@ -32,8 +32,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@backstage/plugin-kubernetes-common": "^0.1.4",
@@ -55,7 +55,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/aws4": "^1.5.1",
"supertest": "^6.1.3",
"aws-sdk-mock": "^5.2.1",
diff --git a/plugins/kubernetes-common/package.json b/plugins/kubernetes-common/package.json
index 28dfc94c49..3c9cb5e357 100644
--- a/plugins/kubernetes-common/package.json
+++ b/plugins/kubernetes-common/package.json
@@ -35,11 +35,11 @@
"url": "https://github.com/backstage/backstage/issues"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/catalog-model": "^0.9.7",
"@kubernetes/client-node": "^0.15.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0"
+ "@backstage/cli": "^0.9.0"
},
"jest": {
"roots": [
diff --git a/plugins/kubernetes/CHANGELOG.md b/plugins/kubernetes/CHANGELOG.md
index a757041b32..0ae3a6c012 100644
--- a/plugins/kubernetes/CHANGELOG.md
+++ b/plugins/kubernetes/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-kubernetes
+## 0.4.20
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.4.19
### Patch Changes
diff --git a/plugins/kubernetes/package.json b/plugins/kubernetes/package.json
index 9dbca8aff8..618f814c21 100644
--- a/plugins/kubernetes/package.json
+++ b/plugins/kubernetes/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-kubernetes",
"description": "A Backstage plugin that integrates towards Kubernetes",
- "version": "0.4.19",
+ "version": "0.4.20",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,11 +31,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/plugin-kubernetes-common": "^0.1.5",
"@backstage/theme": "^0.2.13",
"@kubernetes/client-node": "^0.15.0",
@@ -51,10 +51,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/kubernetes/src/Router.tsx b/plugins/kubernetes/src/Router.tsx
index f98d3ca45e..873bf128e4 100644
--- a/plugins/kubernetes/src/Router.tsx
+++ b/plugins/kubernetes/src/Router.tsx
@@ -18,7 +18,6 @@ import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { useEntity } from '@backstage/plugin-catalog-react';
import { Route, Routes } from 'react-router-dom';
-import { rootCatalogKubernetesRouteRef } from './plugin';
import { KubernetesContent } from './components/KubernetesContent';
import { Button } from '@material-ui/core';
import { MissingAnnotationEmptyState } from '@backstage/core-components';
@@ -53,10 +52,7 @@ export const Router = (_props: Props) => {
) {
return (
- }
- />
+ } />
);
}
diff --git a/plugins/kubernetes/src/plugin.ts b/plugins/kubernetes/src/plugin.ts
index 3f2d8c6a87..a1f2f57621 100644
--- a/plugins/kubernetes/src/plugin.ts
+++ b/plugins/kubernetes/src/plugin.ts
@@ -28,8 +28,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootCatalogKubernetesRouteRef = createRouteRef({
- path: '*',
- title: 'Kubernetes',
+ id: 'kubernetes',
});
export const kubernetesPlugin = createPlugin({
diff --git a/plugins/lighthouse/CHANGELOG.md b/plugins/lighthouse/CHANGELOG.md
index 4ff76d4f1b..48ef9a178d 100644
--- a/plugins/lighthouse/CHANGELOG.md
+++ b/plugins/lighthouse/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-lighthouse
+## 0.2.30
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.29
### Patch Changes
diff --git a/plugins/lighthouse/package.json b/plugins/lighthouse/package.json
index f0dca639fc..e53f6ee261 100644
--- a/plugins/lighthouse/package.json
+++ b/plugins/lighthouse/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-lighthouse",
"description": "A Backstage plugin that integrates towards Lighthouse",
- "version": "0.2.29",
+ "version": "0.2.30",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,11 +32,11 @@
"start": "backstage-cli plugin:serve"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -47,10 +47,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/lighthouse/src/plugin.ts b/plugins/lighthouse/src/plugin.ts
index 25cbeb3f31..1c9bc295f8 100644
--- a/plugins/lighthouse/src/plugin.ts
+++ b/plugins/lighthouse/src/plugin.ts
@@ -25,22 +25,19 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'Lighthouse',
+ id: 'lighthouse',
});
export const viewAuditRouteRef = createRouteRef({
- path: 'audit/:id',
- title: 'View Lighthouse Audit',
+ id: 'lighthouse:audit',
});
export const createAuditRouteRef = createRouteRef({
- path: 'create-audit',
- title: 'Create Lighthouse Audit',
+ id: 'lighthouse:create-audit',
});
export const entityContentRouteRef = createRouteRef({
- title: 'Lighthouse Entity Content',
+ id: 'lighthouse:entity-content',
});
export const lighthousePlugin = createPlugin({
diff --git a/plugins/newrelic/CHANGELOG.md b/plugins/newrelic/CHANGELOG.md
index 7ffd4b06d1..89b77e9866 100644
--- a/plugins/newrelic/CHANGELOG.md
+++ b/plugins/newrelic/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-newrelic
+## 0.3.9
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.8
### Patch Changes
diff --git a/plugins/newrelic/package.json b/plugins/newrelic/package.json
index 271daa566e..16029f1783 100644
--- a/plugins/newrelic/package.json
+++ b/plugins/newrelic/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-newrelic",
"description": "A Backstage plugin that integrates towards New Relic",
- "version": "0.3.8",
+ "version": "0.3.9",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,8 +32,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,10 +43,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/newrelic/src/plugin.ts b/plugins/newrelic/src/plugin.ts
index cb2505e36e..6cf77a785f 100644
--- a/plugins/newrelic/src/plugin.ts
+++ b/plugins/newrelic/src/plugin.ts
@@ -24,8 +24,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/newrelic',
- title: 'newrelic',
+ id: 'newrelic',
});
export const newRelicPlugin = createPlugin({
diff --git a/plugins/org/CHANGELOG.md b/plugins/org/CHANGELOG.md
index 6e1cc7064f..f46095f46a 100644
--- a/plugins/org/CHANGELOG.md
+++ b/plugins/org/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-org
+## 0.3.28
+
+### Patch Changes
+
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.27
### Patch Changes
diff --git a/plugins/org/package.json b/plugins/org/package.json
index 5348f67523..db6cfe4d0b 100644
--- a/plugins/org/package.json
+++ b/plugins/org/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-org",
"description": "A Backstage plugin that helps you create entity pages for your organization",
- "version": "0.3.27",
+ "version": "0.3.28",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,10 +21,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -37,10 +37,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/pagerduty/CHANGELOG.md b/plugins/pagerduty/CHANGELOG.md
index 11ae548db8..bb74598f2a 100644
--- a/plugins/pagerduty/CHANGELOG.md
+++ b/plugins/pagerduty/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-pagerduty
+## 0.3.18
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.17
### Patch Changes
diff --git a/plugins/pagerduty/package.json b/plugins/pagerduty/package.json
index 7b42a15bc6..7981b2c104 100644
--- a/plugins/pagerduty/package.json
+++ b/plugins/pagerduty/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-pagerduty",
"description": "A Backstage plugin that integrates towards PagerDuty",
- "version": "0.3.17",
+ "version": "0.3.18",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,10 +31,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/pagerduty/src/plugin.ts b/plugins/pagerduty/src/plugin.ts
index fb1e573f0c..d1c4e6d35b 100644
--- a/plugins/pagerduty/src/plugin.ts
+++ b/plugins/pagerduty/src/plugin.ts
@@ -24,8 +24,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/pagerduty',
- title: 'pagerduty',
+ id: 'pagerduty',
});
export const pagerDutyPlugin = createPlugin({
diff --git a/plugins/permission-common/api-report.md b/plugins/permission-common/api-report.md
index cbf1877c75..043b27554c 100644
--- a/plugins/permission-common/api-report.md
+++ b/plugins/permission-common/api-report.md
@@ -3,6 +3,8 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
+import { Config } from '@backstage/config';
+
// @public
export type AuthorizeRequest = {
permission: Permission;
@@ -67,7 +69,7 @@ export type PermissionAttributes = {
// @public
export class PermissionClient {
- constructor(options: { discoveryApi: DiscoveryApi; enabled?: boolean });
+ constructor(options: { discoveryApi: DiscoveryApi; configApi: Config });
authorize(
requests: AuthorizeRequest[],
options?: AuthorizeRequestOptions,
diff --git a/plugins/permission-common/package.json b/plugins/permission-common/package.json
index 5e79c1ba7b..9e1d60f782 100644
--- a/plugins/permission-common/package.json
+++ b/plugins/permission-common/package.json
@@ -38,13 +38,14 @@
"url": "https://github.com/backstage/backstage/issues"
},
"dependencies": {
+ "@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.2",
"cross-fetch": "^3.0.6",
"uuid": "^8.0.0",
"zod": "^3.11.6"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/jest": "^26.0.7",
"msw": "^0.35.0"
}
diff --git a/plugins/permission-common/src/PermissionClient.test.ts b/plugins/permission-common/src/PermissionClient.test.ts
index 06e2ae0561..b2e66986a1 100644
--- a/plugins/permission-common/src/PermissionClient.test.ts
+++ b/plugins/permission-common/src/PermissionClient.test.ts
@@ -16,6 +16,7 @@
import { RestContext, rest } from 'msw';
import { setupServer } from 'msw/node';
+import { ConfigReader } from '@backstage/config';
import { PermissionClient } from './PermissionClient';
import { AuthorizeRequest, AuthorizeResult, Identified } from './types/api';
import { DiscoveryApi } from './types/discovery';
@@ -32,7 +33,7 @@ const discoveryApi: DiscoveryApi = {
};
const client: PermissionClient = new PermissionClient({
discoveryApi,
- enabled: true,
+ configApi: new ConfigReader({ permission: { enabled: true } }),
});
const mockPermission: Permission = {
@@ -145,7 +146,7 @@ describe('PermissionClient', () => {
).rejects.toThrowError(/invalid input/i);
});
- it('should allow all when authorization is not enabled', async () => {
+ it('should allow all when permission.enabled is false', async () => {
mockAuthorizeHandler.mockImplementationOnce(
(req, res, { json }: RestContext) => {
const responses = req.body.map((a: Identified) => ({
@@ -156,7 +157,32 @@ describe('PermissionClient', () => {
return res(json(responses));
},
);
- const disabled = new PermissionClient({ discoveryApi, enabled: false });
+ const disabled = new PermissionClient({
+ discoveryApi,
+ configApi: new ConfigReader({ permission: { enabled: false } }),
+ });
+ const response = await disabled.authorize([mockAuthorizeRequest]);
+ expect(response[0]).toEqual(
+ expect.objectContaining({ result: AuthorizeResult.ALLOW }),
+ );
+ expect(mockAuthorizeHandler).not.toBeCalled();
+ });
+
+ it('should allow all when permission.enabled is not configured', async () => {
+ mockAuthorizeHandler.mockImplementationOnce(
+ (req, res, { json }: RestContext) => {
+ const responses = req.body.map((a: Identified) => ({
+ id: a.id,
+ outcome: AuthorizeResult.DENY,
+ }));
+
+ return res(json(responses));
+ },
+ );
+ const disabled = new PermissionClient({
+ discoveryApi,
+ configApi: new ConfigReader({}),
+ });
const response = await disabled.authorize([mockAuthorizeRequest]);
expect(response[0]).toEqual(
expect.objectContaining({ result: AuthorizeResult.ALLOW }),
diff --git a/plugins/permission-common/src/PermissionClient.ts b/plugins/permission-common/src/PermissionClient.ts
index 5b17ccd333..f98d40a3c4 100644
--- a/plugins/permission-common/src/PermissionClient.ts
+++ b/plugins/permission-common/src/PermissionClient.ts
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+import { Config } from '@backstage/config';
import { ResponseError } from '@backstage/errors';
import fetch from 'cross-fetch';
import * as uuid from 'uuid';
@@ -74,9 +75,10 @@ export class PermissionClient {
private readonly enabled: boolean;
private readonly discoveryApi: DiscoveryApi;
- constructor(options: { discoveryApi: DiscoveryApi; enabled?: boolean }) {
+ constructor(options: { discoveryApi: DiscoveryApi; configApi: Config }) {
this.discoveryApi = options.discoveryApi;
- this.enabled = options.enabled ?? false;
+ this.enabled =
+ options.configApi.getOptionalBoolean('permission.enabled') ?? false;
}
/**
diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json
index c43ea8b31a..05499d88e8 100644
--- a/plugins/proxy-backend/package.json
+++ b/plugins/proxy-backend/package.json
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/config": "^0.1.8",
"@types/express": "^4.17.6",
"express": "^4.17.1",
@@ -43,7 +43,7 @@
"yup": "^0.32.9"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/http-proxy-middleware": "^0.19.3",
"@types/supertest": "^2.0.8",
"@types/uuid": "^8.0.0",
diff --git a/plugins/rollbar-backend/package.json b/plugins/rollbar-backend/package.json
index 1d7be09b85..be8b6e65e5 100644
--- a/plugins/rollbar-backend/package.json
+++ b/plugins/rollbar-backend/package.json
@@ -31,7 +31,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/config": "^0.1.10",
"@types/express": "^4.17.6",
"axios": "^0.21.1",
@@ -48,7 +48,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.3"
},
diff --git a/plugins/rollbar/CHANGELOG.md b/plugins/rollbar/CHANGELOG.md
index 4f7f3c9a16..aee0a74525 100644
--- a/plugins/rollbar/CHANGELOG.md
+++ b/plugins/rollbar/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-rollbar
+## 0.3.19
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.18
### Patch Changes
diff --git a/plugins/rollbar/package.json b/plugins/rollbar/package.json
index 2e2da0a284..ee3fc9f5a6 100644
--- a/plugins/rollbar/package.json
+++ b/plugins/rollbar/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-rollbar",
"description": "A Backstage plugin that integrates towards Rollbar",
- "version": "0.3.18",
+ "version": "0.3.19",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,10 +32,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -49,10 +49,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/rollbar/src/components/Router.tsx b/plugins/rollbar/src/components/Router.tsx
index 845da22a20..032bf0166e 100644
--- a/plugins/rollbar/src/components/Router.tsx
+++ b/plugins/rollbar/src/components/Router.tsx
@@ -19,7 +19,6 @@ import { useEntity } from '@backstage/plugin-catalog-react';
import React from 'react';
import { Route, Routes } from 'react-router';
import { ROLLBAR_ANNOTATION } from '../constants';
-import { rootRouteRef } from '../plugin';
import { EntityPageRollbar } from './EntityPageRollbar/EntityPageRollbar';
import { MissingAnnotationEmptyState } from '@backstage/core-components';
@@ -40,10 +39,7 @@ export const Router = (_props: Props) => {
return (
- }
- />
+ } />
);
};
diff --git a/plugins/rollbar/src/plugin.ts b/plugins/rollbar/src/plugin.ts
index b0de6510f3..3ca456058f 100644
--- a/plugins/rollbar/src/plugin.ts
+++ b/plugins/rollbar/src/plugin.ts
@@ -26,8 +26,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '',
- title: 'Rollbar',
+ id: 'rollbar',
});
export const rollbarPlugin = createPlugin({
diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json
index 36a6310aa2..90258d3c28 100644
--- a/plugins/scaffolder-backend-module-cookiecutter/package.json
+++ b/plugins/scaffolder-backend-module-cookiecutter/package.json
@@ -20,10 +20,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
- "@backstage/plugin-scaffolder-backend": "^0.15.12",
+ "@backstage/plugin-scaffolder-backend": "^0.15.13",
"@backstage/config": "^0.1.11",
"@backstage/types": "^0.1.1",
"command-exists": "^1.2.9",
@@ -33,7 +33,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
+ "@backstage/cli": "^0.9.0",
"@types/fs-extra": "^9.0.1",
"@types/mock-fs": "^4.13.0",
"@types/jest": "^26.0.7",
diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json
index f4ace02eca..37b077568e 100644
--- a/plugins/scaffolder-backend-module-rails/package.json
+++ b/plugins/scaffolder-backend-module-rails/package.json
@@ -21,8 +21,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/plugin-scaffolder-backend": "^0.15.12",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/plugin-scaffolder-backend": "^0.15.13",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
@@ -31,7 +31,7 @@
"fs-extra": "^9.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
+ "@backstage/cli": "^0.9.0",
"@types/jest": "^26.0.7",
"@types/node": "^14.14.32",
"@types/command-exists": "^1.2.0",
diff --git a/plugins/scaffolder-backend/CHANGELOG.md b/plugins/scaffolder-backend/CHANGELOG.md
index de033eabbd..f71849a1d2 100644
--- a/plugins/scaffolder-backend/CHANGELOG.md
+++ b/plugins/scaffolder-backend/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-scaffolder-backend
+## 0.15.13
+
+### Patch Changes
+
+- 26eb174ce8: Skip empty file names when scaffolding with nunjucks
+- ecdcbd08ee: Expose template metadata to custom action handler in Scaffolder.
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/backend-common@0.9.10
+ - @backstage/plugin-catalog-backend@0.17.4
+
## 0.15.12
### Patch Changes
diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md
index 3f9b77a3a3..4b27b938c9 100644
--- a/plugins/scaffolder-backend/api-report.md
+++ b/plugins/scaffolder-backend/api-report.md
@@ -41,6 +41,7 @@ export type ActionContext = {
input: Input;
output(name: string, value: JsonValue): void;
createTemporaryDirectory(): Promise;
+ metadata?: TemplateMetadata;
};
// Warning: (ae-missing-release-tag) "CatalogEntityClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -432,6 +433,8 @@ export interface TaskSpecV1beta2 {
// (undocumented)
baseUrl?: string;
// (undocumented)
+ metadata?: TemplateMetadata;
+ // (undocumented)
output: {
[name: string]: string;
};
@@ -454,6 +457,8 @@ export interface TaskSpecV1beta3 {
// (undocumented)
baseUrl?: string;
// (undocumented)
+ metadata?: TemplateMetadata;
+ // (undocumented)
output: {
[name: string]: JsonValue;
};
@@ -558,4 +563,9 @@ export class TemplateActionRegistry {
action: TemplateAction,
): void;
}
+
+// @public
+export type TemplateMetadata = {
+ name: string;
+};
```
diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json
index e5d13801ba..374cfeffd6 100644
--- a/plugins/scaffolder-backend/package.json
+++ b/plugins/scaffolder-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-scaffolder-backend",
"description": "The Backstage backend plugin that helps you create new things",
- "version": "0.15.12",
+ "version": "0.15.13",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,13 +30,13 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
- "@backstage/plugin-catalog-backend": "^0.17.3",
+ "@backstage/plugin-catalog-backend": "^0.17.4",
"@backstage/plugin-scaffolder-common": "^0.1.1",
"@backstage/plugin-scaffolder-backend-module-cookiecutter": "^0.1.4",
"@backstage/types": "^0.1.1",
@@ -71,8 +71,8 @@
"yaml": "^1.10.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
"@types/command-exists": "^1.2.0",
"@types/fs-extra": "^9.0.1",
"@types/git-url-parse": "^9.0.0",
diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/types.ts b/plugins/scaffolder-backend/src/scaffolder/actions/types.ts
index ca3459d29c..52149be724 100644
--- a/plugins/scaffolder-backend/src/scaffolder/actions/types.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/actions/types.ts
@@ -18,6 +18,7 @@ import { Logger } from 'winston';
import { Writable } from 'stream';
import { JsonValue, JsonObject } from '@backstage/types';
import { Schema } from 'jsonschema';
+import { TemplateMetadata } from '../tasks/types';
type PartialJsonObject = Partial;
type PartialJsonValue = PartialJsonObject | JsonValue | undefined;
@@ -44,6 +45,8 @@ export type ActionContext = {
* Creates a temporary directory for use by the action, which is then cleaned up automatically.
*/
createTemporaryDirectory(): Promise;
+
+ metadata?: TemplateMetadata;
};
export type TemplateAction = {
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/DefaultWorkflowRunner.test.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/DefaultWorkflowRunner.test.ts
index d07ff29fae..1f7877791c 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/DefaultWorkflowRunner.test.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/DefaultWorkflowRunner.test.ts
@@ -146,6 +146,30 @@ describe('DefaultWorkflowRunner', () => {
expect(fakeActionHandler).toHaveBeenCalledTimes(1);
});
+
+ it('should pass metadata through', async () => {
+ const templateName = 'template name';
+ const task = createMockTaskWithSpec({
+ apiVersion: 'scaffolder.backstage.io/v1beta3',
+ parameters: {},
+ output: {},
+ steps: [
+ {
+ id: 'test',
+ name: 'name',
+ action: 'jest-validated-action',
+ input: { foo: 1 },
+ },
+ ],
+ metadata: { name: templateName },
+ });
+
+ await runner.execute(task);
+
+ expect(fakeActionHandler.mock.calls[0][0].metadata).toEqual({
+ name: templateName,
+ });
+ });
});
describe('conditionals', () => {
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/HandlebarsWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/HandlebarsWorkflowRunner.ts
index 77d0a7be09..5582b53023 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/HandlebarsWorkflowRunner.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/HandlebarsWorkflowRunner.ts
@@ -225,6 +225,12 @@ export class HandlebarsWorkflowRunner implements WorkflowRunner {
input: JSON.stringify(input, null, 2),
});
+ if (!task.spec.metadata) {
+ console.warn(
+ 'DEPRECATION NOTICE: metadata is undefined. metadata will be required in the future.',
+ );
+ }
+
await action.handler({
baseUrl: task.spec.baseUrl,
logger: taskLogger,
@@ -242,6 +248,7 @@ export class HandlebarsWorkflowRunner implements WorkflowRunner {
output(name: string, value: JsonValue) {
stepOutputs[name] = value;
},
+ metadata: task.spec.metadata,
});
// Remove all temporary directories that were created when executing the action
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/LegacyWorkflowRunner.test.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/LegacyWorkflowRunner.test.ts
index 91e772dc4e..9b05c43831 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/LegacyWorkflowRunner.test.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/LegacyWorkflowRunner.test.ts
@@ -28,6 +28,7 @@ describe('LegacyWorkflowRunner', () => {
let runner: HandlebarsWorkflowRunner;
const logger = getVoidLogger();
let actionRegistry = new TemplateActionRegistry();
+ let fakeActionHandler: jest.Mock;
const integrations = ScmIntegrations.fromConfig(
new ConfigReader({
@@ -59,6 +60,11 @@ describe('LegacyWorkflowRunner', () => {
ctx.output('badOutput', false);
},
});
+ fakeActionHandler = jest.fn();
+ actionRegistry.register({
+ id: 'test-metadata-action',
+ handler: fakeActionHandler,
+ });
runner = new HandlebarsWorkflowRunner({
actionRegistry,
@@ -87,6 +93,30 @@ describe('LegacyWorkflowRunner', () => {
);
});
+ it('should pass metadata through', async () => {
+ const templateName = 'template name';
+ const task = createMockTaskWithSpec({
+ apiVersion: 'backstage.io/v1beta2',
+ steps: [
+ {
+ id: 'test',
+ name: 'name',
+ action: 'test-metadata-action',
+ input: { foo: 1 },
+ },
+ ],
+ output: {},
+ values: {},
+ metadata: { name: templateName },
+ });
+
+ await runner.execute(task);
+
+ expect(fakeActionHandler.mock.calls[0][0].metadata).toEqual({
+ name: templateName,
+ });
+ });
+
describe('templating', () => {
it('should template the output', async () => {
const task = createMockTaskWithSpec({
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts
index 587a93e1f2..c66d967103 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts
@@ -228,6 +228,12 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
const tmpDirs = new Array();
const stepOutput: { [outputName: string]: JsonValue } = {};
+ if (!task.spec.metadata) {
+ console.warn(
+ 'DEPRECATION NOTICE: metadata is undefined. metadata will be required in the future.',
+ );
+ }
+
await action.handler({
baseUrl: task.spec.baseUrl,
input,
@@ -244,6 +250,7 @@ export class NunjucksWorkflowRunner implements WorkflowRunner {
output(name: string, value: JsonValue) {
stepOutput[name] = value;
},
+ metadata: task.spec.metadata,
});
// Remove all temporary directories that were created when executing the action
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/index.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/index.ts
index 510c862dae..f563a08df6 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/index.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/index.ts
@@ -34,4 +34,5 @@ export type {
TaskContext,
TaskStore,
DispatchResult,
+ TemplateMetadata,
} from './types';
diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts
index 6cfd914bd2..b492f8ad2c 100644
--- a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts
+++ b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts
@@ -69,6 +69,15 @@ export type SerializedTaskEvent = {
createdAt: string;
};
+/**
+ * TemplateMetadata
+ *
+ * @public
+ */
+export type TemplateMetadata = {
+ name: string;
+};
+
/**
* TaskSpecV1beta2
*
@@ -86,6 +95,7 @@ export interface TaskSpecV1beta2 {
if?: string | boolean;
}>;
output: { [name: string]: string };
+ metadata?: TemplateMetadata;
}
export interface TaskStep {
@@ -107,6 +117,7 @@ export interface TaskSpecV1beta3 {
parameters: JsonObject;
steps: TaskStep[];
output: { [name: string]: JsonValue };
+ metadata?: TemplateMetadata;
}
/**
diff --git a/plugins/scaffolder-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts
index 2ae30593f2..b8f2968287 100644
--- a/plugins/scaffolder-backend/src/service/router.ts
+++ b/plugins/scaffolder-backend/src/service/router.ts
@@ -209,6 +209,7 @@ export async function createRouter(
name: step.name ?? step.action,
})),
output: template.spec.output ?? {},
+ metadata: { name: template.metadata?.name },
}
: {
apiVersion: template.apiVersion,
@@ -220,6 +221,7 @@ export async function createRouter(
name: step.name ?? step.action,
})),
output: template.spec.output ?? {},
+ metadata: { name: template.metadata?.name },
};
} else {
throw new InputError(
diff --git a/plugins/scaffolder-common/package.json b/plugins/scaffolder-common/package.json
index 006d8ad7aa..05d5ae3031 100644
--- a/plugins/scaffolder-common/package.json
+++ b/plugins/scaffolder-common/package.json
@@ -36,10 +36,10 @@
"url": "https://github.com/backstage/backstage/issues"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/types": "^0.1.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.1"
+ "@backstage/cli": "^0.9.0"
}
}
diff --git a/plugins/scaffolder/CHANGELOG.md b/plugins/scaffolder/CHANGELOG.md
index dd5653240a..8c43d8d010 100644
--- a/plugins/scaffolder/CHANGELOG.md
+++ b/plugins/scaffolder/CHANGELOG.md
@@ -1,5 +1,19 @@
# @backstage/plugin-scaffolder
+## 0.11.11
+
+### Patch Changes
+
+- 8809b6c0dd: Update the json-schema dependency version.
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/integration-react@0.1.14
+
## 0.11.10
### Patch Changes
diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json
index 594a8e6423..a47cee2d75 100644
--- a/plugins/scaffolder/package.json
+++ b/plugins/scaffolder/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-scaffolder",
"description": "The Backstage plugin that helps you create new things",
- "version": "0.11.10",
+ "version": "0.11.11",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,15 +31,15 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-client": "^0.5.1",
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
- "@backstage/integration-react": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/integration-react": "^0.1.14",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@backstage/types": "^0.1.1",
"@material-ui/core": "^4.12.2",
@@ -66,10 +66,10 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts
index a16ab59053..34e16708ea 100644
--- a/plugins/scaffolder/src/api.ts
+++ b/plugins/scaffolder/src/api.ts
@@ -187,7 +187,7 @@ export class ScaffolderClient implements ScaffolderApi {
});
if (!response.ok) {
- throw ResponseError.fromResponse(response);
+ throw await ResponseError.fromResponse(response);
}
return await response.json();
@@ -302,7 +302,7 @@ export class ScaffolderClient implements ScaffolderApi {
});
if (!response.ok) {
- throw ResponseError.fromResponse(response);
+ throw await ResponseError.fromResponse(response);
}
return await response.json();
diff --git a/plugins/scaffolder/src/routes.ts b/plugins/scaffolder/src/routes.ts
index 9b4861fc1e..df5868c9ea 100644
--- a/plugins/scaffolder/src/routes.ts
+++ b/plugins/scaffolder/src/routes.ts
@@ -24,5 +24,5 @@ export const registerComponentRouteRef = createExternalRouteRef({
});
export const rootRouteRef = createRouteRef({
- title: 'Create new entity',
+ id: 'scaffolder',
});
diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json
index df0a783396..5ebc7850a9 100644
--- a/plugins/search-backend-module-elasticsearch/package.json
+++ b/plugins/search-backend-module-elasticsearch/package.json
@@ -30,8 +30,8 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/backend-common": "^0.9.9",
- "@backstage/cli": "^0.8.2",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/cli": "^0.9.0",
"@elastic/elasticsearch-mock": "^0.3.0"
},
"files": [
diff --git a/plugins/search-backend-module-pg/package.json b/plugins/search-backend-module-pg/package.json
index a31d908ac4..74e9698ea4 100644
--- a/plugins/search-backend-module-pg/package.json
+++ b/plugins/search-backend-module-pg/package.json
@@ -20,15 +20,15 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/search-common": "^0.2.0",
"@backstage/plugin-search-backend-node": "^0.4.2",
"lodash": "^4.17.21",
"knex": "^0.95.1"
},
"devDependencies": {
- "@backstage/backend-test-utils": "^0.1.8",
- "@backstage/cli": "^0.8.0"
+ "@backstage/backend-test-utils": "^0.1.9",
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist",
diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json
index 4514d07756..369c52a4f6 100644
--- a/plugins/search-backend-node/package.json
+++ b/plugins/search-backend-node/package.json
@@ -26,8 +26,8 @@
"@types/lunr": "^2.3.3"
},
"devDependencies": {
- "@backstage/backend-common": "^0.9.8",
- "@backstage/cli": "^0.8.1"
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist"
diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json
index 18d4484451..2df51e1bb4 100644
--- a/plugins/search-backend/package.json
+++ b/plugins/search-backend/package.json
@@ -20,7 +20,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/search-common": "^0.2.0",
"@backstage/plugin-search-backend-node": "^0.4.2",
"@types/express": "^4.17.6",
@@ -30,7 +30,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"supertest": "^6.1.3"
},
diff --git a/plugins/search/CHANGELOG.md b/plugins/search/CHANGELOG.md
index 808c847914..ef3736b1df 100644
--- a/plugins/search/CHANGELOG.md
+++ b/plugins/search/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-search
+## 0.4.18
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- 704b267e1c: Smaller UX improvements to search components such as optional autoFocus prop to SearchBar components, decreased debounce value and closing modal on link click of SearchModal, terminology updates of SearchResultPager.
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.4.17
### Patch Changes
diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md
index 0e0ad01fca..c211c48e53 100644
--- a/plugins/search/api-report.md
+++ b/plugins/search/api-report.md
@@ -80,6 +80,7 @@ export const searchApiRef: ApiRef;
//
// @public (undocumented)
export const SearchBar: ({
+ autoFocus,
className,
debounceTime,
placeholder,
@@ -89,10 +90,12 @@ export const SearchBar: ({
//
// @public @deprecated (undocumented)
export const SearchBarNext: ({
+ autoFocus,
className,
debounceTime,
placeholder,
}: {
+ autoFocus?: boolean | undefined;
className?: string | undefined;
debounceTime?: number | undefined;
placeholder?: string | undefined;
diff --git a/plugins/search/package.json b/plugins/search/package.json
index 9d25ec723d..aaddf130bf 100644
--- a/plugins/search/package.json
+++ b/plugins/search/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-search",
"description": "The Backstage plugin that provides your backstage app with search",
- "version": "0.4.17",
+ "version": "0.4.18",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -30,12 +30,12 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/search-common": "^0.2.1",
"@backstage/theme": "^0.2.13",
"@backstage/types": "^0.1.1",
@@ -51,10 +51,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/search/src/components/SearchBar/SearchBar.stories.tsx b/plugins/search/src/components/SearchBar/SearchBar.stories.tsx
index 2c990e512c..72b8429026 100644
--- a/plugins/search/src/components/SearchBar/SearchBar.stories.tsx
+++ b/plugins/search/src/components/SearchBar/SearchBar.stories.tsx
@@ -62,3 +62,22 @@ export const CustomPlaceholder = () => {
);
};
+
+export const Focused = () => {
+ return (
+
+ {/* @ts-ignore (defaultValue requires more than what is used here) */}
+
+
+
+
+ {/* decision up to adopter, read https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-autofocus.md#no-autofocus */}
+ {/* eslint-disable-next-line jsx-a11y/no-autofocus */}
+
+
+
+
+
+
+ );
+};
diff --git a/plugins/search/src/components/SearchBar/SearchBar.tsx b/plugins/search/src/components/SearchBar/SearchBar.tsx
index 53802899eb..4ab680d8fa 100644
--- a/plugins/search/src/components/SearchBar/SearchBar.tsx
+++ b/plugins/search/src/components/SearchBar/SearchBar.tsx
@@ -30,9 +30,11 @@ type PresenterProps = {
onSubmit?: () => void;
className?: string;
placeholder?: string;
+ autoFocus?: boolean;
};
export const SearchBarBase = ({
+ autoFocus,
value,
onChange,
onSubmit,
@@ -60,6 +62,9 @@ export const SearchBarBase = ({
return (
) =>
+ wrapInTestApp(
+ <>
+
+ >,
+ { mountedRoutes: { '/search': rootRouteRef } },
+ ),
+ ],
+};
+
+const mockSearchApi = {
+ query: () =>
+ Promise.resolve({
+ results: [
+ {
+ type: 'custom-result-item',
+ document: {
+ location: 'search/search-result-1',
+ title: 'Search Result 1',
+ text: 'some text from the search result',
+ },
+ },
+ {
+ type: 'no-custom-result-item',
+ document: {
+ location: 'search/search-result-2',
+ title: 'Search Result 2',
+ text: 'some text from the search result',
+ },
+ },
+ {
+ type: 'no-custom-result-item',
+ document: {
+ location: 'search/search-result-3',
+ title: 'Search Result 3',
+ text: 'some text from the search result',
+ },
+ },
+ ],
+ }),
+};
+
+const apiRegistry = () => ApiRegistry.from([[searchApiRef, mockSearchApi]]);
+
+export const Default = () => {
+ const [open, setOpen] = useState(false);
+ const toggleModal = (): void => setOpen(prevState => !prevState);
+
+ return (
+
+
+
+
+ );
+};
diff --git a/plugins/search/src/components/SearchModal/SearchModal.tsx b/plugins/search/src/components/SearchModal/SearchModal.tsx
index feabbc55af..75d4b07a3c 100644
--- a/plugins/search/src/components/SearchModal/SearchModal.tsx
+++ b/plugins/search/src/components/SearchModal/SearchModal.tsx
@@ -68,7 +68,7 @@ export const Modal = ({ open = true, toggleModal }: SearchModalProps) => {
setValue(prevValue => (prevValue !== term ? term : prevValue));
}, [term]);
- useDebounce(() => setTerm(value), 1000, [value]);
+ useDebounce(() => setTerm(value), 500, [value]);
const handleQuery = (newValue: string) => {
setValue(newValue);
@@ -114,7 +114,10 @@ export const Modal = ({ open = true, toggleModal }: SearchModalProps) => {
alignItems="center"
>
-
+
View Full Results
diff --git a/plugins/search/src/components/SearchResultPager/SearchResultPager.tsx b/plugins/search/src/components/SearchResultPager/SearchResultPager.tsx
index f1850772bb..12f07530ef 100644
--- a/plugins/search/src/components/SearchResultPager/SearchResultPager.tsx
+++ b/plugins/search/src/components/SearchResultPager/SearchResultPager.tsx
@@ -25,7 +25,7 @@ const useStyles = makeStyles(theme => ({
display: 'flex',
justifyContent: 'space-between',
gap: theme.spacing(2),
- margin: theme.spacing(4),
+ margin: theme.spacing(2, 0),
},
}));
@@ -44,9 +44,8 @@ export const SearchResultPager = () => {
disabled={!fetchPreviousPage}
onClick={fetchPreviousPage}
startIcon={}
- size="small"
>
- Back
+ Previous
diff --git a/plugins/search/src/plugin.ts b/plugins/search/src/plugin.ts
index b8c016fb36..9dda2a84bb 100644
--- a/plugins/search/src/plugin.ts
+++ b/plugins/search/src/plugin.ts
@@ -26,13 +26,11 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/search',
- title: 'search',
+ id: 'search',
});
export const rootNextRouteRef = createRouteRef({
- path: '/search-next',
- title: 'search',
+ id: 'search:next',
});
export const searchPlugin = createPlugin({
diff --git a/plugins/sentry/CHANGELOG.md b/plugins/sentry/CHANGELOG.md
index b0bcaad261..cad08289ed 100644
--- a/plugins/sentry/CHANGELOG.md
+++ b/plugins/sentry/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-sentry
+## 0.3.29
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.28
### Patch Changes
diff --git a/plugins/sentry/package.json b/plugins/sentry/package.json
index ee2421bf7f..a04043c789 100644
--- a/plugins/sentry/package.json
+++ b/plugins/sentry/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-sentry",
"description": "A Backstage plugin that integrates towards Sentry",
- "version": "0.3.28",
+ "version": "0.3.29",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,10 +32,10 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
- "@backstage/plugin-catalog-react": "^0.6.3",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -48,10 +48,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/sentry/src/plugin.ts b/plugins/sentry/src/plugin.ts
index 454c1f02a6..981745c8fe 100644
--- a/plugins/sentry/src/plugin.ts
+++ b/plugins/sentry/src/plugin.ts
@@ -25,8 +25,7 @@ import {
} from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- path: '/sentry',
- title: 'Sentry',
+ id: 'sentry',
});
export const sentryPlugin = createPlugin({
diff --git a/plugins/shortcuts/CHANGELOG.md b/plugins/shortcuts/CHANGELOG.md
index 41581cc5b4..fdd9f44231 100644
--- a/plugins/shortcuts/CHANGELOG.md
+++ b/plugins/shortcuts/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-shortcuts
+## 0.1.14
+
+### Patch Changes
+
+- f93e56ae3a: Add tooltip to display shortcut title on hover. This should improve the readability of shortcuts with long names, which are cutoff by ellipsis.
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.13
### Patch Changes
diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json
index e73e047bc1..f0139d5728 100644
--- a/plugins/shortcuts/package.json
+++ b/plugins/shortcuts/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-shortcuts",
"description": "A Backstage plugin that provides a shortcuts feature to the sidebar",
- "version": "0.1.13",
+ "version": "0.1.14",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,8 +21,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@backstage/types": "^0.1.1",
"@material-ui/core": "^4.12.2",
@@ -38,10 +38,10 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/shortcuts/src/ShortcutItem.tsx b/plugins/shortcuts/src/ShortcutItem.tsx
index d2ac716737..8ba1a96358 100644
--- a/plugins/shortcuts/src/ShortcutItem.tsx
+++ b/plugins/shortcuts/src/ShortcutItem.tsx
@@ -15,7 +15,9 @@
*/
import React from 'react';
-import { IconButton, makeStyles } from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import IconButton from '@material-ui/core/IconButton';
+import Tooltip from '@material-ui/core/Tooltip';
import EditIcon from '@material-ui/icons/Edit';
import { ShortcutIcon } from './ShortcutIcon';
import { EditShortcut } from './EditShortcut';
@@ -76,21 +78,23 @@ export const ShortcutItem = ({ shortcut, api }: Props) => {
return (
<>
- }
- >
-
+ }
>
-
-
-
+
+
+
+
+
(options: RouterOptions): Promise;
+// @public
+export const entityMetadataFactRetriever: FactRetriever;
+
+// @public
+export const entityOwnershipFactRetriever: FactRetriever;
+
// @public
export type PersistenceContext = {
techInsightsStore: TechInsightsStore;
@@ -52,6 +58,9 @@ export interface RouterOptions<
persistenceContext: PersistenceContext;
}
+// @public
+export const techdocsFactRetriever: FactRetriever;
+
// @public (undocumented)
export type TechInsightsContext<
CheckType extends TechInsightCheck,
diff --git a/plugins/tech-insights-backend/package.json b/plugins/tech-insights-backend/package.json
index 678bec25c4..5bc616db71 100644
--- a/plugins/tech-insights-backend/package.json
+++ b/plugins/tech-insights-backend/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-tech-insights-backend",
- "version": "0.1.0",
+ "version": "0.1.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,9 +31,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.0",
- "@backstage/catalog-client": "^0.3.16",
- "@backstage/catalog-model": "^0.9.0",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.8",
"@backstage/errors": "^0.1.1",
"@backstage/plugin-tech-insights-common": "^0.1.0",
@@ -52,8 +52,8 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/backend-test-utils": "^0.1.8",
- "@backstage/cli": "^0.8.0",
+ "@backstage/backend-test-utils": "^0.1.9",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"@types/node-cron": "^3.0.0",
"@types/semver": "^7.3.8",
diff --git a/plugins/tech-insights-backend/src/index.ts b/plugins/tech-insights-backend/src/index.ts
index 5e8e690e8d..763c565108 100644
--- a/plugins/tech-insights-backend/src/index.ts
+++ b/plugins/tech-insights-backend/src/index.ts
@@ -25,3 +25,4 @@ export type {
export type { PersistenceContext } from './service/persistence/persistenceContext';
export { createFactRetrieverRegistration } from './service/fact/createFactRetriever';
+export * from './service/fact/factRetrievers';
diff --git a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts
index 4dc002465b..8d1f7180a3 100644
--- a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts
+++ b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts
@@ -44,7 +44,7 @@ const testFactRetriever: FactRetriever = {
description: '',
},
},
- handler: async () => {
+ handler: jest.fn(async () => {
return [
{
entity: {
@@ -57,7 +57,7 @@ const testFactRetriever: FactRetriever = {
},
},
];
- },
+ }),
};
const cadence = '1 * * * *';
describe('FactRetrieverEngine', () => {
@@ -145,5 +145,8 @@ describe('FactRetrieverEngine', () => {
const job: any = engine.getJob('test-factretriever');
job.triggerScheduledJobNow();
expect(job.cadence!!).toEqual(cadence);
+ expect(testFactRetriever.handler).toHaveBeenCalledWith(
+ expect.objectContaining({ entityFilter: testFactRetriever.entityFilter }),
+ );
});
});
diff --git a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts
index aa2207cca8..11fd0d29b8 100644
--- a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts
+++ b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.ts
@@ -108,7 +108,10 @@ export class FactRetrieverEngine {
this.logger.info(
`Retrieving facts for fact retriever ${factRetriever.id}`,
);
- const facts = await factRetriever.handler(this.factRetrieverContext);
+ const facts = await factRetriever.handler({
+ ...this.factRetrieverContext,
+ entityFilter: factRetriever.entityFilter,
+ });
if (this.logger.isDebugEnabled()) {
this.logger.debug(
`Retrieved ${facts.length} facts for fact retriever ${
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.test.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.test.ts
new file mode 100644
index 0000000000..b99f6a1c02
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.test.ts
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';
+import {
+ PluginEndpointDiscovery,
+ getVoidLogger,
+} from '@backstage/backend-common';
+import { ConfigReader } from '@backstage/config';
+import { CatalogListResponse } from '@backstage/catalog-client';
+import { entityMetadataFactRetriever } from './entityMetadataFactRetriever';
+
+const getEntitiesMock = jest.fn();
+jest.mock('@backstage/catalog-client', () => {
+ return {
+ CatalogClient: jest
+ .fn()
+ .mockImplementation(() => ({ getEntities: getEntitiesMock })),
+ };
+});
+const discovery: jest.Mocked = {
+ getBaseUrl: jest.fn(),
+ getExternalBaseUrl: jest.fn(),
+};
+
+const defaultEntityListResponse: CatalogListResponse = {
+ items: [
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-owner',
+ description: 'service with an owner',
+ tags: ['a-tag'],
+ annotations: {
+ 'backstage.io/techdocs-ref': 'dir:.',
+ },
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'team-a',
+ },
+ relations: [
+ {
+ type: RELATION_OWNED_BY,
+ target: { name: 'team-a', kind: 'group', namespace: 'default' },
+ },
+ ],
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-incomplete-data',
+ description: '',
+ tags: [],
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: '',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-user-owner',
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'user:my-user',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'user-a',
+ },
+ kind: 'User',
+ spec: {
+ memberOf: 'group-a',
+ },
+ },
+ ],
+};
+
+const handlerContext = {
+ discovery,
+ logger: getVoidLogger(),
+ config: ConfigReader.fromConfigs([]),
+};
+
+const entityFactRetriever = entityMetadataFactRetriever;
+
+describe('entityMetadataFactRetriever', () => {
+ beforeEach(() => {
+ getEntitiesMock.mockResolvedValue(defaultEntityListResponse);
+ });
+ afterEach(() => {
+ getEntitiesMock.mockClear();
+ });
+
+ describe('hasDescription', () => {
+ describe('where the entity has a description', () => {
+ it('returns true for hasDescription', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-owner'),
+ ).toMatchObject({
+ facts: {
+ hasDescription: true,
+ },
+ });
+ });
+ });
+ describe('where the entity does not have a description', () => {
+ it('returns false for hasDescription', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(facts.find(it => it.entity.name === 'user-a')).toMatchObject({
+ facts: {
+ hasDescription: false,
+ },
+ });
+ });
+ });
+ describe('where the entity has an empty value for description', () => {
+ it('returns false for hasDescription', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-incomplete-data'),
+ ).toMatchObject({
+ facts: {
+ hasDescription: false,
+ },
+ });
+ });
+ });
+ });
+ describe('hasTags', () => {
+ describe('where the entity has tags', () => {
+ it('returns true for hasTags', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-owner'),
+ ).toMatchObject({
+ facts: {
+ hasTags: true,
+ },
+ });
+ });
+ });
+ describe('where the entity has no tags', () => {
+ it('returns false for hasTags', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-incomplete-data'),
+ ).toMatchObject({
+ facts: {
+ hasTags: false,
+ },
+ });
+ });
+ });
+ });
+});
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.ts
new file mode 100644
index 0000000000..535aede115
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityMetadataFactRetriever.ts
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {
+ FactRetriever,
+ FactRetrieverContext,
+} from '@backstage/plugin-tech-insights-node';
+import { CatalogClient } from '@backstage/catalog-client';
+import { Entity } from '@backstage/catalog-model';
+import isEmpty from 'lodash/isEmpty';
+
+/**
+ * Generates facts which indicate the completeness of entity metadata.
+ *
+ * @public
+ */
+export const entityMetadataFactRetriever: FactRetriever = {
+ id: 'entityMetadataFactRetriever',
+ version: '0.0.1',
+ schema: {
+ hasTitle: {
+ type: 'boolean',
+ description: 'The entity has a title in metadata',
+ },
+ hasDescription: {
+ type: 'boolean',
+ description: 'The entity has a description in metadata',
+ },
+ hasTags: {
+ type: 'boolean',
+ description: 'The entity has tags in metadata',
+ },
+ },
+ handler: async ({ discovery, entityFilter }: FactRetrieverContext) => {
+ const catalogClient = new CatalogClient({
+ discoveryApi: discovery,
+ });
+ const entities = await catalogClient.getEntities({ filter: entityFilter });
+
+ return entities.items.map((entity: Entity) => {
+ return {
+ entity: {
+ namespace: entity.metadata.namespace!!,
+ kind: entity.kind,
+ name: entity.metadata.name,
+ },
+ facts: {
+ hasTitle: Boolean(entity.metadata?.title),
+ hasDescription: Boolean(entity.metadata?.description),
+ hasTags: !isEmpty(entity.metadata?.tags),
+ },
+ };
+ });
+ },
+};
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.test.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.test.ts
new file mode 100644
index 0000000000..ea0801f17c
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.test.ts
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { entityOwnershipFactRetriever } from './entityOwnershipFactRetriever';
+import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';
+import {
+ PluginEndpointDiscovery,
+ getVoidLogger,
+} from '@backstage/backend-common';
+import { ConfigReader } from '@backstage/config';
+import { CatalogListResponse } from '@backstage/catalog-client';
+
+const getEntitiesMock = jest.fn();
+jest.mock('@backstage/catalog-client', () => {
+ return {
+ CatalogClient: jest
+ .fn()
+ .mockImplementation(() => ({ getEntities: getEntitiesMock })),
+ };
+});
+const discovery: jest.Mocked = {
+ getBaseUrl: jest.fn(),
+ getExternalBaseUrl: jest.fn(),
+};
+
+const defaultEntityListResponse: CatalogListResponse = {
+ items: [
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-owner',
+ description: 'service with an owner',
+ tags: ['a-tag'],
+ annotations: {
+ 'backstage.io/techdocs-ref': 'dir:.',
+ },
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'team-a',
+ },
+ relations: [
+ {
+ type: RELATION_OWNED_BY,
+ target: { name: 'team-a', kind: 'group', namespace: 'default' },
+ },
+ ],
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-incomplete-data',
+ description: '',
+ tags: [],
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: '',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-user-owner',
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'user:my-user',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'user-a',
+ },
+ kind: 'User',
+ spec: {
+ memberOf: 'group-a',
+ },
+ },
+ ],
+};
+
+const handlerContext = {
+ discovery,
+ logger: getVoidLogger(),
+ config: ConfigReader.fromConfigs([]),
+};
+
+const entityFactRetriever = entityOwnershipFactRetriever;
+
+describe('entityFactRetriever', () => {
+ beforeEach(() => {
+ getEntitiesMock.mockResolvedValue(defaultEntityListResponse);
+ });
+ afterEach(() => {
+ getEntitiesMock.mockClear();
+ });
+
+ describe('hasOwner', () => {
+ describe('where the entity has an owner in the spec', () => {
+ it('returns true for hasOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-owner'),
+ ).toMatchObject({
+ facts: {
+ hasOwner: true,
+ },
+ });
+ });
+ });
+ describe('where the entity has an empty value for owner in the spec', () => {
+ it('returns false for hasOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-incomplete-data'),
+ ).toMatchObject({
+ facts: {
+ hasOwner: false,
+ },
+ });
+ });
+ });
+
+ describe('where the entity doesn not have an owner in the spec', () => {
+ it('returns false for hasOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(facts.find(it => it.entity.name === 'user-a')).toMatchObject({
+ facts: {
+ hasOwner: false,
+ },
+ });
+ });
+ });
+ });
+ describe('hasGroupOwner', () => {
+ describe('where the entity has an group as owner in the spec', () => {
+ it('returns true for hasGroupOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-owner'),
+ ).toMatchObject({
+ facts: {
+ hasGroupOwner: true,
+ },
+ });
+ });
+ });
+ describe('where the entity has a user as owner in the spec', () => {
+ it('returns false for hasGroupOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-user-owner'),
+ ).toMatchObject({
+ facts: {
+ hasGroupOwner: false,
+ },
+ });
+ });
+ });
+ describe('where the entity has an empty value for owner in the spec', () => {
+ it('returns false for hasGroupOwner', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-incomplete-data'),
+ ).toMatchObject({
+ facts: {
+ hasGroupOwner: false,
+ },
+ });
+ });
+ });
+ });
+});
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.ts
new file mode 100644
index 0000000000..8f61f182ad
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/entityOwnershipFactRetriever.ts
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {
+ FactRetriever,
+ FactRetrieverContext,
+} from '@backstage/plugin-tech-insights-node';
+import { CatalogClient } from '@backstage/catalog-client';
+import { Entity } from '@backstage/catalog-model';
+
+/**
+ * Generates facts which indicate the quality of data in the spec.owner field.
+ *
+ * @public
+ */
+export const entityOwnershipFactRetriever: FactRetriever = {
+ id: 'entityOwnershipFactRetriever',
+ version: '0.0.1',
+ entityFilter: [
+ { kind: ['component', 'domain', 'system', 'api', 'resource', 'template'] },
+ ],
+ schema: {
+ hasOwner: {
+ type: 'boolean',
+ description: 'The spec.owner field is set',
+ },
+ hasGroupOwner: {
+ type: 'boolean',
+ description: 'The spec.owner field is set and refers to a group',
+ },
+ },
+ handler: async ({ discovery, entityFilter }: FactRetrieverContext) => {
+ const catalogClient = new CatalogClient({
+ discoveryApi: discovery,
+ });
+ const entities = await catalogClient.getEntities({ filter: entityFilter });
+
+ return entities.items.map((entity: Entity) => {
+ return {
+ entity: {
+ namespace: entity.metadata.namespace!!,
+ kind: entity.kind,
+ name: entity.metadata.name,
+ },
+ facts: {
+ hasOwner: Boolean(entity.spec?.owner),
+ hasGroupOwner: Boolean(
+ entity.spec?.owner &&
+ !(entity.spec?.owner as string).startsWith('user:'),
+ ),
+ },
+ };
+ });
+ },
+};
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts
new file mode 100644
index 0000000000..587db8c4b9
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/index.ts
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export * from './entityOwnershipFactRetriever';
+export * from './entityMetadataFactRetriever';
+export * from './techdocsFactRetriever';
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.test.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.test.ts
new file mode 100644
index 0000000000..6ed9b12523
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.test.ts
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { techdocsFactRetriever } from './techdocsFactRetriever';
+import { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';
+import {
+ PluginEndpointDiscovery,
+ getVoidLogger,
+} from '@backstage/backend-common';
+import { ConfigReader } from '@backstage/config';
+import { CatalogListResponse } from '@backstage/catalog-client';
+
+const getEntitiesMock = jest.fn();
+jest.mock('@backstage/catalog-client', () => {
+ return {
+ CatalogClient: jest
+ .fn()
+ .mockImplementation(() => ({ getEntities: getEntitiesMock })),
+ };
+});
+const discovery: jest.Mocked = {
+ getBaseUrl: jest.fn(),
+ getExternalBaseUrl: jest.fn(),
+};
+
+const defaultEntityListResponse: CatalogListResponse = {
+ items: [
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-owner',
+ description: 'service with an owner',
+ tags: ['a-tag'],
+ annotations: {
+ 'backstage.io/techdocs-ref': 'dir:.',
+ },
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'team-a',
+ },
+ relations: [
+ {
+ type: RELATION_OWNED_BY,
+ target: { name: 'team-a', kind: 'group', namespace: 'default' },
+ },
+ ],
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-incomplete-data',
+ description: '',
+ tags: [],
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: '',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'service-with-user-owner',
+ },
+ kind: 'Component',
+ spec: {
+ type: 'service',
+ lifecycle: 'test',
+ owner: 'user:my-user',
+ },
+ },
+ {
+ apiVersion: 'backstage.io/v1beta1',
+ metadata: {
+ name: 'user-a',
+ },
+ kind: 'User',
+ spec: {
+ memberOf: 'group-a',
+ },
+ },
+ ],
+};
+
+const handlerContext = {
+ discovery,
+ logger: getVoidLogger(),
+ config: ConfigReader.fromConfigs([]),
+};
+
+const entityFactRetriever = techdocsFactRetriever;
+
+describe('techdocsFactRetriever', () => {
+ beforeEach(() => {
+ getEntitiesMock.mockResolvedValue(defaultEntityListResponse);
+ });
+ afterEach(() => {
+ getEntitiesMock.mockClear();
+ });
+
+ describe('hasAnnotationBackstageIoTechdocsRef', () => {
+ describe('where the retriever is configured to check for the techdocs annotation', () => {
+ describe('where the entity has the techdocs annotation', () => {
+ it('returns true for hasAnnotationBackstageIoTechdocsRef', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-owner'),
+ ).toMatchObject({
+ facts: {
+ hasAnnotationBackstageIoTechdocsRef: true,
+ },
+ });
+ });
+ });
+ describe('where the entity is missing the techdocs annotation', () => {
+ it('returns false for hasAnnotationBackstageIoTechdocsRef', async () => {
+ const facts = await entityFactRetriever.handler(handlerContext);
+ expect(
+ facts.find(it => it.entity.name === 'service-with-incomplete-data'),
+ ).toMatchObject({
+ facts: {
+ hasAnnotationBackstageIoTechdocsRef: false,
+ },
+ });
+ });
+ });
+ });
+ });
+});
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.ts
new file mode 100644
index 0000000000..c1c3ba5d20
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/techdocsFactRetriever.ts
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import {
+ FactRetriever,
+ FactRetrieverContext,
+} from '@backstage/plugin-tech-insights-node';
+import { CatalogClient } from '@backstage/catalog-client';
+import { Entity } from '@backstage/catalog-model';
+import { entityHasAnnotation, generateAnnotationFactName } from './utils';
+
+const techdocsAnnotation = 'backstage.io/techdocs-ref';
+const techdocsAnnotationFactName =
+ generateAnnotationFactName(techdocsAnnotation);
+
+/**
+ * Generates facts related to the completeness of techdocs configuration for entities.
+ *
+ * @public
+ */
+export const techdocsFactRetriever: FactRetriever = {
+ id: 'techdocsFactRetriever',
+ version: '0.0.1',
+ schema: {
+ [techdocsAnnotationFactName]: {
+ type: 'boolean',
+ description: 'The entity has a title in metadata',
+ },
+ },
+ handler: async ({ discovery, entityFilter }: FactRetrieverContext) => {
+ const catalogClient = new CatalogClient({
+ discoveryApi: discovery,
+ });
+ const entities = await catalogClient.getEntities({ filter: entityFilter });
+
+ return entities.items.map((entity: Entity) => {
+ return {
+ entity: {
+ namespace: entity.metadata.namespace!!,
+ kind: entity.kind,
+ name: entity.metadata.name,
+ },
+ facts: {
+ [techdocsAnnotationFactName]: entityHasAnnotation(
+ entity,
+ techdocsAnnotation,
+ ),
+ },
+ };
+ });
+ },
+};
diff --git a/plugins/tech-insights-backend/src/service/fact/factRetrievers/utils.ts b/plugins/tech-insights-backend/src/service/fact/factRetrievers/utils.ts
new file mode 100644
index 0000000000..7967502a63
--- /dev/null
+++ b/plugins/tech-insights-backend/src/service/fact/factRetrievers/utils.ts
@@ -0,0 +1,24 @@
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import camelCase from 'lodash/camelCase';
+import { Entity } from '@backstage/catalog-model';
+import { get } from 'lodash';
+
+export const generateAnnotationFactName = (annotation: string) =>
+ camelCase(`hasAnnotation-${annotation}`);
+
+export const entityHasAnnotation = (entity: Entity, annotation: string) =>
+ Boolean(get(entity, ['metadata', 'annotations', annotation]));
diff --git a/plugins/tech-insights-common/package.json b/plugins/tech-insights-common/package.json
index 5e02c9e4b0..26d8922329 100644
--- a/plugins/tech-insights-common/package.json
+++ b/plugins/tech-insights-common/package.json
@@ -34,7 +34,7 @@
"luxon": "^2.0.2"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0"
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist"
diff --git a/plugins/tech-insights-node/api-report.md b/plugins/tech-insights-node/api-report.md
index caf4b4cf0e..fc137da4bc 100644
--- a/plugins/tech-insights-node/api-report.md
+++ b/plugins/tech-insights-node/api-report.md
@@ -53,6 +53,9 @@ export type FactRetrieverContext = {
config: Config;
discovery: PluginEndpointDiscovery;
logger: Logger_2;
+ entityFilter?:
+ | Record[]
+ | Record;
};
// @public
diff --git a/plugins/tech-insights-node/package.json b/plugins/tech-insights-node/package.json
index 4a7cf3589b..3c2ba5da08 100644
--- a/plugins/tech-insights-node/package.json
+++ b/plugins/tech-insights-node/package.json
@@ -30,7 +30,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.0",
+ "@backstage/backend-common": "^0.9.10",
"@backstage/config": "^0.1.8",
"@backstage/plugin-tech-insights-common": "^0.1.0 ",
"@types/luxon": "^2.0.5",
@@ -38,7 +38,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0"
+ "@backstage/cli": "^0.9.0"
},
"files": [
"dist"
diff --git a/plugins/tech-insights-node/src/facts.ts b/plugins/tech-insights-node/src/facts.ts
index a52a91f2f4..4a3157d391 100644
--- a/plugins/tech-insights-node/src/facts.ts
+++ b/plugins/tech-insights-node/src/facts.ts
@@ -136,6 +136,9 @@ export type FactRetrieverContext = {
config: Config;
discovery: PluginEndpointDiscovery;
logger: Logger;
+ entityFilter?:
+ | Record[]
+ | Record;
};
/**
diff --git a/plugins/tech-radar/CHANGELOG.md b/plugins/tech-radar/CHANGELOG.md
index 8e7b5875a9..cef7885007 100644
--- a/plugins/tech-radar/CHANGELOG.md
+++ b/plugins/tech-radar/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-tech-radar
+## 0.4.12
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.4.11
### Patch Changes
diff --git a/plugins/tech-radar/package.json b/plugins/tech-radar/package.json
index 839ad1b399..99fce10345 100644
--- a/plugins/tech-radar/package.json
+++ b/plugins/tech-radar/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-tech-radar",
"description": "A Backstage plugin that lets you display a Tech Radar for your organization",
- "version": "0.4.11",
+ "version": "0.4.12",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,8 +31,8 @@
"start": "backstage-cli plugin:serve"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -45,10 +45,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/tech-radar/src/plugin.ts b/plugins/tech-radar/src/plugin.ts
index bd30d6a984..495aa47879 100644
--- a/plugins/tech-radar/src/plugin.ts
+++ b/plugins/tech-radar/src/plugin.ts
@@ -25,7 +25,7 @@ import {
} from '@backstage/core-plugin-api';
const rootRouteRef = createRouteRef({
- title: 'Tech Radar',
+ id: 'tech-radar',
});
/**
diff --git a/plugins/techdocs-backend/CHANGELOG.md b/plugins/techdocs-backend/CHANGELOG.md
index 7331ea0147..ad7a8af85e 100644
--- a/plugins/techdocs-backend/CHANGELOG.md
+++ b/plugins/techdocs-backend/CHANGELOG.md
@@ -1,5 +1,17 @@
# @backstage/plugin-techdocs-backend
+## 0.10.8
+
+### Patch Changes
+
+- e21e3c6102: Bumping minimum requirements for `dockerode` and `testcontainers`
+- 9e64a7ac1e: Allow amazon web services s3 buckets to pass an server side encryption configuration so they can publish to encrypted buckets
+- Updated dependencies
+ - @backstage/catalog-client@0.5.2
+ - @backstage/catalog-model@0.9.7
+ - @backstage/backend-common@0.9.10
+ - @backstage/techdocs-common@0.10.7
+
## 0.10.7
### Patch Changes
diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json
index c71833948b..332884c694 100644
--- a/plugins/techdocs-backend/package.json
+++ b/plugins/techdocs-backend/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-techdocs-backend",
"description": "The Backstage backend plugin that renders technical documentation for your components",
- "version": "0.10.7",
+ "version": "0.10.8",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,17 +31,17 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.8",
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
"@backstage/search-common": "^0.2.1",
- "@backstage/techdocs-common": "^0.10.5",
+ "@backstage/techdocs-common": "^0.10.7",
"@types/express": "^4.17.6",
"cross-fetch": "^3.0.6",
- "dockerode": "^3.2.1",
+ "dockerode": "^3.3.1",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"fs-extra": "9.1.0",
@@ -51,9 +51,9 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.8.1",
- "@backstage/test-utils": "^0.1.20",
- "@types/dockerode": "^3.2.1",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/test-utils": "^0.1.22",
+ "@types/dockerode": "^3.3.0",
"msw": "^0.35.0",
"supertest": "^6.1.3"
},
diff --git a/plugins/techdocs/CHANGELOG.md b/plugins/techdocs/CHANGELOG.md
index be100b9dea..6b8a8f0ff9 100644
--- a/plugins/techdocs/CHANGELOG.md
+++ b/plugins/techdocs/CHANGELOG.md
@@ -1,5 +1,22 @@
# @backstage/plugin-techdocs
+## 0.12.6
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- c1858c4cf9: Fixed entity triplet case handling for certain locales.
+- f7703981a9: Use a better checkbox rendering in a task list.
+- e266687580: Updates reader component used to display techdocs documentation. A previous change made this component not usable out of a page which don't have entityRef in url parameters. Reader component EntityRef parameter is now used instead of url parameters. Techdocs documentation component can now be used in our custom pages.
+- Updated dependencies
+ - @backstage/plugin-catalog@0.7.3
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/plugin-search@0.4.18
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+ - @backstage/integration-react@0.1.14
+
## 0.12.5
### Patch Changes
diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json
index 79841a0621..663c83118e 100644
--- a/plugins/techdocs/package.json
+++ b/plugins/techdocs/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-techdocs",
"description": "The Backstage plugin that renders technical documentation for your components",
- "version": "0.12.5",
+ "version": "0.12.6",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -32,16 +32,16 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.6",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.11",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.4",
"@backstage/integration": "^0.6.9",
- "@backstage/integration-react": "^0.1.13",
- "@backstage/plugin-catalog": "^0.7.2",
- "@backstage/plugin-catalog-react": "^0.6.3",
- "@backstage/plugin-search": "^0.4.17",
+ "@backstage/integration-react": "^0.1.14",
+ "@backstage/plugin-catalog": "^0.7.3",
+ "@backstage/plugin-catalog-react": "^0.6.4",
+ "@backstage/plugin-search": "^0.4.18",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -61,10 +61,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^7.0.2",
diff --git a/plugins/techdocs/src/routes.ts b/plugins/techdocs/src/routes.ts
index e0b7661ffd..e781550899 100644
--- a/plugins/techdocs/src/routes.ts
+++ b/plugins/techdocs/src/routes.ts
@@ -17,17 +17,14 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- id: 'techdocs-index-page',
- title: 'TechDocs Landing Page',
+ id: 'techdocs:index-page',
});
export const rootDocsRouteRef = createRouteRef({
- id: 'techdocs-reader-page',
- title: 'Docs',
+ id: 'techdocs:reader-page',
params: ['namespace', 'kind', 'name'],
});
export const rootCatalogDocsRouteRef = createRouteRef({
- id: 'catalog-techdocs-reader-view',
- title: 'Docs',
+ id: 'techdocs:catalog-reader-view',
});
diff --git a/plugins/todo-backend/README.md b/plugins/todo-backend/README.md
index 61ca5202d0..5540ca598e 100644
--- a/plugins/todo-backend/README.md
+++ b/plugins/todo-backend/README.md
@@ -36,6 +36,19 @@ export default async function createPlugin({
}
```
+And then add to `packages/backend/src/index.ts`:
+
+```js
+// In packages/backend/src/index.ts
+import todo from './plugins/todo';
+// ...
+async function main() {
+ // ...
+ const todoEnv = useHotMemoize(module, () => createEnv('todo'));
+ // ...
+ apiRouter.use('/todo', await todo(todoEnv));
+```
+
## Scanned Files
The included `TodoReaderService` and `TodoScmReader` works by reading source code of to the entity that is being viewed. The location source code is determined by the value of the [`backstage.io/source-location`
diff --git a/plugins/todo-backend/package.json b/plugins/todo-backend/package.json
index c3f0e469aa..be1dc658f1 100644
--- a/plugins/todo-backend/package.json
+++ b/plugins/todo-backend/package.json
@@ -25,9 +25,9 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/backend-common": "^0.9.7",
- "@backstage/catalog-client": "^0.5.0",
- "@backstage/catalog-model": "^0.9.5",
+ "@backstage/backend-common": "^0.9.10",
+ "@backstage/catalog-client": "^0.5.2",
+ "@backstage/catalog-model": "^0.9.7",
"@backstage/config": "^0.1.10",
"@backstage/errors": "^0.1.3",
"@backstage/integration": "^0.6.7",
@@ -40,7 +40,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/cli": "^0.8.0",
+ "@backstage/cli": "^0.9.0",
"@types/supertest": "^2.0.8",
"msw": "^0.35.0",
"supertest": "^6.1.3"
diff --git a/plugins/todo/CHANGELOG.md b/plugins/todo/CHANGELOG.md
index 99c33c425e..1a6a352e73 100644
--- a/plugins/todo/CHANGELOG.md
+++ b/plugins/todo/CHANGELOG.md
@@ -1,5 +1,16 @@
# @backstage/plugin-todo
+## 0.1.15
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/catalog-model@0.9.7
+ - @backstage/plugin-catalog-react@0.6.4
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.1.14
### Patch Changes
diff --git a/plugins/todo/README.md b/plugins/todo/README.md
index 4165582b65..ad0ad4fc1d 100644
--- a/plugins/todo/README.md
+++ b/plugins/todo/README.md
@@ -2,6 +2,77 @@
This plugin lists `// TODO` comments in source code. It currently exports a single component extension for use on entity pages.
+## Setup
+
+1. Run:
+
+```bash
+# From your Backstage root directory
+yarn --cwd packages/app add @backstage/plugin-todo
+yarn --cwd packages/backend add @backstage/plugin-todo-backend
+```
+
+2. Add the plugin backend:
+
+In a new file named `todo.ts` under `backend/src/plugins`:
+
+```js
+import { Router } from 'express';
+import { CatalogClient } from '@backstage/catalog-client';
+import {
+ createRouter,
+ TodoReaderService,
+ TodoScmReader,
+} from '@backstage/plugin-todo-backend';
+import { PluginEnvironment } from '../types';
+
+export default async function createPlugin({
+ logger,
+ reader,
+ config,
+ discovery,
+}: PluginEnvironment): Promise {
+ const todoReader = TodoScmReader.fromConfig(config, {
+ logger,
+ reader,
+ });
+ const catalogClient = new CatalogClient({ discoveryApi: discovery });
+ const todoService = new TodoReaderService({
+ todoReader,
+ catalogClient,
+ });
+
+ return await createRouter({ todoService });
+}
+```
+
+And then add to `packages/backend/src/index.ts`:
+
+```js
+// In packages/backend/src/index.ts
+import todo from './plugins/todo';
+// ...
+async function main() {
+ // ...
+ const todoEnv = useHotMemoize(module, () => createEnv('todo'));
+ // ...
+ apiRouter.use('/todo', await todo(todoEnv));
+```
+
+3. Add the plugin as a tab to your service entities:
+
+```jsx
+// In packages/app/src/components/catalog/EntityPage.tsx
+import { EntityTodoContent } from '@backstage/plugin-todo';
+
+const serviceEntityPage = (
+
+ {/* other tabs... */}
+
+
+
+```
+
## Format
The default parser uses [Leasot](https://github.com/pgilad/leasot), which supports a wide range of languages. By default it supports the `TODO` and `FIXME` tags, along with `@` prefix and author reference through with either a `()` suffix or trailing `/`. For more information on how to configure the parser, see `@backstage/plugin-todo-backend`.
diff --git a/plugins/todo/package.json b/plugins/todo/package.json
index 5e32d84497..22a8e6b1e2 100644
--- a/plugins/todo/package.json
+++ b/plugins/todo/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-todo",
"description": "A Backstage plugin that lets you browse TODO comments in your source code",
- "version": "0.1.14",
+ "version": "0.1.15",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -27,11 +27,11 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/catalog-model": "^0.9.5",
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/catalog-model": "^0.9.7",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
- "@backstage/plugin-catalog-react": "^0.6.1",
+ "@backstage/plugin-catalog-react": "^0.6.4",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -41,10 +41,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/todo/src/routes.ts b/plugins/todo/src/routes.ts
index 8ab3fb1b94..01d8d9f354 100644
--- a/plugins/todo/src/routes.ts
+++ b/plugins/todo/src/routes.ts
@@ -16,5 +16,5 @@
import { createRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'todo',
+ id: 'todo',
});
diff --git a/plugins/user-settings/CHANGELOG.md b/plugins/user-settings/CHANGELOG.md
index ae3bc1c72d..a309afb497 100644
--- a/plugins/user-settings/CHANGELOG.md
+++ b/plugins/user-settings/CHANGELOG.md
@@ -1,5 +1,15 @@
# @backstage/plugin-user-settings
+## 0.3.11
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- 274a4fc633: Add Props Icon for Sidebar Item SidebarSearchField and Settings
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.3.10
### Patch Changes
diff --git a/plugins/user-settings/package.json b/plugins/user-settings/package.json
index dc63957cb9..def12ac1d2 100644
--- a/plugins/user-settings/package.json
+++ b/plugins/user-settings/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-user-settings",
"description": "A Backstage plugin that provides a settings page",
- "version": "0.3.10",
+ "version": "0.3.11",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -31,8 +31,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
@@ -43,10 +43,10 @@
"react-use": "^17.2.4"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/user-settings/src/components/Settings.tsx b/plugins/user-settings/src/components/Settings.tsx
index 43a00ee9cc..e9b3ae7d0a 100644
--- a/plugins/user-settings/src/components/Settings.tsx
+++ b/plugins/user-settings/src/components/Settings.tsx
@@ -18,14 +18,14 @@ import React from 'react';
import SettingsIcon from '@material-ui/icons/Settings';
import { settingsRouteRef } from '../plugin';
import { SidebarItem } from '@backstage/core-components';
-import { IconComponent } from '@backstage/core-plugin-api';
+import { useRouteRef, IconComponent } from '@backstage/core-plugin-api';
type SettingsProps = {
icon?: IconComponent;
};
export const Settings = (props: SettingsProps) => {
+ const routePath = useRouteRef(settingsRouteRef);
const Icon = props.icon ? props.icon : SettingsIcon;
-
- return ;
+ return ;
};
diff --git a/plugins/user-settings/src/plugin.ts b/plugins/user-settings/src/plugin.ts
index 54f6faceed..01793dc418 100644
--- a/plugins/user-settings/src/plugin.ts
+++ b/plugins/user-settings/src/plugin.ts
@@ -21,8 +21,7 @@ import {
} from '@backstage/core-plugin-api';
export const settingsRouteRef = createRouteRef({
- path: '/settings',
- title: 'Settings',
+ id: 'user-settings',
});
export const userSettingsPlugin = createPlugin({
diff --git a/plugins/xcmetrics/CHANGELOG.md b/plugins/xcmetrics/CHANGELOG.md
index a7d2d480b7..4ae5c49c32 100644
--- a/plugins/xcmetrics/CHANGELOG.md
+++ b/plugins/xcmetrics/CHANGELOG.md
@@ -1,5 +1,14 @@
# @backstage/plugin-xcmetrics
+## 0.2.10
+
+### Patch Changes
+
+- a125278b81: Refactor out the deprecated path and icon from RouteRefs
+- Updated dependencies
+ - @backstage/core-components@0.7.4
+ - @backstage/core-plugin-api@0.2.0
+
## 0.2.9
### Patch Changes
diff --git a/plugins/xcmetrics/package.json b/plugins/xcmetrics/package.json
index bbab66e455..f29f763666 100644
--- a/plugins/xcmetrics/package.json
+++ b/plugins/xcmetrics/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-xcmetrics",
"description": "A Backstage plugin that shows XCode build metrics for your components",
- "version": "0.2.9",
+ "version": "0.2.10",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -21,8 +21,8 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/core-components": "^0.7.3",
- "@backstage/core-plugin-api": "^0.1.13",
+ "@backstage/core-components": "^0.7.4",
+ "@backstage/core-plugin-api": "^0.2.0",
"@backstage/errors": "^0.1.3",
"@backstage/theme": "^0.2.13",
"@material-ui/core": "^4.12.2",
@@ -36,10 +36,10 @@
"recharts": "^1.8.5"
},
"devDependencies": {
- "@backstage/cli": "^0.8.2",
- "@backstage/core-app-api": "^0.1.20",
- "@backstage/dev-utils": "^0.2.12",
- "@backstage/test-utils": "^0.1.21",
+ "@backstage/cli": "^0.9.0",
+ "@backstage/core-app-api": "^0.1.22",
+ "@backstage/dev-utils": "^0.2.13",
+ "@backstage/test-utils": "^0.1.22",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^11.2.5",
"@testing-library/user-event": "^13.1.8",
diff --git a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
index 53545890a4..a21918e322 100644
--- a/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
+++ b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx
@@ -22,24 +22,23 @@ import {
TabbedLayout,
} from '@backstage/core-components';
import { Overview } from '../Overview';
-import { buildsRouteRef, rootRouteRef } from '../../routes';
-import { RouteRef, SubRouteRef } from '@backstage/core-plugin-api';
+import { buildsRouteRef } from '../../routes';
import { BuildsPage } from '../BuildsPage';
export interface TabConfig {
- routeRef: RouteRef | SubRouteRef;
+ path: string;
title: string;
component: ReactChild;
}
const TABS: TabConfig[] = [
{
- routeRef: rootRouteRef,
+ path: '/',
title: 'Overview',
component: ,
},
{
- routeRef: buildsRouteRef,
+ path: buildsRouteRef.path,
title: 'Builds',
component: ,
},
@@ -53,11 +52,7 @@ export const XcmetricsLayout = () => (
{TABS.map(tab => (
-
+
{tab.component}
))}
diff --git a/plugins/xcmetrics/src/routes.ts b/plugins/xcmetrics/src/routes.ts
index 212ecbae48..81934c860f 100644
--- a/plugins/xcmetrics/src/routes.ts
+++ b/plugins/xcmetrics/src/routes.ts
@@ -16,7 +16,7 @@
import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
export const rootRouteRef = createRouteRef({
- title: 'XCMetrics',
+ id: 'xcmetrics',
});
export const buildsRouteRef = createSubRouteRef({
diff --git a/scripts/check-if-release.js b/scripts/check-if-release.js
index 4475ed6207..b61b0e2eb7 100755
--- a/scripts/check-if-release.js
+++ b/scripts/check-if-release.js
@@ -96,7 +96,9 @@ async function main() {
const newVersions = packageVersions.filter(
({ oldVersion, newVersion }) =>
- oldVersion !== newVersion && newVersion !== '',
+ oldVersion !== newVersion &&
+ oldVersion !== '' &&
+ newVersion !== '',
);
if (newVersions.length === 0) {
diff --git a/scripts/list-deprecations.js b/scripts/list-deprecations.js
new file mode 100755
index 0000000000..920b01c7b5
--- /dev/null
+++ b/scripts/list-deprecations.js
@@ -0,0 +1,229 @@
+#!/usr/bin/env node
+/*
+ * Copyright 2021 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* eslint-disable import/no-extraneous-dependencies */
+
+const _ = require('lodash');
+const fs = require('fs-extra');
+const globby = require('globby');
+const { resolve: resolvePath, relative: relativePath } = require('path');
+const { execFile: execFileCb } = require('child_process');
+const { promisify } = require('util');
+
+const execFile = promisify(execFileCb);
+
+const WORKER_COUNT = 16;
+
+const deprecatedPattern = /@deprecated|DEPRECATION/;
+
+class ReleaseProvider {
+ cache = new Map();
+
+ constructor(rootPath) {
+ this.rootPath = rootPath;
+ }
+
+ async lookup(commitSha, packageDir) {
+ const key = commitSha + packageDir;
+
+ if (this.cache.has(key)) {
+ return this.cache.get(key);
+ }
+
+ const pkgJsonPath = relativePath(
+ this.rootPath,
+ resolvePath(this.rootPath, packageDir, 'package.json'),
+ );
+ const releasePromise = Promise.resolve().then(async () => {
+ // Find all tags that contain the commit
+ const { stdout: tagOutput } = await execFile(
+ 'git',
+ ['tag', '--contains', commitSha],
+ { shell: true },
+ );
+
+ // Filter out just the releases
+ const releases = tagOutput
+ .split('\n')
+ .filter(l => l.startsWith('release-'));
+
+ // Then find the earliest release that affected our package
+ for (const release of releases) {
+ let oldVersion;
+ let newVersion;
+
+ try {
+ const { stdout: content } = await execFile(
+ 'git',
+ ['show', `${release}^:${pkgJsonPath}`],
+ { shell: true },
+ );
+ oldVersion = JSON.parse(content).version;
+ } catch {
+ /* */
+ }
+ try {
+ const { stdout: content } = await execFile(
+ 'git',
+ ['show', `${release}:${pkgJsonPath}`],
+ { shell: true },
+ );
+ newVersion = JSON.parse(content).version;
+ } catch {
+ /* */
+ }
+
+ if (oldVersion !== newVersion) {
+ return release;
+ }
+ }
+ return undefined;
+ });
+
+ this.cache.set(key, releasePromise);
+ return releasePromise;
+ }
+}
+
+async function main() {
+ let packageDirQueue = process.argv.slice(2);
+
+ const rootPath = resolvePath(__dirname, '..');
+
+ if (packageDirQueue.length === 0) {
+ packageDirQueue = await Promise.all([
+ fs.readdir(resolvePath(rootPath, 'packages')),
+ fs.readdir(resolvePath(rootPath, 'plugins')),
+ ]).then(([packages, plugins]) => [
+ ...packages.map(dir => `packages/${dir}`),
+ ...plugins.map(dir => `plugins/${dir}`),
+ ]);
+ }
+
+ const fileQueue = [];
+ const deprecationQueue = [];
+ const releaseProvider = new ReleaseProvider(rootPath);
+ const deprecations = [];
+
+ await Promise.all(
+ Array(WORKER_COUNT)
+ .fill()
+ .map(async () => {
+ // Find all files we want to scan
+ while (packageDirQueue.length) {
+ const packageDir = packageDirQueue.pop();
+ const srcDir = resolvePath(rootPath, packageDir, 'src');
+
+ if (await fs.pathExists(srcDir)) {
+ const files = await globby(['**/*.{js,jsx,ts,tsx}'], {
+ cwd: srcDir,
+ });
+ fileQueue.push(
+ ...files.map(file => ({
+ packageDir,
+ file: resolvePath(srcDir, file),
+ })),
+ );
+ }
+ }
+
+ // Parse files and search for deprecations
+ while (fileQueue.length) {
+ const { packageDir, file } = fileQueue.pop();
+ const content = await fs.readFile(file, 'utf8');
+ if (!deprecatedPattern.test(content)) {
+ continue;
+ }
+
+ const lines = content.split('\n');
+ for (const [index, line] of lines.entries()) {
+ if (deprecatedPattern.test(line)) {
+ deprecationQueue.push({
+ packageDir,
+ file,
+ lineNumber: index + 1,
+ lineContent: line,
+ });
+ }
+ }
+ }
+
+ // Lookup git information for each deprecation
+ while (deprecationQueue.length) {
+ const deprecation = deprecationQueue.pop();
+
+ const { file, packageDir, lineNumber: n, lineContent } = deprecation;
+ const { stdout: blameOutput } = await execFile(
+ 'git',
+ ['blame', '--porcelain', `-L ${n},${n}`, file],
+ { shell: true },
+ );
+
+ const blameInfo = Object.fromEntries(
+ blameOutput
+ .split('\n')
+ .slice(1, -2)
+ .map(line => {
+ const [key] = line.split(' ', 1);
+ return [key, line.slice(key.length + 1)];
+ }),
+ );
+ const [commit] = blameOutput.split(' ', 1);
+ const { author, ['author-time']: authorTime } = blameInfo;
+
+ const release = await releaseProvider.lookup(commit, packageDir);
+
+ deprecations.push({
+ file: relativePath(rootPath, file),
+ release,
+ commit,
+ author,
+ authorTime: new Date(authorTime * 1000),
+ lineContent,
+ lineNumber: n,
+ });
+ }
+ }),
+ );
+
+ const maxAuthor = Math.max(...deprecations.map(d => d.author.length)) + 1;
+
+ // Group and sort by release
+ const sortedByRelease = _.sortBy(
+ Object.entries(_.groupBy(deprecations, 'release')),
+ ([release]) => release,
+ );
+
+ for (const [release, ds] of sortedByRelease) {
+ console.log(`\n### ${release === 'undefined' ? 'Not released' : release}`);
+ for (const d of _.sortBy(ds, 'authorTime', 'file', 'lineNumber')) {
+ console.log(
+ [
+ d.commit.slice(0, 8),
+ d.authorTime.toLocaleDateString().padEnd('00/00/0000'.length + 1),
+ d.author.padEnd(maxAuthor + 1),
+ `${d.file}:${d.lineNumber}`,
+ ].join(' '),
+ );
+ }
+ }
+}
+
+main().catch(err => {
+ console.error(err.stack);
+ process.exit(1);
+});
diff --git a/yarn.lock b/yarn.lock
index debcf79d8e..788549ca7a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2172,7 +2172,7 @@
"@babel/helper-validator-identifier" "^7.14.9"
to-fast-properties "^2.0.0"
-"@backstage/catalog-client@^0.3.16", "@backstage/catalog-client@^0.3.18":
+"@backstage/catalog-client@^0.3.18":
version "0.3.19"
resolved "https://registry.npmjs.org/@backstage/catalog-client/-/catalog-client-0.3.19.tgz#109b0fde1cc2d9a306635f3775fc8f6174172b14"
integrity sha512-0ydcC/1ISNgR8SggOUnMNNHtsRwrKN5GX+AXgTVdZk4qpz1MqG1+fzrNld9V7KVvXdsbGDZAl/b5a7/FJEpCqg==
@@ -2360,6 +2360,24 @@
remark-gfm "^1.0.0"
zen-observable "^0.8.15"
+"@backstage/core-plugin-api@^0.1.10", "@backstage/core-plugin-api@^0.1.3", "@backstage/core-plugin-api@^0.1.4", "@backstage/core-plugin-api@^0.1.6", "@backstage/core-plugin-api@^0.1.8":
+ version "0.1.13"
+ resolved "https://registry.npmjs.org/@backstage/core-plugin-api/-/core-plugin-api-0.1.13.tgz#583c0fe3440450c304f13dcc85eac3bd80f357d7"
+ integrity sha512-BWEqleTXR7m7nsCyt6cEnc+Gx/VT4vLdNr9fc1kXfzSAA7cUT4VKjlVmm5kdyih3BSQ4+0k7Pm/NIf0jfa7rlg==
+ dependencies:
+ "@backstage/config" "^0.1.11"
+ "@backstage/theme" "^0.2.13"
+ "@backstage/types" "^0.1.1"
+ "@backstage/version-bridge" "^0.1.0"
+ "@material-ui/core" "^4.12.2"
+ "@types/react" "*"
+ history "^5.0.0"
+ prop-types "^15.7.2"
+ react "^16.12.0"
+ react-router-dom "6.0.0-beta.0"
+ react-use "^17.2.4"
+ zen-observable "^0.8.15"
+
"@backstage/plugin-catalog-react@^0.4.0":
version "0.4.6"
resolved "https://registry.npmjs.org/@backstage/plugin-catalog-react/-/plugin-catalog-react-0.4.6.tgz#f33f3cd734f110d3c547f7eae4e25d14806ec796"
@@ -5054,19 +5072,19 @@
resolved "https://registry.npmjs.org/@octokit/webhooks-methods/-/webhooks-methods-2.0.0.tgz#1108b9ea661ca6c81e4a8bfa63a09eb27d5bc2db"
integrity sha512-35cfQ4YWlnZnmZKmIxlGPUPLtbkF8lr/A/1Sk1eC0ddLMwQN06dOuLc+dI3YLQS+T+MoNt3DIQ0NynwgKPilig==
-"@octokit/webhooks-types@4.12.0":
- version "4.12.0"
- resolved "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-4.12.0.tgz#add8b98d60ab42e965c4ba31040097f810e222de"
- integrity sha512-G0k7CoS9bK+OI7kPHgqi1KqK4WhrjDQSjy0wJI+0OTx/xvbHUIZDeqatY60ceeRINP/1ExEk6kTARboP0xavEw==
+"@octokit/webhooks-types@4.15.0":
+ version "4.15.0"
+ resolved "https://registry.npmjs.org/@octokit/webhooks-types/-/webhooks-types-4.15.0.tgz#1158cba6578237d60957a37963a4a05654f5668b"
+ integrity sha512-s9LgKsUzq/JH3PWDjaD/m1DIlC/QWgBWbmXVqjdxJXJQBA67KZrLWjStVlYPf0mWlVZ1MOKphDyHiOGCbs0+Kg==
"@octokit/webhooks@^9.14.1":
- version "9.17.0"
- resolved "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-9.17.0.tgz#81140b2e127157aa9817d085cd8758545e4a72e4"
- integrity sha512-/+9WSLuDuoqNWnMY4w6ePioILBqsUOiUt0ygQzugYzd112WB+yPIjmUQjAbNXImDsAa1myLpBICAMQDZlULyAA==
+ version "9.18.0"
+ resolved "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-9.18.0.tgz#19cc70e1ef281e33d830ea23e8011d25d8051f7f"
+ integrity sha512-N2hP7vCouKk9UWZxvqgWTPbp34i6g9Om/jk+TZeZ5Z+VsKjXvGtONlEd9H8DM1yOeEC+ARDpfhraX6UsK5tesQ==
dependencies:
"@octokit/request-error" "^2.0.2"
"@octokit/webhooks-methods" "^2.0.0"
- "@octokit/webhooks-types" "4.12.0"
+ "@octokit/webhooks-types" "4.15.0"
aggregate-error "^3.1.0"
"@open-draft/until@^1.0.3":
@@ -6763,6 +6781,13 @@
dependencies:
"@types/glob" "*"
+"@types/archiver@^5.1.1":
+ version "5.1.1"
+ resolved "https://registry.npmjs.org/@types/archiver/-/archiver-5.1.1.tgz#d6d7610de4386b293abd5c1cb1875e0a4f4e1c30"
+ integrity sha512-heuaCk0YH5m274NOLSi66H1zX6GtZoMsdE6TYFcpFFjBjg0FoU4i4/M/a/kNlgNg26Xk3g364mNOYe1JaiEPOQ==
+ dependencies:
+ "@types/glob" "*"
+
"@types/argparse@1.0.38":
version "1.0.38"
resolved "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9"
@@ -7055,19 +7080,19 @@
"@types/ms" "*"
"@types/diff@^5.0.0":
- version "5.0.0"
- resolved "https://registry.npmjs.org/@types/diff/-/diff-5.0.0.tgz#eb71e94feae62548282c4889308a3dfb57e36020"
- integrity sha512-jrm2K65CokCCX4NmowtA+MfXyuprZC13jbRuwprs6/04z/EcFg/MCwYdsHn+zgV4CQBiATiI7AEq7y1sZCtWKA==
+ version "5.0.1"
+ resolved "https://registry.npmjs.org/@types/diff/-/diff-5.0.1.tgz#9c9b9a331d4e41ccccff553f5d7ef964c6cf4042"
+ integrity sha512-XIpxU6Qdvp1ZE6Kr3yrkv1qgUab0fyf4mHYvW8N3Bx3PCsbN6or1q9/q72cv5jIFWolaGH08U9XyYoLLIykyKQ==
"@types/docker-modem@*":
- version "3.0.1"
- resolved "https://registry.npmjs.org/@types/docker-modem/-/docker-modem-3.0.1.tgz#2a29c914dd64c4c9213510d2ce75fa85232934df"
- integrity sha512-ZUXPF0WNnvs7AxoQRijt+DW2jsXnWCk8ac28tTYzTpBNnOEIAw83A+pYkCXjTFdJHMTc+wUmwNr71Zy2TRjlWg==
+ version "3.0.2"
+ resolved "https://registry.npmjs.org/@types/docker-modem/-/docker-modem-3.0.2.tgz#c49c902e17364fc724e050db5c1d2b298c6379d4"
+ integrity sha512-qC7prjoEYR2QEe6SmCVfB1x3rfcQtUr1n4x89+3e0wSTMQ/KYCyf+/RAA9n2tllkkNc6//JMUZePdFRiGIWfaQ==
dependencies:
"@types/node" "*"
"@types/ssh2" "*"
-"@types/dockerode@^3.2.1":
+"@types/dockerode@^3.2.5", "@types/dockerode@^3.3.0":
version "3.3.0"
resolved "https://registry.npmjs.org/@types/dockerode/-/dockerode-3.3.0.tgz#d6afcc1de31e211ee900da3a48ef4f1a496cf05a"
integrity sha512-3Mc0b2gnypJB8Gwmr+8UVPkwjpf4kg1gVxw8lAI4Y/EzpK50LixU1wBSPN9D+xqiw2Ubb02JO8oM0xpwzvi2mg==
@@ -8010,10 +8035,10 @@
"@types/node" "*"
"@types/ssh2-streams" "*"
-"@types/ssh2@^0.5.45":
- version "0.5.46"
- resolved "https://registry.npmjs.org/@types/ssh2/-/ssh2-0.5.46.tgz#e12341a242aea0e98ac2dec89e039bf421fd3584"
- integrity sha512-1pC8FHrMPYdkLoUOwTYYifnSEPzAFZRsp3JFC/vokQ+dRrVI+hDBwz0SNmQ3pL6h39OSZlPs0uCG7wKJkftnaA==
+"@types/ssh2@^0.5.48":
+ version "0.5.48"
+ resolved "https://registry.npmjs.org/@types/ssh2/-/ssh2-0.5.48.tgz#0d9e8654a76eaaf4cfeaeb88d74c4489cfcf7aea"
+ integrity sha512-cmQu0gp/6RtDXe1r2xXGgi0V0TeCdueDSRMEvBX8cTRT/sSREkUpgCYZLyh+iI8Ql+VNV8Az9toQoYa/IdgHbQ==
dependencies:
"@types/node" "*"
"@types/ssh2-streams" "*"
@@ -9028,7 +9053,7 @@ any-observable@^0.3.0:
resolved "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b"
integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==
-any-promise@^1.0.0, any-promise@^1.1.0:
+any-promise@^1.0.0:
version "1.3.0"
resolved "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"
integrity sha1-q8av7tzqUugJzcA3au0845Y10X8=
@@ -9467,7 +9492,7 @@ asn1.js@^4.0.0:
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
-asn1@^0.2.4, asn1@~0.2.0, asn1@~0.2.3:
+asn1@^0.2.4, asn1@~0.2.3:
version "0.2.4"
resolved "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136"
integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==
@@ -11884,6 +11909,13 @@ cp-file@^7.0.0:
nested-error-stacks "^2.0.0"
p-event "^4.1.0"
+cpu-features@0.0.2:
+ version "0.0.2"
+ resolved "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.2.tgz#9f636156f1155fd04bdbaa028bb3c2fbef3cea7a"
+ integrity sha512-/2yieBqvMcRj8McNzkycjW2v3OIUOibBfd2dLEJ0nWts8NobAxwiyw9phVNS6oDL8x8tz9F7uNVFEVpJncQpeA==
+ dependencies:
+ nan "^2.14.1"
+
cpy@^8.1.1:
version "8.1.1"
resolved "https://registry.npmjs.org/cpy/-/cpy-8.1.1.tgz#066ed4c6eaeed9577df96dae4db9438c1a90df62"
@@ -13078,27 +13110,27 @@ dns-txt@^2.0.2:
dependencies:
buffer-indexof "^1.0.0"
-docker-compose@^0.23.10:
- version "0.23.12"
- resolved "https://registry.npmjs.org/docker-compose/-/docker-compose-0.23.12.tgz#fa883b98be08f6926143d06bf9e522ef7ed3210c"
- integrity sha512-KFbSMqQBuHjTGZGmYDOCO0L4SaML3BsWTId5oSUyaBa22vALuFHNv+UdDWs3HcMylHWKsxCbLB7hnM/nCosWZw==
+docker-compose@^0.23.13:
+ version "0.23.13"
+ resolved "https://registry.npmjs.org/docker-compose/-/docker-compose-0.23.13.tgz#77d37bd05b6a966345f631e6d05e961c79514f06"
+ integrity sha512-/9fYC4g3AO+qsqxIZhmbVnFvJJPcYEV2yJbAPPXH+6AytU3urIY8lUAXOlvY8sl4u25pdKu1JrOfAmWC7lJDJg==
dependencies:
yaml "^1.10.2"
docker-modem@^3.0.0:
- version "3.0.0"
- resolved "https://registry.npmjs.org/docker-modem/-/docker-modem-3.0.0.tgz#cb912ad8daed42f858269fb3be6944df281ec12d"
- integrity sha512-WwFajJ8I5geZ/dDZ5FDMDA6TBkWa76xWwGIGw8uzUjNUGCN0to83wJ8Oi1AxrJTC0JBn+7fvIxUctnawtlwXeg==
+ version "3.0.3"
+ resolved "https://registry.npmjs.org/docker-modem/-/docker-modem-3.0.3.tgz#ac4bb1f32f81ac2e7120c5e99a068fab2458a32f"
+ integrity sha512-Tgkn2a+yiNP9FoZgMa/D9Wk+D2Db///0KOyKSYZRJa8w4+DzKyzQMkczKSdR/adQ0x46BOpeNkoyEOKjPhCzjw==
dependencies:
debug "^4.1.1"
readable-stream "^3.5.0"
split-ca "^1.0.1"
- ssh2 "^0.8.7"
+ ssh2 "^1.4.0"
-dockerode@^3.2.1:
- version "3.3.0"
- resolved "https://registry.npmjs.org/dockerode/-/dockerode-3.3.0.tgz#bedaf48ef9fa9124275a54a9881a92374c51008e"
- integrity sha512-St08lfOjpYCOXEM8XA0VLu3B3hRjtddODphNW5GFoA0AS3JHgoPQKOz0Qmdzg3P+hUPxhb02g1o1Cu1G+U3lRg==
+dockerode@^3.3.1:
+ version "3.3.1"
+ resolved "https://registry.npmjs.org/dockerode/-/dockerode-3.3.1.tgz#74f66e239e092e7910e2beae6322d35c44b08cdc"
+ integrity sha512-AS2mr8Lp122aa5n6d99HkuTNdRV1wkkhHwBdcnY6V0+28D3DSYwhxAk85/mM9XwD3RMliTxyr63iuvn5ZblFYQ==
dependencies:
docker-modem "^3.0.0"
tar-fs "~2.0.1"
@@ -15430,6 +15462,18 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, gl
once "^1.3.0"
path-is-absolute "^1.0.0"
+glob@^7.2.0:
+ version "7.2.0"
+ resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
+ integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
+ dependencies:
+ fs.realpath "^1.0.0"
+ inflight "^1.0.4"
+ inherits "2"
+ minimatch "^3.0.4"
+ once "^1.3.0"
+ path-is-absolute "^1.0.0"
+
global-dirs@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201"
@@ -20711,10 +20755,10 @@ mixin-object@^2.0.1:
for-in "^0.1.3"
is-extendable "^0.1.1"
-mixme@^0.3.1:
- version "0.3.5"
- resolved "https://registry.npmjs.org/mixme/-/mixme-0.3.5.tgz#304652cdaf24a3df0487205e61ac6162c6906ddd"
- integrity sha512-SyV9uPETRig5ZmYev0ANfiGeB+g6N2EnqqEfBbCGmmJ6MgZ3E4qv5aPbnHVdZ60KAHHXV+T3sXopdrnIXQdmjQ==
+mixme@^0.5.1:
+ version "0.5.4"
+ resolved "https://registry.npmjs.org/mixme/-/mixme-0.5.4.tgz#8cb3bd0cd32a513c161bf1ca99d143f0bcf2eff3"
+ integrity sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==
mkdirp-classic@^0.5.2:
version "0.5.2"
@@ -20928,6 +20972,11 @@ nan@^2.12.1, nan@^2.14.0:
resolved "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==
+nan@^2.14.1, nan@^2.15.0:
+ version "2.15.0"
+ resolved "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
+ integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==
+
nano-css@^5.1.0, nano-css@^5.3.1:
version "5.3.1"
resolved "https://registry.npmjs.org/nano-css/-/nano-css-5.3.1.tgz#b709383e07ad3be61f64edffacb9d98250b87a1f"
@@ -26208,29 +26257,24 @@ sqlstring@^2.3.2:
resolved "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.2.tgz#cdae7169389a1375b18e885f2e60b3e460809514"
integrity sha512-vF4ZbYdKS8OnoJAWBmMxCQDkiEBkGQYU7UZPtL8flbDRSNkhaXvRJ279ZtI6M+zDaQovVU4tuRgzK5fVhvFAhg==
-ssh-remote-port-forward@^1.0.3:
- version "1.0.3"
- resolved "https://registry.npmjs.org/ssh-remote-port-forward/-/ssh-remote-port-forward-1.0.3.tgz#074cebed6d54a42ce4659d6aa24987e433ff5fef"
- integrity sha512-PJ6qGFmB6n0iMCQIp+qzx8qVUE5cgacopvEh63t3NJjEQHOaza/JT9zywmmVlaol/eGtCmpvBXx2A03ih1Y+xg==
+ssh-remote-port-forward@^1.0.4:
+ version "1.0.4"
+ resolved "https://registry.npmjs.org/ssh-remote-port-forward/-/ssh-remote-port-forward-1.0.4.tgz#72b0c5df8ec27ca300c75805cc6b266dee07e298"
+ integrity sha512-x0LV1eVDwjf1gmG7TTnfqIzf+3VPRz7vrNIjX6oYLbeCrf/PeVY6hkT68Mg+q02qXxQhrLjB0jfgvhevoCRmLQ==
dependencies:
- "@types/ssh2" "^0.5.45"
- ssh2 "^0.8.9"
+ "@types/ssh2" "^0.5.48"
+ ssh2 "^1.4.0"
-ssh2-streams@~0.4.10:
- version "0.4.10"
- resolved "https://registry.npmjs.org/ssh2-streams/-/ssh2-streams-0.4.10.tgz#48ef7e8a0e39d8f2921c30521d56dacb31d23a34"
- integrity sha512-8pnlMjvnIZJvmTzUIIA5nT4jr2ZWNNVHwyXfMGdRJbug9TpI3kd99ffglgfSWqujVv/0gxwMsDn9j9RVst8yhQ==
+ssh2@^1.4.0:
+ version "1.5.0"
+ resolved "https://registry.npmjs.org/ssh2/-/ssh2-1.5.0.tgz#4dc559ba98a1cbb420e8d42998dfe35d0eda92bc"
+ integrity sha512-iUmRkhH9KGeszQwDW7YyyqjsMTf4z+0o48Cp4xOwlY5LjtbIAvyd3fwnsoUZW/hXmTCRA3yt7S/Jb9uVjErVlA==
dependencies:
- asn1 "~0.2.0"
+ asn1 "^0.2.4"
bcrypt-pbkdf "^1.0.2"
- streamsearch "~0.1.2"
-
-ssh2@^0.8.7, ssh2@^0.8.9:
- version "0.8.9"
- resolved "https://registry.npmjs.org/ssh2/-/ssh2-0.8.9.tgz#54da3a6c4ba3daf0d8477a538a481326091815f3"
- integrity sha512-GmoNPxWDMkVpMFa9LVVzQZHF6EW3WKmBwL+4/GeILf2hFmix5Isxm7Amamo8o7bHiU0tC+wXsGcUXOxp8ChPaw==
- dependencies:
- ssh2-streams "~0.4.10"
+ optionalDependencies:
+ cpu-features "0.0.2"
+ nan "^2.15.0"
sshpk@^1.7.0:
version "1.16.1"
@@ -26424,21 +26468,14 @@ stream-shift@^1.0.0:
resolved "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
-stream-to-array@^2.3.0:
- version "2.3.0"
- resolved "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz#bbf6b39f5f43ec30bc71babcb37557acecf34353"
- integrity sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M=
- dependencies:
- any-promise "^1.1.0"
-
stream-transform@^2.0.1:
- version "2.0.2"
- resolved "https://registry.npmjs.org/stream-transform/-/stream-transform-2.0.2.tgz#3cb7a14c802eb39bc40caaab0535e584f3a65caf"
- integrity sha512-J+D5jWPF/1oX+r9ZaZvEXFbu7znjxSkbNAHJ9L44bt/tCVuOEWZlDqU9qJk7N2xBU1S+K2DPpSKeR/MucmCA1Q==
+ version "2.1.3"
+ resolved "https://registry.npmjs.org/stream-transform/-/stream-transform-2.1.3.tgz#a1c3ecd72ddbf500aa8d342b0b9df38f5aa598e3"
+ integrity sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==
dependencies:
- mixme "^0.3.1"
+ mixme "^0.5.1"
-streamsearch@0.1.2, streamsearch@~0.1.2:
+streamsearch@0.1.2:
version "0.1.2"
resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=
@@ -27237,23 +27274,22 @@ test-exclude@^6.0.0:
glob "^7.1.4"
minimatch "^3.0.4"
-testcontainers@^7.10.0:
- version "7.11.1"
- resolved "https://registry.npmjs.org/testcontainers/-/testcontainers-7.11.1.tgz#b3810badf79433ba02f210683eec1a1c488c107d"
- integrity sha512-lfZeys5bLkADjOaoXfQy0V0+G8sGKr8ESANz7MhSVBwC+OTTxkP3+FVwP48bW4mwRcQ4Hojwbfw10OYT80QZmQ==
+testcontainers@^7.23.0:
+ version "7.23.0"
+ resolved "https://registry.npmjs.org/testcontainers/-/testcontainers-7.23.0.tgz#7d73a5e219a970fb75ff6a23a28dace8b7f3f232"
+ integrity sha512-90H1iijeIjOLp7WVNYKTNkM1sd+dlW5019ns45hSPcOET43WebEZQVJl8/Ag9vwSZD2mjomMum9a/EXk/st4sQ==
dependencies:
- "@types/archiver" "^5.1.0"
- "@types/dockerode" "^3.2.1"
+ "@types/archiver" "^5.1.1"
+ "@types/dockerode" "^3.2.5"
archiver "^5.3.0"
byline "^5.0.0"
- debug "^4.3.1"
- docker-compose "^0.23.10"
- dockerode "^3.2.1"
+ debug "^4.3.2"
+ docker-compose "^0.23.13"
+ dockerode "^3.3.1"
get-port "^5.1.1"
- glob "^7.1.7"
+ glob "^7.2.0"
slash "^3.0.0"
- ssh-remote-port-forward "^1.0.3"
- stream-to-array "^2.3.0"
+ ssh-remote-port-forward "^1.0.4"
tar-fs "^2.1.1"
text-encoding-utf-8@^1.0.1: