Merge pull request #29478 from RoadieHQ/dont-add-processors

Add ability disable the built in entity processors [ContribFest]
This commit is contained in:
Fredrik Adelöw
2025-04-28 16:41:36 +02:00
committed by GitHub
3 changed files with 22 additions and 2 deletions
+5
View File
@@ -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`.
+9
View File
@@ -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
@@ -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());
}