From 0307a28b4ac3472196aa79525d7ff7040a8abecf Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Tue, 15 Jun 2021 09:17:55 +0200 Subject: [PATCH] Add changeset for create-app describing upgrade path Signed-off-by: Johan Haals --- .changeset/dull-poets-learn.md | 45 +++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.changeset/dull-poets-learn.md b/.changeset/dull-poets-learn.md index 0574d0ebc6..b504c0c6a3 100644 --- a/.changeset/dull-poets-learn.md +++ b/.changeset/dull-poets-learn.md @@ -1,9 +1,52 @@ --- '@backstage/plugin-catalog-backend': patch +'@backstage/create-app': patch --- This release enables the new catalog processing engine which is a major milestone for the catalog! This update makes processing more scalable across multiple instances, adds support for deletions and ui flagging of entities that are no longer referenced by a location. -As this is a major internal change we have taken some precaution by offering a `LEGACY_CATALOG=1` environment variable that you can set when starting the backend in order to run the previous version. If you do so for any reason make sure to raise an issue immediately as this is a temporary "break the glass" option which will be removed in a subsequent release. +**Changes Required** to `catalog.ts` + +```diff +-import { useHotCleanup } from '@backstage/backend-common'; + import { + CatalogBuilder, +- createRouter, +- runPeriodically ++ createRouter + } from '@backstage/plugin-catalog-backend'; + import { Router } from 'express'; + import { PluginEnvironment } from '../types'; + + export default async function createPlugin(env: PluginEnvironment): Promise { +- const builder = new CatalogBuilder(env); ++ const builder = await CatalogBuilder.create(env); + const { + entitiesCatalog, + locationsCatalog, +- higherOrderOperation, ++ locationService, ++ processingEngine, + locationAnalyzer, + } = await builder.build(); + +- useHotCleanup( +- module, +- runPeriodically(() => higherOrderOperation.refreshAllLocations(), 100000), +- ); ++ await processingEngine.start(); + + return await createRouter({ + entitiesCatalog, + locationsCatalog, +- higherOrderOperation, ++ locationService, + locationAnalyzer, + logger: env.logger, + config: env.config, +``` + +As this is a major internal change we have taken some precaution by still allowing the old catalog to be enabled by keeping your `catalog.ts` in it's current state. +If you encounter any issues and have to revert to the previous catalog engine make sure to raise an issue immediately as the old catalog engine is deprecated and will be removed in a future release.