From 2c5598cb6d60cd89ff1b03b63267f7ea7eb38152 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Apr 2025 12:07:02 +0100 Subject: [PATCH 1/3] adds function documentation for catalog extension points Signed-off-by: Brian Fletcher --- .changeset/cruel-animals-sink.md | 5 +++++ plugins/catalog-node/src/extensions.ts | 28 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .changeset/cruel-animals-sink.md diff --git a/.changeset/cruel-animals-sink.md b/.changeset/cruel-animals-sink.md new file mode 100644 index 0000000000..3ac44c1319 --- /dev/null +++ b/.changeset/cruel-animals-sink.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-node': patch +--- + +Adds documentation for the CatalogProcessingExtensionPoint functions. diff --git a/plugins/catalog-node/src/extensions.ts b/plugins/catalog-node/src/extensions.ts index b52835b1a9..91ff9eb414 100644 --- a/plugins/catalog-node/src/extensions.ts +++ b/plugins/catalog-node/src/extensions.ts @@ -54,13 +54,41 @@ export const catalogLocationsExtensionPoint = * @alpha */ export interface CatalogProcessingExtensionPoint { + /** + * Adds entity processors. These are responsible for reading, parsing, and + * processing entities before they are persisted in the catalog. + * + * This function also can replace a Default processor if the provided processor + * matches the process name. + * + * @param processors - One or more processors + */ addProcessor( ...processors: Array> ): void; + + /** + * Adds or replaces entity providers. These are responsible for bootstrapping + * the list of entities out of original data sources. For example, there is + * one entity source for the config locations, and one for the database + * stored locations. If you ingest entities out of a third party system, you + * may want to implement that in terms of an entity provider as well. + * + * @param providers - One or more entity providers + */ addEntityProvider( ...providers: Array> ): void; + + /** + * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity + * definition files. + * + * @param key - The key that identifies the placeholder, e.g. "file" + * @param resolver - The resolver that gets values for this placeholder + */ addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void; + setOnProcessingErrorHandler( handler: (event: { unprocessedEntity: Entity; From afbfc1e13f638eef6b2b71ef7f6532a45cd584fb Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Apr 2025 12:09:46 +0100 Subject: [PATCH 2/3] fix typo Signed-off-by: Brian Fletcher --- plugins/catalog-node/src/extensions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-node/src/extensions.ts b/plugins/catalog-node/src/extensions.ts index 91ff9eb414..ad11000339 100644 --- a/plugins/catalog-node/src/extensions.ts +++ b/plugins/catalog-node/src/extensions.ts @@ -59,7 +59,7 @@ export interface CatalogProcessingExtensionPoint { * processing entities before they are persisted in the catalog. * * This function also can replace a Default processor if the provided processor - * matches the process name. + * matches the processor name. * * @param processors - One or more processors */ From 8146843cb4095536c5ebf6956a1c026067dc8b9b Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Apr 2025 12:23:34 +0100 Subject: [PATCH 3/3] add signoff Signed-off-by: Brian Fletcher --- plugins/catalog-node/report-alpha.api.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/catalog-node/report-alpha.api.md b/plugins/catalog-node/report-alpha.api.md index 59f32cf76c..660b18521a 100644 --- a/plugins/catalog-node/report-alpha.api.md +++ b/plugins/catalog-node/report-alpha.api.md @@ -82,13 +82,10 @@ export type CatalogPermissionRuleInput< // @alpha (undocumented) export interface CatalogProcessingExtensionPoint { - // (undocumented) addEntityProvider( ...providers: Array> ): void; - // (undocumented) addPlaceholderResolver(key: string, resolver: PlaceholderResolver): void; - // (undocumented) addProcessor( ...processors: Array> ): void;