diff --git a/plugins/catalog-backend-module-incremental-ingestion/api-report.md b/plugins/catalog-backend-module-incremental-ingestion/api-report.md index aef16e1533..387e505c33 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/api-report.md +++ b/plugins/catalog-backend-module-incremental-ingestion/api-report.md @@ -62,8 +62,8 @@ export interface IncrementalEntityProviderOptions { backoff?: DurationObjectUnits[]; burstInterval: DurationObjectUnits; burstLength: DurationObjectUnits; - rejectEmptyEntityCollections?: boolean; - removalThreshold?: number; + rejectEmptySourceCollections?: boolean; + rejectRemovalsAbovePercentage?: number; restLength: DurationObjectUnits; } diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts index 8df74b8891..e2000c609e 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/engine/IncrementalIngestionEngine.ts @@ -283,7 +283,7 @@ export class IncrementalIngestionEngine implements IterationEngine { const { total } = result; let doRemoval = true; - if (this.options.rejectEmptyEntityCollections) { + if (this.options.rejectEmptySourceCollections) { if (total === 0) { this.options.logger.error( `incremental-engine: Ingestion '${id}': Rejecting empty entity collection!`, @@ -292,12 +292,12 @@ export class IncrementalIngestionEngine implements IterationEngine { } } - if (this.options.removalThreshold) { + if (this.options.rejectRemovalsAbovePercentage) { // If the total entities upserted in this ingestion is 0, then // 100% of entities are stale and marked for removal. const percentRemoved = total > 0 ? (result.removed.length / total) * 100 : 100; - if (percentRemoved <= this.options.removalThreshold) { + if (percentRemoved <= this.options.rejectRemovalsAbovePercentage) { this.options.logger.info( `incremental-engine: Ingestion '${id}': Removing ${result.removed.length} entities that have no matching assets`, ); diff --git a/plugins/catalog-backend-module-incremental-ingestion/src/types.ts b/plugins/catalog-backend-module-incremental-ingestion/src/types.ts index 657073b9fb..51a8738500 100644 --- a/plugins/catalog-backend-module-incremental-ingestion/src/types.ts +++ b/plugins/catalog-backend-module-incremental-ingestion/src/types.ts @@ -129,15 +129,15 @@ export interface IncrementalEntityProviderOptions { * Backstage removing all associated entities. To avoid that, set * a percentage of entities past which removal will be disallowed. */ - removalThreshold?: number; + rejectRemovalsAbovePercentage?: number; /** - * Similar to the removalThreshold, this option prevents removals - * in circumstances where a data source has improperly returned 0 - * assets. If set to `true`, Backstage will reject removals when - * that happens. + * Similar to the rejectRemovalsAbovePercentage, this option + * prevents removals in circumstances where a data source has + * improperly returned 0 assets. If set to `true`, Backstage will + * reject removals when that happens. */ - rejectEmptyEntityCollections?: boolean; + rejectEmptySourceCollections?: boolean; } /** @public */ @@ -162,6 +162,6 @@ export interface IterationEngineOptions { restLength: DurationObjectUnits; ready: Promise; backoff?: IncrementalEntityProviderOptions['backoff']; - removalThreshold?: number; - rejectEmptyEntityCollections?: boolean; + rejectRemovalsAbovePercentage?: number; + rejectEmptySourceCollections?: boolean; }