diff --git a/workspaces/nomad/.changeset/bright-ads-clean.md b/workspaces/nomad/.changeset/bright-ads-clean.md new file mode 100644 index 0000000000..d0393d7ba2 --- /dev/null +++ b/workspaces/nomad/.changeset/bright-ads-clean.md @@ -0,0 +1,5 @@ +--- +'@backstage-community/plugin-nomad-backend': minor +--- + +Drops support for the old backend system. diff --git a/workspaces/nomad/bcp.json b/workspaces/nomad/bcp.json index 9d2158e4fb..e1b8e25f0c 100644 --- a/workspaces/nomad/bcp.json +++ b/workspaces/nomad/bcp.json @@ -1,4 +1,5 @@ { "autoVersionBump": true, - "knipReports": false + "knipReports": false, + "listDeprecations": true } diff --git a/workspaces/nomad/plugins/nomad-backend/README.md b/workspaces/nomad/plugins/nomad-backend/README.md index c612766891..b5deb09acd 100644 --- a/workspaces/nomad/plugins/nomad-backend/README.md +++ b/workspaces/nomad/plugins/nomad-backend/README.md @@ -2,9 +2,7 @@ A backend for [Nomad](https://www.nomadproject.io/), this plugin exposes a service with routes that are used by the `@backstage-community/plugin-nomad-backend` plugin to query Job and Group information from a Nomad API. -## New Backend System - -The Nomad backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up: +## Setup In your `packages/backend/src/index.ts` make the following changes: @@ -16,49 +14,4 @@ In your `packages/backend/src/index.ts` make the following changes: backend.start(); ``` -## Set Up - -1. Install the plugin using: - -```bash -# From your Backstage root directory -yarn --cwd packages/backend add @backstage-community/plugin-nomad-backend -``` - -2. Create a `nomad.ts` file inside `packages/backend/src/plugins/`: - -```typescript -import { createRouter } from '@backstage-community/plugin-nomad-backend'; -import { Router } from 'express'; -import { PluginEnvironment } from '../types'; - -export default async function createPlugin( - props: PluginEnvironment, -): Promise { - return await createRouter(props); -} -``` - -3. Modify your `packages/backend/src/index.ts` to include: - -```diff - ... - - import { Config } from '@backstage/config'; - import app from './plugins/app'; -+import nomad from './plugins/nomad'; - ... - - async function main() { - ... - - const authEnv = useHotMemoize(module, () => createEnv('auth')); -+ const nomadEnv = useHotMemoize(module, () => createEnv('nomad')); - ... - - const apiRouter = Router(); - apiRouter.use('/catalog', await catalog(catalogEnv)); -+ apiRouter.use('/nomad', await nomad(nomadEnv)); -``` - Note: for this backend to work, the `nomad` configuration described in the README of `@backstage-community/plugin-nomad` must be implemented. diff --git a/workspaces/nomad/plugins/nomad-backend/report.api.md b/workspaces/nomad/plugins/nomad-backend/report.api.md index a9962a8fb4..3234e431e2 100644 --- a/workspaces/nomad/plugins/nomad-backend/report.api.md +++ b/workspaces/nomad/plugins/nomad-backend/report.api.md @@ -4,24 +4,10 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; -import { Config } from '@backstage/config'; -import express from 'express'; -import { LoggerService } from '@backstage/backend-plugin-api'; - -// @public @deprecated (undocumented) -export function createRouter(options: RouterOptions): Promise; // @public const nomadPlugin: BackendFeature; export default nomadPlugin; -// @public @deprecated (undocumented) -export interface RouterOptions { - // (undocumented) - config: Config; - // (undocumented) - logger: LoggerService; -} - // (No @packageDocumentation comment for this package) ``` diff --git a/workspaces/nomad/plugins/nomad-backend/src/index.ts b/workspaces/nomad/plugins/nomad-backend/src/index.ts index 21aa299d6d..fcb5eb21b2 100644 --- a/workspaces/nomad/plugins/nomad-backend/src/index.ts +++ b/workspaces/nomad/plugins/nomad-backend/src/index.ts @@ -13,5 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './service/router'; export { nomadPlugin as default } from './plugin'; diff --git a/workspaces/nomad/plugins/nomad-backend/src/plugin.ts b/workspaces/nomad/plugins/nomad-backend/src/plugin.ts index 551f42cdc7..f3c45e8138 100644 --- a/workspaces/nomad/plugins/nomad-backend/src/plugin.ts +++ b/workspaces/nomad/plugins/nomad-backend/src/plugin.ts @@ -37,9 +37,6 @@ export const nomadPlugin = createBackendPlugin({ async init({ logger, config, httpRouter }) { httpRouter.use( await createRouter({ - /** - * Logger for logging purposes - */ logger, config, }), diff --git a/workspaces/nomad/plugins/nomad-backend/src/service/router.ts b/workspaces/nomad/plugins/nomad-backend/src/service/router.ts index ddca647dbc..a422bcab85 100644 --- a/workspaces/nomad/plugins/nomad-backend/src/service/router.ts +++ b/workspaces/nomad/plugins/nomad-backend/src/service/router.ts @@ -22,19 +22,11 @@ import Router from 'express-promise-router'; import { LoggerService } from '@backstage/backend-plugin-api'; import { MiddlewareFactory } from '@backstage/backend-defaults/rootHttpRouter'; -/** - * @deprecated Please migrate to the new backend system as this will be removed in the future. - * - * @public */ export interface RouterOptions { logger: LoggerService; config: Config; } -/** - * @deprecated Please migrate to the new backend system as this will be removed in the future. - * - * @public */ export async function createRouter( options: RouterOptions, ): Promise {