remove CatalogApi.getEntityByName

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-03-05 14:42:10 +01:00
parent e71753226f
commit bf95bb806c
17 changed files with 17 additions and 31 deletions
+10
View File
@@ -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`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-client': minor
---
**BREAKING**: Removed previously deprecated `CatalogApi.getEntityByName`, please use `getEntityByRef` instead.
+1 -5
View File
@@ -38,11 +38,6 @@ export interface CatalogApi {
request: GetEntityAncestorsRequest,
options?: CatalogRequestOptions,
): Promise<GetEntityAncestorsResponse>;
// @deprecated
getEntityByName(
name: CompoundEntityRef,
options?: CatalogRequestOptions,
): Promise<Entity | undefined>;
getEntityByRef(
entityRef: string | CompoundEntityRef,
options?: CatalogRequestOptions,
@@ -95,6 +90,7 @@ export class CatalogClient implements CatalogApi {
request: GetEntityAncestorsRequest,
options?: CatalogRequestOptions,
): Promise<GetEntityAncestorsResponse>;
// @deprecated (undocumented)
getEntityByName(
compoundName: CompoundEntityRef,
options?: CatalogRequestOptions,
+1 -1
View File
@@ -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,
-13
View File
@@ -315,19 +315,6 @@ export interface CatalogApi {
options?: CatalogRequestOptions,
): Promise<Entity | undefined>;
/**
* 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<Entity | undefined>;
/**
* Removes a single entity from the catalog by entity UID.
*
@@ -27,7 +27,6 @@ describe('CatalogIdentityClient', () => {
const catalogApi: jest.Mocked<CatalogApi> = {
getLocationById: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
getEntities: jest.fn(),
addLocation: jest.fn(),
removeLocationById: jest.fn(),
@@ -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(),
@@ -58,7 +58,6 @@ describe('<CatalogGraphCard/>', () => {
catalog = {
getEntities: jest.fn(),
getEntityByRef: jest.fn(async _ => ({ ...entity, relations: [] })),
getEntityByName: jest.fn(),
removeEntityByUid: jest.fn(),
getLocationById: jest.fn(),
getLocationByRef: jest.fn(),
@@ -91,7 +91,6 @@ describe('<CatalogGraphPage/>', () => {
getEntityByRef: jest.fn(async (n: any) =>
n === 'b:d/e' ? entityE : entityC,
),
getEntityByName: jest.fn(),
removeEntityByUid: jest.fn(),
getLocationById: jest.fn(),
getLocationByRef: jest.fn(),
@@ -156,7 +156,6 @@ describe('<EntityRelationsGraph/>', () => {
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(),
@@ -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(),
@@ -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(),
@@ -39,7 +39,6 @@ describe('<StepPrepareCreatePullRequest />', () => {
getEntities: jest.fn(),
addLocation: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
getLocationByRef: jest.fn(),
getLocationById: jest.fn(),
removeLocationById: jest.fn(),
@@ -29,7 +29,6 @@ describe('<DefaultExplorePage />', () => {
removeLocationById: jest.fn(),
removeEntityByUid: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
refreshEntity: jest.fn(),
getEntityAncestors: jest.fn(),
getEntityFacets: jest.fn(),
@@ -30,7 +30,6 @@ describe('<DomainExplorerContent />', () => {
removeLocationById: jest.fn(),
removeEntityByUid: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
refreshEntity: jest.fn(),
getEntityAncestors: jest.fn(),
getEntityFacets: jest.fn(),
@@ -30,7 +30,6 @@ describe('<GroupsExplorerContent />', () => {
removeLocationById: jest.fn(),
removeEntityByUid: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
refreshEntity: jest.fn(),
getEntityAncestors: jest.fn(),
getEntityFacets: jest.fn(),
@@ -30,7 +30,6 @@ describe('<FossaPage />', () => {
addLocation: jest.fn(),
getEntities: jest.fn(),
getEntityByRef: jest.fn(),
getEntityByName: jest.fn(),
getLocationByRef: jest.fn(),
getLocationById: jest.fn(),
removeEntityByUid: jest.fn(),