diff --git a/.changeset/sharp-ligers-beg.md b/.changeset/sharp-ligers-beg.md new file mode 100644 index 0000000000..0582ed72d2 --- /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.disableDefaultProcessors`. 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()); }