From bf95bb806c52cb8d6771f3967c9a760868762b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Sat, 5 Mar 2022 14:42:10 +0100 Subject: [PATCH] remove CatalogApi.getEntityByName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/olive-emus-speak.md | 10 ++++++++++ .changeset/thick-gifts-cheat.md | 5 +++++ packages/catalog-client/api-report.md | 6 +----- packages/catalog-client/src/CatalogClient.ts | 2 +- packages/catalog-client/src/types/api.ts | 13 ------------- .../src/lib/catalog/CatalogIdentityClient.test.ts | 1 - plugins/badges-backend/src/service/router.test.ts | 1 - .../CatalogGraphCard/CatalogGraphCard.test.tsx | 1 - .../CatalogGraphPage/CatalogGraphPage.test.tsx | 1 - .../EntityRelationsGraph.test.tsx | 1 - .../EntityRelationsGraph/useEntityStore.test.ts | 1 - .../src/api/CatalogImportClient.test.ts | 1 - .../StepPrepareCreatePullRequest.test.tsx | 1 - .../DefaultExplorePage/DefaultExplorePage.test.tsx | 1 - .../DomainExplorerContent.test.tsx | 1 - .../GroupsExplorerContent.test.tsx | 1 - .../src/components/FossaPage/FossaPage.test.tsx | 1 - 17 files changed, 17 insertions(+), 31 deletions(-) create mode 100644 .changeset/olive-emus-speak.md create mode 100644 .changeset/thick-gifts-cheat.md diff --git a/.changeset/olive-emus-speak.md b/.changeset/olive-emus-speak.md new file mode 100644 index 0000000000..3cb6a775cf --- /dev/null +++ b/.changeset/olive-emus-speak.md @@ -0,0 +1,10 @@ +--- +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-badges-backend': patch +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-explore': patch +'@backstage/plugin-fossa': patch +--- + +Remove usages of now-removed `CatalogApi.getEntityByName` diff --git a/.changeset/thick-gifts-cheat.md b/.changeset/thick-gifts-cheat.md new file mode 100644 index 0000000000..00154a8492 --- /dev/null +++ b/.changeset/thick-gifts-cheat.md @@ -0,0 +1,5 @@ +--- +'@backstage/catalog-client': minor +--- + +**BREAKING**: Removed previously deprecated `CatalogApi.getEntityByName`, please use `getEntityByRef` instead. diff --git a/packages/catalog-client/api-report.md b/packages/catalog-client/api-report.md index d85b9c4d0d..ac8f712e11 100644 --- a/packages/catalog-client/api-report.md +++ b/packages/catalog-client/api-report.md @@ -38,11 +38,6 @@ export interface CatalogApi { request: GetEntityAncestorsRequest, options?: CatalogRequestOptions, ): Promise; - // @deprecated - getEntityByName( - name: CompoundEntityRef, - options?: CatalogRequestOptions, - ): Promise; getEntityByRef( entityRef: string | CompoundEntityRef, options?: CatalogRequestOptions, @@ -95,6 +90,7 @@ export class CatalogClient implements CatalogApi { request: GetEntityAncestorsRequest, options?: CatalogRequestOptions, ): Promise; + // @deprecated (undocumented) getEntityByName( compoundName: CompoundEntityRef, options?: CatalogRequestOptions, diff --git a/packages/catalog-client/src/CatalogClient.ts b/packages/catalog-client/src/CatalogClient.ts index 53397d061e..85aada616c 100644 --- a/packages/catalog-client/src/CatalogClient.ts +++ b/packages/catalog-client/src/CatalogClient.ts @@ -190,7 +190,7 @@ export class CatalogClient implements CatalogApi { // longer, to minimize the risk for breakages. Suggested date for removal: // August 2022 /** - * {@inheritdoc CatalogApi.getEntityByName} + * @deprecated Use getEntityByRef instead */ async getEntityByName( compoundName: CompoundEntityRef, diff --git a/packages/catalog-client/src/types/api.ts b/packages/catalog-client/src/types/api.ts index 26af3889e2..ba0c5e9359 100644 --- a/packages/catalog-client/src/types/api.ts +++ b/packages/catalog-client/src/types/api.ts @@ -315,19 +315,6 @@ export interface CatalogApi { options?: CatalogRequestOptions, ): Promise; - /** - * Gets a single entity from the catalog by its ref (kind, namespace, name) - * triplet. - * - * @deprecated Use getEntityRef instead - * @param name - A complete entity ref - * @param options - Additional options - */ - getEntityByName( - name: CompoundEntityRef, - options?: CatalogRequestOptions, - ): Promise; - /** * Removes a single entity from the catalog by entity UID. * diff --git a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts index 08c46f2c21..b99c8a7615 100644 --- a/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts +++ b/plugins/auth-backend/src/lib/catalog/CatalogIdentityClient.test.ts @@ -27,7 +27,6 @@ describe('CatalogIdentityClient', () => { const catalogApi: jest.Mocked = { getLocationById: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), getEntities: jest.fn(), addLocation: jest.fn(), removeLocationById: jest.fn(), diff --git a/plugins/badges-backend/src/service/router.test.ts b/plugins/badges-backend/src/service/router.test.ts index c492449cb3..1750a55be7 100644 --- a/plugins/badges-backend/src/service/router.test.ts +++ b/plugins/badges-backend/src/service/router.test.ts @@ -61,7 +61,6 @@ describe('createRouter', () => { addLocation: jest.fn(), getEntities: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), diff --git a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx index 858fca1a83..9fbe110811 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphCard/CatalogGraphCard.test.tsx @@ -58,7 +58,6 @@ describe('', () => { catalog = { getEntities: jest.fn(), getEntityByRef: jest.fn(async _ => ({ ...entity, relations: [] })), - getEntityByName: jest.fn(), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), getLocationByRef: jest.fn(), diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx index 0bf6469123..9453d5a000 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx @@ -91,7 +91,6 @@ describe('', () => { getEntityByRef: jest.fn(async (n: any) => n === 'b:d/e' ? entityE : entityC, ), - getEntityByName: jest.fn(), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), getLocationByRef: jest.fn(), diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx index 58ff81a91f..e8c9239739 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/EntityRelationsGraph.test.tsx @@ -156,7 +156,6 @@ describe('', () => { catalog = { getEntities: jest.fn(), getEntityByRef: jest.fn(async n => entities[n as string]), - getEntityByName: jest.fn(), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), getLocationByRef: jest.fn(), diff --git a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts index 5349b64a72..9956137287 100644 --- a/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts +++ b/plugins/catalog-graph/src/components/EntityRelationsGraph/useEntityStore.test.ts @@ -30,7 +30,6 @@ describe('useEntityStore', () => { catalogApi = { getEntities: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), removeEntityByUid: jest.fn(), getLocationById: jest.fn(), getLocationByRef: jest.fn(), diff --git a/plugins/catalog-import/src/api/CatalogImportClient.test.ts b/plugins/catalog-import/src/api/CatalogImportClient.test.ts index 969ff25c00..5a65738d61 100644 --- a/plugins/catalog-import/src/api/CatalogImportClient.test.ts +++ b/plugins/catalog-import/src/api/CatalogImportClient.test.ts @@ -94,7 +94,6 @@ describe('CatalogImportClient', () => { addLocation: jest.fn(), removeLocationById: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeEntityByUid: jest.fn(), diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx index dd8087c51e..ea2bee9425 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/StepPrepareCreatePullRequest.test.tsx @@ -39,7 +39,6 @@ describe('', () => { getEntities: jest.fn(), addLocation: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeLocationById: jest.fn(), diff --git a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx index c490dd00da..a79d02a2a0 100644 --- a/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx +++ b/plugins/explore/src/components/DefaultExplorePage/DefaultExplorePage.test.tsx @@ -29,7 +29,6 @@ describe('', () => { removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), refreshEntity: jest.fn(), getEntityAncestors: jest.fn(), getEntityFacets: jest.fn(), diff --git a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx index d103541333..c30e845112 100644 --- a/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx +++ b/plugins/explore/src/components/DomainExplorerContent/DomainExplorerContent.test.tsx @@ -30,7 +30,6 @@ describe('', () => { removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), refreshEntity: jest.fn(), getEntityAncestors: jest.fn(), getEntityFacets: jest.fn(), diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx index 99500336cf..4488a4d0d9 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsExplorerContent.test.tsx @@ -30,7 +30,6 @@ describe('', () => { removeLocationById: jest.fn(), removeEntityByUid: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), refreshEntity: jest.fn(), getEntityAncestors: jest.fn(), getEntityFacets: jest.fn(), diff --git a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx index f178b7de7f..e6cf65771a 100644 --- a/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx +++ b/plugins/fossa/src/components/FossaPage/FossaPage.test.tsx @@ -30,7 +30,6 @@ describe('', () => { addLocation: jest.fn(), getEntities: jest.fn(), getEntityByRef: jest.fn(), - getEntityByName: jest.fn(), getLocationByRef: jest.fn(), getLocationById: jest.fn(), removeEntityByUid: jest.fn(),