Merge pull request #24364 from backstage/blam/migrate-packages-and-deprecate
Deprecate Plugins and Packages that have been moved to `backstage/community-plugins`
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-adr': patch
|
||||
'@backstage/plugin-adr-backend': patch
|
||||
'@backstage/plugin-adr-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -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.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-allure': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-analytics-module-ga': patch
|
||||
'@backstage/plugin-analytics-module-ga4': patch
|
||||
'@backstage/plugin-analytics-module-newrelic-browser': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-apache-airflow': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-apollo-explorer': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-azure-devops': patch
|
||||
'@backstage/plugin-azure-devops-backend': patch
|
||||
'@backstage/plugin-azure-devops-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-azure-sites': patch
|
||||
'@backstage/plugin-azure-sites-backend': patch
|
||||
'@backstage/plugin-azure-sites-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-badges': patch
|
||||
'@backstage/plugin-badges-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-bazaar': patch
|
||||
'@backstage/plugin-bazaar-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-bitrise': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-cicd-statistics': patch
|
||||
'@backstage/plugin-cicd-statistics-module-gitlab': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-circleci': patch
|
||||
---
|
||||
|
||||
This package has been deprecated in favour of the [Circle-CI](https://github.com/CircleCI-Public/backstage-plugin) plugin. Please migrate to that plugin instead.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-cloudbuild': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-code-climate': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-code-coverage': patch
|
||||
'@backstage/plugin-code-coverage-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-codescene': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-cost-insights': patch
|
||||
'@backstage/plugin-cost-insights-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-dynatrace': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-entity-feedback': patch
|
||||
'@backstage/plugin-entity-feedback-backend': patch
|
||||
'@backstage/plugin-entity-feedback-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-entity-validation': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
'@backstage/plugin-explore': patch
|
||||
'@backstage/plugin-explore-backend': patch
|
||||
'@backstage/plugin-explore-common': patch
|
||||
'@backstage/plugin-explore-react': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-firehydrant': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-fossa': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-gcalendar': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-gcp-projects': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-git-release-manager': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-actions': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-deployments': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-issues': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-github-pull-requests-board': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-gitops-profiles': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-gocd': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-graphiql': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-graphql-voyager': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-ilert': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-jenkins': patch
|
||||
'@backstage/plugin-jenkins-backend': patch
|
||||
'@backstage/plugin-jenkins-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-kafka': patch
|
||||
'@backstage/plugin-kafka-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-lighthouse': patch
|
||||
'@backstage/plugin-lighthouse-backend': patch
|
||||
'@backstage/plugin-lighthouse-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-microsoft-calendar': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-newrelic': patch
|
||||
'@backstage/plugin-newrelic-dashboard': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-octopus-deploy': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-opencost': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-periskop': patch
|
||||
'@backstage/plugin-periskop-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-playlist': patch
|
||||
'@backstage/plugin-playlist-backend': patch
|
||||
'@backstage/plugin-playlist-common': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-puppetdb': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-rollbar': patch
|
||||
'@backstage/plugin-rollbar-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-sentry': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-shortcuts': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-sonarqube': patch
|
||||
'@backstage/plugin-sonarqube-backend': patch
|
||||
'@backstage/plugin-sonarqube-react': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-splunk-on-call': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/plugin-stack-overflow': patch
|
||||
'@backstage/plugin-stack-overflow-backend': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-stackstorm': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
'@backstage/plugin-tech-insights': patch
|
||||
'@backstage/plugin-tech-insights-backend': patch
|
||||
'@backstage/plugin-tech-insights-backend-module-jsonfc': patch
|
||||
'@backstage/plugin-tech-insights-common': patch
|
||||
'@backstage/plugin-tech-insights-node': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-vault': patch
|
||||
'@backstage/plugin-vault-backend': patch
|
||||
'@backstage/plugin-vault-node': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-xcmetrics': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-tech-radar': patch
|
||||
---
|
||||
|
||||
These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository.
|
||||
@@ -1,117 +1,3 @@
|
||||
# ADR Backend
|
||||
# Deprecated
|
||||
|
||||
This ADR backend plugin is primarily responsible for the following:
|
||||
|
||||
- Provides a `DefaultAdrCollatorFactory`, which can be used in the search backend to index ADR documents associated with entities to your Backstage Search.
|
||||
|
||||
- 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 your Backstage root directory
|
||||
yarn --cwd packages/backend 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<Router> {
|
||||
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
|
||||
|
||||
### New Backend System
|
||||
|
||||
The ADR 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
|
||||
const backend = createBackend();
|
||||
|
||||
+ backend.add(import('@backstage/plugin-adr-backend'));
|
||||
|
||||
// ... other feature additions
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
## 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).
|
||||
|
||||
When you have your `packages/backend/src/plugins/search.ts` file ready to make modifications, install this plugin and add the following code snippet to add the `DefaultAdrCollatorFactory`. Also make sure to set up the frontend [ADR plugin](../adr/README.md) so search results can be routed correctly.
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-adr-backend
|
||||
```
|
||||
|
||||
```ts
|
||||
import { DefaultAdrCollatorFactory } from '@backstage/plugin-adr-backend';
|
||||
|
||||
...
|
||||
|
||||
indexBuilder.addCollator({
|
||||
schedule,
|
||||
factory: DefaultAdrCollatorFactory.fromConfig({
|
||||
cache: env.cache,
|
||||
config: env.config,
|
||||
discovery: env.discovery,
|
||||
logger: env.logger,
|
||||
reader: env.reader,
|
||||
tokenManager: env.tokenManager,
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
### Parsing custom ADR document formats
|
||||
|
||||
By default, the `DefaultAdrCollatorFactory` will parse and index documents that follow [MADR v3.0.0](https://github.com/adr/madr/tree/3.0.0) and [MADR v2.x](https://github.com/adr/madr/tree/2.1.2) standard file name and template format. If you use a different ADR format and file name convention, you can configure `DefaultAdrCollatorFactory` with custom `adrFilePathFilterFn` and `parser` options (see type definitions for details):
|
||||
|
||||
```ts
|
||||
DefaultAdrCollatorFactory.fromConfig({
|
||||
...
|
||||
parser: myCustomAdrParser,
|
||||
adrFilePathFilterFn: myCustomAdrFilePathFilter,
|
||||
...
|
||||
})
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-adr-backend` instead.
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
{
|
||||
"name": "@backstage/plugin-adr-backend",
|
||||
"version": "0.4.14",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"backstage": {
|
||||
"role": "backend-plugin",
|
||||
"moved": "@backstage-community/plugin-adr-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/adr-backend"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"lint": "backstage-cli package lint",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack"
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"start": "backstage-cli package start",
|
||||
"test": "backstage-cli package test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "workspace:^",
|
||||
@@ -50,7 +54,5 @@
|
||||
"@types/supertest": "^2.0.8",
|
||||
"supertest": "^6.1.3"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
]
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-adr-backend instead."
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# ADR Common
|
||||
# Deprecated
|
||||
|
||||
Common types and functionalities for the ADR plugin.
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-adr-common` instead.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"version": "0.2.22",
|
||||
"description": "Common functionalities for the adr plugin",
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
"role": "common-library",
|
||||
"moved": "@backstage-community/plugin-adr-common"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -41,5 +42,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^"
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-adr-common instead."
|
||||
}
|
||||
|
||||
+2
-160
@@ -1,161 +1,3 @@
|
||||
# Architecture Decision Records (ADR) Plugin
|
||||
# Deprecated
|
||||
|
||||
Welcome to the ADR plugin!
|
||||
|
||||
This plugin allows you to explore ADRs (Architecture Decision Records) associated with your entities, as well as discover ADRs across other entities using Backstage Search. Use this to inform your own architectural decisions based on the experiences of previous projects.
|
||||
|
||||

|
||||
|
||||
## Setup
|
||||
|
||||
1. Install this plugin:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-adr
|
||||
```
|
||||
|
||||
2. Make sure the [ADR backend plugin](../adr-backend/README.md) is installed.
|
||||
|
||||
3. [Configure integrations](https://backstage.io/docs/integrations/) for all sites you would like to pull ADRs from.
|
||||
|
||||
### Entity Pages
|
||||
|
||||
1. Add the plugin as a tab to your Entity pages:
|
||||
|
||||
```jsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import { EntityAdrContent, isAdrAvailable } from '@backstage/plugin-adr';
|
||||
|
||||
...
|
||||
// Note: Add to any other Pages as well (e.g. defaultEntityPage and websiteEntityPage)
|
||||
const serviceEntityPage = (
|
||||
<EntityLayout>
|
||||
{/* other tabs... */}
|
||||
<EntityLayout.Route if={isAdrAvailable} path="/adrs" title="ADRs">
|
||||
<EntityAdrContent />
|
||||
</EntityLayout.Route>
|
||||
</EntityLayout>
|
||||
```
|
||||
|
||||
2. Add `backstage.io/adr-location` annotation to your `catalog-info.yaml`:
|
||||
|
||||
```yaml
|
||||
metadata:
|
||||
annotations:
|
||||
backstage.io/adr-location: <RELATIVE_PATH_TO_ADR_FILES_DIR>
|
||||
```
|
||||
|
||||
The value for `backstage.io/adr-location` should be a path relative to your `catalog-info.yaml` file or a absolute URL to the directory which contains your ADR markdown files.
|
||||
|
||||
For example, if you have the following directory structure, you would set `backstage.io/adr-location: docs/adrs`:
|
||||
|
||||
```
|
||||
repo-root/
|
||||
README.md
|
||||
src/
|
||||
catalog-info.yaml
|
||||
docs/
|
||||
adrs/
|
||||
0001-use-adrs.md
|
||||
0002-use-cloud.md
|
||||
```
|
||||
|
||||
### Search
|
||||
|
||||
First, make sure to setup Backstage Search with the [ADR backend plugin](../adr-backend/README.md).
|
||||
Afterwards, add the following code snippet to use `AdrSearchResultListItem` when the type of the search results is `adr`:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/search/SearchPage.tsx
|
||||
import { AdrSearchResultListItem } from '@backstage/plugin-adr';
|
||||
import { AdrDocument } from '@backstage/plugin-adr-common';
|
||||
|
||||
...
|
||||
// Optional - Add type to side pane
|
||||
<SearchType.Accordion
|
||||
name="Result Type"
|
||||
defaultValue="software-catalog"
|
||||
types={[
|
||||
...
|
||||
{
|
||||
value: 'adr',
|
||||
name: 'Architecture Decision Records',
|
||||
icon: <DocsIcon />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
...
|
||||
|
||||
// In results
|
||||
<SearchResult>
|
||||
{({ results }) => (
|
||||
<List>
|
||||
{results.map(({ type, document, highlight, rank }) => {
|
||||
switch (type) {
|
||||
...
|
||||
case 'adr':
|
||||
return (
|
||||
<AdrSearchResultListItem
|
||||
key={document.location}
|
||||
// Not required if you're leveraging the new search results extensions available in v1.11+
|
||||
// https://backstage.io/docs/features/search/how-to-guides#2-using-an-extension-in-your-backstage-app
|
||||
result={document as AdrDocument}
|
||||
/>
|
||||
);
|
||||
...
|
||||
}
|
||||
})}
|
||||
</List>
|
||||
)}
|
||||
</SearchResult>
|
||||
```
|
||||
|
||||
## Custom ADR formats
|
||||
|
||||
By default, this plugin will parse ADRs according to the format specified by the [Markdown Architecture Decision Record (MADR) v2.x template](https://github.com/adr/madr/tree/2.1.2) or the [Markdown Any Decision Record (MADR) 3.x template](https://github.com/adr/madr/tree/3.0.0). If your ADRs are written using a different format, you can apply the following customizations to correctly identify and parse your documents:
|
||||
|
||||
### Custom Filename/Path Format
|
||||
|
||||
In order to ensure the plugin fetches the correct ADR files (e.g. ignoring your template file), you can pass in an optional `filePathFilterFn` parameter to `EntityAdrContent` which will be called with each file path relative to the ADR location specified by `backstage.io/adr-location`. For example, the follow custom filter function will ignore the ADR template file and include files with a specific naming convention including those under a specified sub-directory:
|
||||
|
||||
```tsx
|
||||
const myCustomFilterFn: AdrFilePathFilterFn = (path: string): boolean => {
|
||||
if (path === '0000-adr-template.md') {
|
||||
return false;
|
||||
}
|
||||
// Match all files following the pattern NNNN-title-with-dashes.md including those under decided-adrs/
|
||||
return /^(decided-adrs\/)?\d{4}-.+\.md$/.test(path);
|
||||
}
|
||||
|
||||
...
|
||||
|
||||
<EntityAdrContent filePathFilterFn={myCustomFilterFn} />
|
||||
```
|
||||
|
||||
### Custom Content Decorators
|
||||
|
||||
Your ADR Markdown content will typically be rendered in the UI as is with the exception of relative links/embeds being rewritten as absolute URLs so they can be linked correctly (e.g. `./my-diagram.png` => `<ABSOLUTE_ADR_DIR_URL>/my-diagram.png`). Depending on your ADR format, you may want to apply additional transformations to the content (e.g. hiding or formatting front matter in a different way). You can do so by passing in a list of custom content decorators for the optional `contentDecorators` parameter. Note that passing in this parameter will override the default decorators. If you want to include the default ones, make sure to add them as well:
|
||||
|
||||
```tsx
|
||||
import {
|
||||
AdrReader,
|
||||
...
|
||||
} from '@backstage/plugin-adr';
|
||||
|
||||
...
|
||||
|
||||
const myCustomDecorator: AdrContentDecorator = ({ content }) => {
|
||||
return { content: applyCustomContentTransformation(content) };
|
||||
};
|
||||
|
||||
...
|
||||
|
||||
<EntityAdrContent contentDecorators={[
|
||||
AdrReader.decorators.createRewriteRelativeLinksDecorator(),
|
||||
AdrReader.decorators.createRewriteRelativeEmbedsDecorator(),
|
||||
AdrReader.decorators.createFrontMatterFormatterDecorator(),
|
||||
myCustomDecorator,
|
||||
]}
|
||||
/>
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-adr` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-adr",
|
||||
"version": "0.6.17",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-adr"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -70,5 +71,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-adr instead."
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
@@ -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.
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
|
||||
@@ -1,40 +1,3 @@
|
||||
# [Allure](https://docs.qameta.io/allure/)
|
||||
# Deprecated
|
||||
|
||||
Welcome to the Backstage Allure plugin. This plugin add an entity service page to display Allure test reports related to the service.
|
||||
|
||||
## Install
|
||||
|
||||
```shell
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-allure
|
||||
```
|
||||
|
||||
## Configure
|
||||
|
||||
### Configure Allure service
|
||||
|
||||
Add below configuration in the `app-config.yaml`.
|
||||
|
||||
```yaml
|
||||
allure:
|
||||
baseUrl: <ALLURE_SERVICE_BASE_URL> # Example: https://allure.my-company.net or when running allure locally, http://localhost:5050/allure-docker-service
|
||||
```
|
||||
|
||||
### Setup entity service page
|
||||
|
||||
Add `EntityAllureReportContent` in the `EntityPage.tsx` like below:
|
||||
|
||||
```diff
|
||||
+ import { EntityAllureReportContent } from '@backstage/plugin-allure';
|
||||
|
||||
...
|
||||
|
||||
const serviceEntityPage = (
|
||||
<EntityLayoutWrapper>
|
||||
...
|
||||
+ <EntityLayout.Route path="/allure" title="Allure Report">
|
||||
+ <EntityAllureReportContent />
|
||||
+ </EntityLayout.Route>
|
||||
</EntityLayoutWrapper>
|
||||
);
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-allure` instead.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"version": "0.1.50",
|
||||
"description": "A Backstage plugin that integrates with Allure",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-allure"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -69,5 +70,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-allure instead."
|
||||
}
|
||||
|
||||
@@ -1,259 +1,3 @@
|
||||
# Analytics Module: Google Analytics
|
||||
# Deprecated
|
||||
|
||||
This plugin provides an opinionated implementation of the Backstage Analytics
|
||||
API for Google Analytics. Once installed and configured, analytics events will
|
||||
be sent to GA as your users navigate and use your Backstage instance.
|
||||
|
||||
This plugin contains no other functionality.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install the plugin package in your Backstage app:
|
||||
|
||||
```sh
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-analytics-module-ga
|
||||
```
|
||||
|
||||
2. Wire up the API implementation to your App:
|
||||
|
||||
```tsx
|
||||
// packages/app/src/apis.ts
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { GoogleAnalytics } from '@backstage/plugin-analytics-module-ga';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
// Instantiate and register the GA Analytics API Implementation.
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
GoogleAnalytics.fromConfig(configApi, {
|
||||
identityApi,
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
3. Configure the plugin in your `app-config.yaml`:
|
||||
|
||||
The following is the minimum configuration required to start sending analytics
|
||||
events to GA. All that's needed is your Universal Analytics tracking ID:
|
||||
|
||||
```yaml
|
||||
# app-config.yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
trackingId: UA-0000000-0
|
||||
```
|
||||
|
||||
4. Update CSP in your `app-config.yaml`:
|
||||
|
||||
The following is the minimal content security policy required to load scripts from GA.
|
||||
|
||||
```yaml
|
||||
backend:
|
||||
csp:
|
||||
connect-src: ["'self'", 'http:', 'https:']
|
||||
# Add these two lines below
|
||||
script-src: ["'self'", "'unsafe-eval'", 'https://www.google-analytics.com']
|
||||
img-src: ["'self'", 'data:', 'https://www.google-analytics.com']
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
In order to be able to analyze usage of your Backstage instance _by plugin_, we
|
||||
strongly recommend configuring at least one [custom dimension][what-is-a-custom-dimension]
|
||||
to capture Plugin IDs associated with events, including page views.
|
||||
|
||||
1. First, [configure the custom dimension in GA][configure-custom-dimension].
|
||||
Be sure to set the Scope to `hit`, and name it something like `Plugin`. Note
|
||||
the index of the dimension you just created (e.g. `1`, if this is the first
|
||||
custom dimension you've created in your GA property).
|
||||
2. Then, add a mapping to your `app.analytics.ga` configuration that instructs
|
||||
the plugin to capture Plugin IDs on the custom dimension you just created.
|
||||
It should look like this:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
trackingId: UA-0000000-0
|
||||
customDimensionsMetrics:
|
||||
- type: dimension
|
||||
index: 1
|
||||
source: context
|
||||
key: pluginId
|
||||
```
|
||||
|
||||
You can configure additional custom dimension and metric collection by adding
|
||||
more entries to the `customDimensionsMetrics` array:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
customDimensionsMetrics:
|
||||
- type: dimension
|
||||
index: 1
|
||||
source: context
|
||||
key: pluginId
|
||||
- type: dimension
|
||||
index: 2
|
||||
source: context
|
||||
key: routeRef
|
||||
- type: dimension
|
||||
index: 3
|
||||
source: context
|
||||
key: extension
|
||||
- type: metric
|
||||
index: 1
|
||||
source: attributes
|
||||
key: someEventContextAttr
|
||||
```
|
||||
|
||||
### User IDs
|
||||
|
||||
This plugin supports accurately deriving user-oriented metrics (like monthly
|
||||
active users) using Google Analytics' [user ID views][ga-user-id-view]. To
|
||||
enable this...
|
||||
|
||||
1. Be sure you've gone through the process of setting up a user ID view in your
|
||||
Backstage instance's Google Analytics property (see docs linked above).
|
||||
2. Make sure you instantiate `GoogleAnalytics` with an `identityApi` instance
|
||||
passed to it, as shown in the installation section above.
|
||||
3. Set `app.analytics.ga.identity` to either `required` or `optional` in your
|
||||
`app.config.yaml`, like this:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
trackingId: UA-0000000-0
|
||||
identity: optional
|
||||
```
|
||||
|
||||
Set `identity` to `optional` if you need accurate session counts, including
|
||||
cases where users do not sign in at all. Use `required` if you need all hits
|
||||
to be associated with a user ID without exception (and don't mind if some
|
||||
sessions are not captured, such as those where no sign in occur).
|
||||
|
||||
Note that, to comply with GA policies, the value of the User ID is
|
||||
pseudonymized before being sent to GA. By default, it is a `sha256` hash of the
|
||||
current user's `userEntityRef` as returned by the `identityApi`. To set a
|
||||
different value, provide a `userIdTransform` function alongside `identityApi`
|
||||
when you instantiate `GoogleAnalytics`. This function will be passed the
|
||||
`userEntityRef` as an argument and should resolve to the value you wish to set
|
||||
as the user ID. For example:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { GoogleAnalytics } from '@backstage/plugin-analytics-module-ga';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
GoogleAnalytics.fromConfig(configApi, {
|
||||
identityApi,
|
||||
userIdTransform: async (userEntityRef: string): Promise<string> => {
|
||||
return customHashingFunction(userEntityRef);
|
||||
},
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
### Enabling Site Search
|
||||
|
||||
If you wish to see all of the search events in the [Site Search](https://support.google.com/analytics/answer/1012264)
|
||||
section of Google Analytics, you can enable sending virtual pageviews on every `search` event like so:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
virtualSearchPageView:
|
||||
mode: only # Defaults to 'disabled'
|
||||
mountPath: /virtual-search # Defaults to '/search'
|
||||
searchQuery: term # Defaults to 'query'
|
||||
categoryQuery: sc # Omitted by default
|
||||
```
|
||||
|
||||
Available `mode`s are:
|
||||
|
||||
- `disabled` - no virtual pageviews are sent, default behavior
|
||||
- `only` - sends virtual pageviews _instead_ of `search` events
|
||||
- `both` - sends both virtual pageviews _and_ `search` events
|
||||
|
||||
Virtual pageviews will be sent to the path specified in the `mountPath`, the search term will be
|
||||
set as the value for query parameter `searchQuery` and category (if provided) will be set as the value for
|
||||
query parameter `categoryQuery`, e.g. the example config above will result in
|
||||
virtual pageviews being sent to `/virtual-search?term=SearchTermHere&sc=CategoryHere`.
|
||||
|
||||
### Debugging and Testing
|
||||
|
||||
In pre-production environments, you may wish to set additional configurations
|
||||
to turn off reporting to Analytics and/or print debug statements to the
|
||||
console. You can do so like this:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
testMode: true # Prevents data being sent to GA
|
||||
debug: true # Logs analytics event to the web console
|
||||
```
|
||||
|
||||
You might commonly set the above in an `app-config.local.yaml` file, which is
|
||||
normally `gitignore`'d but loaded and merged in when Backstage is bootstrapped.
|
||||
|
||||
## Development
|
||||
|
||||
If you would like to contribute improvements to this plugin, the easiest way to
|
||||
make and test changes is to do the following:
|
||||
|
||||
1. Clone the main Backstage monorepo `git clone git@github.com:backstage/backstage.git`
|
||||
2. Install all dependencies `yarn install`
|
||||
3. If one does not exist, create an `app-config.local.yaml` file in the root of
|
||||
the monorepo and add config for this plugin (see below)
|
||||
4. Enter this plugin's working directory: `cd plugins/analytics-provider-ga`
|
||||
5. Start the plugin in isolation: `yarn start`
|
||||
6. Navigate to the playground page at `http://localhost:3000/ga`
|
||||
7. Open the web console to see events fire when you navigate or when you
|
||||
interact with instrumented components.
|
||||
|
||||
Code for the isolated version of the plugin can be found inside the [/dev](./dev)
|
||||
directory. Changes to the plugin are hot-reloaded.
|
||||
|
||||
### Recommended Dev Config
|
||||
|
||||
Paste this into your `app-config.local.yaml` while developing this plugin:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga:
|
||||
trackingId: UA-0000000-0
|
||||
debug: true
|
||||
testMode: true
|
||||
customDimensionsMetrics:
|
||||
- type: dimension
|
||||
index: 1
|
||||
source: context
|
||||
key: pluginId
|
||||
```
|
||||
|
||||
[what-is-a-custom-dimension]: https://support.google.com/analytics/answer/2709828
|
||||
[configure-custom-dimension]: https://support.google.com/analytics/answer/2709828#configuration
|
||||
[ga-user-id-view]: https://support.google.com/analytics/answer/3123669
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-analytics-module-ga` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-analytics-module-ga",
|
||||
"version": "0.2.4",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin-module"
|
||||
"role": "frontend-plugin-module",
|
||||
"moved": "@backstage-community/plugin-analytics-module-ga"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -52,5 +53,6 @@
|
||||
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
||||
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
||||
},
|
||||
"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-analytics-module-ga instead."
|
||||
}
|
||||
|
||||
@@ -1,233 +1,3 @@
|
||||
# Analytics Module: Google Analytics 4
|
||||
# Deprecated
|
||||
|
||||
This plugin provides an opinionated implementation of the Backstage Analytics
|
||||
API for Google Analytics 4. Once installed and configured, analytics events will
|
||||
be sent to GA as your users navigate and use your Backstage instance.
|
||||
|
||||
This plugin contains no other functionality.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install the plugin package in your Backstage app:
|
||||
|
||||
```sh
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-analytics-module-ga4
|
||||
```
|
||||
|
||||
2. Wire up the API implementation to your App:
|
||||
|
||||
```tsx
|
||||
// packages/app/src/apis.ts
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { GoogleAnalytics4 } from '@backstage/plugin-analytics-module-ga4';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
// Instantiate and register the GA Analytics API Implementation.
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
GoogleAnalytics4.fromConfig(configApi, {
|
||||
identityApi,
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
3. Configure the plugin in your `app-config.yaml`:
|
||||
|
||||
The following is the minimum configuration required to start sending analytics
|
||||
events to GA. All that's needed is your GA4 measurement ID:
|
||||
|
||||
```yaml
|
||||
# app-config.yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
measurementId: G-0000000-0
|
||||
```
|
||||
|
||||
4. Update CSP in your `app-config.yaml`:
|
||||
|
||||
The following is the minimal content security policy required to load scripts from GA.
|
||||
|
||||
```yaml
|
||||
backend:
|
||||
csp:
|
||||
connect-src: ["'self'", 'http:', 'https:']
|
||||
# Add these two lines below
|
||||
script-src:
|
||||
[
|
||||
"'self'",
|
||||
"'unsafe-eval'",
|
||||
'https://www.google-analytics.com',
|
||||
'https://www.googletagmanager.com',
|
||||
]
|
||||
img-src: ["'self'", 'data:', 'https://www.google-analytics.com']
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
In order to be able to analyze usage of your Backstage instance by plugin, we recommend configuring [a content grouping](#enabling-content-grouping).
|
||||
Additional dimensional data can be captured using custom dimensions, like this:
|
||||
|
||||
1. First, [configure the custom dimension in GA] [configure-custom-dimension].
|
||||
Be sure to set the Scope to `Event`, and name it `dimension1`.
|
||||
2. Then, add a mapping to your `app.analytics.ga4` configuration that instructs
|
||||
the plugin to capture Plugin IDs on the custom dimension you just created.
|
||||
It should look like this:
|
||||
3. `allowedContexts` config accepts array of string, where each entry is a context parameter that will be sent in the event.
|
||||
context names will be prefixed by `c_`.
|
||||
4. `allowedAttributes` config accepts array of string, where each entry is an attribute that will be sent in the event.
|
||||
attribute names will be prefixed by `a_`.
|
||||
5. `allowedContexts` and `allowedAttributes` are optional, if not provided, no additional context and attributes will be sent.
|
||||
6. if `allowedContexts` or `allowedAttributes` is set to '\*', all context and attributes will be sent.
|
||||
7. `enableSendPageView` is used to send default events and is disabled by default.
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
measurementId: G-0000000-0
|
||||
allowedContexts: ['pluginId']
|
||||
```
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
allowedContexts: ['pluginId']
|
||||
allowedAttributes: ['someEventContextAttr']
|
||||
```
|
||||
|
||||
### User IDs
|
||||
|
||||
This plugin supports accurately deriving user-oriented metrics (like monthly
|
||||
active users) using Google Analytics' [user ID views][ga-user-id-view]. To
|
||||
enable this...
|
||||
|
||||
1. Be sure you've gone through the process of setting up a user ID view in your
|
||||
Backstage instance's Google Analytics property (see docs linked above).
|
||||
2. Make sure you instantiate `GoogleAnalytics` with an `identityApi` instance
|
||||
passed to it, as shown in the installation section above.
|
||||
3. Set `app.analytics.ga4.identity` to either `required` or `optional` in your
|
||||
`app.config.yaml`, like this:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
measurementId: G-0000000-0
|
||||
identity: optional
|
||||
```
|
||||
|
||||
Set `identity` to `optional` if you need accurate session counts, including
|
||||
cases where users do not sign in at all. Use `required` if you need all hits
|
||||
to be associated with a user ID without exception (and don't mind if some
|
||||
sessions are not captured, such as those where no sign in occur).
|
||||
|
||||
Note that, to comply with GA policies, the value of the User ID is
|
||||
pseudonymized before being sent to GA. By default, it is a `sha256` hash of the
|
||||
current user's `userEntityRef` as returned by the `identityApi`. To set a
|
||||
different value, provide a `userIdTransform` function alongside `identityApi`
|
||||
when you instantiate `GoogleAnalytics`. This function will be passed the
|
||||
`userEntityRef` as an argument and should resolve to the value you wish to set
|
||||
as the user ID. For example:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { GoogleAnalytics } from '@backstage/plugin-analytics-module-ga';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
GoogleAnalytics4.fromConfig(configApi, {
|
||||
identityApi,
|
||||
userIdTransform: async (userEntityRef: string): Promise<string> => {
|
||||
return customHashingFunction(userEntityRef);
|
||||
},
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
### Enabling content grouping
|
||||
|
||||
Content groups enable you to categorize pages and screens into custom buckets which you can see
|
||||
metrics for related groups of information.
|
||||
More about content grouping here [content groups][content-grouping].
|
||||
It's recommended to enable content grouping by PluginId. `contentGrouping` supports `routeRef` and extension.
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
contentGrouping: pluginId
|
||||
```
|
||||
|
||||
Please note, content grouping takes 24hrs to show up in the Google Analytics dashboard.
|
||||
|
||||
### Debugging and Testing
|
||||
|
||||
In pre-production environments, you may wish to set additional configurations
|
||||
to turn off reporting to Analytics and/or print debug statements to the
|
||||
console. You can do so like this:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
testMode: true # Prevents data being sent to GA
|
||||
debug: true # Logs analytics event to the web console
|
||||
```
|
||||
|
||||
You might commonly set the above in an `app-config.local.yaml` file, which is
|
||||
normally `gitignore`'d but loaded and merged in when Backstage is bootstrapped.
|
||||
|
||||
## Development
|
||||
|
||||
If you would like to contribute improvements to this plugin, the easiest way to
|
||||
make and test changes is to do the following:
|
||||
|
||||
1. Clone the main Backstage monorepo `git clone git@github.com:backstage/backstage.git`
|
||||
2. Install all dependencies `yarn install`
|
||||
3. If one does not exist, create an `app-config.local.yaml` file in the root of
|
||||
the monorepo and add config for this plugin (see below)
|
||||
4. Enter this plugin's working directory: `cd plugins/analytics-provider-ga4`
|
||||
5. Start the plugin in isolation: `yarn start`
|
||||
6. Navigate to the playground page at `http://localhost:3000/ga4`
|
||||
7. Open the web console to see events fire when you navigate or when you
|
||||
interact with instrumented components.
|
||||
|
||||
Code for the isolated version of the plugin can be found inside the [/dev](./dev)
|
||||
directory. Changes to the plugin are hot-reloaded.
|
||||
|
||||
#### Recommended Dev Config
|
||||
|
||||
Paste this into your `app-config.local.yaml` while developing this plugin:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
ga4:
|
||||
measurementId: G-0000000-0
|
||||
debug: true
|
||||
testMode: true
|
||||
allowedContexts: ['pluginId']
|
||||
```
|
||||
|
||||
[what-is-a-custom-dimension]: https://support.google.com/analytics/answer/2709828
|
||||
[configure-custom-dimension]: https://support.google.com/analytics/answer/10075209?hl=en#
|
||||
[ga-user-id-view]: https://support.google.com/analytics/answer/3123669
|
||||
[content-grouping]: https://support.google.com/analytics/answer/11523339?hl=en
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-analytics-module-ga4` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-analytics-module-ga4",
|
||||
"version": "0.2.4",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin-module"
|
||||
"role": "frontend-plugin-module",
|
||||
"moved": "@backstage-community/plugin-analytics-module-ga4"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -53,5 +54,6 @@
|
||||
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
||||
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
||||
},
|
||||
"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-analytics-module-ga4 instead."
|
||||
}
|
||||
|
||||
@@ -1,135 +1,3 @@
|
||||
# Analytics Module: New Relic Browser
|
||||
# Deprecated
|
||||
|
||||
This plugin provides an opinionated implementation of the Backstage Analytics API for New Relic Browser. Once installed and configured, analytics events will be sent to New Relic as your users navigate and use your Backstage instance.
|
||||
|
||||
This plugin contains no other functionality.
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install the plugin package in your Backstage app:
|
||||
|
||||
```sh
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-analytics-module-newrelic-browser
|
||||
```
|
||||
|
||||
2. Wire up the API implementation to your App:
|
||||
|
||||
```tsx
|
||||
// packages/app/src/apis.ts
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { NewRelicBrowser } from '@backstage/plugin-analytics-module-newrelic-browser';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
// Instantiate and register the New Relic Browser API Implementation.
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
NewRelicBrowser.fromConfig(configApi, {
|
||||
identityApi,
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
3. Configure the plugin in your `app-config.yaml`:
|
||||
|
||||
The following is the minimum configuration required to start sending analytics
|
||||
events to New Relic Browser. You find this information when creating a new application
|
||||
in New Relic Browser using the Copy/Paste method.
|
||||
|
||||
```yaml
|
||||
# app-config.yaml
|
||||
app:
|
||||
analytics:
|
||||
newRelic:
|
||||
endpoint: 'bam.nr-data.net',
|
||||
accountId: '1234567'
|
||||
applicationId: '987654321'
|
||||
licenseKey: 'NRJS-12a3456bc78de9123f4'
|
||||
```
|
||||
|
||||
> Note: Depending on New Relic's data center you are using you'll want to change the `endpoint` to `bam.eu01.nr-data.net` for the EU data center. Refer to [this document](https://docs.newrelic.com/docs/new-relic-solutions/get-started/networks/#data-ingest) for available endpoints.
|
||||
|
||||
## Configuration
|
||||
|
||||
By default the distributed tracing and cookies features are disabled. You can enable them by adding the following to your `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
# app-config.yaml
|
||||
app:
|
||||
analytics:
|
||||
newRelic:
|
||||
...
|
||||
distributedTracing: true
|
||||
cookiesEnabled: true
|
||||
```
|
||||
|
||||
### User IDs
|
||||
|
||||
This plugin supports sending user context to New Relic Browser by providing a User ID. This requires instantiating the `NewRelicBrowser` instance with an `identityApi` instance passed to it, but this is optional. If omitted the plugin will not send user context to New Relic Browser.
|
||||
|
||||
By default the user ID is calculated as a SHA-256 hash of the current user's `userEntityRef` as returned by the `identityApi`. To set a
|
||||
different value, provide a `userIdTransform` function alongside `identityApi` when you instantiate `NewRelicBrowser`. This function will be passed the `userEntityRef` as an argument and should resolve to the value you wish to set as the user ID. For example:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
analyticsApiRef,
|
||||
configApiRef,
|
||||
identityApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { GoogleAnalytics } from '@backstage/plugin-analytics-module-newrelic-browser';
|
||||
|
||||
export const apis: AnyApiFactory[] = [
|
||||
createApiFactory({
|
||||
api: analyticsApiRef,
|
||||
deps: { configApi: configApiRef, identityApi: identityApiRef },
|
||||
factory: ({ configApi, identityApi }) =>
|
||||
NewRelicBrowser.fromConfig(configApi, {
|
||||
identityApi,
|
||||
userIdTransform: async (userEntityRef: string): Promise<string> => {
|
||||
return customHashingFunction(userEntityRef);
|
||||
},
|
||||
}),
|
||||
}),
|
||||
];
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
If you would like to contribute improvements to this plugin, the easiest way to
|
||||
make and test changes is to do the following:
|
||||
|
||||
1. Clone the main Backstage monorepo `git clone git@github.com:backstage/backstage.git`
|
||||
2. Install all dependencies `yarn install`
|
||||
3. If one does not exist, create an `app-config.local.yaml` file in the root of
|
||||
the monorepo and add config for this plugin (see below)
|
||||
4. Enter this plugin's working directory: `cd plugins/analytics-provider-newrelic-browser`
|
||||
5. Start the plugin in isolation: `yarn start`
|
||||
6. Navigate to the playground page at `http://localhost:3000/newrelic`
|
||||
7. Open the web console to see events fire when you navigate or when you
|
||||
interact with instrumented components.
|
||||
|
||||
Code for the isolated version of the plugin can be found inside the [/dev](./dev)
|
||||
directory. Changes to the plugin are hot-reloaded.
|
||||
|
||||
#### Recommended Dev Config
|
||||
|
||||
Paste this into your `app-config.local.yaml` while developing this plugin:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
analytics:
|
||||
newRelic:
|
||||
accountId: '1234567'
|
||||
applicationId: '987654321'
|
||||
licenseKey: 'NRJS-12a3456bc78de9123f4'
|
||||
distributedTracingEnabled: true
|
||||
cookiesEnabled: true
|
||||
useEuEndpoint: false
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-analytics-module-newrelic-browser` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-analytics-module-newrelic-browser",
|
||||
"version": "0.1.4",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin-module"
|
||||
"role": "frontend-plugin-module",
|
||||
"moved": "@backstage-community/plugin-analytics-module-newrelic-browser"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -47,5 +48,6 @@
|
||||
"peerDependencies": {
|
||||
"react": "^16.13.1 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"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-analytics-module-newrelic-browser instead."
|
||||
}
|
||||
|
||||
@@ -1,147 +1,3 @@
|
||||
# Apache Airflow Plugin
|
||||
# Deprecated
|
||||
|
||||
Welcome to the apache-airflow plugin!
|
||||
|
||||
This plugin serves as frontend to the REST API exposed by Apache Airflow.
|
||||
Note only [Airflow v2 (and later)](https://airflow.apache.org/docs/apache-airflow/stable/deprecated-rest-api-ref.html) integrate with the plugin.
|
||||
|
||||
## Feature Requests & Ideas
|
||||
|
||||
- [ ] Add support for running multiple instances of Airflow for monitoring
|
||||
various deployment stages or business domains. ([Suggested by @JGoldman110](https://github.com/backstage/backstage/issues/735#issuecomment-985063468))
|
||||
- [ ] Make owner chips in the DAG table clickable, resolving to a user or group
|
||||
in the entity catalog. ([Suggested by @julioz](https://github.com/backstage/backstage/pull/8348#discussion_r764766295))
|
||||
|
||||
## Installation
|
||||
|
||||
1. Install the plugin with `yarn` in the root of your Backstage directory
|
||||
|
||||
```sh
|
||||
yarn --cwd packages/app add @backstage/plugin-apache-airflow
|
||||
```
|
||||
|
||||
2. Import and use the plugin extension in `spp/src/App.tsx`
|
||||
|
||||
```diff
|
||||
--- a/packages/app/src/App.tsx
|
||||
+++ b/packages/app/src/App.tsx
|
||||
@@ -86,6 +86,7 @@ import { providers } from './identityProviders';
|
||||
import * as plugins from './plugins';
|
||||
|
||||
import { techDocsPage } from './components/techdocs/TechDocsPage';
|
||||
+import { ApacheAirflowPage } from '@backstage/plugin-apache-airflow';
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
@@ -203,6 +204,7 @@ const routes = (
|
||||
element={<CostInsightsLabelDataflowInstructionsPage />}
|
||||
/>
|
||||
<Route path="/settings" element={<UserSettingsPage />} />
|
||||
+ <Route path="/apache-airflow" element={<ApacheAirflowPage />} />
|
||||
</FlatRoutes>
|
||||
);
|
||||
```
|
||||
|
||||
If you just want to embed the DAGs into an existing page, you can use the `ApacheAirflowDagTable`
|
||||
|
||||
```tsx
|
||||
import { ApacheAirflowDagTable } from '@backstage/plugin-apache-airflow';
|
||||
|
||||
export function SomeEntityPage(): JSX.Element {
|
||||
return (
|
||||
<Grid item md={6} xs={12}>
|
||||
<ApacheAirflowDagTable
|
||||
dagIds={[
|
||||
'example_bash_operator',
|
||||
'example_branch_datetime_operator_2',
|
||||
'example_branch_labels',
|
||||
]}
|
||||
/>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
For links to the Airflow instance, the `baseUrl` must be defined in
|
||||
`app-config.yaml`.
|
||||
|
||||
```yaml
|
||||
apacheAirflow:
|
||||
baseUrl: https://your.airflow.instance.com
|
||||
```
|
||||
|
||||
This plugin uses the Backstage proxy to securely communicate with the Apache
|
||||
Airflow API. Add the following to your `app-config.yaml` to enable this
|
||||
configuration:
|
||||
|
||||
```yaml
|
||||
proxy:
|
||||
'/airflow':
|
||||
target: https://your.airflow.instance.com/api/v1
|
||||
headers:
|
||||
Authorization: ${AIRFLOW_BASIC_AUTH_HEADER}
|
||||
```
|
||||
|
||||
In your production deployment of Backstage, you would also need to ensure that
|
||||
you've set the `AIRFLOW_BASIC_AUTH_HEADER` environment variable before starting
|
||||
the backend.
|
||||
|
||||
While working locally, you may wish to hard-code your API key in your
|
||||
`app-config.local.yaml` like this:
|
||||
|
||||
```yaml
|
||||
# app-config.local.yaml
|
||||
proxy:
|
||||
'/airflow':
|
||||
target: http://localhost:8080/api/v1
|
||||
headers:
|
||||
Authorization: Basic YWlyZmxvdzphaXJmbG93
|
||||
```
|
||||
|
||||
Where the basic authorization token is the base64 encoding of the username and
|
||||
password of your instance.
|
||||
|
||||
```sh
|
||||
echo -n "airflow:airflow" | base64 -w0
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
For local development, you can setup a local Airflow instance for development
|
||||
purposes by [running Airflow with Docker Compose][2].
|
||||
|
||||
To verify that Airflow is running, and the API is functioning as expected, you
|
||||
can run the following `curl` command:
|
||||
|
||||
```sh
|
||||
curl -X GET \
|
||||
--user "airflow:airflow" \
|
||||
localhost:8080/api/v1/dags
|
||||
```
|
||||
|
||||
To run the Backstage proxy, you will have to run start the `example-backend`
|
||||
plugin.
|
||||
|
||||
```sh
|
||||
yarn workspace example-backend start
|
||||
```
|
||||
|
||||
To verify that the proxy is configured correctly, you can curl the Backstage
|
||||
proxy endpoint. If using basic authentication, you will have to base64 encode
|
||||
the username and password:
|
||||
|
||||
```sh
|
||||
curl http://localhost:7007/api/proxy/airflow/dags
|
||||
```
|
||||
|
||||
And finally, to run an instance of this plugin, you can run:
|
||||
|
||||
```sh
|
||||
yarn start
|
||||
```
|
||||
|
||||
[1]: https://airflow.apache.org/docs/apache-airflow/stable/security/api.html
|
||||
[2]: https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html
|
||||
[3]: https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-apache-airflow` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-apache-airflow",
|
||||
"version": "0.2.24",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-apache-airflow"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -58,5 +59,6 @@
|
||||
"react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
|
||||
"react-router-dom": "6.0.0-beta.0 || ^6.3.0"
|
||||
},
|
||||
"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-apache-airflow instead."
|
||||
}
|
||||
|
||||
@@ -1,104 +1,3 @@
|
||||
# apollo-explorer
|
||||
# Deprecated
|
||||
|
||||
Welcome to the Apollo Explorer plugin!
|
||||
|
||||
This plugin allows users to directly embed an [Apollo](https://www.apollographql.com) graph explorer directly into
|
||||
Backstage!
|
||||
|
||||
## Getting started
|
||||
|
||||
### Getting an Apollo Graph Reference
|
||||
|
||||
First things first, you will need an Apollo account, and a graph imported into your account. This is beyond the scope of
|
||||
this plugin, so if you are totally new to Apollo, please reference their official
|
||||
documentation [here](https://www.apollographql.com/docs).
|
||||
|
||||
Once you have a graph set up in Apollo, we need to grab the graph reference. First, go to your Apollo graphs home page and choose the graph you wish to embed.
|
||||
|
||||

|
||||
|
||||
Once you are in your graph explorer, click the dropdown next to the share icon and select `Share as Embedded`
|
||||
|
||||

|
||||
|
||||
This modal contains a number of useful properties, all of which can be passed to the plugin via the component properties, but the only mandatory input we need from here is the `graphRef`.
|
||||
|
||||

|
||||
|
||||
Hold on to this snippet for a second while we set up the plugin ✨
|
||||
|
||||
### Installing the Backstage Plugin
|
||||
|
||||
First, add the plugin to your Backstage app
|
||||
|
||||
```shell
|
||||
yarn --cwd packages/app add @backstage/plugin-apollo-explorer
|
||||
```
|
||||
|
||||
Then, in `packages/app/src/App.tsx` add the plugin as a `Route`
|
||||
|
||||
```typescript
|
||||
import { ApolloExplorerPage } from '@backstage/plugin-apollo-explorer';
|
||||
|
||||
const routes = (
|
||||
<FlatRoutes>
|
||||
{/* other routes... */}
|
||||
<Route
|
||||
path="/apollo-explorer"
|
||||
element={
|
||||
<ApolloExplorerPage
|
||||
endpoints={[
|
||||
{ title: 'Github', graphRef: 'my-github-graph-ref@current' },
|
||||
{ title: 'Linear', graphRef: 'my-linear-graph-ref@current' },
|
||||
]}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
```
|
||||
|
||||
Then, in `packages/app/src/components/Root/Root.tsx` add a sidebar item so users can find your beautiful plugin!
|
||||
|
||||
```typescript
|
||||
<SidebarItem icon={GraphiQLIcon} to="apollo-explorer" text="Apollo Explorer" />
|
||||
```
|
||||
|
||||
That's it! You should now see an `Apollo Explorer` item in your sidebar, and if you click it, you should see your graph(s) load and direct you to authenticate via Apollo!
|
||||
|
||||

|
||||
|
||||
Once you authenticate, your graph is ready to use 🚀
|
||||
|
||||

|
||||
|
||||
### Authentication Tokens for Apollo Studio
|
||||
|
||||
If you need to utilize an ApiRef to supply a token to Apollo, you may do so using an ApiHolder.
|
||||
|
||||
In `packages/app/src/App.tsx` perform the following modifications from above. The import `ssoAuthApiRef` is used as an example and **does not exist**.
|
||||
|
||||
```typescript
|
||||
import { ApolloExplorerPage, EndpointProps } from '@backstage/plugin-apollo-explorer';
|
||||
import { ssoAuthApiRef } from '@companyxyz/devkit';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
|
||||
async function authCallback(options: { apiHolder: ApiHolder }): Promise<{token: string}> {
|
||||
const sso = options.apiHolder.get<any>(ssoAuthApiRef)
|
||||
return await sso.getToken()
|
||||
}
|
||||
|
||||
const routes = (
|
||||
<FlatRoutes>
|
||||
{/* other routes... */}
|
||||
<Route
|
||||
path="/apollo-explorer"
|
||||
element={
|
||||
<ApolloExplorerPage
|
||||
endpoints={[{
|
||||
title: 'Github',
|
||||
graphRef: 'my-github-graph-ref@current',
|
||||
authCallback: authCallback
|
||||
}]}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-apollo-explorer` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-apollo-explorer",
|
||||
"version": "0.2.0",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-apollo-explorer"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -52,5 +53,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-apollo-explorer instead."
|
||||
}
|
||||
|
||||
@@ -1,154 +1,3 @@
|
||||
# Azure DevOps Backend
|
||||
# Deprecated
|
||||
|
||||
Simple plugin that proxies requests to the [Azure DevOps](https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-6.1) API.
|
||||
|
||||
## Setup
|
||||
|
||||
The following sections will help you get the Azure DevOps Backend plugin setup and running.
|
||||
|
||||
### Credentials
|
||||
|
||||
In order to support **Multiple Organizations** as well as **Service Principals** and **Managed Identity** the Azure DevOps plugin relies on the `integrations.azure` section of your `app-config.yaml` being properly configured to be able to access the needed credentials. More details on this can be found in the [Azure DevOps Locations](https://backstage.io/docs/integrations/azure/locations) documentation.
|
||||
|
||||
### Single Organization Configuration
|
||||
|
||||
For those with a single organization the Azure DevOps plugin requires the following YAML configuration to be added to your `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
azureDevOps:
|
||||
host: dev.azure.com
|
||||
organization: my-company
|
||||
```
|
||||
|
||||
Configuration Details:
|
||||
|
||||
- `host` can be the same as the ones used for the `integration` section
|
||||
- `organization` is your Azure DevOps Services (cloud) Organization name or for Azure DevOps Server (on-premise) this will be your Collection name
|
||||
|
||||
> Note: The credentials in this setup would still need to be defined in your `integrations.azure` section of your `app-config.yaml` as noted in the [Credentials](#credentials) section above.
|
||||
|
||||
### Up and Running
|
||||
|
||||
Here's how to get the backend up and running:
|
||||
|
||||
1. First we need to add the `@backstage/plugin-azure-devops-backend` package to your backend:
|
||||
|
||||
```sh
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-azure-devops-backend
|
||||
```
|
||||
|
||||
2. Then we will create a new file named `packages/backend/src/plugins/azure-devops.ts`, and add the
|
||||
following to it:
|
||||
|
||||
```ts
|
||||
import { createRouter } from '@backstage/plugin-azure-devops-backend';
|
||||
import { Router } from 'express';
|
||||
import type { PluginEnvironment } from '../types';
|
||||
|
||||
export default function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
return createRouter({
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
reader: env.reader,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
3. Next we wire this into the overall backend router, edit `packages/backend/src/index.ts`:
|
||||
|
||||
```ts
|
||||
import azureDevOps from './plugins/azure-devops';
|
||||
// ...
|
||||
async function main() {
|
||||
// ...
|
||||
// Add this line under the other lines that follow the useHotMemoize pattern
|
||||
const azureDevOpsEnv = useHotMemoize(module, () => createEnv('azure-devops'));
|
||||
// ...
|
||||
// Insert this line under the other lines that add their routers to apiRouter in the same way
|
||||
apiRouter.use('/azure-devops', await azureDevOps(azureDevOpsEnv));
|
||||
```
|
||||
|
||||
4. Now run `yarn start-backend` from the repo root
|
||||
5. Finally open `http://localhost:7007/api/azure-devops/health` in a browser and it should return `{"status":"ok"}`
|
||||
|
||||
#### New Backend System
|
||||
|
||||
The Azure DevOps 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-azure-devops-backend'));
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
## Processor
|
||||
|
||||
The Azure DevOps backend plugin includes the `AzureDevOpsAnnotatorProcessor` which will automatically add the needed annotations for you. Here's how to install it:
|
||||
|
||||
```diff
|
||||
import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
|
||||
import { ScaffolderEntitiesProcessor } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
+ import { AzureDevOpsAnnotatorProcessor } from '@backstage/plugin-azure-devops-backend';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const builder = await CatalogBuilder.create(env);
|
||||
builder.addProcessor(new ScaffolderEntitiesProcessor());
|
||||
+ builder.addProcessor(AzureDevOpsAnnotatorProcessor.fromConfig(env.config));
|
||||
const { processingEngine, router } = await builder.build();
|
||||
await processingEngine.start();
|
||||
return router;
|
||||
}
|
||||
```
|
||||
|
||||
To use this with the New Backend System you'll want to create a [backend module extension for the Catalog](https://backstage.io/docs/backend-system/building-backends/migrating#other-catalog-extensions) if you haven't already. Here's a basic example of this assuming you are only adding the `AzureDevOpsAnnotatorProcessor`, this would go in your `packages/backend/index.ts`:
|
||||
|
||||
```diff
|
||||
import { createBackend } from '@backstage/backend-defaults';
|
||||
+ import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
|
||||
+ import { coreServices, createBackendModule } from '@backstage/backend-plugin-api';
|
||||
+ import { AzureDevOpsAnnotatorProcessor } from '@backstage/plugin-azure-devops-backend';
|
||||
|
||||
+ const catalogModuleCustomExtensions = createBackendModule({
|
||||
+ pluginId: 'catalog', // name of the plugin that the module is targeting
|
||||
+ moduleId: 'custom-extensions',
|
||||
+ register(env) {
|
||||
+ env.registerInit({
|
||||
+ deps: {
|
||||
+ catalog: catalogProcessingExtensionPoint,
|
||||
+ config: coreServices.rootConfig,
|
||||
+ },
|
||||
+ async init({ catalog, config }) {
|
||||
+ catalog.addProcessor(AzureDevOpsAnnotatorProcessor.fromConfig(config));
|
||||
+ },
|
||||
+ });
|
||||
+ },
|
||||
+ });
|
||||
|
||||
const backend = createBackend();
|
||||
|
||||
// ... other feature additions
|
||||
|
||||
+ backend.add(catalogModuleCustomExtensions());
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/azure-devops)
|
||||
- [The Backstage homepage](https://backstage.io)
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-devops-backend` instead.
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
{
|
||||
"name": "@backstage/plugin-azure-devops-backend",
|
||||
"version": "0.6.4",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"backstage": {
|
||||
"role": "backend-plugin",
|
||||
"moved": "@backstage-community/plugin-azure-devops-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/azure-devops-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:^",
|
||||
@@ -54,9 +59,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-azure-devops-backend instead."
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Deprecated
|
||||
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-devops-common` instead.
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-azure-devops-common",
|
||||
"version": "0.4.1",
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
"role": "common-library",
|
||||
"moved": "@backstage-community/plugin-azure-devops-common"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -40,5 +41,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^"
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-azure-devops-common instead."
|
||||
}
|
||||
|
||||
@@ -1,399 +1,3 @@
|
||||
# Azure DevOps Plugin
|
||||
# Deprecated
|
||||
|
||||
Website: [https://dev.azure.com/](https://dev.azure.com/)
|
||||
|
||||
## Features
|
||||
|
||||
### Azure Pipelines
|
||||
|
||||
Lists the top _n_ builds for a given Azure Repo where _n_ is a configurable value
|
||||
|
||||

|
||||
|
||||
### Azure Repos
|
||||
|
||||
Lists the top _n_ Active, Completed, or Abandoned Pull Requests for a given repository where _n_ is a configurable value
|
||||
|
||||

|
||||
|
||||
### Azure Repos Git Tags
|
||||
|
||||
Lists all Git Tags for a given repository
|
||||
|
||||

|
||||
|
||||
### Azure Readme
|
||||
|
||||
Readme for a given repository
|
||||
|
||||

|
||||
|
||||
## Setup
|
||||
|
||||
The following sections will help you get the Azure DevOps plugin setup and running
|
||||
|
||||
### Azure DevOps Backend
|
||||
|
||||
You need to setup the [Azure DevOps backend plugin](https://github.com/backstage/backstage/tree/master/plugins/azure-devops-backend) before you move forward with any of these steps if you haven't already
|
||||
|
||||
### Entity Annotation
|
||||
|
||||
To be able to use the Azure DevOps plugin you need to add the following annotation to any entities you want to use it with:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project-repo: <project-name>/<repo-name>
|
||||
```
|
||||
|
||||
Let's break this down a little: `<project-name>` will be the name of your Team Project and `<repo-name>` will be the name of your repository which needs to be part of the Team Project you entered for `<project-name>`.
|
||||
|
||||
Here's what that will look like in action:
|
||||
|
||||
```yaml
|
||||
# Example catalog-info.yaml entity definition file
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
# ...
|
||||
annotations:
|
||||
dev.azure.com/project-repo: my-project/my-repo
|
||||
spec:
|
||||
type: service
|
||||
# ...
|
||||
```
|
||||
|
||||
#### Mono repos
|
||||
|
||||
If you have multiple entities within a single repo, you will need to specify which pipelines belong to each entity, like this:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project-repo: <my-project>/<my-repo>
|
||||
dev.azure.com/build-definition: <build-definition-name>
|
||||
```
|
||||
|
||||
Then to display the `README` file that belongs to each entity you would do this:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/readme-path: /<path-to>/<my-readme-file>.md
|
||||
```
|
||||
|
||||
#### Pipeline in different project to repo
|
||||
|
||||
If your pipeline is in a different project to the source code, you will need to specify this in the project annotation.
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project-repo: <project-with-source-code>/<my-repo>
|
||||
dev.azure.com/build-definition: <build-definition-name>
|
||||
dev.azure.com/project: <project-with-build-code>
|
||||
```
|
||||
|
||||
#### Azure Pipelines Only
|
||||
|
||||
If you are only using Azure Pipelines along with a different SCM tool then you can use the following two annotations to see Builds:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/project: <project-name>
|
||||
dev.azure.com/build-definition: <build-definition-name>
|
||||
```
|
||||
|
||||
In this case `<project-name>` will be the name of your Team Project and `<build-definition-name>` will be the name of the Build Definition you would like to see Builds for, and it's possible to add more Builds separated by a comma. If the Build Definition name has spaces in it make sure to put quotes around it.
|
||||
|
||||
#### Multiple Organizations
|
||||
|
||||
If you have multiple organizations you'll need to also add this annotation:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/host-org: <host>/<organization>
|
||||
```
|
||||
|
||||
For this annotation `<host>` will match the `host` value in the `integrations.azure` section in your `app-config.yaml` and `<organization>` will be the name of the Organization that is part of the `host`. Let's break this down with an example:
|
||||
|
||||
Say we have the following `integrations.azure` section:
|
||||
|
||||
```yaml
|
||||
integrations:
|
||||
azure:
|
||||
- host: dev.azure.com
|
||||
credentials:
|
||||
- organizations:
|
||||
- my-org
|
||||
- my-other-org
|
||||
clientId: ${AZURE_CLIENT_ID}
|
||||
clientSecret: ${AZURE_CLIENT_SECRET}
|
||||
tenantId: ${AZURE_TENANT_ID}
|
||||
- organizations:
|
||||
- another-org
|
||||
clientId: ${AZURE_CLIENT_ID}
|
||||
- host: server.company.com
|
||||
credentials:
|
||||
- organizations:
|
||||
- yet-another-org
|
||||
personalAccessToken: ${PERSONAL_ACCESS_TOKEN}
|
||||
```
|
||||
|
||||
If the entity we are viewing lives in the `my-other-org` organization then the `dev.azure.com/host-org` annotation would look like this:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/host-org: dev.azure.com/my-other-org
|
||||
```
|
||||
|
||||
And if the entity was from `yet-another-org` it would look like this:
|
||||
|
||||
```yaml
|
||||
dev.azure.com/host-org: server.company.com/yet-another-org
|
||||
```
|
||||
|
||||
**Note:** To save you time, effort, and confusion setting up these annotations manually you can use the `AzureDevOpsAnnotatorProcessor` processor which will add the `dev.azure.com/host-org` and `dev.azure.com/project-repo` annotations for you with the correct values. The Azure DevOps backend plugin has details on how to [add this processor](https://github.com/backstage/backstage/tree/master/plugins/azure-devops-backend#processor).
|
||||
|
||||
### Azure Pipelines Component
|
||||
|
||||
To get the Azure Pipelines component working you'll need to do the following two steps:
|
||||
|
||||
1. First we need to add the `@backstage/plugin-azure-devops` package to your frontend app:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-azure-devops
|
||||
```
|
||||
|
||||
2. Second we need to add the `EntityAzurePipelinesContent` extension to the entity page in your app. How to do this will depend on which annotation you are using in your entities:
|
||||
|
||||
1. If you are using the `dev.azure.com/project-repo` annotation then you'll want to do the following:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityAzurePipelinesContent,
|
||||
isAzureDevOpsAvailable,
|
||||
} from '@backstage/plugin-azure-devops';
|
||||
|
||||
// For example in the CI/CD section
|
||||
const cicdContent = (
|
||||
<EntitySwitch>
|
||||
// ...
|
||||
<EntitySwitch.Case if={isAzureDevOpsAvailable}>
|
||||
<EntityAzurePipelinesContent defaultLimit={25} />
|
||||
</EntitySwitch.Case>
|
||||
// ...
|
||||
</EntitySwitch>
|
||||
```
|
||||
|
||||
2. If you are using the `dev.azure.com/project` and `dev.azure.com/build-definition` annotations then you'll want to do this:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityAzurePipelinesContent,
|
||||
isAzurePipelinesAvailable,
|
||||
} from '@backstage/plugin-azure-devops';
|
||||
|
||||
// For example in the CI/CD section
|
||||
const cicdContent = (
|
||||
<EntitySwitch>
|
||||
// ...
|
||||
<EntitySwitch.Case if={isAzurePipelinesAvailable}>
|
||||
<EntityAzurePipelinesContent defaultLimit={25} />
|
||||
</EntitySwitch.Case>
|
||||
// ...
|
||||
</EntitySwitch>
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
- The `if` prop is optional on the `EntitySwitch.Case`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
||||
- The `defaultLimit` property on the `EntityAzurePipelinesContent` will set the max number of Builds you would like to see, if not set this will default to 10
|
||||
|
||||
### Azure Repos Component
|
||||
|
||||
To get the Azure Repos component working you'll need to do the following two steps:
|
||||
|
||||
1. First we need to add the @backstage/plugin-azure-devops package to your frontend app:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-azure-devops
|
||||
```
|
||||
|
||||
2. Second we need to add the `EntityAzurePullRequestsContent` extension to the entity page in your app:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityAzurePullRequestsContent,
|
||||
isAzureDevOpsAvailable,
|
||||
} from '@backstage/plugin-azure-devops';
|
||||
|
||||
// For example in the Service section
|
||||
const serviceEntityPage = (
|
||||
<EntityLayout>
|
||||
// ...
|
||||
<EntityLayout.Route if={isAzureDevOpsAvailable} path="/pull-requests" title="Pull Requests">
|
||||
<EntityAzurePullRequestsContent defaultLimit={25} />
|
||||
</EntityLayout.Route>
|
||||
// ...
|
||||
</EntityLayout>
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
- You'll need to add the `EntityLayout.Route` above from step 2 to all the entity sections you want to see Pull Requests in. For example if you wanted to see Pull Requests when looking at Website entities then you would need to add this to the `websiteEntityPage` section.
|
||||
- The `if` prop is optional on the `EntityLayout.Route`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
||||
- The `defaultLimit` property on the `EntityAzurePullRequestsContent` will set the max number of Pull Requests you would like to see, if not set this will default to 10
|
||||
|
||||
### Git Tags Component
|
||||
|
||||
To get the Git Tags component working you'll need to do the following two steps:
|
||||
|
||||
1. First we need to add the @backstage/plugin-azure-devops package to your frontend app:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-azure-devops
|
||||
```
|
||||
|
||||
2. Second we need to add the `EntityAzureGitTagsContent` extension to the entity page in your app:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityAzureGitTagsContent,
|
||||
isAzureDevOpsAvailable,
|
||||
} from '@backstage/plugin-azure-devops';
|
||||
|
||||
// For example in the Service section
|
||||
const serviceEntityPage = (
|
||||
<EntityLayout>
|
||||
// ...
|
||||
<EntityLayout.Route if={isAzureDevOpsAvailable} path="/git-tags" title="Git Tags">
|
||||
<EntityAzureGitTagsContent />
|
||||
</EntityLayout.Route>
|
||||
// ...
|
||||
</EntityLayout>
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
- You'll need to add the `EntityLayout.Route` above from step 2 to all the entity sections you want to see Git Tags in. For example if you wanted to see Git Tags when looking at Website entities then you would need to add this to the `websiteEntityPage` section.
|
||||
- The `if` prop is optional on the `EntityLayout.Route`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
||||
|
||||
### Git README
|
||||
|
||||
To get the README component working you'll need to do the following two steps:
|
||||
|
||||
1. First we need to add the @backstage/plugin-azure-devops package to your frontend app:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-azure-devops
|
||||
```
|
||||
|
||||
2. Second we need to add the `EntityAzureReadmeCard` extension to the entity page in your app:
|
||||
|
||||
```tsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import {
|
||||
EntityAzureReadmeCard,
|
||||
isAzureDevOpsAvailable,
|
||||
} from '@backstage/plugin-azure-devops';
|
||||
|
||||
// As it is a card, you can customize it the way you prefer
|
||||
// For example in the Service section
|
||||
|
||||
const overviewContent = (
|
||||
<Grid container spacing={3} alignItems="stretch">
|
||||
<EntitySwitch>
|
||||
<EntitySwitch.Case if={isAzureDevOpsAvailable}>
|
||||
<Grid item md={6}>
|
||||
...
|
||||
</Grid>
|
||||
<Grid item md={6}>
|
||||
<EntityAzureReadmeCard maxHeight={350} />
|
||||
</Grid>
|
||||
</EntitySwitch.Case>
|
||||
</EntitySwitch>
|
||||
</Grid>
|
||||
);
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
- You'll need to add the `EntitySwitch.Case` above from step 2 to all the entity sections you want to see Readme in. For example if you wanted to see Readme when looking at Website entities then you would need to add this to the `websiteEntityPage` section.
|
||||
- The `if` prop is optional on the `EntitySwitch.Case`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
||||
- The `maxHeight` property on the `EntityAzureReadmeCard` will set the maximum screen size you would like to see, if not set it will default to 100%
|
||||
|
||||
## Permission Framework
|
||||
|
||||
Azure DevOps plugin supports the permission framework for PRs, GitTags, Pipelines and Readme features.
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-azure-devops-common
|
||||
```
|
||||
|
||||
New Backend you can skip the below and proceed with [permission configuration](#configure-permission)
|
||||
|
||||
To enable permissions for the legacy backend system in `packages/backend/src/plugins/azure-devops.ts` add the following.
|
||||
|
||||
```diff
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
return createRouter({
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
reader: env.reader,
|
||||
+ permissions: env.permissions,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
### Configure Permission
|
||||
|
||||
To apply the permission rules add the following in `packages/backend/src/plugins/permissions.ts`.
|
||||
|
||||
> Note: the following is just an example of how you might want to setup permissions, as an Adopter you can configure this to fit your needs. Also all the permissions are Resource Permissions as they work with an Entity with the exception of `azureDevOpsPullRequestDashboardReadPermission`.
|
||||
|
||||
```diff
|
||||
|
||||
+ import {
|
||||
+ azureDevOpsPullRequestReadPermission,
|
||||
+ azureDevOpsPipelineReadPermission,
|
||||
+ azureDevOpsGitTagReadPermission,
|
||||
+ azureDevOpsReadmeReadPermission,
|
||||
+ azureDevOpsPullRequestDashboardReadPermission } from '@backstage/plugin-azure-devops-common';
|
||||
+ import {
|
||||
+ AuthorizeResult,
|
||||
+ PolicyDecision,
|
||||
+ isPermission,
|
||||
+ } from '@backstage/plugin-permission-common';
|
||||
+ import {
|
||||
+ catalogConditions,
|
||||
+ createCatalogConditionalDecision,
|
||||
+ } from '@backstage/plugin-catalog-backend/alpha';
|
||||
...
|
||||
async handle(
|
||||
request: PolicyQuery,
|
||||
user?: BackstageIdentityResponse,
|
||||
): Promise<PolicyDecision> {
|
||||
+ if ( isPermission(request.permission, azureDevOpsPullRequestReadPermission) ||
|
||||
+ isPermission(request.permission, azureDevOpsPipelineReadPermission) ||
|
||||
+ isPermission(request.permission, azureDevOpsGitTagReadPermission) ||
|
||||
+ isPermission(request.permission, azureDevOpsReadmeReadPermission)) {
|
||||
+ return createCatalogConditionalDecision(
|
||||
+ request.permission,
|
||||
+ catalogConditions.isEntityOwner({
|
||||
+ claims: user?.identity.ownershipEntityRefs ?? [],
|
||||
+ }),
|
||||
+ );
|
||||
+ }
|
||||
|
||||
+ if ( isPermission(request.permission, azureDevOpsPullRequestDashboardReadPermission) {
|
||||
+ return {
|
||||
+ result: AuthorizeResult.ALLOW,
|
||||
+ };
|
||||
+ }
|
||||
|
||||
return {
|
||||
result: AuthorizeResult.ALLOW,
|
||||
};
|
||||
}
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-devops` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-azure-devops",
|
||||
"version": "0.4.3",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-azure-devops"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -73,5 +74,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-azure-devops instead."
|
||||
}
|
||||
|
||||
@@ -1,137 +1,3 @@
|
||||
# Azure Sites Backend
|
||||
# Deprecated
|
||||
|
||||
Simple plugin that proxies requests to the Azure Portal API through Azure SDK JavaScript libraries.
|
||||
|
||||
_Inspired by [roadie.io AWS Lambda plugin](https://roadie.io/backstage/plugins/aws-lambda/)_
|
||||
|
||||
## Setup
|
||||
|
||||
The following sections will help you get the Azure Sites Backend plugin setup and running.
|
||||
|
||||
### Configuration
|
||||
|
||||
The Azure plugin requires the following YAML to be added to your app-config.yaml:
|
||||
|
||||
```yaml
|
||||
azureSites:
|
||||
domain:
|
||||
tenantId:
|
||||
clientId:
|
||||
clientSecret:
|
||||
allowedSubscriptions:
|
||||
- id:
|
||||
```
|
||||
|
||||
Configuration Details:
|
||||
|
||||
- `domain` can be found by visiting the [Directories + Subscriptions settings page](https://portal.azure.com/#settings/directory). Alternatively you can inspect the [Azure home](https://portal.azure.com/#home) URL - `https://portal.azure.com/#@<Your_Domain>/`.
|
||||
- `tenantId` can be found by visiting [Azure Directory Overview page](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade).
|
||||
- (Optional) `clientId` and `clientSecret` can be the same values you used for [Azure DevOps Backend](https://github.com/backstage/backstage/tree/master/plugins/azure-devops-backend) or [Azure Integration](https://backstage.io/docs/integrations/azure/org#app-registration) as long as this App Registration has permissions to read your function apps.
|
||||
- (Optional) `allowedSubscriptions` is an array of `id` that will be used to iterate over and look for the specified functions' app. `id` can be found the [Subscriptions page](https://portal.azure.com/#view/Microsoft_Azure_Billing/SubscriptionsBlade).
|
||||
|
||||
### Integrating
|
||||
|
||||
Here's how to get the backend plugin up and running:
|
||||
|
||||
#### Legacy Backend System
|
||||
|
||||
1. First we need to add the `@backstage/plugin-azure-sites-backend` package to your backend:
|
||||
|
||||
```sh
|
||||
# From the Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-azure-sites-backend
|
||||
```
|
||||
|
||||
2. Then we will create a new file named `packages/backend/src/plugins/azure-sites.ts`, and add the following to it:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createRouter,
|
||||
AzureSitesApi,
|
||||
} from '@backstage/plugin-azure-sites-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const catalogApi = new CatalogClient({ discoveryApi: env.discovery });
|
||||
return await createRouter({
|
||||
logger: env.logger,
|
||||
azureSitesApi: AzureSitesApi.fromConfig(env.config),
|
||||
permissions: env.permissions,
|
||||
catalogApi,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
3. Next we wire this into the overall backend router, edit `packages/backend/src/index.ts`:
|
||||
|
||||
```ts
|
||||
import azureSites from './plugins/azure-sites';
|
||||
|
||||
// Removed for clarity...
|
||||
|
||||
async function main() {
|
||||
// ...
|
||||
// Add this line under the other lines that follow the useHotMemoize pattern
|
||||
const azureSitesEnv = useHotMemoize(module, () =>
|
||||
createEnv('azure-sites'),
|
||||
);
|
||||
|
||||
// ...
|
||||
// Insert this line under the other lines that add their routers to apiRouter in the same way
|
||||
apiRouter.use('/azure-sites', await azureSites(azureSitesEnv));
|
||||
}
|
||||
```
|
||||
|
||||
4. Enable permissions and that the below is just an example policy that forbids anyone but the owner of the catalog entity to trigger actions towards a site tied to an entity, edit your `packages/backend/src/plugins/permission.ts`
|
||||
|
||||
```diff
|
||||
// packages/backend/src/plugins/permission.ts
|
||||
+ import { azureSitesActionPermission } from '@backstage/plugin-azure-sites-common';
|
||||
...
|
||||
class TestPermissionPolicy implements PermissionPolicy {
|
||||
- async handle(): Promise<PolicyDecision> {
|
||||
+ async handle(request: PolicyQuery, user?: BackstageIdentityResponse): Promise<PolicyDecision> {
|
||||
if (isPermission(request.permission, azureSitesActionPermission)) {
|
||||
return createCatalogConditionalDecision(
|
||||
request.permission,
|
||||
catalogConditions.isEntityOwner({
|
||||
claims: user?.identity.ownershipEntityRefs ?? [],
|
||||
}),
|
||||
);
|
||||
}
|
||||
...
|
||||
return {
|
||||
result: AuthorizeResult.ALLOW,
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
#### New Backend System
|
||||
|
||||
The Azure Sites 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-azure-sites-backend'));
|
||||
|
||||
// ...
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
#### Start Backed & Test
|
||||
|
||||
1. Now run `yarn start-backend` from the repo root.
|
||||
|
||||
2. Finally, open `http://localhost:7007/api/azure/health` in a browser, it should return `{"status":"ok"}`.
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-sites-backend` instead.
|
||||
|
||||
@@ -1,35 +1,39 @@
|
||||
{
|
||||
"name": "@backstage/plugin-azure-sites-backend",
|
||||
"version": "0.3.4",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
"backstage": {
|
||||
"role": "backend-plugin",
|
||||
"moved": "@backstage-community/plugin-azure-sites-backend"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "backend-plugin"
|
||||
},
|
||||
"keywords": [
|
||||
"backstage",
|
||||
"azure"
|
||||
],
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/backstage/backstage",
|
||||
"directory": "plugins/azure-sites-backend"
|
||||
},
|
||||
"keywords": [
|
||||
"backstage",
|
||||
"azure"
|
||||
"license": "Apache-2.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"start": "backstage-cli package start",
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"clean": "backstage-cli package clean",
|
||||
"lint": "backstage-cli package lint",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack"
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"start": "backstage-cli package start",
|
||||
"test": "backstage-cli package test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/arm-appservice": "^14.0.0",
|
||||
@@ -53,7 +57,5 @@
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@types/supertest": "^2.0.8"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
]
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-azure-sites-backend instead."
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Deprecated
|
||||
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-sites-common` instead.
|
||||
@@ -3,7 +3,8 @@
|
||||
"version": "0.1.3",
|
||||
"description": "Common functionalities for the azure plugin",
|
||||
"backstage": {
|
||||
"role": "common-library"
|
||||
"role": "common-library",
|
||||
"moved": "@backstage-community/plugin-azure-sites-common"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -42,5 +43,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^"
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-azure-sites-common instead."
|
||||
}
|
||||
|
||||
@@ -1,73 +1,3 @@
|
||||
# Azure Sites Plugin
|
||||
# Deprecated
|
||||
|
||||
Azure Sites (Apps & Functions) plugin support for a given entity. View the current status of the site, quickly jump to site's Overview page, or Log Stream page.
|
||||
|
||||

|
||||
|
||||
_Inspired by [roadie.io AWS Lamda plugin](https://roadie.io/backstage/plugins/aws-lambda/)_
|
||||
|
||||
## Features
|
||||
|
||||
- Azure overview table
|
||||
|
||||
## Plugin Setup
|
||||
|
||||
The following sections will help you get the Azure plugin setup and running
|
||||
|
||||
### Azure Sites Backend
|
||||
|
||||
You need to set up the [Azure Sites Backend plugin](https://github.com/backstage/backstage/tree/master/plugins/azure-sites-backend) before you move forward with any of these steps if you haven't already.
|
||||
|
||||
### Entity Annotation
|
||||
|
||||
To be able to use the Azure Sites plugin you need to add the following annotation to any entities you want to use it with:
|
||||
|
||||
```yaml
|
||||
azure.com/microsoft-web-sites: <name>
|
||||
```
|
||||
|
||||
`<name>` supports case-insensitive exact / partial value.
|
||||
|
||||
Example of Partial Matching:
|
||||
|
||||
Let's say you have a number of functions apps, spread out over different regions (and possibly different subscriptions), and they follow a naming convention:
|
||||
|
||||
```
|
||||
func-testapp-eu
|
||||
func-testapp-ca
|
||||
func-testapp-us
|
||||
```
|
||||
|
||||
The annotation you will use to have the three functions' app appear in the overview table would look like this:
|
||||
|
||||
```yaml
|
||||
azure.com/microsoft-web-sites: func-testapp
|
||||
```
|
||||
|
||||
### Install the component
|
||||
|
||||
1. Install the plugin
|
||||
|
||||
```sh
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-azure-sites
|
||||
```
|
||||
|
||||
2. Add widget component to your Backstage instance:
|
||||
|
||||
```ts
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import { EntityAzureSitesOverviewWidget, isAzureWebSiteNameAvailable } from '@backstage/plugin-azure-sites';
|
||||
|
||||
...
|
||||
|
||||
const serviceEntityPage = (
|
||||
<EntityLayout>
|
||||
//...
|
||||
<EntityLayout.Route if={e => Boolean(isAzureWebSiteNameAvailable(e))} path="/azure" title="Azure">
|
||||
<EntityAzureSitesOverviewWidget />
|
||||
</EntityLayout.Route>
|
||||
//...
|
||||
</EntityLayout>
|
||||
);
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-azure-sites` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-azure-sites",
|
||||
"version": "0.1.23",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-azure-sites"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -64,5 +65,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-azure-sites instead."
|
||||
}
|
||||
|
||||
@@ -1,186 +1,3 @@
|
||||
# Badges Backend
|
||||
# Deprecated
|
||||
|
||||
Backend plugin for serving badges to the `@backstage/plugin-badges` plugin.
|
||||
Default implementation uses
|
||||
[badge-maker](https://www.npmjs.com/package/badge-maker) for creating the
|
||||
badges, in SVG.
|
||||
|
||||
Currently, only entity badges are implemented. i.e. badges that may have entity
|
||||
specific information in them, and as such, are served from an entity specific
|
||||
endpoint.
|
||||
|
||||
## Installation
|
||||
|
||||
Install the `@backstage/plugin-badges-backend` package in your backend package:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-badges-backend
|
||||
```
|
||||
|
||||
Add the plugin using the following default setup for
|
||||
`src/plugins/badges.ts`:
|
||||
|
||||
```ts
|
||||
import {
|
||||
createRouter,
|
||||
createDefaultBadgeFactories,
|
||||
} from '@backstage/plugin-badges-backend';
|
||||
import { Router } from 'express';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
return await createRouter({
|
||||
config: env.config,
|
||||
discovery: env.discovery,
|
||||
badgeFactories: createDefaultBadgeFactories(),
|
||||
tokenManager: env.tokenManager,
|
||||
logger: env.logger,
|
||||
identity: env.identity,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
The `createDefaultBadgeFactories()` returns an object with badge factories to
|
||||
the badges-backend `createRouter()` to forward to the default badge builder. To
|
||||
customize the available badges, provide a custom set of badge factories. See
|
||||
further down for an example of a custom badge factories function.
|
||||
|
||||
Finally, you have to make the following changes in `src/index.ts`:
|
||||
|
||||
```ts
|
||||
// 1. import the plugin
|
||||
import badges from './plugins/badges';
|
||||
|
||||
...
|
||||
|
||||
const config = await loadBackendConfig({
|
||||
argv: process.argv,
|
||||
logger: rootLogger,
|
||||
});
|
||||
const createEnv = makeCreateEnv(config);
|
||||
|
||||
...
|
||||
// 2. Create a PluginEnvironment for the Badges plugin
|
||||
const badgesEnv = useHotMemoize(module, () => createEnv('badges'));
|
||||
|
||||
...
|
||||
|
||||
const apiRouter = Router();
|
||||
...
|
||||
// 3. Register the badges plugin in the router
|
||||
apiRouter.use('/badges', await badges(badgesEnv));
|
||||
...
|
||||
apiRouter.use(notFoundHandler());
|
||||
```
|
||||
|
||||
### New Backend System
|
||||
|
||||
The Badges 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-badges-backend'));
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
## Badge builder
|
||||
|
||||
Badges are created by classes implementing the `BadgeBuilder` type. The default
|
||||
badge builder uses badge factories to turn a `BadgeContext` into a `Badge` spec
|
||||
for the `badge-maker` to create the SVG image.
|
||||
|
||||
### Default badges
|
||||
|
||||
A set of default badge factories are defined in
|
||||
[badges.ts](https://github.com/backstage/backstage/tree/master/plugins/badges-backend/src/badges.ts)
|
||||
as examples.
|
||||
|
||||
Additional badges may be provided in your application by defining custom badge
|
||||
factories, and provide them to the badge builder.
|
||||
|
||||
### Custom badges
|
||||
|
||||
To provide custom badges, create a badge factories function, and use that when
|
||||
creating the badges backend router.
|
||||
|
||||
```ts
|
||||
import type { Badge, BadgeContext, BadgeFactories } from '@backstage/plugin-badges-backend';
|
||||
export const createMyCustomBadgeFactories = (): BadgeFactories => ({
|
||||
<custom-badge-id>: {
|
||||
createBadge: (context: BadgeContext): Badge | null => {
|
||||
// ...
|
||||
return {
|
||||
label: 'my-badge',
|
||||
message: 'custom stuff',
|
||||
// ...
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
// optional: include the default badges
|
||||
// ...createDefaultBadgeFactories(),
|
||||
});
|
||||
```
|
||||
|
||||
### Badge obfuscation
|
||||
|
||||
When you enable the obfuscation feature, the badges backend will obfuscate the entity names in the badge link. It's useful when you want your badges to be visible to the public, but you don't want to expose the entity names and also to protect your entity names from being enumerated.
|
||||
|
||||
To enable the obfuscation you need to activate the `obfuscation` feature in the `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
badges:
|
||||
obfuscate: true
|
||||
```
|
||||
|
||||
:warning: **Warning**: The only endpoint to be publicly available is the `/entity/:entityUuid/:badgeId` endpoint. The other endpoints are meant for trusted internal users and should not be publicly exposed.
|
||||
|
||||
> Note that you cannot use env vars to set the `obfuscate` value. It must be a boolean value and env vars are always strings.
|
||||
|
||||
## API
|
||||
|
||||
The badges backend api exposes two main endpoints for entity badges. The
|
||||
`/badges` prefix is arbitrary, and the default for the example backend.
|
||||
|
||||
### If obfuscation is disabled (default or apps.badges.obfuscate: false)
|
||||
|
||||
- `/badges/entity/:namespace/:kind/:name/badge-specs` List all defined badges
|
||||
for a particular entity, in json format. See
|
||||
[BadgeSpec](https://github.com/backstage/backstage/tree/master/plugins/badges/src/api/types.ts)
|
||||
from the frontend plugin for a type declaration.
|
||||
|
||||
- `/badges/entity/:namespace/:kind/:name/badge/:badgeId` Get the entity badge as
|
||||
an SVG image. If the `accept` request header prefers `application/json` the
|
||||
badge spec as JSON will be returned instead of the image.
|
||||
|
||||
### If obfuscation is enabled (apps.badges.obfuscate: true)
|
||||
|
||||
- `/badges/entity/:namespace/:kind/:name/obfuscated` Get the obfuscated `entity url`.
|
||||
|
||||
> Note that endpoint have a embedded authMiddleware to authenticate the user requesting this endpoint. _It meant to be called from the frontend plugin._
|
||||
|
||||
- `/badges/entity/:entityUuid/:badgeId` Get the entity badge as an SVG image. If
|
||||
the `accept` request header prefers `application/json` the badge spec as JSON
|
||||
will be returned instead of the image.
|
||||
|
||||
- `/badge/entity/:entityUuid/badge-specs` List all defined badges for a
|
||||
particular entity, in json format. See
|
||||
[BadgeSpec](https://github.com/backstage/backstage/tree/master/plugins/badges/src/api/types.ts)
|
||||
from the frontend plugin for a type declaration.
|
||||
|
||||
## Links
|
||||
|
||||
- [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/badges)
|
||||
- [The Backstage homepage](https://backstage.io)
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-badges-backend` instead.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"version": "0.4.0",
|
||||
"description": "A Backstage backend plugin that generates README badges for your entities",
|
||||
"backstage": {
|
||||
"role": "backend-plugin"
|
||||
"role": "backend-plugin",
|
||||
"moved": "@backstage-community/plugin-badges-backend"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -60,5 +61,6 @@
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/catalog-client": "workspace:^",
|
||||
"@backstage/cli": "workspace:^"
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-badges-backend instead."
|
||||
}
|
||||
|
||||
+2
-203
@@ -1,204 +1,3 @@
|
||||
# @backstage/plugin-badges
|
||||
# Deprecated
|
||||
|
||||
The badges plugin offers a set of badges that can be used outside of
|
||||
your backstage deployment, showing information related to data from
|
||||
the catalog, such as entity owner and lifecycle data for instance.
|
||||
|
||||
The available badges are setup in the `badges-backend` plugin, see
|
||||
link below for more details.
|
||||
|
||||
## Entity badges
|
||||
|
||||
To get markdown code for the entity badges, access the `Badges` context menu
|
||||
(three dots in the upper right corner) of an entity page like this:
|
||||
|
||||

|
||||
|
||||
This will popup a badges dialog showing all available badges for that entity like this:
|
||||
|
||||

|
||||
|
||||
## Badge obfuscation
|
||||
|
||||
The badges plugin supports obfuscating the badge URL to prevent it from being enumerated if the badges are used in a public context (like in Github repositories).
|
||||
|
||||
To enable obfuscation, set the `obfuscate` option to `true` in the `app.badges` section of your `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
badges:
|
||||
obfuscate: true
|
||||
```
|
||||
|
||||
Please note that if you have already set badges in your repositories and you activate the obfuscation you will need to update the badges in your repositories to use the new obfuscated URLs.
|
||||
|
||||
Please note that the backend part needs to be configured to support obfuscation. See the [backend plugin documentation](../badges-backend/README.md) for more details.
|
||||
|
||||
Also, you need to allow your frontend to access the configuration see <https://backstage.io/docs/conf/defining/#visibility> :
|
||||
|
||||
Example implementation would be in : `packages/app/src/config.d.ts`
|
||||
|
||||
```typescript
|
||||
export interface Config {
|
||||
app: {
|
||||
... some code
|
||||
badges: {
|
||||
/**
|
||||
* badges obfuscate
|
||||
* @visibility frontend
|
||||
*/
|
||||
obfuscate?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
then include in the `packages/app/package.json` :
|
||||
|
||||
```json
|
||||
"files": [
|
||||
"dist",
|
||||
"config.d.ts"
|
||||
],
|
||||
"configSchema": "config.d.ts",
|
||||
```
|
||||
|
||||
## Sample Badges
|
||||
|
||||
Here are some samples of badges for the `artists-lookup` service in the Demo Backstage site:
|
||||
|
||||
- Component: [](https://demo.backstage.io/catalog/default/component/artist-lookup)
|
||||
- Lifecycle: [](https://demo.backstage.io/catalog/default/component/artist-lookup)
|
||||
- Owner: [](https://demo.backstage.io/catalog/default/component/artist-lookup)
|
||||
- Docs: [](https://demo.backstage.io/catalog/default/component/artist-lookup/docs)
|
||||
|
||||
## Usage
|
||||
|
||||
### Install the package
|
||||
|
||||
Install the `@backstage/plugin-badges` package in your frontend app package:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-badges
|
||||
```
|
||||
|
||||
### Register plugin
|
||||
|
||||
This plugin requires explicit registration, so you will need to add it to your App's `plugins.ts` file:
|
||||
|
||||
```ts
|
||||
import { badgesPlugin } from '@backstage/plugin-badges';
|
||||
```
|
||||
|
||||
If you don't have a `plugins.ts` file see: [troubleshooting](#troubleshooting)
|
||||
|
||||
### Update your EntityPage
|
||||
|
||||
In your `EntityPage.tsx` file located in `packages\app\src\components\catalog` we'll need to make a few changes to get the Badges context menu added to the UI.
|
||||
|
||||
First we need to add the following imports:
|
||||
|
||||
```ts
|
||||
import { EntityBadgesDialog } from '@backstage/plugin-badges';
|
||||
import BadgeIcon from '@material-ui/icons/CallToAction';
|
||||
```
|
||||
|
||||
Next we'll update the React import that looks like this:
|
||||
|
||||
```ts
|
||||
import React from 'react';
|
||||
```
|
||||
|
||||
To look like this:
|
||||
|
||||
```ts
|
||||
import React, { ReactNode, useMemo, useState } from 'react';
|
||||
```
|
||||
|
||||
Then we have to add this chunk of code after all the imports but before any of the other code:
|
||||
|
||||
```ts
|
||||
const EntityLayoutWrapper = (props: { children?: ReactNode }) => {
|
||||
const [badgesDialogOpen, setBadgesDialogOpen] = useState(false);
|
||||
|
||||
const extraMenuItems = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: 'Badges',
|
||||
Icon: BadgeIcon,
|
||||
onClick: () => setBadgesDialogOpen(true),
|
||||
},
|
||||
];
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<EntityLayout UNSTABLE_extraContextMenuItems={extraMenuItems}>
|
||||
{props.children}
|
||||
</EntityLayout>
|
||||
<EntityBadgesDialog
|
||||
open={badgesDialogOpen}
|
||||
onClose={() => setBadgesDialogOpen(false)}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
The last step is to wrap all the entity pages in the `EntityLayoutWrapper` like this:
|
||||
|
||||
```diff
|
||||
const defaultEntityPage = (
|
||||
+ <EntityLayoutWrapper>
|
||||
<EntityLayout.Route path="/" title="Overview">
|
||||
{overviewContent}
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/docs" title="Docs">
|
||||
<EntityTechdocsContent />
|
||||
</EntityLayout.Route>
|
||||
|
||||
<EntityLayout.Route path="/todos" title="TODOs">
|
||||
<EntityTodoContent />
|
||||
</EntityLayout.Route>
|
||||
+ </EntityLayoutWrapper>
|
||||
);
|
||||
```
|
||||
|
||||
Note: the above only shows an example for the `defaultEntityPage` for a full example of this you can look at [this EntityPage](https://github.com/backstage/backstage/blob/1fd9e6f601cabe42af8eb20b5d200ad1988ba309/packages/app/src/components/catalog/EntityPage.tsx#L318)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you don't have a `plugins.ts` file, you can create it with the path `packages/app/src/plugins.ts` and then import it into your `App.tsx`:
|
||||
|
||||
```diff
|
||||
+ import * as plugins from './plugins';
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
+ plugins: Object.values(plugins),
|
||||
bindRoutes({ bind }) {
|
||||
/* ... */
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Or simply edit `App.tsx` with:
|
||||
|
||||
```diff
|
||||
+ import { badgesPlugin } from '@backstage/plugin-badges'
|
||||
|
||||
const app = createApp({
|
||||
apis,
|
||||
+ plugins: [badgesPlugin],
|
||||
bindRoutes({ bind }) {
|
||||
/* ... */
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Backend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/badges-backend)
|
||||
- [The Backstage homepage](https://backstage.io)
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-badges` instead.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"version": "0.2.58",
|
||||
"description": "A Backstage plugin that generates README badges for your entities",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-badges"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -52,5 +53,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-badges instead."
|
||||
}
|
||||
|
||||
@@ -1,52 +1,3 @@
|
||||
# Bazaar Backend
|
||||
# Deprecated
|
||||
|
||||
Welcome to the Bazaar backend plugin!
|
||||
|
||||
# Installation
|
||||
|
||||
## Install the package
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/backend add @backstage/plugin-bazaar-backend
|
||||
```
|
||||
|
||||
## Adding the plugin to your `packages/backend`
|
||||
|
||||
You'll need to add the plugin to the router in your `backend` package. You can do this by creating a file called `packages/backend/src/plugins/bazaar.ts`
|
||||
|
||||
```typescript
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { createRouter } from '@backstage/plugin-bazaar-backend';
|
||||
import { Router } from 'express';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
return await createRouter({
|
||||
logger: env.logger,
|
||||
config: env.config,
|
||||
database: env.database,
|
||||
identity: env.identity,
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
With the `bazaar.ts` router setup in place, add the router to `packages/backend/src/index.ts`:
|
||||
|
||||
```diff
|
||||
+ import bazaar from './plugins/bazaar';
|
||||
|
||||
async function main() {
|
||||
...
|
||||
const createEnv = makeCreateEnv(config);
|
||||
|
||||
const catalogEnv = useHotMemoize(module, () => createEnv('catalog'));
|
||||
+ const bazaarEnv = useHotMemoize(module, () => createEnv('bazaar'));
|
||||
|
||||
const apiRouter = Router();
|
||||
+ apiRouter.use('/bazaar', await bazaar(bazaarEnv));
|
||||
...
|
||||
apiRouter.use(notFoundHandler());
|
||||
|
||||
```
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-bazaar-backend` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-bazaar-backend",
|
||||
"version": "0.3.15",
|
||||
"backstage": {
|
||||
"role": "backend-plugin"
|
||||
"role": "backend-plugin",
|
||||
"moved": "@backstage-community/plugin-bazaar-backend"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -59,5 +60,6 @@
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "workspace:^",
|
||||
"@backstage/cli": "workspace:^"
|
||||
}
|
||||
},
|
||||
"deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-bazaar-backend instead."
|
||||
}
|
||||
|
||||
+2
-154
@@ -1,155 +1,3 @@
|
||||
# @backstage/plugin-bazaar
|
||||
# Deprecated
|
||||
|
||||
### What is the Bazaar?
|
||||
|
||||
The Bazaar is a place where teams can propose projects for cross-functional team development. Essentially, it’s a marketplace for internal projects suitable for [Inner Sourcing](https://en.wikipedia.org/wiki/Inner_source). By “Inner Sourcing,” we mean projects that are developed internally within a company but follow Open Source best practices.
|
||||
|
||||
### Why?
|
||||
|
||||
Many companies today have a high need to increase the ease of cross-team cooperation. In large organizations, engineers often have limited ways of discovering or announcing projects that could benefit from a wider development effort in terms of different expertise, experiences, and teams spread across the organization. With no good way to find these existing internal projects to join, the possibility of working with Inner Sourcing practices suffers.
|
||||
|
||||
### How?
|
||||
|
||||
The Bazaar allows engineers and teams to open up and announce their new and exciting projects for transparent cooperation in other parts of larger organizations. The Bazaar ensures that new Inner Sourcing-friendly projects gain visibility through Backstage and a way for interested engineers to show their interest and, in the future, contribute with their specific skill set. The Bazaar also provides an easy way to manage, catalog, and browse these Inner Sourcing-friendly projects and components.
|
||||
|
||||
# Note
|
||||
|
||||
You will **need** to also perform the installation instructions in [Bazaar Backend](https://github.com/backstage/backstage/tree/master/plugins/bazaar-backend) in order for this plugin to work.
|
||||
|
||||
## Getting Started
|
||||
|
||||
First install the plugin into your app:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-bazaar
|
||||
```
|
||||
|
||||
Modify your app routes in `packages/app/src/App.tsx` to include the `Bazaar` component exported from the plugin, for example:
|
||||
|
||||
```diff
|
||||
+ import { BazaarPage } from '@backstage/plugin-bazaar';
|
||||
|
||||
const routes = (
|
||||
|
||||
<FlatRoutes>
|
||||
...
|
||||
+ <Route path="bazaar" element={<BazaarPage />} />
|
||||
{/* other routes... */}
|
||||
|
||||
```
|
||||
|
||||
`BazaarPage` can be given the optional properties `fullHeight` and `fullWidth` which are used to adjust the cards styling to fit more or less on the page as required (both default to `true`).
|
||||
|
||||
Add a **Bazaar icon** to the Sidebar to easily access the Bazaar. In `packages/app/src/components/Root.tsx` add:
|
||||
|
||||
```diff
|
||||
+ import StorefrontIcon from '@material-ui/icons/Storefront';
|
||||
|
||||
<SidebarDivider />
|
||||
<SidebarScrollWrapper>
|
||||
+ <SidebarItem icon={StorefrontIcon} to="bazaar" text="Bazaar" />
|
||||
{/* ...other sidebar-items */}
|
||||
```
|
||||
|
||||
Add a **Bazaar card** to the overview tab on the `packages/app/src/components/catalog/EntityPage.tsx` add:
|
||||
|
||||
```diff
|
||||
+ import { EntityBazaarInfoCard, isBazaarAvailable } from '@backstage/plugin-bazaar';
|
||||
|
||||
const overviewContent = (
|
||||
|
||||
<Grid item md={8} xs={12}>
|
||||
<EntityAboutCard variant="gridItem" />
|
||||
</Grid>
|
||||
+ <EntitySwitch>
|
||||
+ <EntitySwitch.Case if={isBazaarAvailable}>
|
||||
+ <Grid item sm={6}>
|
||||
+ <EntityBazaarInfoCard />
|
||||
+ </Grid>
|
||||
+ </EntitySwitch.Case>
|
||||
+ </EntitySwitch>
|
||||
|
||||
{/* ...other entity-cards */}
|
||||
```
|
||||
|
||||
Add a **Bazaar overview card** to the homepage that displays either the latest projects or random projects. In `packages/app/src/components/home/HomePage.tsx` add:
|
||||
|
||||
```diff
|
||||
+ import { BazaarOverviewCard } from '@backstage/plugin-bazaar';
|
||||
|
||||
export const homePage = (
|
||||
|
||||
<Page themeId="home">
|
||||
<Content>
|
||||
<Grid container spacing={3}>
|
||||
|
||||
+ <Grid item xs={12} md={6}>
|
||||
+ <BazaarOverviewCard order='latest'/>
|
||||
+ </Grid>
|
||||
|
||||
+ <Grid item xs={12} >
|
||||
+ <BazaarOverviewCard title='My Orgs Projects' order='random' fullWidth fullHeight />
|
||||
+ </Grid>
|
||||
|
||||
{/* ...other homepage items */}
|
||||
```
|
||||
|
||||
The property `title` is optional and can be used to customize the title in the card header. If no title is submitted the default titles `Bazaar Random Projects` or `Bazaar Latest Projects` are displayed.
|
||||
|
||||
The properties `fullHeight` and `fullWidth` are also optional and can be used to adjust the cards styling.
|
||||
|
||||
# How does the Bazaar work?
|
||||
|
||||
### Layout
|
||||
|
||||
The latest modified Bazaar projects are displayed in the Bazaar landing page, located at the Bazaar icon in the sidebar. Each project is represented as a card containing its most relevant data to give an overview of the project. It is also possible to sort in alphabetical order or on the number of members. Here you can also search or add project to the Bazaar.
|
||||
|
||||

|
||||
|
||||
The "BazaarOverviewCard" can be displayed in Backstage homepage.
|
||||
|
||||

|
||||
|
||||
### Workflow
|
||||
|
||||
To add a project to the bazaar, simply click on the `add-project` button and fill in the form.
|
||||
|
||||
The following fields are mandatory:
|
||||
|
||||
- title - title of the project
|
||||
- description - present your idea and what skills you are looking for
|
||||
- status - whether or not the project has started
|
||||
- size - small, medium or large
|
||||
- responsible - main contact person of the project
|
||||
|
||||
The other fields are:
|
||||
|
||||
- project - link Bazaar project to existing entity in the catalog
|
||||
- community link - link to where the project members can communicate, e.g. Teams or Discord link
|
||||
- docs link - link to visit the documentation of the project
|
||||
- start date
|
||||
- end date
|
||||
|
||||
When clicking on a Bazaar project a card containing the Bazaar information will show up. If the Bazaar project is linked to an entity, the card is also visible on that entity's EntityPage. From that card it is possible to either link or unlink an entity to a project, edit or delete the project and join the project if it seems interesting to you. Once you have joined a project, you will get access to the community link if it exists.
|
||||
|
||||

|
||||
|
||||
## Future work and ideas
|
||||
|
||||
- Workflow
|
||||
|
||||
- Make it possible for multiple Bazaar project to link to the same catalog entity
|
||||
|
||||
- Bazaar landing page
|
||||
|
||||
- Add a tab 'My page', where your personal data is displayed. For example: your projects and its latest activities etc.
|
||||
|
||||
- Bazaar tab on the EntityPage
|
||||
|
||||
- Fill Bazaar-tab with more content, for example images and achievements
|
||||
- Show all the members that have joined the project
|
||||
|
||||
- Dialogues
|
||||
|
||||
- Extend the dialogue for adding a project with more fields, e.g. the possibility to add images
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-bazaar` instead.
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "@backstage/plugin-bazaar",
|
||||
"version": "0.2.26",
|
||||
"backstage": {
|
||||
"role": "frontend-plugin"
|
||||
"role": "frontend-plugin",
|
||||
"moved": "@backstage-community/plugin-bazaar"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -59,5 +60,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-bazaar instead."
|
||||
}
|
||||
|
||||
@@ -1,53 +1,3 @@
|
||||
# Bitrise
|
||||
# Deprecated
|
||||
|
||||
Welcome to the Bitrise plugin!
|
||||
|
||||
- View recent Bitrise Builds for a Bitrise application
|
||||
- Download build artifacts
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-bitrise
|
||||
```
|
||||
|
||||
Bitrise Plugin exposes an entity tab component named `EntityBitriseContent`. You can include it in the
|
||||
[`EntityPage.tsx`](https://github.com/backstage/backstage/blob/master/packages/app/src/components/catalog/EntityPage.tsx)`:
|
||||
|
||||
```tsx
|
||||
// At the top imports
|
||||
import { EntityBitriseContent } from '@backstage/plugin-bitrise';
|
||||
|
||||
// Farther down at the website declaration
|
||||
const websiteEntityPage = (
|
||||
<EntityLayout>
|
||||
{/* Place the following section where you want the tab to appear */}
|
||||
<EntityLayout.Route path="/bitrise" title="Bitrise">
|
||||
<EntityBitriseContent />
|
||||
</EntityLayout.Route>
|
||||
```
|
||||
|
||||
Your plugin should now appear as a tab at the top of entity pages, particularly for `website` component types.
|
||||
However, it alerts you to a missing `bitrise.io/app` annotation.
|
||||
|
||||
Add the annotation to your component [catalog-info.yaml](https://github.com/backstage/backstage/blob/master/catalog-info.yaml) as shown in the highlighted example below:
|
||||
|
||||
```yaml
|
||||
metadata:
|
||||
annotations:
|
||||
bitrise.io/app: '<THE NAME OF THE BITRISE APP>'
|
||||
```
|
||||
|
||||
The plugin requires to configure a Bitrise API proxy with a `BITRISE_AUTH_TOKEN` for authentication in the [app-config.yaml](https://github.com/backstage/backstage/blob/master/app-config.yaml):
|
||||
|
||||
```yaml
|
||||
proxy:
|
||||
'/bitrise':
|
||||
target: 'https://api.bitrise.io/v0.1'
|
||||
allowedMethods: ['GET']
|
||||
headers:
|
||||
Authorization: ${BITRISE_AUTH_TOKEN}
|
||||
```
|
||||
|
||||
Learn how to generate a new Bitrise token at https://devcenter.bitrise.io/api/authentication.
|
||||
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-bitrise` instead.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user