Fix test and make fields optional

Signed-off-by: sblausten <sam@roadie.io>
This commit is contained in:
sblausten
2022-07-06 17:17:52 +02:00
parent 4f17e4eb55
commit 307ade7499
4 changed files with 9 additions and 9 deletions
+3 -5
View File
@@ -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.
@@ -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: {
+2 -2
View File
@@ -46,14 +46,14 @@ export type FactLifecycle = TTL | MaxItems;
// @public
export interface FactRetriever {
description: string;
description?: string;
entityFilter?:
| Record<string, string | symbol | (string | symbol)[]>[]
| Record<string, string | symbol | (string | symbol)[]>;
handler: (ctx: FactRetrieverContext) => Promise<TechInsightFact[]>;
id: string;
schema: FactSchema;
title: string;
title?: string;
version: string;
}
+2 -2
View File
@@ -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.