From f538b9c5b83a67bf22b587e43d44071e9bfcb35f Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Mon, 13 Mar 2023 17:59:54 +0100 Subject: [PATCH 1/3] Include the failureMetadata and successMetadata in TechInsightsApi Signed-off-by: Miguel Alexandre --- .changeset/lazy-monkeys-worry.md | 5 ++++ plugins/tech-insights/src/api/types.ts | 37 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .changeset/lazy-monkeys-worry.md diff --git a/.changeset/lazy-monkeys-worry.md b/.changeset/lazy-monkeys-worry.md new file mode 100644 index 0000000000..2c7e2ba4a2 --- /dev/null +++ b/.changeset/lazy-monkeys-worry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights': minor +--- + +The Check class now includes the failureMetadata and successMetadata as returned by the runChecks call. diff --git a/plugins/tech-insights/src/api/types.ts b/plugins/tech-insights/src/api/types.ts index ac1f2e44ee..aa073dcbc4 100644 --- a/plugins/tech-insights/src/api/types.ts +++ b/plugins/tech-insights/src/api/types.ts @@ -22,11 +22,48 @@ import { JsonValue } from '@backstage/types'; * @public */ export type Check = { + /** + * Unique identifier of the check + * + * Used to identify which checks to use when running checks. + */ id: string; + + /** + * Type identifier for the check. + * Can be used to determine storage options, logical routing to correct FactChecker implementation + * or to help frontend render correct component types based on this + */ type: string; + + /** + * Human readable name of the check, may be displayed in the UI + */ name: string; + + /** + * Human readable description of the check, may be displayed in the UI + */ description: string; + + /** + * A collection of string referencing fact rows that a check will be run against. + * + * References the fact container, aka fact retriever itself which may or may not contain multiple individual facts and values + */ factIds: string[]; + + /** + * Metadata to be returned in case a check has been successfully evaluated + * Can contain links, description texts or other actionable items + */ + successMetadata?: Record; + + /** + * Metadata to be returned in case a check evaluation has ended in failure + * Can contain links, description texts or other actionable items + */ + failureMetadata?: Record; }; /** From d197f9f7827c4cb0df79a83a177211495e337ec7 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Wed, 15 Mar 2023 17:43:01 +0100 Subject: [PATCH 2/3] Include suggested changes Signed-off-by: Miguel Alexandre --- plugins/tech-insights/api-report.md | 2 ++ plugins/tech-insights/src/api/types.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/tech-insights/api-report.md b/plugins/tech-insights/api-report.md index 83509e1673..47aa8bbbea 100644 --- a/plugins/tech-insights/api-report.md +++ b/plugins/tech-insights/api-report.md @@ -27,6 +27,8 @@ export type Check = { name: string; description: string; factIds: string[]; + successMetadata?: Record; + failureMetadata?: Record; }; // @public diff --git a/plugins/tech-insights/src/api/types.ts b/plugins/tech-insights/src/api/types.ts index aa073dcbc4..b08f63ecc2 100644 --- a/plugins/tech-insights/src/api/types.ts +++ b/plugins/tech-insights/src/api/types.ts @@ -57,13 +57,13 @@ export type Check = { * Metadata to be returned in case a check has been successfully evaluated * Can contain links, description texts or other actionable items */ - successMetadata?: Record; + successMetadata?: Record; /** * Metadata to be returned in case a check evaluation has ended in failure * Can contain links, description texts or other actionable items */ - failureMetadata?: Record; + failureMetadata?: Record; }; /** From 196a4aa7e789318a62f23f42d1cc941c7ae42346 Mon Sep 17 00:00:00 2001 From: Miguel Alexandre Date: Wed, 15 Mar 2023 17:43:14 +0100 Subject: [PATCH 3/3] Generate api-report Signed-off-by: Miguel Alexandre --- .changeset/lazy-monkeys-worry.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/lazy-monkeys-worry.md b/.changeset/lazy-monkeys-worry.md index 2c7e2ba4a2..9dc3ea514e 100644 --- a/.changeset/lazy-monkeys-worry.md +++ b/.changeset/lazy-monkeys-worry.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-tech-insights': minor +'@backstage/plugin-tech-insights': patch --- -The Check class now includes the failureMetadata and successMetadata as returned by the runChecks call. +The `Check` type now optionally includes the `failureMetadata` and `successMetadata` as returned by the `runChecks` call.