From b562c68091623329029d8a2c3a6ddcaad58f6618 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 22 Sep 2021 11:50:19 +0200 Subject: [PATCH] catalog-backend: use inlined local type for cache items Co-authored-by: blam Co-authored-by: Johan Haals Signed-off-by: Patrik Oldsberg --- .../src/ingestion/processors/UrlReaderProcessor.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts index 02aa94522b..cf889eb577 100644 --- a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts @@ -15,7 +15,7 @@ */ import { UrlReader } from '@backstage/backend-common'; -import { LocationSpec } from '@backstage/catalog-model'; +import { Entity, LocationSpec } from '@backstage/catalog-model'; import parseGitUrl from 'git-url-parse'; import limiterFactory from 'p-limit'; import { Logger } from 'winston'; @@ -36,9 +36,14 @@ type Options = { logger: Logger; }; +// WARNING: If you change this type, you likely need to bump the CACHE_KEY as well type CacheItem = { etag: string; - value: CatalogProcessorEntityResult[]; + value: { + type: 'entity'; + entity: Entity; + location: LocationSpec; + }[]; }; export class UrlReaderProcessor implements CatalogProcessor {