diff --git a/.changeset/beige-queens-crash.md b/.changeset/beige-queens-crash.md new file mode 100644 index 0000000000..6253717673 --- /dev/null +++ b/.changeset/beige-queens-crash.md @@ -0,0 +1,13 @@ +--- +'@backstage/create-app': patch +--- + +Optimized the `yarn install` step in the backend `Dockerfile`. + +To apply these changes to an existing app, make the following changes to `packages/backend/Dockerfile`: + +Replace the `RUN yarn install ...` line with the following: + +```bash +RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)" +``` diff --git a/.changeset/chilly-chefs-protect.md b/.changeset/chilly-chefs-protect.md new file mode 100644 index 0000000000..22e2ea9b7e --- /dev/null +++ b/.changeset/chilly-chefs-protect.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-api-docs': patch +--- + +Update swagger-ui-react to 3.37.2 diff --git a/.changeset/cost-insights-cyan-nails-film.md b/.changeset/cost-insights-cyan-nails-film.md new file mode 100644 index 0000000000..69e21d87fe --- /dev/null +++ b/.changeset/cost-insights-cyan-nails-film.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-cost-insights': patch +--- + +Add breakdown view to the Cost Overview panel diff --git a/.changeset/famous-items-travel.md b/.changeset/famous-items-travel.md new file mode 100644 index 0000000000..a0aa02732d --- /dev/null +++ b/.changeset/famous-items-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +Update URL auth format for Gitlab clone diff --git a/.changeset/four-plants-happen.md b/.changeset/four-plants-happen.md new file mode 100644 index 0000000000..b273d8ec41 --- /dev/null +++ b/.changeset/four-plants-happen.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-sentry': patch +'@backstage/plugin-welcome': patch +--- + +Refactor route registration to remove deprecating code diff --git a/.changeset/grumpy-crews-build.md b/.changeset/grumpy-crews-build.md new file mode 100644 index 0000000000..502210c257 --- /dev/null +++ b/.changeset/grumpy-crews-build.md @@ -0,0 +1,9 @@ +--- +'@backstage/config-loader': minor +--- + +Fix typo of "visibility" in config schema reference + +If you have defined a config element named `visiblity`, you +will need to fix the spelling to `visibility`. For more info, +see https://backstage.io/docs/conf/defining#visibility. diff --git a/.changeset/light-bulldogs-guess.md b/.changeset/light-bulldogs-guess.md new file mode 100644 index 0000000000..d7b5a5aef5 --- /dev/null +++ b/.changeset/light-bulldogs-guess.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Allow the `backend.listen.port` config to be both a number or a string. diff --git a/.changeset/light-nails-crash.md b/.changeset/light-nails-crash.md new file mode 100644 index 0000000000..c7791d1027 --- /dev/null +++ b/.changeset/light-nails-crash.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Bump versions of `esbuild` and `rollup-plugin-esbuild` diff --git a/.changeset/new-nails-thank.md b/.changeset/new-nails-thank.md new file mode 100644 index 0000000000..4fc7ccac68 --- /dev/null +++ b/.changeset/new-nails-thank.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-proxy-backend': patch +--- + +Filter the headers that are sent from the proxied-targed back to the frontend to not forwarded unwanted authentication or +monitoring contexts from other origins (like `Set-Cookie` with e.g. a google analytics context). The implementation reuses +the `allowedHeaders` configuration that now controls both directions `frontend->target` and `target->frontend`. diff --git a/.changeset/perfect-dryers-sell.md b/.changeset/perfect-dryers-sell.md new file mode 100644 index 0000000000..e1c5592162 --- /dev/null +++ b/.changeset/perfect-dryers-sell.md @@ -0,0 +1,13 @@ +--- +'@backstage/create-app': patch +--- + +Removed `"resolutions"` entry for `esbuild` in the root `package.json` in order to use the version specified by `@backstage/cli`. + +To apply this change to an existing app, remove the following from your root `package.json`: + +```json +"resolutions": { + "esbuild": "0.6.3" +}, +``` diff --git a/.changeset/slow-insects-fail.md b/.changeset/slow-insects-fail.md new file mode 100644 index 0000000000..a07e025f34 --- /dev/null +++ b/.changeset/slow-insects-fail.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Add [API docs plugin](https://github.com/backstage/backstage/tree/master/plugins/api-docs) to new apps being created through the CLI. diff --git a/.changeset/smart-turkeys-bathe.md b/.changeset/smart-turkeys-bathe.md new file mode 100644 index 0000000000..5f429b5b37 --- /dev/null +++ b/.changeset/smart-turkeys-bathe.md @@ -0,0 +1,28 @@ +--- +'@backstage/plugin-catalog-backend': minor +'@backstage/plugin-catalog-import': minor +'@backstage/catalog-model': patch +'@backstage/plugin-scaffolder': patch +--- + +Add Analyze location endpoint to catalog backend. Add catalog-import plugin and replace import-component with it. To start using Analyze location endpoint, you have add it to the `createRouter` function options in the `\backstage\packages\backend\src\plugins\catalog.ts` file: + +```ts +export default async function createPlugin(env: PluginEnvironment) { + const builder = new CatalogBuilder(env); + const { + entitiesCatalog, + locationsCatalog, + higherOrderOperation, + locationAnalyzer, //<-- + } = await builder.build(); + + return await createRouter({ + entitiesCatalog, + locationsCatalog, + higherOrderOperation, + locationAnalyzer, //<-- + logger: env.logger, + }); +} +``` diff --git a/.changeset/sour-eels-dream.md b/.changeset/sour-eels-dream.md new file mode 100644 index 0000000000..75b9fb3c8d --- /dev/null +++ b/.changeset/sour-eels-dream.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Gracefully handle missing codeowners. + +The CodeOwnersProcessor now also takes a logger as a parameter. diff --git a/.changeset/stupid-taxis-sneeze.md b/.changeset/stupid-taxis-sneeze.md new file mode 100644 index 0000000000..d8e0fb130a --- /dev/null +++ b/.changeset/stupid-taxis-sneeze.md @@ -0,0 +1,7 @@ +--- +'@backstage/cli': minor +'@backstage/plugin-cost-insights': patch +--- + +sort product panels and navigation menu by greatest cost +update tsconfig.json to use ES2020 api diff --git a/.changeset/tidy-actors-repair.md b/.changeset/tidy-actors-repair.md new file mode 100644 index 0000000000..4869400556 --- /dev/null +++ b/.changeset/tidy-actors-repair.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Use type EntityName from catalog-model for entities diff --git a/.changeset/twenty-trees-travel.md b/.changeset/twenty-trees-travel.md new file mode 100644 index 0000000000..7f65084320 --- /dev/null +++ b/.changeset/twenty-trees-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Use the OWNED_BY relation and compare it to the users MEMBER_OF relation. The user entity is searched by name, based on the userId of the identity. diff --git a/.changeset/weak-roses-search.md b/.changeset/weak-roses-search.md new file mode 100644 index 0000000000..9f5074ce48 --- /dev/null +++ b/.changeset/weak-roses-search.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-proxy-backend': patch +--- + +Add configuration schema for the commonly used properties diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index a0841fe7d0..7f889392ac 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -230,3 +230,4 @@ yaml Zalando Zhou Zolotusky +zoomable diff --git a/.yarnrc b/.yarnrc index 6b56b971d7..4cdaac2408 100644 --- a/.yarnrc +++ b/.yarnrc @@ -6,4 +6,4 @@ registry "https://registry.npmjs.org/" disable-self-update-check true lastUpdateCheck 1580389148099 yarn-path ".yarn/releases/yarn-1.22.1.js" -network-timeout 600000 +network-timeout 300000 diff --git a/app-config.yaml b/app-config.yaml index 66e16506b9..3b476981e4 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -38,7 +38,7 @@ proxy: headers: Authorization: $env: TRAVISCI_AUTH_TOKEN - travis-api-version: 3 + travis-api-version: '3' '/newrelic/apm/api': target: https://api.newrelic.com/v2 diff --git a/docs/features/techdocs/architecture.md b/docs/features/techdocs/architecture.md index 01497b31bc..f502b3836e 100644 --- a/docs/features/techdocs/architecture.md +++ b/docs/features/techdocs/architecture.md @@ -9,7 +9,7 @@ description: Documentation on TechDocs Architecture When you deploy Backstage (with TechDocs enabled by default), you get a basic out-of-the box experience. -![TechDocs Architecture diagram](../../assets/techdocs/architecture-basic.drawio.svg) +TechDocs Architecture diagram > Note: See below for our recommended deployment architecture which takes care > of stability, scalability and speed. @@ -43,7 +43,7 @@ channel to talk about it. This is how we recommend deploying TechDocs in production environment. -![TechDocs Architecture diagram](../../assets/techdocs/architecture-recommended.drawio.svg) +TechDocs Architecture diagram The key difference in the recommended deployment approach is where the docs are built. diff --git a/docs/getting-started/configure-app-with-plugins.md b/docs/getting-started/configure-app-with-plugins.md index 1d02f147c1..042d8964ca 100644 --- a/docs/getting-started/configure-app-with-plugins.md +++ b/docs/getting-started/configure-app-with-plugins.md @@ -6,7 +6,53 @@ description: Documentation on How Configuring App with plugins ## Adding existing plugins to your app -Coming soon! +The following steps assume that you have created a new Backstage app and want to +add an existing plugin to it. We are using the +[CircleCI](https://github.com/backstage/backstage/blob/master/plugins/circleci/README.md) +plugin in this example. + +1. Add the plugin's NPM package to the repo: + +```bash +yarn add @backstage/plugin-circleci +``` + +2. Add the plugin itself: + +```js +// packages/app/src/plugins.ts +export { plugin as Circleci } from '@backstage/plugin-circleci'; +``` + +3. Register the plugin router: + +```jsx +// packages/app/src/components/catalog/EntityPage.tsx + +import { Router as CircleCIRouter } from '@backstage/plugin-circleci'; + +// Then somewhere inside +} +/>; +``` + +Note that stand-alone plugins that are not "attached" to the Software Catalog +would be added outside the `EntityPage`. + +4. [Optional] Add proxy config: + +```yaml +// app-config.yaml +proxy: + '/circleci/api': + target: https://circleci.com/api/v1.1 + headers: + Circle-Token: + $env: CIRCLECI_AUTH_TOKEN +``` ### Adding a plugin page to the Sidebar diff --git a/docs/plugins/proxying.md b/docs/plugins/proxying.md index f55b4d9229..f2d7d3c12a 100644 --- a/docs/plugins/proxying.md +++ b/docs/plugins/proxying.md @@ -52,19 +52,7 @@ configuration will lead to the proxy acting on backend requests to The value inside each route is either a simple URL string, or an object on the format accepted by -[http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware). It -is also possible to limit the forwarded HTTP methods with the configuration -`allowedMethods`, for example `allowedMethods: ['GET']` to enforce read-only -access. - -By default, the proxy will only forward safe HTTP request headers to the target. -Those are based on the headers that are considered safe for CORS and includes -headers like `content-type` or `last-modified`, as well as all headers that are -set by the proxy. If the proxy should forward other headers like -`authorization`, this must be enabled by the `allowedHeaders` config, for -example `allowedHeaders: ['Authorization']`. This should help to not -accidentally forward confidential headers (`cookie`, `X-Auth-Request-User`) to -third-parties. +[http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware). If the value is a string, it is assumed to correspond to: @@ -85,3 +73,22 @@ except with the following caveats for convenience: `'^/api/proxy/larger-example/v1/': '/'` is added. That means that a request to `/api/proxy/larger-example/v1/some/path` will be translated to a request to `http://larger.example.com:8080/svc.v1/some/path`. + +There are also additional settings: + +- `allowedMethods`: Limit the forwarded HTTP methods. For example + `allowedMethods: ['GET']` enforces read-only access. +- `allowedHeaders`: A list of headers that should be forwarded to and received + from the target. + +By default, the proxy will only forward safe HTTP request headers to the target. +Those are based on the headers that are considered safe for CORS and includes +headers like `content-type` or `last-modified`, as well as all headers that are +set by the proxy. If the proxy should forward other headers like +`authorization`, this must be enabled by the `allowedHeaders` config, for +example `allowedHeaders: ['Authorization']`. This should help to not +accidentally forward confidential headers (`cookie`, `X-Auth-Request-User`) to +third-parties. + +The same logic applies to headers that are sent from the target back to the +frontend. diff --git a/docs/reference/createPlugin.md b/docs/reference/createPlugin.md index 45e3303124..4a58a5ecdc 100644 --- a/docs/reference/createPlugin.md +++ b/docs/reference/createPlugin.md @@ -4,7 +4,7 @@ title: createPlugin description: Documentation on createPlugin --- -Taking a plugin config as argument and returns a new plugin. +Takes a plugin config as an argument and returns a new plugin. ## Plugin Config @@ -28,18 +28,22 @@ type PluginHooks = { ### Creating a basic plugin -Showcasing adding multiple routes, a feature flag and a redirect. +Showcasing adding a route and a feature flag. ```jsx -import { createPlugin } from '@backstage/core'; +import { createPlugin, createRouteRef } from '@backstage/core'; import ExampleComponent from './components/ExampleComponent'; +export const rootRouteRef = createRouteRef({ + path: '/new-plugin', + title: 'New Plugin', +}); + export default createPlugin({ id: 'new-plugin', register({ router, featureFlags }) { + router.addRoute(rootRouteRef, ExampleComponent); featureFlags.register('enable-example-component'); - - router.registerRoute('/new-plugin', ExampleComponent); }, }); ``` diff --git a/microsite/README.md b/microsite/README.md index d244caa22a..9589def3e3 100644 --- a/microsite/README.md +++ b/microsite/README.md @@ -204,3 +204,8 @@ For more information about custom pages, click [here](https://docusaurus.io/docs # Full Documentation Full documentation can be found on the [website](https://docusaurus.io/). + +## Additional notes + +- If you want to make images zoomable on click, add the `data-zoomable` attribute to your `img` element. + - In a docs or blog `.md` file, convert `![This is image](/microsite/static/img/code.png)` syntax to `This is image` diff --git a/microsite/data/plugins/kubernetes.yaml b/microsite/data/plugins/kubernetes.yaml new file mode 100644 index 0000000000..3134edf858 --- /dev/null +++ b/microsite/data/plugins/kubernetes.yaml @@ -0,0 +1,12 @@ +--- +title: Kubernetes +author: Spotify +authorUrl: https://github.com/spotify +category: Kubernetes +description: Surfaces components in a Kubernetes container orchestration environment into the Backstage catalog. +documentation: https://github.com/backstage/backstage/tree/master/plugins/kubernetes +iconUrl: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.png +npmPackageName: '@backstage/plugin-kubernetes' +tags: + - kubernetes + - k8s diff --git a/microsite/package.json b/microsite/package.json index 3b5ab2eeb4..6be0579475 100644 --- a/microsite/package.json +++ b/microsite/package.json @@ -17,7 +17,7 @@ "@spotify/prettier-config": "^9.0.0", "docusaurus": "^2.0.0-alpha.66", "js-yaml": "^3.14.0", - "prettier": "^2.2.0" + "prettier": "^2.2.1" }, "prettier": "@spotify/prettier-config" } diff --git a/microsite/siteConfig.js b/microsite/siteConfig.js index 6e8f8edddf..517cac2496 100644 --- a/microsite/siteConfig.js +++ b/microsite/siteConfig.js @@ -86,7 +86,11 @@ const siteConfig = { }, // Add custom scripts here that would be placed in