Deprecate packages

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-04-18 20:44:08 +02:00
parent 4af1f1bf00
commit 33573b571d
5 changed files with 30 additions and 189 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-airbrake': patch
'@backstage/plugin-airbrake-backend': patch
---
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
+2 -31
View File
@@ -1,32 +1,3 @@
# airbrake-backend
# Deprecated
The Airbrake backend plugin provides a simple proxy to the Airbrake API while hiding away the secret API key from the frontend.
## How to use
See the [Airbrake plugin instructions](../airbrake/README.md#how-to-use).
## Local Development
This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
1. Add the required config to your `app-config.local.yaml`:
```yaml
airbrake:
apiKey: ${AIRBRAKE_API_KEY}
```
2. Set the environment variable `AIRBRAKE_API_KEY` with your [API
key](https://airbrake.io/docs/api/#authentication). You can also write it
directly into the config file above for convenience - but beware of
accidentally leaking the key.
3. Go into the plugin's directory and run it in standalone mode by running `yarn start`.
Access it from http://localhost:7007/api/airbrake. Or use the [Airbrake plugin in standalone mode](../airbrake/README.md#local-development) which will talk to it automatically.
Here are some example endpoints:
- http://localhost:7007/api/airbrake/health
- http://localhost:7007/api/airbrake/api/v4/projects
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-airbrake-backend` instead.
+16 -14
View File
@@ -1,31 +1,36 @@
{
"name": "@backstage/plugin-airbrake-backend",
"version": "0.3.14",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"backstage": {
"role": "backend-plugin",
"moved": "@backstage-community/plugin-airbrake-backend"
},
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin"
},
"homepage": "https://backstage.io",
"repository": {
"type": "git",
"url": "https://github.com/backstage/backstage",
"directory": "plugins/airbrake-backend"
},
"license": "Apache-2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"files": [
"dist",
"config.d.ts"
],
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"clean": "backstage-cli package clean",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack",
"clean": "backstage-cli package clean"
"start": "backstage-cli package start",
"test": "backstage-cli package test"
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
@@ -44,9 +49,6 @@
"@types/supertest": "^2.0.8",
"supertest": "^6.1.6"
},
"files": [
"dist",
"config.d.ts"
],
"configSchema": "config.d.ts"
"configSchema": "config.d.ts",
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-airbrake-backend instead."
}
+2 -142
View File
@@ -1,143 +1,3 @@
# Airbrake
# Deprecated
The Airbrake plugin provides connectivity between Backstage and Airbrake (https://airbrake.io/).
## How to use
1. Install the Frontend plugin:
```bash
# From your Backstage root directory
yarn --cwd packages/app add @backstage/plugin-airbrake
```
2. Install the Backend plugin:
```bash
# From your Backstage root directory
yarn --cwd packages/backend add @backstage/plugin-airbrake-backend
```
3. Add the `EntityAirbrakeContent` and `isAirbrakeAvailable` to `packages/app/src/components/catalog/EntityPage.tsx` for all the entity pages you want Airbrake to be in:
```typescript jsx
import {
EntityAirbrakeContent,
isAirbrakeAvailable,
} from '@backstage/plugin-airbrake';
const serviceEntityPage = (
<EntityLayoutWrapper>
<EntityLayout.Route
if={isAirbrakeAvailable}
path="/airbrake"
title="Airbrake"
>
<EntityAirbrakeContent />
</EntityLayout.Route>
</EntityLayoutWrapper>
);
const websiteEntityPage = (
<EntityLayoutWrapper>
<EntityLayout.Route
if={isAirbrakeAvailable}
path="/airbrake"
title="Airbrake"
>
<EntityAirbrakeContent />
</EntityLayout.Route>
</EntityLayoutWrapper>
);
const defaultEntityPage = (
<EntityLayoutWrapper>
<EntityLayout.Route
if={isAirbrakeAvailable}
path="/airbrake"
title="Airbrake"
>
<EntityAirbrakeContent />
</EntityLayout.Route>
</EntityLayoutWrapper>
);
```
4. Create `packages/backend/src/plugins/airbrake.ts` with these contents:
```typescript
import { Router } from 'express';
import { PluginEnvironment } from '../types';
import {
createRouter,
extractAirbrakeConfig,
} from '@backstage/plugin-airbrake-backend';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return createRouter({
logger: env.logger,
airbrakeConfig: extractAirbrakeConfig(env.config),
});
}
```
5. Setup the Backend code in `packages/backend/src/index.ts`:
```typescript
import airbrake from './plugins/airbrake';
async function main() {
//... After const createEnv = makeCreateEnv(config) ...
const airbrakeEnv = useHotMemoize(module, () => createEnv('airbrake'));
//... After const apiRouter = Router() ...
apiRouter.use('/airbrake', await airbrake(airbrakeEnv));
}
```
6. Add this config as a top level section in your `app-config.yaml`:
```yaml
airbrake:
apiKey: ${AIRBRAKE_API_KEY}
```
7. Set an environment variable `AIRBRAKE_API_KEY` with your [API key](https://airbrake.io/docs/api/#authentication)
before starting Backstage backend.
8. Add the following annotation to the `catalog-info.yaml` for a repo you want to link to an Airbrake project:
```yaml
metadata:
annotations:
airbrake.io/project-id: '123456'
```
#### New Backend System
The Airbrake backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up:
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
const backend = createBackend();
// ... other feature additions
+ backend.add(import('@backstage/plugin-airbrake-backend'));
backend.start();
```
## Local Development
Start this plugin in standalone mode by running `yarn start` inside the plugin directory. This method of serving the plugin provides quicker
iteration speed and a faster startup and hot reloads. It is only meant for local development, and the setup for it can
be found inside the [/dev](./dev) directory.
> A mock API will be used to run it in standalone. If you want to talk to the real API [follow the instructions to start up Airbrake Backend in standalone](../airbrake-backend/README.md#local-development).
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-airbrake` instead.
+4 -2
View File
@@ -2,7 +2,8 @@
"name": "@backstage/plugin-airbrake",
"version": "0.3.34",
"backstage": {
"role": "frontend-plugin"
"role": "frontend-plugin",
"moved": "@backstage-community/plugin-airbrake"
},
"publishConfig": {
"access": "public",
@@ -57,5 +58,6 @@
"react": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
}
},
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-airbrake instead."
}