diff --git a/.changeset/lazy-monkeys-worry.md b/.changeset/lazy-monkeys-worry.md new file mode 100644 index 0000000000..9dc3ea514e --- /dev/null +++ b/.changeset/lazy-monkeys-worry.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights': patch +--- + +The `Check` type now optionally includes the `failureMetadata` and `successMetadata` as returned by the `runChecks` call. 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 ac1f2e44ee..b08f63ecc2 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; }; /**