deprecate EntityName, introduce CompoundEntityRef

deprecate getEntityName, introduce getCompoundEntityRef

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-03-02 21:26:22 +01:00
parent 80d2674a31
commit 36aa63022b
84 changed files with 393 additions and 268 deletions
@@ -16,7 +16,7 @@
import { CachedEntityLoader } from './CachedEntityLoader';
import { CatalogClient } from '@backstage/catalog-client';
import { CacheClient } from '@backstage/backend-common';
import { EntityName } from '@backstage/catalog-model';
import { CompoundEntityRef } from '@backstage/catalog-model';
describe('CachedEntityLoader', () => {
const catalog: jest.Mocked<CatalogClient> = {
@@ -28,7 +28,7 @@ describe('CachedEntityLoader', () => {
set: jest.fn(),
} as any;
const entityName: EntityName = {
const entityName: CompoundEntityRef = {
kind: 'component',
namespace: 'default',
name: 'test',
@@ -17,7 +17,7 @@ import { CatalogClient } from '@backstage/catalog-client';
import { CacheClient } from '@backstage/backend-common';
import {
Entity,
EntityName,
CompoundEntityRef,
stringifyEntityRef,
} from '@backstage/catalog-model';
@@ -37,7 +37,7 @@ export class CachedEntityLoader {
}
async load(
entityName: EntityName,
entityName: CompoundEntityRef,
token: string | undefined,
): Promise<Entity | undefined> {
const cacheKey = this.getCacheKey(entityName, token);
@@ -66,7 +66,7 @@ export class CachedEntityLoader {
}
private getCacheKey(
entityName: EntityName,
entityName: CompoundEntityRef,
token: string | undefined,
): string {
const key = ['catalog', stringifyEntityRef(entityName)];