From aa17643a069a9a5218621e143f25e35914cb5361 Mon Sep 17 00:00:00 2001 From: blam Date: Tue, 17 Jan 2023 10:55:35 +0100 Subject: [PATCH] chore: fix some changeset Signed-off-by: blam --- .changeset/angry-cheetahs-hide.md | 4 +-- .changeset/dull-cabs-carry.md | 0 .changeset/dull-taxis-carry.md | 3 +- .changeset/metal-nails-punch.md | 4 +-- plugins/adr-backend/README.md | 53 +++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 .changeset/dull-cabs-carry.md diff --git a/.changeset/angry-cheetahs-hide.md b/.changeset/angry-cheetahs-hide.md index d294c507e9..8491fa1bc0 100644 --- a/.changeset/angry-cheetahs-hide.md +++ b/.changeset/angry-cheetahs-hide.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-scaffolder-backend': minor --- -Implement "Required approving review count", "Restrictions", and "Required commit signing" support for "publish:github" action +Implement `Required approving review count`, `Restrictions`, and `Required commit signing` support for `publish:github` action diff --git a/.changeset/dull-cabs-carry.md b/.changeset/dull-cabs-carry.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.changeset/dull-taxis-carry.md b/.changeset/dull-taxis-carry.md index 1466f1246a..28561c52e6 100644 --- a/.changeset/dull-taxis-carry.md +++ b/.changeset/dull-taxis-carry.md @@ -1,8 +1,7 @@ --- '@backstage/plugin-adr': minor -'@backstage/plugin-adr-backend': patch --- The ADR plugin can now work with sites other than GitHub. Expanded the ADR backend plugin to provide endpoints to facilitate this. -**BREAKING** The ADR plugin now uses UrlReaders. You will have to [configure integrations](https://backstage.io/docs/integrations/index#configuration) for all sites you want to get ADRs from. If you would like to create your own implementation that has different behavior, you can override the AdrApi [just like you can with other apis.](https://backstage.io/docs/api/utility-apis#app-apis) The previously used Octokit implementation has been completely removed. +**BREAKING** The ADR plugin now requires the `@backstage/plugin-adr-backend` plugin to be installed by using the `createRouter` method to add into your `backend`. You read more in the [install instructions](https://github.com/backstage/backstage/blob/master/src/plugins/adr-backend/README.md#install) diff --git a/.changeset/metal-nails-punch.md b/.changeset/metal-nails-punch.md index a34c340c0a..77b763081b 100644 --- a/.changeset/metal-nails-punch.md +++ b/.changeset/metal-nails-punch.md @@ -1,8 +1,8 @@ --- -'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-scaffolder-backend': minor --- -This patch adds changes to provide examples alongside scaffolder task actions. +This change adds changes to provide examples alongside scaffolder task actions. The `createTemplateAction` function now takes a list of examples e.g. diff --git a/plugins/adr-backend/README.md b/plugins/adr-backend/README.md index 225f07fdf7..b751a3b56d 100644 --- a/plugins/adr-backend/README.md +++ b/plugins/adr-backend/README.md @@ -6,6 +6,59 @@ This ADR backend plugin is primarily responsible for the following: - Provides endpoints that use UrlReaders for getting ADR documents (used in the [ADR frontend plugin](../adr/README.md)). +## Install + +## Setup your `integrations` config + +First off you'll need to setup your `integrations` config inside your `app-config.yaml`. You can skip this step if it's already setup previously, and if you need help configuring this you can read the [integrations documentation](https://backstage.io/docs/integrations/) + +### Up and Running + +Here's how to get the backend up and running: + +1. First we need to add the `@backstage/plugin-adr-backend` package to your backend: + +```sh +# From the Backstage root directory +cd packages/backend +yarn add @backstage/plugin-adr-backend +``` + +2. Then we will create a new file named `packages/backend/src/plugins/adr.ts`, and add the + following to it: + +```ts +import { createRouter } from '@backstage/plugin-adr-backend'; +import { Router } from 'express'; +import { PluginEnvironment } from '../types'; + +export default async function createPlugin( + env: PluginEnvironment, +): Promise { + return await createRouter({ + reader: env.reader, + cacheClient: env.cache.getClient(), + logger: env.logger, + }); +} +``` + +3. Next we wire this into the overall backend router, edit `packages/backend/src/index.ts`: + +```ts +import adr from './plugins/adr'; +// ... +async function main() { + // ... + // Add this line under the other lines that follow the useHotMemoize pattern + const adrEnv = useHotMemoize(module, () => createEnv('adr')); + // ... + // Insert this line under the other lines that add their routers to apiRouter in the same way + apiRouter.use('/adr', await adr(adrEnv)); +``` + +4. Now run `yarn start-backend` from the repo root + ## Indexing ADR documents for search Before you are able to start indexing ADR documents to search, you need to go through the [search getting started guide](https://backstage.io/docs/features/search/getting-started).