From 1797c5ce5dd660db633d22d4b2ad90b0ac431985 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Wed, 8 Sep 2021 13:29:35 +0200 Subject: [PATCH 1/2] catalog-backend: Drop support for deprecated location types Signed-off-by: Johan Haals --- .changeset/strange-buckets-design.md | 16 ++++++++++++++++ .../ingestion/processors/UrlReaderProcessor.ts | 18 +----------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 .changeset/strange-buckets-design.md diff --git a/.changeset/strange-buckets-design.md b/.changeset/strange-buckets-design.md new file mode 100644 index 0000000000..3cdf858174 --- /dev/null +++ b/.changeset/strange-buckets-design.md @@ -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 +``` diff --git a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts index da7bee12d8..e3ec8c0480 100644 --- a/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts +++ b/plugins/catalog-backend/src/ingestion/processors/UrlReaderProcessor.ts @@ -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 { - 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; } From af05164b67eb33d09cccd5c1a89eeafe72aa6e49 Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Wed, 8 Sep 2021 13:49:28 +0200 Subject: [PATCH 2/2] chore: fix tests Signed-off-by: Johan Haals --- plugins/catalog-backend/src/service/CatalogBuilder.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.test.ts b/plugins/catalog-backend/src/service/CatalogBuilder.test.ts index 579772dcce..87a26ed3aa 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.test.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.test.ts @@ -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();