catalog-backend: start warning about usage of deprecated location types

This commit is contained in:
Patrik Oldsberg
2020-12-15 21:45:12 +01:00
parent d7bb7bf39b
commit 5de26b9a6d
2 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Start warning about usage of deprecated location types, such as `github`
@@ -45,11 +45,11 @@ export class UrlReaderProcessor implements CatalogProcessor {
emit: CatalogProcessorEmit,
): Promise<boolean> {
if (deprecatedTypes.includes(location.type)) {
// TODO(Rugvip): Let's not enable this warning yet, as we want to move over the example YAMLs
// in this repo to use the 'url' type first.
// this.options.logger.warn(
// `Using deprecated location type '${location.type}' for '${location.target}', use 'url' instead`,
// );
// 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') {
return false;
}