From bcc122c46d34f4340c2f4e628900451472d2c00a Mon Sep 17 00:00:00 2001 From: sblausten Date: Wed, 6 Jul 2022 13:59:42 +0200 Subject: [PATCH] Api report and changelog Signed-off-by: sblausten --- .changeset/rich-steaks-juggle.md | 9 +++++++++ plugins/tech-insights-node/api-report.md | 2 ++ plugins/tech-insights-node/src/facts.ts | 10 ++++++++++ 3 files changed, 21 insertions(+) create mode 100644 .changeset/rich-steaks-juggle.md diff --git a/.changeset/rich-steaks-juggle.md b/.changeset/rich-steaks-juggle.md new file mode 100644 index 0000000000..291e9dac2b --- /dev/null +++ b/.changeset/rich-steaks-juggle.md @@ -0,0 +1,9 @@ +--- +'@backstage/plugin-tech-insights-node': minor +'@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. diff --git a/plugins/tech-insights-node/api-report.md b/plugins/tech-insights-node/api-report.md index 09d409fecd..060158a619 100644 --- a/plugins/tech-insights-node/api-report.md +++ b/plugins/tech-insights-node/api-report.md @@ -46,12 +46,14 @@ export type FactLifecycle = TTL | MaxItems; // @public export interface FactRetriever { + description: string; entityFilter?: | Record[] | Record; handler: (ctx: FactRetrieverContext) => Promise; id: string; schema: FactSchema; + title: string; version: string; } diff --git a/plugins/tech-insights-node/src/facts.ts b/plugins/tech-insights-node/src/facts.ts index bcc2aa42e1..6905a12f9c 100644 --- a/plugins/tech-insights-node/src/facts.ts +++ b/plugins/tech-insights-node/src/facts.ts @@ -174,6 +174,16 @@ export interface FactRetriever { */ version: string; + /** + * A short display title for the fact retriever to be used in the interface + */ + title: string; + + /** + * A short display description for the fact retriever to be used in the interface. + */ + description: string; + /** * Handler function that needs to be implemented to retrieve fact values for entities. *