diff --git a/.changeset/odd-spoons-design.md b/.changeset/odd-spoons-design.md new file mode 100644 index 0000000000..1d0ca96015 --- /dev/null +++ b/.changeset/odd-spoons-design.md @@ -0,0 +1,10 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +**BREAKING**: Removed the following deprecated symbols: + +- `catalogBuilder.setRefreshInterval`, use `catalogBuilder.setProcessingInterval` instead. +- `catalogBuilder.setRefreshIntervalSeconds`, use `catalogBuilder.setProcessingIntervalSeconds` instead. +- `createRandomRefreshInterval`, use `createRandomProcessingInterval` instead. +- `RefreshIntervalFunction`, use `ProcessingIntervalFunction` instead. diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index 714fdffb87..7623aada69 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -142,10 +142,6 @@ export class CatalogBuilder { processingInterval: ProcessingIntervalFunction, ): CatalogBuilder; setProcessingIntervalSeconds(seconds: number): CatalogBuilder; - // @deprecated - setRefreshInterval(refreshInterval: RefreshIntervalFunction): CatalogBuilder; - // @deprecated - setRefreshIntervalSeconds(seconds: number): CatalogBuilder; } // @alpha @@ -327,12 +323,6 @@ export function createRandomProcessingInterval(options: { maxSeconds: number; }): ProcessingIntervalFunction; -// @public @deprecated -export function createRandomRefreshInterval(options: { - minSeconds: number; - maxSeconds: number; -}): RefreshIntervalFunction; - // @public export function createRouter(options: RouterOptions): Promise; @@ -814,9 +804,6 @@ export type RecursivePartial = { : T[P]; }; -// @public @deprecated -export type RefreshIntervalFunction = () => number; - // @public export type RefreshOptions = { entityRef: string; diff --git a/plugins/catalog-backend/src/processing/index.ts b/plugins/catalog-backend/src/processing/index.ts index aec6a5d71c..315cea37d7 100644 --- a/plugins/catalog-backend/src/processing/index.ts +++ b/plugins/catalog-backend/src/processing/index.ts @@ -23,11 +23,5 @@ export type { } from './types'; export { DefaultCatalogProcessingOrchestrator } from './DefaultCatalogProcessingOrchestrator'; -export { - createRandomRefreshInterval, - createRandomProcessingInterval, -} from './refresh'; -export type { - RefreshIntervalFunction, - ProcessingIntervalFunction, -} from './refresh'; +export { createRandomProcessingInterval } from './refresh'; +export type { ProcessingIntervalFunction } from './refresh'; diff --git a/plugins/catalog-backend/src/processing/refresh.ts b/plugins/catalog-backend/src/processing/refresh.ts index 941c338912..f9f596cdb9 100644 --- a/plugins/catalog-backend/src/processing/refresh.ts +++ b/plugins/catalog-backend/src/processing/refresh.ts @@ -14,35 +14,12 @@ * limitations under the License. */ -/** - * Function that returns the catalog refresh interval in seconds. - * @deprecated use {@link ProcessingIntervalFunction} instead - * @public - */ -export type RefreshIntervalFunction = () => number; - /** * Function that returns the catalog processing interval in seconds. * @public */ export type ProcessingIntervalFunction = () => number; -/** - * Creates a function that returns a random refresh interval between minSeconds and maxSeconds. - * @returns A {@link RefreshIntervalFunction} that provides the next refresh interval - * @deprecated use {@link createRandomProcessingInterval} instead - * @public - */ -export function createRandomRefreshInterval(options: { - minSeconds: number; - maxSeconds: number; -}): RefreshIntervalFunction { - const { minSeconds, maxSeconds } = options; - return () => { - return Math.random() * (maxSeconds - minSeconds) + minSeconds; - }; -} - /** * Creates a function that returns a random processing interval between minSeconds and maxSeconds. * @returns A {@link ProcessingIntervalFunction} that provides the next processing interval diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.ts b/plugins/catalog-backend/src/service/CatalogBuilder.ts index 79edf3b221..8dd507c74e 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.ts @@ -68,7 +68,6 @@ import { DefaultCatalogProcessingOrchestrator } from '../processing/DefaultCatal import { Stitcher } from '../stitching/Stitcher'; import { createRandomProcessingInterval, - RefreshIntervalFunction, ProcessingIntervalFunction, } from '../processing/refresh'; import { createRouter } from './createRouter'; @@ -179,25 +178,6 @@ export class CatalogBuilder { return this; } - /** - * Refresh interval determines how often entities should be refreshed. - * Seconds provided will be multiplied by 1.5 - * The default refresh duration is 100-150 seconds. - * setting this too low will potentially deplete request quotas to upstream services. - * - * @deprecated use {@link CatalogBuilder#setProcessingIntervalSeconds} instead - */ - setRefreshIntervalSeconds(seconds: number): CatalogBuilder { - this.env.logger.warn( - '[DEPRECATION] - CatalogBuilder.setRefreshIntervalSeconds is deprecated. Use CatalogBuilder.setProcessingIntervalSeconds instead.', - ); - this.processingInterval = createRandomProcessingInterval({ - minSeconds: seconds, - maxSeconds: seconds * 1.5, - }); - return this; - } - /** * Processing interval determines how often entities should be processed. * Seconds provided will be multiplied by 1.5 @@ -212,20 +192,6 @@ export class CatalogBuilder { return this; } - /** - * Overwrites the default refresh interval function used to spread - * entity updates in the catalog. - * - * @deprecated use {@link CatalogBuilder#setProcessingInterval} instead - */ - setRefreshInterval(refreshInterval: RefreshIntervalFunction): CatalogBuilder { - this.env.logger.warn( - '[DEPRECATION] - CatalogBuilder.setRefreshInterval is deprecated. Use CatalogBuilder.setProcessingInterval instead.', - ); - this.processingInterval = refreshInterval; - return this; - } - /** * Overwrites the default processing interval function used to spread * entity updates in the catalog.