Merge pull request #7100 from backstage/jhaals/remove-deprecated-types

catalog-backend: Drop support for deprecated location types
This commit is contained in:
Johan Haals
2021-09-09 09:10:07 +02:00
committed by GitHub
3 changed files with 18 additions and 18 deletions
+16
View File
@@ -0,0 +1,16 @@
---
'@backstage/plugin-catalog-backend': patch
---
This change drops support for deprecated location types which have all been replaced by the `url` type.
There has been a deprecation warning in place since the beginning of this year so most should already be migrated and received information at this point.
The now removed location types are:
```
github
github/api
bitbucket/api
gitlab/api
azure/api
```
@@ -26,16 +26,6 @@ import {
CatalogProcessorParser,
} from './types';
// TODO(Rugvip): Added for backwards compatibility when moving to UrlReader, this
// can be removed in a bit
const deprecatedTypes = [
'github',
'github/api',
'bitbucket/api',
'gitlab/api',
'azure/api',
];
type Options = {
reader: UrlReader;
logger: Logger;
@@ -50,13 +40,7 @@ export class UrlReaderProcessor implements CatalogProcessor {
emit: CatalogProcessorEmit,
parser: CatalogProcessorParser,
): Promise<boolean> {
if (deprecatedTypes.includes(location.type)) {
// TODO(Rugvip): Remove this warning a month or two into 2021, and remove support for the deprecated types.
this.options.logger.warn(
`Location '${location.target}' uses deprecated location type '${location.type}', use 'url' instead. ` +
'Use "scripts/migrate-location-types.js" in the Backstage repo to migrate existing locations.',
);
} else if (location.type !== 'url') {
if (location.type !== 'url') {
return false;
}
@@ -166,7 +166,7 @@ describe('CatalogBuilder', () => {
const { entitiesCatalog, higherOrderOperation } = await builder.build();
await higherOrderOperation.addLocation({
type: 'github',
type: 'url',
target: 'https://github.com/a/b/x.yaml',
});
const { entities } = await entitiesCatalog.entities();