From 307ade749948966d7e01ffa6de3b78a95a091fd5 Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 6 Jul 2022 17:17:52 +0200 Subject: [PATCH] Fix test and make fields optional Signed-off-by: sblausten --- .changeset/rich-steaks-juggle.md | 8 +++----- .../src/service/fact/FactRetrieverEngine.test.ts | 2 ++ plugins/tech-insights-node/api-report.md | 4 ++-- plugins/tech-insights-node/src/facts.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.changeset/rich-steaks-juggle.md b/.changeset/rich-steaks-juggle.md index 291e9dac2b..f47de1af0d 100644 --- a/.changeset/rich-steaks-juggle.md +++ b/.changeset/rich-steaks-juggle.md @@ -1,9 +1,7 @@ --- -'@backstage/plugin-tech-insights-node': minor +'@backstage/plugin-tech-insights-node': patch '@backstage/plugin-tech-insights-backend': patch --- -**Breaking**: The FactRetriever model is extended by adding required title and description fields. This allows us to -display Fact Retrievers in the UI in future. - -If you have existing custom `FactRetriever` implementations hardcoded, you'll need to add a `title` and `description` to them. +The FactRetriever model is extended by adding optional title and description fields. This allows us to display Fact +Retrievers in the UI in future. diff --git a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts index 454711171f..f9b145c876 100644 --- a/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts +++ b/plugins/tech-insights-backend/src/service/fact/FactRetrieverEngine.test.ts @@ -36,6 +36,8 @@ jest.useFakeTimers(); const testFactRetriever: FactRetriever = { id: 'test_factretriever', version: '0.0.1', + title: 'Test 1', + description: 'testing', entityFilter: [{ kind: 'component' }], schema: { testnumberfact: { diff --git a/plugins/tech-insights-node/api-report.md b/plugins/tech-insights-node/api-report.md index 060158a619..84677bdcbc 100644 --- a/plugins/tech-insights-node/api-report.md +++ b/plugins/tech-insights-node/api-report.md @@ -46,14 +46,14 @@ export type FactLifecycle = TTL | MaxItems; // @public export interface FactRetriever { - description: string; + description?: string; entityFilter?: | Record[] | Record; handler: (ctx: FactRetrieverContext) => Promise; id: string; schema: FactSchema; - title: string; + title?: string; version: string; } diff --git a/plugins/tech-insights-node/src/facts.ts b/plugins/tech-insights-node/src/facts.ts index 6905a12f9c..cda238694f 100644 --- a/plugins/tech-insights-node/src/facts.ts +++ b/plugins/tech-insights-node/src/facts.ts @@ -177,12 +177,12 @@ export interface FactRetriever { /** * A short display title for the fact retriever to be used in the interface */ - title: string; + title?: string; /** * A short display description for the fact retriever to be used in the interface. */ - description: string; + description?: string; /** * Handler function that needs to be implemented to retrieve fact values for entities.