Merge branch 'master' into rugvip/favorite

This commit is contained in:
Patrik Oldsberg
2022-03-14 13:24:33 +01:00
committed by GitHub
10 changed files with 20 additions and 126 deletions
+10
View File
@@ -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.
+8
View File
@@ -0,0 +1,8 @@
---
'@backstage/plugin-catalog-react': minor
---
**BREAKING**: The following deprecated annotation reading helper functions were removed:
- `getEntityMetadataViewUrl`, use `entity.metadata.annotations?.[ANNOTATION_VIEW_URL]` instead.
- `getEntityMetadataEditUrl`, use `entity.metadata.annotations?.[ANNOTATION_EDIT_URL]` instead.
-13
View File
@@ -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
@@ -324,12 +320,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<express.Router>;
@@ -811,9 +801,6 @@ export type RecursivePartial<T> = {
: T[P];
};
// @public @deprecated
export type RefreshIntervalFunction = () => number;
// @public
export type RefreshOptions = {
entityRef: string;
@@ -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';
@@ -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
@@ -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.
-6
View File
@@ -393,12 +393,6 @@ export type FavoriteEntityProps = ComponentProps<typeof IconButton> & {
entity: Entity;
};
// @public @deprecated (undocumented)
export function getEntityMetadataEditUrl(entity: Entity): string | undefined;
// @public @deprecated (undocumented)
export function getEntityMetadataViewUrl(entity: Entity): string | undefined;
// @public
export function getEntityRelations(
entity: Entity | undefined,
-2
View File
@@ -32,8 +32,6 @@ export * from './testUtils';
export * from './types';
export * from './overridableComponents';
export {
getEntityMetadataEditUrl,
getEntityMetadataViewUrl,
getEntityRelations,
getEntitySourceLocation,
isOwnerOf,
@@ -1,36 +0,0 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
ANNOTATION_EDIT_URL,
ANNOTATION_VIEW_URL,
Entity,
} from '@backstage/catalog-model';
/**
* @public
* @deprecated use entity.metadata.annotations?.[ANNOTATION_VIEW_URL] instead. */
export function getEntityMetadataViewUrl(entity: Entity): string | undefined {
return entity.metadata.annotations?.[ANNOTATION_VIEW_URL];
}
/**
* @public
* @deprecated use entity.metadata.annotations?.[ANNOTATION_EDIT_URL] instead.
*/
export function getEntityMetadataEditUrl(entity: Entity): string | undefined {
return entity.metadata.annotations?.[ANNOTATION_EDIT_URL];
}
-4
View File
@@ -14,10 +14,6 @@
* limitations under the License.
*/
export * from './filters';
export {
getEntityMetadataEditUrl,
getEntityMetadataViewUrl,
} from './getEntityMetadataUrl';
export { getEntityRelations } from './getEntityRelations';
export { getEntitySourceLocation } from './getEntitySourceLocation';
export type { EntitySourceLocation } from './getEntitySourceLocation';