From 89fd81a1abb05b143697805654cf0eb3bd57e24a Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Mon, 13 Sep 2021 16:55:51 +0200 Subject: [PATCH] Add changesets Signed-off-by: Johan Haals --- .changeset/neat-coats-sell.md | 37 ++++++++++++++++++++++++++++++++ .changeset/red-lizards-accept.md | 5 +++++ 2 files changed, 42 insertions(+) create mode 100644 .changeset/neat-coats-sell.md create mode 100644 .changeset/red-lizards-accept.md diff --git a/.changeset/neat-coats-sell.md b/.changeset/neat-coats-sell.md new file mode 100644 index 0000000000..fd585425be --- /dev/null +++ b/.changeset/neat-coats-sell.md @@ -0,0 +1,37 @@ +--- +'@backstage/create-app': patch +--- + +This change adds an API endpoint for requesting a catalog refresh at `/refresh`, which is activated if a `CatalogProcessingEngine` is passed to `createRouter`. +The creation of the router has been abstracted behind the `CatalogBuilder` to simplify usage and future changes. The following changes are **changes are required** to your `catalog.ts`. + +```diff +- import { +- CatalogBuilder, +- createRouter, +- } from '@backstage/plugin-catalog-backend'; ++ import { CatalogBuilder } from '@backstage/plugin-catalog-backend'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); +- const { +- entitiesCatalog, +- locationAnalyzer, +- processingEngine, +- locationService, +- } = await builder.build(); ++ const { processingEngine, router } = await builder.build(); + await processingEngine.start(); + +- return await createRouter({ +- entitiesCatalog, +- locationAnalyzer, +- locationService, +- logger: env.logger, +- config: env.config, +- }); ++ return router; + } +``` diff --git a/.changeset/red-lizards-accept.md b/.changeset/red-lizards-accept.md new file mode 100644 index 0000000000..758eb11da5 --- /dev/null +++ b/.changeset/red-lizards-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +Add API endpoint for requesting a catalog refresh at `/refresh`, which is activated if a `CatalogProcessingEngine` is passed to `createRouter`.