From 9a7570c5bdcad1955bb9bee1d0d505dec5c94abc Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Apr 2025 19:51:39 +0100 Subject: [PATCH 1/3] Add ability replace the built in entity processors Signed-off-by: Brian Fletcher --- plugins/catalog-backend/config.d.ts | 9 +++++++++ plugins/catalog-backend/src/service/CatalogBuilder.ts | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index d7816fa856..7e68c4bea9 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -148,6 +148,15 @@ export interface Config { */ disableRelationsCompatibility?: boolean; + /** + * Disables the default backstage processors. + * + * Enabling this option allows more complete control of which processors are included + * in the backstage processing loop. + * + */ + disableDefaultProcessors?: boolean; + /** * The strategy to use for entities that are orphaned, i.e. no longer have * any other entities or providers referencing them. The default value is diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.ts b/plugins/catalog-backend/src/service/CatalogBuilder.ts index 99752ca5cf..a69f0bcfb0 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.ts @@ -736,8 +736,14 @@ export class CatalogBuilder { processors.push(builtinKindsEntityProcessor); } - // These are only added unless the user replaced them all - if (!this.processorsReplace) { + const disableDefaultProcessors = config.getOptionalBoolean( + 'catalog.disableDefaultProcessors', + ); + + // Add default processors if: + // - processors have NOT been explicitly replaced + // - and default processors are NOT disabled via config + if (!this.processorsReplace && !disableDefaultProcessors) { processors.push(...this.getDefaultProcessors()); } From d88b922353c21ce14ddb3f0cd9f40496ae19f59a Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Thu, 3 Apr 2025 19:54:02 +0100 Subject: [PATCH 2/3] add changeset Signed-off-by: Brian Fletcher --- .changeset/sharp-ligers-beg.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/sharp-ligers-beg.md diff --git a/.changeset/sharp-ligers-beg.md b/.changeset/sharp-ligers-beg.md new file mode 100644 index 0000000000..a89ce8ee05 --- /dev/null +++ b/.changeset/sharp-ligers-beg.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +Adds the ability to disable the default entity processors using a new boolean app config item `catalog.disableCatalogProcessors`. From e802ee2b819229f32c23d13c80bc05bb34e62874 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Mon, 28 Apr 2025 15:05:40 +0100 Subject: [PATCH 3/3] Update .changeset/sharp-ligers-beg.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Brian Fletcher --- .changeset/sharp-ligers-beg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/sharp-ligers-beg.md b/.changeset/sharp-ligers-beg.md index a89ce8ee05..0582ed72d2 100644 --- a/.changeset/sharp-ligers-beg.md +++ b/.changeset/sharp-ligers-beg.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': minor --- -Adds the ability to disable the default entity processors using a new boolean app config item `catalog.disableCatalogProcessors`. +Adds the ability to disable the default entity processors using a new boolean app config item `catalog.disableDefaultProcessors`.