From 8adadd87b81b2e947217b39ddba859ec49d54c77 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 16 Aug 2023 11:51:38 +0200 Subject: [PATCH 01/11] workflows: send discord notification if version packages fail Signed-off-by: Patrik Oldsberg --- .github/workflows/sync_version-packages.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/sync_version-packages.yml b/.github/workflows/sync_version-packages.yml index 22421925c7..6d662ea05f 100644 --- a/.github/workflows/sync_version-packages.yml +++ b/.github/workflows/sync_version-packages.yml @@ -27,3 +27,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GH_SERVICE_ACCOUNT_TOKEN }} HUSKY: '0' + + - name: Discord notification + if: ${{ failure() }} + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + args: 'Version Packages Sync Failed https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}}' From 42bde12f046202a1cb3f1a1af23c2b8b8d727d45 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:21:24 -0400 Subject: [PATCH 02/11] chore: Add backend logging if posts fail Signed-off-by: Adam Harvey --- plugins/entity-feedback-backend/src/service/router.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/entity-feedback-backend/src/service/router.ts b/plugins/entity-feedback-backend/src/service/router.ts index ea759c1639..4953c531b8 100644 --- a/plugins/entity-feedback-backend/src/service/router.ts +++ b/plugins/entity-feedback-backend/src/service/router.ts @@ -134,6 +134,9 @@ export async function createRouter( const user = await identity.getIdentity({ request: req }); const rating = req.body.rating; if (!user || !rating) { + logger.warn( + `Can't save rating because there is not enough info: user=${user}, rating=${rating}`, + ); res.status(400).end(); return; } @@ -188,6 +191,7 @@ export async function createRouter( const { response, comments, consent } = req.body; if (!user) { + logger.warn(`Could not identify user to save responses, user=${user}`); res.status(400).end(); return; } From 740155e8e976dd424b4b80f56436e0a33af46212 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:22:03 -0400 Subject: [PATCH 03/11] chor: Add changeset Signed-off-by: Adam Harvey --- .changeset/poor-years-appear.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/poor-years-appear.md diff --git a/.changeset/poor-years-appear.md b/.changeset/poor-years-appear.md new file mode 100644 index 0000000000..d5b53a7051 --- /dev/null +++ b/.changeset/poor-years-appear.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-entity-feedback-backend': patch +--- + +Improve backend logging if method calls fail From 4e0e9b2a488e14b68b2dcd71645e1557f96572b5 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:29:51 -0400 Subject: [PATCH 04/11] chore: Clarify identify requirement Signed-off-by: Adam Harvey --- plugins/entity-feedback-backend/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/entity-feedback-backend/README.md b/plugins/entity-feedback-backend/README.md index 99489e28b2..49a8ce20e0 100644 --- a/plugins/entity-feedback-backend/README.md +++ b/plugins/entity-feedback-backend/README.md @@ -4,6 +4,10 @@ Welcome to the entity-feedback backend plugin! ## Installation +Note: this plugin requires authentication and identity configured so Backstage can identify +which user has rated the entity. If you are using the guest identity provider which comes +out of the box, this plugin will not work when you test it. + ### Install the package ```bash From 5e2e06db747aa6865c724adfaaf79063c957874a Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:30:36 -0400 Subject: [PATCH 05/11] chore: Add changeset Signed-off-by: Adam Harvey --- .changeset/few-nails-smile.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/few-nails-smile.md diff --git a/.changeset/few-nails-smile.md b/.changeset/few-nails-smile.md new file mode 100644 index 0000000000..6b5a08c97d --- /dev/null +++ b/.changeset/few-nails-smile.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-entity-feedback': patch +--- + +Improve README to identify that Backstage identity is required to be configured From 6093d001cf6c47f58e30bcf1e9dabdc37fdc9edc Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:32:38 -0400 Subject: [PATCH 06/11] chore: Clarify identity requirement Signed-off-by: Adam Harvey --- plugins/entity-feedback/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/entity-feedback/README.md b/plugins/entity-feedback/README.md index fdfa4761d6..c405bd4083 100644 --- a/plugins/entity-feedback/README.md +++ b/plugins/entity-feedback/README.md @@ -36,7 +36,11 @@ This plugin allows you give and view feedback on entities available in the Backs ## Setup -The following sections will help you get the Entity Feedback plugin setup and running +The following sections will help you get the Entity Feedback plugin setup and running. + +Note: this plugin requires authentication and identity configured so Backstage can identify +which user has rated the entity. If you are using the guest identity provider which comes +out of the box, this plugin will not work when you test it. ### Backend @@ -133,4 +137,4 @@ const groupPage = ( ); ``` -Note: For a full example of this you can look at [this EntityPage](../../packages/app/src/components/catalog/EntityPage.tsx) +Note: For a full example of this you can look at [this EntityPage](../../packages/app/src/components/catalog/EntityPage.tsx). From 828f5a67af457d6bd62e2f23f62a94311e525544 Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Wed, 16 Aug 2023 12:33:40 -0400 Subject: [PATCH 07/11] chore: Simplify wording Signed-off-by: Adam Harvey --- .changeset/few-nails-smile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/few-nails-smile.md b/.changeset/few-nails-smile.md index 6b5a08c97d..2fad9a0b40 100644 --- a/.changeset/few-nails-smile.md +++ b/.changeset/few-nails-smile.md @@ -2,4 +2,4 @@ '@backstage/plugin-entity-feedback': patch --- -Improve README to identify that Backstage identity is required to be configured +Improve README to note that Backstage identity is required to be configured From 044b4f2fb1e38083cdc0c51cf8ce82dbc0e8f419 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 17 Aug 2023 11:29:29 +0100 Subject: [PATCH 08/11] deduplicate search results from azure Signed-off-by: Brian Fletcher --- .changeset/mean-carpets-provide.md | 5 +++++ .../src/providers/AzureDevOpsEntityProvider.ts | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/mean-carpets-provide.md diff --git a/.changeset/mean-carpets-provide.md b/.changeset/mean-carpets-provide.md new file mode 100644 index 0000000000..0d33816228 --- /dev/null +++ b/.changeset/mean-carpets-provide.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-azure': patch +--- + +Remove duplications from Azure search before commiting the new locations to the catalog. diff --git a/plugins/catalog-backend-module-azure/src/providers/AzureDevOpsEntityProvider.ts b/plugins/catalog-backend-module-azure/src/providers/AzureDevOpsEntityProvider.ts index 5abd23ce00..4a9ad2f250 100644 --- a/plugins/catalog-backend-module-azure/src/providers/AzureDevOpsEntityProvider.ts +++ b/plugins/catalog-backend-module-azure/src/providers/AzureDevOpsEntityProvider.ts @@ -148,7 +148,10 @@ export class AzureDevOpsEntityProvider implements EntityProvider { logger.info(`Discovered ${files.length} catalog files`); - const locations = files.map(key => this.createLocationSpec(key)); + const targets = files.map(key => this.createObjectUrl(key)); + const locations = Array.from(new Set(targets)).map(key => + this.createLocationSpec(key), + ); await this.connection.applyMutation({ type: 'full', @@ -165,9 +168,7 @@ export class AzureDevOpsEntityProvider implements EntityProvider { ); } - private createLocationSpec(file: CodeSearchResultItem): LocationSpec { - const target = this.createObjectUrl(file); - + private createLocationSpec(target: string): LocationSpec { return { type: 'url', target: target, From c0a2e6e8c26aebd7ff365434af3b86ba696ba9f4 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 17 Aug 2023 11:32:49 +0100 Subject: [PATCH 09/11] fix typo Signed-off-by: Brian Fletcher --- .changeset/mean-carpets-provide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/mean-carpets-provide.md b/.changeset/mean-carpets-provide.md index 0d33816228..b5e9f551d4 100644 --- a/.changeset/mean-carpets-provide.md +++ b/.changeset/mean-carpets-provide.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend-module-azure': patch --- -Remove duplications from Azure search before commiting the new locations to the catalog. +Remove duplications from Azure search before committing the new locations to the catalog. From 47782f4bfa5b2cb79f582542b3dff195880dbdbb Mon Sep 17 00:00:00 2001 From: Matthew Clarke Date: Thu, 17 Aug 2023 09:46:03 -0400 Subject: [PATCH 10/11] feat: Table initial loading (#19343) * feat: add initial loading state for Table Signed-off-by: Matthew Clarke * Please answer yes or no. feat: add loading state for Table component Signed-off-by: Matthew Clarke * chore: changeset Signed-off-by: Matthew Clarke * test: add test Signed-off-by: Matthew Clarke * docs: api reports Signed-off-by: Matthew Clarke --------- Signed-off-by: Matthew Clarke --- .changeset/strange-frogs-count.md | 5 +++ packages/core-components/api-report.md | 2 + .../src/components/Table/Table.stories.tsx | 37 +++++++++++++++++++ .../src/components/Table/Table.test.tsx | 5 +++ .../src/components/Table/Table.tsx | 27 +++++++++++++- 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .changeset/strange-frogs-count.md diff --git a/.changeset/strange-frogs-count.md b/.changeset/strange-frogs-count.md new file mode 100644 index 0000000000..94fa6b9fb6 --- /dev/null +++ b/.changeset/strange-frogs-count.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Add loading indicator to Table diff --git a/packages/core-components/api-report.md b/packages/core-components/api-report.md index df34abdd03..cc9246c752 100644 --- a/packages/core-components/api-report.md +++ b/packages/core-components/api-report.md @@ -1356,6 +1356,8 @@ export interface TableProps // (undocumented) initialState?: TableState; // (undocumented) + isLoading?: boolean; + // (undocumented) onStateChange?: (state: TableState) => any; // (undocumented) subtitle?: string; diff --git a/packages/core-components/src/components/Table/Table.stories.tsx b/packages/core-components/src/components/Table/Table.stories.tsx index 807d58057d..b38941012c 100644 --- a/packages/core-components/src/components/Table/Table.stories.tsx +++ b/packages/core-components/src/components/Table/Table.stories.tsx @@ -89,6 +89,43 @@ export const DefaultTable = () => { ); }; +export const LoadingTable = () => { + const classes = useStyles(); + const columns: TableColumn[] = [ + { + title: 'Column 1', + field: 'col1', + highlight: true, + }, + { + title: 'Column 2', + field: 'col2', + }, + { + title: 'Numeric value', + field: 'number', + type: 'numeric', + }, + { + title: 'A Date', + field: 'date', + type: 'date', + }, + ]; + + return ( +
+ + + ); +}; + export const EmptyTable = () => { const classes = useStyles(); const columns: TableColumn[] = [ diff --git a/packages/core-components/src/components/Table/Table.test.tsx b/packages/core-components/src/components/Table/Table.test.tsx index ffdca26d98..43c8cfe41d 100644 --- a/packages/core-components/src/components/Table/Table.test.tsx +++ b/packages/core-components/src/components/Table/Table.test.tsx @@ -48,6 +48,11 @@ describe('
', () => { expect(rendered.getByText('second value, second row')).toBeInTheDocument(); }); + it('renders loading without exploding', async () => { + const rendered = await renderInTestApp(
); + expect(rendered.getByTestId('loading-indicator')).toBeInTheDocument(); + }); + describe('with style rows', () => { describe('with CSS Properties object', () => { const styledColumn2 = { diff --git a/packages/core-components/src/components/Table/Table.tsx b/packages/core-components/src/components/Table/Table.tsx index 5cea3dd6b6..9f2b04c214 100644 --- a/packages/core-components/src/components/Table/Table.tsx +++ b/packages/core-components/src/components/Table/Table.tsx @@ -53,6 +53,7 @@ import React, { import { SelectProps } from '../Select/Select'; import { Filter, Filters, SelectedFilters, Without } from './Filters'; +import CircularProgress from '@material-ui/core/CircularProgress'; // Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51 const tableIcons: Icons = { @@ -236,6 +237,7 @@ export interface TableProps filters?: TableFilter[]; initialState?: TableState; emptyContent?: ReactNode; + isLoading?: boolean; onStateChange?: (state: TableState) => any; } @@ -309,6 +311,7 @@ export function Table(props: TableProps) { emptyContent, onStateChange, components, + isLoading: isLoading, ...restProps } = props; const tableClasses = useTableStyles(); @@ -470,6 +473,28 @@ export function Table(props: TableProps) { const columnCount = columns.length; const Body = useCallback( bodyProps => { + if (isLoading) { + return ( + + + + + + ); + } + if (emptyContent && hasNoRows) { return ( @@ -482,7 +507,7 @@ export function Table(props: TableProps) { return ; }, - [hasNoRows, emptyContent, columnCount], + [hasNoRows, emptyContent, columnCount, isLoading], ); return ( From fb57a4694fc6f2efbba4baff22bc11690fdad738 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 17 Aug 2023 17:37:21 +0200 Subject: [PATCH 11/11] scaffolder-backend: fixed alpha module plugin and module ID Signed-off-by: Patrik Oldsberg --- .changeset/lazy-rice-rule.md | 5 +++++ .../src/modules/catalogModuleTemplateKind.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/lazy-rice-rule.md diff --git a/.changeset/lazy-rice-rule.md b/.changeset/lazy-rice-rule.md new file mode 100644 index 0000000000..1c3a3c3250 --- /dev/null +++ b/.changeset/lazy-rice-rule.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Fixed the plugin and module ID of the alpha `catalogModuleTemplateKind` export. diff --git a/plugins/scaffolder-backend/src/modules/catalogModuleTemplateKind.ts b/plugins/scaffolder-backend/src/modules/catalogModuleTemplateKind.ts index 3359bd1dba..81d3dc3e93 100644 --- a/plugins/scaffolder-backend/src/modules/catalogModuleTemplateKind.ts +++ b/plugins/scaffolder-backend/src/modules/catalogModuleTemplateKind.ts @@ -24,8 +24,8 @@ import { ScaffolderEntitiesProcessor } from '../processor'; * @alpha */ export const catalogModuleTemplateKind = createBackendModule({ - moduleId: 'scaffolder', - pluginId: 'templateKind', + moduleId: 'templateKind', + pluginId: 'catalog', register(env) { env.registerInit({ deps: {
+ + + +