diff --git a/.changeset/beige-mangos-knock.md b/.changeset/beige-mangos-knock.md deleted file mode 100644 index d8723c3f87..0000000000 --- a/.changeset/beige-mangos-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-github-actions': patch ---- - -Show empty state only when workflow API call has completed diff --git a/.changeset/beige-news-cover.md b/.changeset/beige-news-cover.md deleted file mode 100644 index 70cebcd76f..0000000000 --- a/.changeset/beige-news-cover.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-app-api': patch ---- - -Deprecated `Auth0Auth`, pointing to using `OAuth2` directly instead. diff --git a/.changeset/brave-pugs-fold.md b/.changeset/brave-pugs-fold.md new file mode 100644 index 0000000000..f79867a719 --- /dev/null +++ b/.changeset/brave-pugs-fold.md @@ -0,0 +1,5 @@ +--- +'@backstage/test-utils': patch +--- + +Add new `MockConfigApi` as a more discoverable and leaner method for mocking configuration. diff --git a/.changeset/clean-wolves-jog.md b/.changeset/clean-wolves-jog.md new file mode 100644 index 0000000000..70ab23715f --- /dev/null +++ b/.changeset/clean-wolves-jog.md @@ -0,0 +1,5 @@ +--- +'@backstage/config': patch +--- + +The `ConfigReader#get` method now always returns a deep clone of the configuration data. diff --git a/.changeset/cold-steaks-flash.md b/.changeset/cold-steaks-flash.md new file mode 100644 index 0000000000..74cdcbdec2 --- /dev/null +++ b/.changeset/cold-steaks-flash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +fix: Register plugin to prioritise Component kind for entityRef diff --git a/.changeset/cold-toes-sniff.md b/.changeset/cold-toes-sniff.md new file mode 100644 index 0000000000..7fcfb54408 --- /dev/null +++ b/.changeset/cold-toes-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Adds a new GitHub credentials provider (DefaultGithubCredentialsProvider). It handles multiple app configurations. It looks up the app configuration based on the url. diff --git a/.changeset/config.json b/.changeset/config.json index 067dcb5f9f..283caa6ac4 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json", "changelog": "./backstage-changelog.js", "commit": false, - "linked": [["*"]], + "linked": [], "access": "public", "baseBranch": "master", "updateInternalDependencies": "patch", diff --git a/.changeset/dependabot-2af4c1d.md b/.changeset/dependabot-2af4c1d.md new file mode 100644 index 0000000000..116df9ccd3 --- /dev/null +++ b/.changeset/dependabot-2af4c1d.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-bazaar': patch +'@backstage/plugin-ilert': patch +--- + +build(deps): bump @date-io/luxon from 1.3.13 to 2.11.1 \ No newline at end of file diff --git a/.changeset/dry-boats-tap.md b/.changeset/dry-boats-tap.md new file mode 100644 index 0000000000..c69c4360b5 --- /dev/null +++ b/.changeset/dry-boats-tap.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-todo-backend': patch +--- + +Properly exported all referenced types diff --git a/.changeset/dull-bulldogs-laugh.md b/.changeset/dull-bulldogs-laugh.md new file mode 100644 index 0000000000..f49aa694b6 --- /dev/null +++ b/.changeset/dull-bulldogs-laugh.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Create a short delay when `` is opened diff --git a/.changeset/eight-rats-raise.md b/.changeset/eight-rats-raise.md new file mode 100644 index 0000000000..7bc2a07f04 --- /dev/null +++ b/.changeset/eight-rats-raise.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Add catalog permission rules. diff --git a/.changeset/fair-bikes-scream.md b/.changeset/fair-bikes-scream.md new file mode 100644 index 0000000000..decdfd3828 --- /dev/null +++ b/.changeset/fair-bikes-scream.md @@ -0,0 +1,28 @@ +--- +'@backstage/cli': minor +--- + +ESLint upgraded to version 8 and all it's plugins updated to newest version. + +If you use any custom plugins for ESLint please check compatibility. + +```diff +- "@typescript-eslint/eslint-plugin": "^v4.33.0", +- "@typescript-eslint/parser": "^v4.28.3", ++ "@typescript-eslint/eslint-plugin": "^5.9.0", ++ "@typescript-eslint/parser": "^5.9.0", +- "eslint": "^7.30.0", ++ "eslint": "^8.6.0", +- "eslint-plugin-import": "^2.20.2", +- "eslint-plugin-jest": "^24.1.0", +- "eslint-plugin-jsx-a11y": "^6.2.1", ++ "eslint-plugin-import": "^2.25.4", ++ "eslint-plugin-jest": "^25.3.4", ++ "eslint-plugin-jsx-a11y": "^6.5.1", +- "eslint-plugin-react": "^7.12.4", +- "eslint-plugin-react-hooks": "^4.0.0", ++ "eslint-plugin-react": "^7.28.0", ++ "eslint-plugin-react-hooks": "^4.3.0", +``` + +Please consult changelogs from packages if you find any problems. diff --git a/.changeset/five-cats-hunt.md b/.changeset/five-cats-hunt.md deleted file mode 100644 index cf3364a23a..0000000000 --- a/.changeset/five-cats-hunt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-backend': patch ---- - -Fixed the handling of optional locations so that the catalog no longer logs `NotFoundError`s for missing optional locations. diff --git a/.changeset/flat-shirts-watch.md b/.changeset/flat-shirts-watch.md new file mode 100644 index 0000000000..af6ff350da --- /dev/null +++ b/.changeset/flat-shirts-watch.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights': patch +--- + +Added possibility to pass customized title and description for the scorecards instead of using hardcoded ones. diff --git a/.changeset/four-ghosts-sniff.md b/.changeset/four-ghosts-sniff.md new file mode 100644 index 0000000000..9da0ab15ed --- /dev/null +++ b/.changeset/four-ghosts-sniff.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-plugin-api': minor +--- + +Removed the deprecated `OldIconComponent` type. diff --git a/.changeset/funny-llamas-yell.md b/.changeset/funny-llamas-yell.md new file mode 100644 index 0000000000..890caaa221 --- /dev/null +++ b/.changeset/funny-llamas-yell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-graphql': patch +--- + +Bump graphql versions diff --git a/.changeset/fuzzy-llamas-collect.md b/.changeset/fuzzy-llamas-collect.md new file mode 100644 index 0000000000..17ee925e56 --- /dev/null +++ b/.changeset/fuzzy-llamas-collect.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-ldap': patch +--- + +Make sure to avoid accidental data sharing / mutation of `set` values diff --git a/.changeset/good-fans-dance.md b/.changeset/good-fans-dance.md deleted file mode 100644 index a24b467c01..0000000000 --- a/.changeset/good-fans-dance.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-bazaar': patch -'@backstage/plugin-bazaar-backend': patch ---- - -made the linkage between a Bazaar project to a catalog Entity optional diff --git a/.changeset/healthy-toes-laugh.md b/.changeset/healthy-toes-laugh.md new file mode 100644 index 0000000000..e0db38e5e3 --- /dev/null +++ b/.changeset/healthy-toes-laugh.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-permission-node': patch +--- + +Add helpers for creating PermissionRules with inferred types diff --git a/.changeset/late-plums-act.md b/.changeset/late-plums-act.md new file mode 100644 index 0000000000..6822f40eeb --- /dev/null +++ b/.changeset/late-plums-act.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Allow a custom GithubCredentialsProvider to be passed to the GitHub processors. diff --git a/.changeset/lazy-gorillas-tell.md b/.changeset/lazy-gorillas-tell.md new file mode 100644 index 0000000000..672d8c221b --- /dev/null +++ b/.changeset/lazy-gorillas-tell.md @@ -0,0 +1,7 @@ +--- +'@backstage/core-plugin-api': minor +--- + +Removed previously deprecated exports: `PluginHooks`, `PluginOutput`, and `FeatureFlagOutput`. + +The deprecated `register` method of `PluginConfig` has been removed, as well as the deprecated `output` method of `BackstagePlugin`. diff --git a/.changeset/long-otters-promise.md b/.changeset/long-otters-promise.md new file mode 100644 index 0000000000..eecb97e8ac --- /dev/null +++ b/.changeset/long-otters-promise.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-catalog-backend-module-ldap': patch +'@backstage/plugin-catalog-backend-module-msgraph': patch +--- + +Clean up API report diff --git a/.changeset/mighty-llamas-hope.md b/.changeset/mighty-llamas-hope.md deleted file mode 100644 index 7ea87e50d0..0000000000 --- a/.changeset/mighty-llamas-hope.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Makes cookiecutter a default, but optional action based on if a containerRunner argument is passed in to createRouter or createBuiltinActions diff --git a/.changeset/nervous-hounds-attend.md b/.changeset/nervous-hounds-attend.md deleted file mode 100644 index b54eb5a688..0000000000 --- a/.changeset/nervous-hounds-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-backend': patch ---- - -Adding changes to create GitLab Merge Request using custom action diff --git a/.changeset/nervous-starfishes-report.md b/.changeset/nervous-starfishes-report.md new file mode 100644 index 0000000000..2ac4179a2c --- /dev/null +++ b/.changeset/nervous-starfishes-report.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': patch +--- + +Adds two new home components - CompanyLogo and Toolkit. diff --git a/.changeset/nice-seahorses-look.md b/.changeset/nice-seahorses-look.md deleted file mode 100644 index 9652898c54..0000000000 --- a/.changeset/nice-seahorses-look.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-plugin-api': patch ---- - -Deprecated `auth0AuthApiRef`, `oauth2ApiRef`, `oidcAuthApiRef`, `samlAuthApiRef`, and marked the rest of the auth `ApiRef`s as experimental. For more information on how to address the deprecations, see https://backstage.io/docs/api/deprecations#generic-auth-api-refs. diff --git a/.changeset/olive-points-flash.md b/.changeset/olive-points-flash.md new file mode 100644 index 0000000000..64b23419de --- /dev/null +++ b/.changeset/olive-points-flash.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Switch Webpack minification to use `esbuild` instead of `terser`. diff --git a/.changeset/org-ownershipcard-filteradded.md b/.changeset/org-ownershipcard-filteradded.md deleted file mode 100644 index cbd1475bb1..0000000000 --- a/.changeset/org-ownershipcard-filteradded.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-org': patch ---- - -Added `entityFilterKind` property for `EntityOwnershipCard` diff --git a/.changeset/pink-ladybugs-share.md b/.changeset/pink-ladybugs-share.md deleted file mode 100644 index 83f5b8b78a..0000000000 --- a/.changeset/pink-ladybugs-share.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/backend-common': patch ---- - -Each plugin now saves to a separate sqlite database file when `connection.filename` is provided in the sqlite config. -Any existing sqlite database files will be ignored. diff --git a/.changeset/pink-suns-walk.md b/.changeset/pink-suns-walk.md new file mode 100644 index 0000000000..1857b90811 --- /dev/null +++ b/.changeset/pink-suns-walk.md @@ -0,0 +1,25 @@ +--- +'@backstage/backend-common': patch +'@backstage/core-components': patch +'@backstage/create-app': patch +'@backstage/integration': patch +'@backstage/techdocs-common': patch +'@backstage/plugin-apache-airflow': patch +'@backstage/plugin-auth-backend': patch +'@backstage/plugin-azure-devops': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-code-coverage': patch +'@backstage/plugin-code-coverage-backend': patch +'@backstage/plugin-cost-insights': patch +'@backstage/plugin-fossa': patch +'@backstage/plugin-jenkins': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-search-backend-node': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-techdocs-backend': patch +--- + +Cleaned up API exports diff --git a/.changeset/plenty-eyes-brush.md b/.changeset/plenty-eyes-brush.md new file mode 100644 index 0000000000..354c216c3c --- /dev/null +++ b/.changeset/plenty-eyes-brush.md @@ -0,0 +1,60 @@ +--- +'@backstage/create-app': patch +--- + +Add permissions to create-app's PluginEnvironment + +`CatalogEnvironment` now has a `permissions` field, which means that a permission client must now be provided as part of `PluginEnvironment`. To apply these changes to an existing app, add the following to the `makeCreateEnv` function in `packages/backend/src/index.ts`: + +```diff + // packages/backend/src/index.ts + ++ import { ServerPermissionClient } from '@backstage/plugin-permission-node'; + + function makeCreateEnv(config: Config) { + ... ++ const permissions = ServerPerimssionClient.fromConfig(config, { ++ discovery, ++ tokenManager, ++ }); + + root.info(`Created UrlReader ${reader}`); + + return (plugin: string): PluginEnvironment => { + ... + return { + logger, + cache, + database, + config, + reader, + discovery, + tokenManager, + scheduler, ++ permissions, + }; + } + } +``` + +And add a permissions field to the `PluginEnvironment` type in `packages/backend/src/types.ts`: + +```diff + // packages/backend/src/types.ts + ++ import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; + + export type PluginEnvironment = { + ... ++ permissions: PermissionAuthorizer; + }; +``` + +[`@backstage/plugin-permission-common`](https://www.npmjs.com/package/@backstage/plugin-permission-common) and [`@backstage/plugin-permission-node`](https://www.npmjs.com/package/@backstage/plugin-permission-node) will need to be installed as dependencies: + +```diff + // packages/backend/package.json + ++ "@backstage/plugin-permission-common": "...", ++ "@backstage/plugin-permission-node": "...", +``` diff --git a/.changeset/popular-cycles-work.md b/.changeset/popular-cycles-work.md new file mode 100644 index 0000000000..939f59de94 --- /dev/null +++ b/.changeset/popular-cycles-work.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +bump `logform` to use fixed version of `color` dependency diff --git a/.changeset/quiet-carpets-shake.md b/.changeset/quiet-carpets-shake.md new file mode 100644 index 0000000000..a0744651e3 --- /dev/null +++ b/.changeset/quiet-carpets-shake.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-kubernetes': patch +'@backstage/plugin-pagerduty': patch +'@backstage/plugin-splunk-on-call': patch +--- + +Clean up emptystate.svg image, removing wrong white artifact from the background diff --git a/.changeset/rotten-files-wink.md b/.changeset/rotten-files-wink.md new file mode 100644 index 0000000000..65bd92bcc5 --- /dev/null +++ b/.changeset/rotten-files-wink.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Updated `ResponseErrorPanel` to not use the deprecated `data` property of `ResponseError`. diff --git a/.changeset/rotten-olives-shop.md b/.changeset/rotten-olives-shop.md new file mode 100644 index 0000000000..b7fb51ad06 --- /dev/null +++ b/.changeset/rotten-olives-shop.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Update `config/eslint.js` to forbid imports of `@material-ui/icons/` as well. diff --git a/.changeset/selfish-bikes-sleep.md b/.changeset/selfish-bikes-sleep.md new file mode 100644 index 0000000000..f05518fde1 --- /dev/null +++ b/.changeset/selfish-bikes-sleep.md @@ -0,0 +1,12 @@ +--- +'@backstage/plugin-api-docs': patch +--- + +Update @asyncapi/react-component to 1.0.0-next.26, which will fix the +`ResizeObserver loop limit exceeded` errors which we encountered in several E2E +tests. + +For more details check the following links: + +- https://github.com/backstage/backstage/pull/8088#issuecomment-991183968 +- https://github.com/asyncapi/asyncapi-react/issues/498 diff --git a/.changeset/shaggy-bears-remember.md b/.changeset/shaggy-bears-remember.md deleted file mode 100644 index d041abb3d1..0000000000 --- a/.changeset/shaggy-bears-remember.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/core-app-api': patch -'@backstage/core-components': patch ---- - -Switched out usage of deprecated `OAuthRequestApi` types from `@backstage/core-plugin-api`. diff --git a/.changeset/shaggy-emus-look.md b/.changeset/shaggy-emus-look.md new file mode 100644 index 0000000000..df8a1fe6fe --- /dev/null +++ b/.changeset/shaggy-emus-look.md @@ -0,0 +1,7 @@ +--- +'@backstage/core-app-api': patch +--- + +Fixed an issue where valid SAML and GitHub sessions would be considered invalid and not be stored. + +Deprecated the `SamlSession` and `GithubSession` types. diff --git a/.changeset/short-shoes-fail.md b/.changeset/short-shoes-fail.md new file mode 100644 index 0000000000..0b45d67a32 --- /dev/null +++ b/.changeset/short-shoes-fail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Removed `@backstage/test-utils` dependency. diff --git a/.changeset/silent-nails-sleep.md b/.changeset/silent-nails-sleep.md new file mode 100644 index 0000000000..a1587f8427 --- /dev/null +++ b/.changeset/silent-nails-sleep.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Allow a GitHubCredentialsProvider to be passed to the GitHub scaffolder tasks actions. diff --git a/.changeset/silly-dryers-smile.md b/.changeset/silly-dryers-smile.md deleted file mode 100644 index 7337651532..0000000000 --- a/.changeset/silly-dryers-smile.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -'@backstage/plugin-azure-devops': patch -'@backstage/plugin-azure-devops-backend': patch -'@backstage/plugin-azure-devops-common': patch ---- - -Created some initial filters that can be used to create pull request columns: - -- All -- AssignedToUser -- AssignedToCurrentUser -- AssignedToTeam -- AssignedToTeams -- AssignedToCurrentUsersTeams -- CreatedByUser -- CreatedByCurrentUser -- CreatedByTeam -- CreatedByTeams -- CreatedByCurrentUsersTeams - -Example custom column creation: - -```tsx -const COLUMN_CONFIGS: PullRequestColumnConfig[] = [ - { - title: 'Created by me', - filters: [{ type: FilterType.CreatedByCurrentUser }], - }, - { - title: 'Created by Backstage Core', - filters: [ - { - type: FilterType.CreatedByTeam, - teamName: 'Backstage Core', - }, - ], - }, - { - title: 'Assigned to my teams', - filters: [{ type: FilterType.AssignedToCurrentUsersTeams }], - }, - { - title: 'Other PRs', - filters: [{ type: FilterType.All }], - simplified: true, - }, -]; - - - } -/>; -``` diff --git a/.changeset/silver-falcons-nail.md b/.changeset/silver-falcons-nail.md new file mode 100644 index 0000000000..970bbd7fee --- /dev/null +++ b/.changeset/silver-falcons-nail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': patch +--- + +Add apply-conditions endpoint for evaluating conditional permissions in catalog backend. diff --git a/.changeset/silver-knives-change.md b/.changeset/silver-knives-change.md new file mode 100644 index 0000000000..a2bbaf1e0b --- /dev/null +++ b/.changeset/silver-knives-change.md @@ -0,0 +1,6 @@ +--- +'@backstage/cli': patch +'@backstage/backend-common': patch +--- + +Switched to using `@manypkg/get-packages` to list monorepo packages, which provides better support for different kind of monorepo setups. diff --git a/.changeset/silver-mice-bake.md b/.changeset/silver-mice-bake.md new file mode 100644 index 0000000000..6cba2fdb0a --- /dev/null +++ b/.changeset/silver-mice-bake.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-app-api': minor +--- + +Removed previously deprecated `ApiRegistry` export. diff --git a/.changeset/slimy-eggs-carry.md b/.changeset/slimy-eggs-carry.md new file mode 100644 index 0000000000..a58a3d8c61 --- /dev/null +++ b/.changeset/slimy-eggs-carry.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Switched the secure cookie mode set on the `express-session` to use `'auto'` rather than `true`. This works around an issue where cookies would not be set if TLS termination was handled in a proxy rather than having the backend served directly with HTTPS. + +The downside of this change is that secure cookies won't be used unless the backend is directly served with HTTPS. This will be remedied in a future update that allows the backend to configured for trusted proxy mode. diff --git a/.changeset/spicy-parents-fold.md b/.changeset/spicy-parents-fold.md deleted file mode 100644 index 1ba056c7c8..0000000000 --- a/.changeset/spicy-parents-fold.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@backstage/create-app': patch ---- - -Updated the root `package.json` to include files with `.cjs` and `.mjs` extensions in the `"lint-staged"` configuration. - -To make this change to an existing app, apply the following changes to the `package.json` file: - -```diff - "lint-staged": { -- "*.{js,jsx,ts,tsx}": [ -+ "*.{js,jsx,ts,tsx,mjs,cjs}": [ -``` diff --git a/.changeset/stale-gorillas-mix.md b/.changeset/stale-gorillas-mix.md new file mode 100644 index 0000000000..4ffa1fd553 --- /dev/null +++ b/.changeset/stale-gorillas-mix.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +The GithubUrlReader is switched to use the DefaultGithubCredentialsProvider diff --git a/.changeset/strong-doors-destroy.md b/.changeset/strong-doors-destroy.md deleted file mode 100644 index d568ed4e07..0000000000 --- a/.changeset/strong-doors-destroy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/cli': patch ---- - -Add support for `.cjs` and `.mjs` extensions in local and dependency modules. diff --git a/.changeset/strong-paws-laugh.md b/.changeset/strong-paws-laugh.md deleted file mode 100644 index de39440e34..0000000000 --- a/.changeset/strong-paws-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-auth-backend': patch ---- - -export minimal typescript types for OIDC provider diff --git a/.changeset/stupid-mice-dream.md b/.changeset/stupid-mice-dream.md deleted file mode 100644 index 2cd2b4e067..0000000000 --- a/.changeset/stupid-mice-dream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/core-components': patch ---- - -Add Missing Override Components Type for SidebarSpace, SidebarSpacer, and SidebarDivider Components. diff --git a/.changeset/sweet-camels-learn.md b/.changeset/sweet-camels-learn.md deleted file mode 100644 index 60481b9363..0000000000 --- a/.changeset/sweet-camels-learn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/catalog-model': patch ---- - -Added an optional `presence` field to Location spec, which describes whether the target of a location is required to exist or not. It defaults to `'required'`, which is the current behaviour of the catalog. diff --git a/.changeset/techdocs-forty-pumas-compete.md b/.changeset/techdocs-forty-pumas-compete.md deleted file mode 100644 index 929ce3e2c9..0000000000 --- a/.changeset/techdocs-forty-pumas-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-techdocs': patch ---- - -Fix issue where assets weren't being fetched from the correct URL path for doc URLs without trailing slashes diff --git a/.changeset/techdocs-light-onions-cover.md b/.changeset/techdocs-light-onions-cover.md new file mode 100644 index 0000000000..55c0873575 --- /dev/null +++ b/.changeset/techdocs-light-onions-cover.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Fix an issue where the TechDocs sidebar is hidden when the Backstage sidebar is pinned at smaller screen sizes diff --git a/.changeset/tender-cars-look.md b/.changeset/tender-cars-look.md new file mode 100644 index 0000000000..f20ba447d4 --- /dev/null +++ b/.changeset/tender-cars-look.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-test-utils': patch +--- + +Bump `testcontainers` dependency to version `8.1.2` diff --git a/.changeset/thin-buckets-juggle.md b/.changeset/thin-buckets-juggle.md new file mode 100644 index 0000000000..a95f8a86ad --- /dev/null +++ b/.changeset/thin-buckets-juggle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-airbrake': minor +--- + +A plugin for Airbrake (https://airbrake.io/) has been created diff --git a/.changeset/thirty-ways-attend.md b/.changeset/thirty-ways-attend.md deleted file mode 100644 index b294b4bfb0..0000000000 --- a/.changeset/thirty-ways-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-catalog-react': patch ---- - -`useEntityTypeFilter`: Skip updating selected types if a kind filter change did not change them. diff --git a/.changeset/three-sheep-sparkle.md b/.changeset/three-sheep-sparkle.md new file mode 100644 index 0000000000..db6d8148ce --- /dev/null +++ b/.changeset/three-sheep-sparkle.md @@ -0,0 +1,7 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +In order to integrate the permissions system with the refresh endpoint in catalog-backend, a new AuthorizedRefreshService was created as a thin wrapper around the existing refresh service which performs authorization and handles the case when authorization is denied. In order to instantiate AuthorizedRefreshService, a permission client is required, which was added as a new field to `CatalogEnvironment`. + +The new `permissions` field in `CatalogEnvironment` should already receive the permission client from the `PluginEnvrionment`, so there should be no changes required to the catalog backend setup. See [the create-app changelog](https://github.com/backstage/backstage/blob/master/packages/create-app/CHANGELOG.md) for more details. diff --git a/.changeset/twelve-bears-fail.md b/.changeset/twelve-bears-fail.md new file mode 100644 index 0000000000..6112f5a980 --- /dev/null +++ b/.changeset/twelve-bears-fail.md @@ -0,0 +1,6 @@ +--- +'@backstage/core-app-api': patch +'@backstage/core-plugin-api': patch +--- + +Removed direct and transitive MUI dependencies. diff --git a/.changeset/twelve-panthers-move.md b/.changeset/twelve-panthers-move.md new file mode 100644 index 0000000000..f52050a488 --- /dev/null +++ b/.changeset/twelve-panthers-move.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-common': patch +--- + +Clean up API reports diff --git a/.changeset/violet-dingos-relate.md b/.changeset/violet-dingos-relate.md new file mode 100644 index 0000000000..c8b0c03e2c --- /dev/null +++ b/.changeset/violet-dingos-relate.md @@ -0,0 +1,7 @@ +--- +'@backstage/errors': minor +--- + +Removed the deprecated exports `ErrorResponse` and `parseErrorResponse`. + +Removed the deprecated `constructor` and the deprecated `data` property of `ResponseError`. diff --git a/.changeset/warm-crews-flash.md b/.changeset/warm-crews-flash.md new file mode 100644 index 0000000000..b21a3ada02 --- /dev/null +++ b/.changeset/warm-crews-flash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes-backend': patch +--- + +Exclude the AWS session token from credential validation, because it's not necessary in this context. diff --git a/.changeset/warm-moles-battle.md b/.changeset/warm-moles-battle.md new file mode 100644 index 0000000000..3d203ea1d3 --- /dev/null +++ b/.changeset/warm-moles-battle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-tech-insights': patch +--- + +fix React warning because of missing `key` prop diff --git a/.changeset/weak-berries-heal.md b/.changeset/weak-berries-heal.md deleted file mode 100644 index 4160d078fc..0000000000 --- a/.changeset/weak-berries-heal.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'@backstage/plugin-apache-airflow': minor ---- - -Introduces a new plugin for the Apache Airflow workflow management platform. -This implementation has been tested with the Apache Airflow v2 API, -authenticating with basic authentication through the Backstage proxy plugin. - -Supported functionality includes: - -- Information card of version information of the Airflow instance -- Information card of instance health for the meta-database and scheduler -- Table of DAGs with meta information and status, along with a link to view - details in the Airflow UI diff --git a/.changeset/young-students-applaud.md b/.changeset/young-students-applaud.md deleted file mode 100644 index bbd825cf00..0000000000 --- a/.changeset/young-students-applaud.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'@backstage/core-plugin-api': patch ---- - -Renamed `AuthProvider` to `AuthProviderInfo` and add a required 'id' property to match the majority of usage. The `AuthProvider` type without the `id` property still exists but is deprecated, and all usage of it without an `id` is deprecated as well. For example, calling `createAuthRequest` without a `provider.id` is deprecated and it will be required in the future. - -The following types have been renamed. The old names are still exported but deprecated, and are scheduled for removal in a future release. - -- Renamed `AuthRequesterOptions` to `OAuthRequesterOptions` -- Renamed `AuthRequester` to `OAuthRequester` -- Renamed `PendingAuthRequest` to `PendingOAuthRequest` diff --git a/.eslintrc.js b/.eslintrc.js index ec7b4f9130..47a47daee6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,12 +25,6 @@ module.exports = { { // eslint-disable-next-line no-restricted-syntax templateFile: path.resolve(__dirname, './scripts/copyright-header.txt'), - templateVars: { - NAME: 'The Backstage Authors', - }, - varRegexps: { - NAME: /(The Backstage Authors)|(Spotify AB)/, - }, onNonMatchingHeader: 'replace', }, ], diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ed4b61099f..a587419d50 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -42,3 +42,5 @@ /.changeset/search-* @backstage/techdocs-core /.changeset/techdocs-* @backstage/techdocs-core /cypress/src/integration/plugins/techdocs.spec.ts @backstage/techdocs-core +/plugins/apache-airflow @backstage/reviewers @cmpadden +/plugins/newrelic-dashboard @backstage/reviewers @mufaddal7 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 59847fd65f..65a4b1a438 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ updates: schedule: interval: daily time: '04:00' - open-pull-requests-limit: 5 + open-pull-requests-limit: 10 labels: - dependencies - package-ecosystem: npm @@ -13,6 +13,6 @@ updates: schedule: interval: daily time: '04:00' - open-pull-requests-limit: 2 + open-pull-requests-limit: 5 labels: - dependencies diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..f141107482 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,24 @@ +catalog: + - plugins/catalog/**/* + - plugins/catalog-*/**/* + - packages/catalog-*/**/* +scaffolder: + - plugins/scaffolder/**/* + - plugins/scaffolder-*/**/* +search: + - plugins/search/**/* + - plugins/search-*/**/* + - packages/search-*/**/* +docs-like-code: + - plugins/techdocs/**/* + - plugins/techdocs-*/**/* + - packages/techdocs-*/**/* +documentation: + - docs/**/* +microsite: + - microsite/**/* +auth: + - plugins/auth-backend/**/* + - packages/core-app-api/src/apis/implementations/auth/**/* + - packages/core-app-api/src/lib/Auth*/**/* + - packages/core-plugin-api/src/apis/definitions/auth.ts diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index 4ec62923d8..d3ea8c1c27 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -1,5 +1,6 @@ abc accessors +Airbrake Anddddd Apdex api @@ -12,6 +13,7 @@ Atlassian automations autoscaling Autoscaling +autoselect Avro backrub Bigtable @@ -53,6 +55,7 @@ configs const cookiecutter cron +cronjobs css Datadog dataflow @@ -90,10 +93,12 @@ Figma firehydrant FireHydrant Firekube +Firestore Fiverr gitbeaker GitHub GitLab +Gource Grafana graphql GraphQL @@ -187,6 +192,7 @@ OAuth octokit oidc Okta +Oldsberg onboarding Onboarding OpenShift @@ -194,6 +200,8 @@ orgs pagerduty pageview parallelization +Patrik +Peloton plantuml Platformize Podman @@ -293,6 +301,7 @@ truthy typeahead ui unbreak +Unconference unmanaged unregister unregistration @@ -304,6 +313,7 @@ utils validator validators varchar +Wayfair Weaveworks Webpack winston @@ -316,4 +326,3 @@ Zalando Zhou zoomable zsh -Firestore diff --git a/.github/workflows/chromatic-storybook-test.yml b/.github/workflows/chromatic-storybook-test.yml index 4c64db309d..355ad65bee 100644 --- a/.github/workflows/chromatic-storybook-test.yml +++ b/.github/workflows/chromatic-storybook-test.yml @@ -4,6 +4,14 @@ on: paths: - '.github/workflows/chromatic-storybook-test.yml' - 'packages/storybook/**' + - 'packages/config/src/**' + - 'packages/theme/src/**' + - 'packages/types/src/**' + - 'packages/errors/src/**' + - 'packages/version-bridge/src/**' + - 'packages/test-utils/src/**' + - 'packages/core-app-api/src/**' + - 'packages/core-plugin-api/src/**' - 'packages/core-components/src/**' - '**/*.stories.tsx' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7222edef08..109f90eff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,9 @@ jobs: - name: check api reports and generate API reference run: yarn build:api-reports:only --ci --docs + - name: verify changesets + run: node scripts/verify-changesets.js + - name: verify doc links run: node scripts/verify-links.js diff --git a/.github/workflows/dependabot-changeset-maker.yml b/.github/workflows/dependabot-changeset-maker.yml new file mode 100644 index 0000000000..1387892489 --- /dev/null +++ b/.github/workflows/dependabot-changeset-maker.yml @@ -0,0 +1,72 @@ +name: 'Dependabot changeset maker' +on: + - pull_request_target + +jobs: + generate-changeset: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' && github.repository == 'backstage/backstage' + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + ref: ${{ github.head_ref }} + - name: Configure Git + run: | + git config --global user.email noreply@backstage.io + git config --global user.name 'Github changeset workflow' + - name: Generate changeset + uses: actions/github-script@v5 + with: + script: | + const { promises: fs } = require('fs'); + + // Parses package.json files and returns the package names + async function getPackagesNames(files) { + const names = []; + for (const file of files) { + const data = JSON.parse(await fs.readFile(file, 'utf8')); + names.push(data.name); + } + return names; + } + + async function createChangeset(fileName, commitMessage, packages) { + const pkgs = packages.map(pkg => `'${pkg}': patch`).join('\n'); + const message = commitMessage.replace(/(b|B)ump ([a-z-]+)/, 'Bump `$2`'); + const body = `---\n${pkgs}\n---\n\n${message}`; + await fs.writeFile(fileName, body); + } + + const branch = await exec.getExecOutput('git branch --show-current'); + if (!branch.stdout.startsWith('dependabot/')) { + console.log('Not a dependabot branch, skipping'); + return; + } + + const diffOutput = await exec.getExecOutput('git diff --name-only HEAD~1'); + const diffFiles = diffOutput.stdout.split('\n'); + + if (diffFiles.find(f => f.startsWith('.changeset'))) { + console.log('Changeset already exists, skipping'); + return; + } + + const files = diffFiles + .filter(file => file !== 'package.json') // skip root package.json + .filter(file => file.includes('package.json')); + + if (!files.length) { + console.log('No package.json changes, skipping'); + return; + } + + const packageNames = await getPackagesNames(files); + const { stdout: shortHash } = await exec.getExecOutput('git rev-parse --short HEAD'); + const fileName = `.changeset/dependabot-${shortHash.trim()}.md`; + const { stdout: commitMessage } = await exec.getExecOutput('git show --pretty=format:%s -s HEAD'); + await createChangeset(fileName, commitMessage, packageNames); + await exec.exec('git', ['add', fileName]); + await exec.exec('git commit -C HEAD --amend --no-edit'); + await exec.exec('git push --force'); diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000000..dc7127ab0d --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,12 @@ +name: 'Pull Request Labeler' +on: + - pull_request_target + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v3 + with: + repo-token: '${{ secrets.GITHUB_TOKEN }}' + sync-labels: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5cbf4e32ef..f0bfe17326 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -17,7 +17,7 @@ jobs: for your contributions. days-before-issue-stale: 60 days-before-issue-close: 7 - exempt-issue-labels: 'pinned,security,plugin,help wanted,good first issue,rfc' + exempt-issue-labels: 'pinned,security,plugin,help wanted,good first issue,rfc,will-fix' stale-issue-label: stale stale-pr-message: > This PR has been automatically marked as stale because it has not had @@ -25,6 +25,6 @@ jobs: If you are the author and the PR has been closed, feel free to re-open the PR and continue the contribution! days-before-pr-stale: 7 days-before-pr-close: 5 - exempt-pr-labels: reviewer-approved,awaiting-review + exempt-pr-labels: reviewer-approved,awaiting-review,will-fix stale-pr-label: stale operations-per-run: 100 diff --git a/.gitignore b/.gitignore index 8c37280023..60d0d6da3b 100644 --- a/.gitignore +++ b/.gitignore @@ -136,3 +136,6 @@ site # e2e tests cypress/cypress/* + +# Possible leftover from build:api-reports +tsconfig.tmp.json diff --git a/ADOPTERS.md b/ADOPTERS.md index 43e7fba68b..1c19fe559e 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -75,3 +75,9 @@ | [Telstra](https://www.telstra.com.au) | [@kiranpatel11](https://github.com/kiranpatel11), [JasonC](https://github.com/JasonC17) | Primary usage: software catalog and templates
Emerging usage : TechDocs, Explore Ecosystem, TechRadar, etc | | [Mosaico](https://www.mosaico.com.br/) | [Wédney Yuri](https://github.com/wedneyyuri),[@tino.milton](https://github.com/miltonjacomini) | A centralized service catalog of our documentation for our service engineers. | | [Mox Bank](https://www.mox.com/) | [Nick Laqua](https://github.com/nick-laqua-dragon), [Gauthier Roebroeck](https://github.com/gauthier-roebroeck-mox) | "Single pane of glass" developer portal for providing a best-in-class developer experience to our product teams and making Mox the best tech environment in Hongkong 🥰🚀 | +| [Keyloop](https://www.keyloop.com/) | [Andre Wanlin](https://github.com/awanlin) | Future-motive Developer Portal to help our teams create technology to make everything about buying and owning a car better. 🚗 | +| [Simply Business](https://sbtech.simplybusiness.co.uk/) | [@addersuk](https://github.com/addersuk), [@LightningStairs](https://github.com/LightningStairs), [@punitcse](https://github.com/punitcse), [@moltenice](https://github.com/moltenice) | Central developer portal to access everything a developer needs such as docs, internal service catalog, and the ability to quickly create a new service from a template. Internally developed Backstage plugins allow us to customise the experience to how we work. | +| [Overwolf](https://www.overwolf.com) | [@tomwolfgang](https://github.com/tomwolfgang) | Dev portal - software catalog, tech-docs, scaffolding | +| [Hotmart](https://www.hotmart.com) | [@fabioviana-hotmart](https://github.com/fabioviana-hotmart) | The main Developers Portal to centralize docs, applications and technical metrics. | +| [EF Education First](https://www.ef.com) | [Daan Boerlage](https://github.com/runebaas), [Rafał Nowosielski](https://github.com/rnowosielski) | Our developer portal - primarily used for cataloging and scaffolding with the ambition to expand with more feature adoptions over time | +| [Power Home Remodeling](https://www.techatpower.com) | [Ben Langfeld](https://github.com/benlangfeld) | Developer portal to our internal services, build on open-source software (including Kubernetes) in our own datacenters. Our Portal allows our team members to navigate inherant complexity and standardise. | diff --git a/app-config.yaml b/app-config.yaml index 6cd05f44e8..2837d97d2f 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -74,6 +74,11 @@ proxy: headers: X-Api-Key: ${NEW_RELIC_REST_API_KEY} + '/newrelic/api': + target: https://api.newrelic.com + headers: + X-Api-Key: ${NEW_RELIC_USER_KEY} + '/pagerduty': target: https://api.pagerduty.com headers: diff --git a/contrib/chart/backstage/Chart.yaml b/contrib/chart/backstage/Chart.yaml index 8aeab9be3e..9154368475 100644 --- a/contrib/chart/backstage/Chart.yaml +++ b/contrib/chart/backstage/Chart.yaml @@ -5,7 +5,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/contrib/chart/backstage/templates/ingress.yaml b/contrib/chart/backstage/templates/ingress.yaml index 9340467800..3ec4990561 100644 --- a/contrib/chart/backstage/templates/ingress.yaml +++ b/contrib/chart/backstage/templates/ingress.yaml @@ -40,7 +40,7 @@ spec: servicePort: 80 {{/* Route the backend inside the same hostname as the frontend when they are the same */}} {{- if eq $frontendUrl.host $backendUrl.host}} - - path: /api + - path: /api/ backend: serviceName: {{ include "backend.serviceName" . }} servicePort: 80 diff --git a/contrib/docs/tutorials/authenticate-api-requests.md b/contrib/docs/tutorials/authenticate-api-requests.md index 9f651ddd1a..803a6babc7 100644 --- a/contrib/docs/tutorials/authenticate-api-requests.md +++ b/contrib/docs/tutorials/authenticate-api-requests.md @@ -129,8 +129,12 @@ function msUntilExpiry(token: string): number { // Calls the specified url regularly using an auth token to set a token cookie // to authorize regular HTTP requests when loading techdocs -async function setTokenCookie(url: string, getIdToken: () => Promise) { - const token = await getIdToken(); +async function setTokenCookie(url: string, identityApi: IdentityApi) { + const { token } = await identityApi.getCredentials(); + if (!token) { + return; + } + await fetch(url, { mode: 'cors', credentials: 'include', @@ -138,11 +142,12 @@ async function setTokenCookie(url: string, getIdToken: () => Promise) { Authorization: `Bearer ${token}`, }, }); + // Call this function again a few minutes before the token expires const ms = msUntilExpiry(token) - 4 * 60 * 1000; setTimeout( () => { - setTokenCookie(url, getIdToken); + setTokenCookie(url, identityApi); }, ms > 0 ? ms : 10000, ); @@ -160,16 +165,13 @@ const app = createApp({ providers={['guest', 'custom', ...providers]} title="Select a sign-in method" align="center" - onResult={async result => { - // When logged in, set a token cookie - if (typeof result.getIdToken !== 'undefined') { - setTokenCookie( - await discoveryApi.getBaseUrl('cookie'), - result.getIdToken, - ); - } - // Forward results - props.onResult(result); + onSignInSuccess={async (identityApi: IdentityApi) => { + setTokenCookie( + await discoveryApi.getBaseUrl('cookie'), + identityApi, + ); + + props.onSignInSuccess(identityApi); }} /> ); diff --git a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md index 086175a0ce..f45b70cdb1 100644 --- a/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md +++ b/contrib/docs/tutorials/quickstart-app-plugin/ExampleFetchComponent.md @@ -4,7 +4,7 @@ ExampleFetchComponent.tsx reference ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; import { Table, TableColumn, Progress } from '@backstage/core-components'; diff --git a/cypress/src/integration/plugins/techdocs.spec.ts b/cypress/src/integration/plugins/techdocs.spec.ts index 0edd7b15ff..d6049ea53d 100644 --- a/cypress/src/integration/plugins/techdocs.spec.ts +++ b/cypress/src/integration/plugins/techdocs.spec.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 Spotify AB + * Copyright 2020 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/cypress/src/integration/user/login.spec.ts b/cypress/src/integration/user/login.spec.ts index 25be6e8d4b..8e84ebbf06 100644 --- a/cypress/src/integration/user/login.spec.ts +++ b/cypress/src/integration/user/login.spec.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 Spotify AB + * Copyright 2020 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/cypress/src/integration/user/logout.spec.ts b/cypress/src/integration/user/logout.spec.ts index 2d37cb63e5..a3aea9d6a8 100644 --- a/cypress/src/integration/user/logout.spec.ts +++ b/cypress/src/integration/user/logout.spec.ts @@ -1,5 +1,5 @@ /* - * Copyright 2020 Spotify AB + * Copyright 2020 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/cypress/src/support/commands.ts b/cypress/src/support/commands.ts index 3c8456fcbd..666dc157d7 100644 --- a/cypress/src/support/commands.ts +++ b/cypress/src/support/commands.ts @@ -1,5 +1,5 @@ /* - * Copyright 2021 Spotify AB + * Copyright 2021 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/docs/api/utility-apis.md b/docs/api/utility-apis.md index 14920513af..9ebcfc0945 100644 --- a/docs/api/utility-apis.md +++ b/docs/api/utility-apis.md @@ -128,8 +128,8 @@ the core APIs. The core APIs are the ones exported by [configApiRef](../reference/core-plugin-api.configapiref.md). The core APIs are loaded for any app created with -[createApp](../reference/core-app-api.createapp.md) from -[@backstage/core-plugin-api](../reference/core-plugin-api.md), which means that +[createApp](../reference/app-defaults.createapp.md) from +[@backstage/core-plugin-api](../reference/app-defaults.md), which means that there is no step that needs to be taken to include these APIs in an app. ### Plugin APIs @@ -168,7 +168,7 @@ Lastly, the app itself is the final point where APIs can be added, and what has the final say in what APIs will be loaded at runtime. The app may override the factories for any of the core or plugin APIs, with the exception of the config, app theme, and identity APIs. These are static APIs that are tied into the -[createApp](../reference/core-app-api.createapp.md) implementation, and +[createApp](../reference/app-defaults.createapp.md) implementation, and therefore not possible to override. Overriding APIs is useful for apps that want to switch out behavior to tailor it @@ -313,7 +313,7 @@ The common development environment for plugins is included in [createDevApp](../reference/dev-utils.createdevapp.md) function creates an application with implementations for all core APIs already present. Contrary to the method for wiring up Utility API implementations in an app created with -[createApp](../reference/core-app-api.createapp.md), +[createApp](../reference/app-defaults.createapp.md), [createDevApp](../reference/dev-utils.createdevapp.md) uses automatic dependency injection. This is to make it possible to replace any API implementation, and having that be reflected in dependents of that API. diff --git a/docs/architecture-decisions/adr000-template.md b/docs/architecture-decisions/adr000-template.md index 5e6edd8dba..f16ae7d39f 100644 --- a/docs/architecture-decisions/adr000-template.md +++ b/docs/architecture-decisions/adr000-template.md @@ -1,6 +1,7 @@ --- id: adrs-adr000 -title: ADR000: [TITLE] +title: 'ADR000: [TITLE]' +# prettier-ignore description: Architecture Decision Record (ADR) for [TITLE] [DESCRIPTION] --- diff --git a/docs/architecture-decisions/adr001-add-adr-log.md b/docs/architecture-decisions/adr001-add-adr-log.md index 872b3311a5..d1bf0f83f5 100644 --- a/docs/architecture-decisions/adr001-add-adr-log.md +++ b/docs/architecture-decisions/adr001-add-adr-log.md @@ -1,6 +1,7 @@ --- id: adrs-adr001 -title: ADR001: Architecture Decision Record (ADR) log +title: 'ADR001: Architecture Decision Record (ADR) log' +# prettier-ignore description: Architecture Decision Record (ADR) logs as a reference point for the team --- diff --git a/docs/architecture-decisions/adr002-default-catalog-file-format.md b/docs/architecture-decisions/adr002-default-catalog-file-format.md index 013e2cbf39..d0a657fe46 100644 --- a/docs/architecture-decisions/adr002-default-catalog-file-format.md +++ b/docs/architecture-decisions/adr002-default-catalog-file-format.md @@ -1,6 +1,7 @@ --- id: adrs-adr002 -title: ADR002: Default Software Catalog File Format +title: 'ADR002: Default Software Catalog File Format' +# prettier-ignore description: Architecture Decision Record (ADR) log on Default Software Catalog File Format --- diff --git a/docs/architecture-decisions/adr003-avoid-default-exports.md b/docs/architecture-decisions/adr003-avoid-default-exports.md index 878d0d701c..34e5cd5411 100644 --- a/docs/architecture-decisions/adr003-avoid-default-exports.md +++ b/docs/architecture-decisions/adr003-avoid-default-exports.md @@ -1,6 +1,7 @@ --- id: adrs-adr003 -title: ADR003: Avoid Default Exports and Prefer Named Exports +title: 'ADR003: Avoid Default Exports and Prefer Named Exports' +# prettier-ignore description: Architecture Decision Record (ADR) log on Avoid Default Exports and Prefer Named Exports --- diff --git a/docs/architecture-decisions/adr004-module-export-structure.md b/docs/architecture-decisions/adr004-module-export-structure.md index e6e378da9d..95d0f27811 100644 --- a/docs/architecture-decisions/adr004-module-export-structure.md +++ b/docs/architecture-decisions/adr004-module-export-structure.md @@ -1,6 +1,7 @@ --- id: adrs-adr004 -title: ADR004: Module Export Structure +title: 'ADR004: Module Export Structure' +# prettier-ignore description: Architecture Decision Record (ADR) log on Module Export Structure --- diff --git a/docs/architecture-decisions/adr005-catalog-core-entities.md b/docs/architecture-decisions/adr005-catalog-core-entities.md index 83196c12e2..1206d9e83d 100644 --- a/docs/architecture-decisions/adr005-catalog-core-entities.md +++ b/docs/architecture-decisions/adr005-catalog-core-entities.md @@ -1,6 +1,7 @@ --- id: adrs-adr005 -title: ADR005: Catalog Core Entities +title: 'ADR005: Catalog Core Entities' +# prettier-ignore description: Architecture Decision Record (ADR) log on Catalog Core Entities --- diff --git a/docs/architecture-decisions/adr006-avoid-react-fc.md b/docs/architecture-decisions/adr006-avoid-react-fc.md index eecb4ad87a..ea43cb215d 100644 --- a/docs/architecture-decisions/adr006-avoid-react-fc.md +++ b/docs/architecture-decisions/adr006-avoid-react-fc.md @@ -1,6 +1,7 @@ --- id: adrs-adr006 -title: ADR006: Avoid React.FC and React.SFC +title: 'ADR006: Avoid React.FC and React.SFC' +# prettier-ignore description: Architecture Decision Record (ADR) log on Avoid React.FC and React.SFC --- diff --git a/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md b/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md index 68394de17c..a61bb78787 100644 --- a/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md +++ b/docs/architecture-decisions/adr007-use-msw-to-mock-service-requests.md @@ -1,6 +1,7 @@ --- id: adrs-adr007 -title: ADR007: Use MSW to mock http requests +title: 'ADR007: Use MSW to mock http requests' +# prettier-ignore description: Architecture Decision Record (ADR) log on Use MSW to mock http requests --- diff --git a/docs/architecture-decisions/adr008-default-catalog-file-name.md b/docs/architecture-decisions/adr008-default-catalog-file-name.md index 6794dc87cc..fca65c8355 100644 --- a/docs/architecture-decisions/adr008-default-catalog-file-name.md +++ b/docs/architecture-decisions/adr008-default-catalog-file-name.md @@ -1,6 +1,7 @@ --- id: adrs-adr008 -title: ADR008: Default Catalog File Name +title: 'ADR008: Default Catalog File Name' +# prettier-ignore description: Architecture Decision Record (ADR) log on Default Catalog File Name --- diff --git a/docs/architecture-decisions/adr009-entity-references.md b/docs/architecture-decisions/adr009-entity-references.md index a6fe3ee583..254ae7ac1d 100644 --- a/docs/architecture-decisions/adr009-entity-references.md +++ b/docs/architecture-decisions/adr009-entity-references.md @@ -1,6 +1,7 @@ --- id: adrs-adr009 -title: ADR009: Entity References +title: 'ADR009: Entity References' +# prettier-ignore description: Architecture Decision Record (ADR) log on Entity References --- diff --git a/docs/architecture-decisions/adr010-luxon-date-library.md b/docs/architecture-decisions/adr010-luxon-date-library.md index 43f18f0f69..65cabd256c 100644 --- a/docs/architecture-decisions/adr010-luxon-date-library.md +++ b/docs/architecture-decisions/adr010-luxon-date-library.md @@ -1,6 +1,7 @@ --- id: adrs-adr010 -title: ADR010: Use the Luxon Date Library +title: 'ADR010: Use the Luxon Date Library' +# prettier-ignore description: Architecture Decision Record (ADR) for Luxon Date Library --- diff --git a/docs/architecture-decisions/adr011-plugin-package-structure.md b/docs/architecture-decisions/adr011-plugin-package-structure.md index 374a3ed546..2def903dfc 100644 --- a/docs/architecture-decisions/adr011-plugin-package-structure.md +++ b/docs/architecture-decisions/adr011-plugin-package-structure.md @@ -1,6 +1,7 @@ --- id: adrs-adr011 -title: ADR011: Plugin Package Structure +title: 'ADR011: Plugin Package Structure' +# prettier-ignore description: Architecture Decision Record (ADR) for Plugin Package Structure --- @@ -34,9 +35,11 @@ We follow this structure for plugin packages (where `x` is the plugin name, for example `catalog` or `techdocs`): - `x`: Contains the main frontend code of the plugin. +- `x-module-`: Contains optional modules related to the frontend plugin + package. - `x-backend`: Contains the main backend code of the plugin. - `x-backend-module-`: Contains optional modules related to the backend - plugin. + plugin package. - `x-react`: Contains shared widgets, hooks and similar that both the plugin itself (`x`) and third-party frontend plugins can depend on. - `x-node`: Contains utilities for backends that both the plugin backend itself diff --git a/docs/architecture-decisions/adr012-use-luxon-locale-and-date-presets.md b/docs/architecture-decisions/adr012-use-luxon-locale-and-date-presets.md index 0893c105f4..25bb6c1833 100644 --- a/docs/architecture-decisions/adr012-use-luxon-locale-and-date-presets.md +++ b/docs/architecture-decisions/adr012-use-luxon-locale-and-date-presets.md @@ -1,6 +1,7 @@ --- id: adrs-adr012 -title: ADR012: Use Luxon.toLocaleString and date/time presets +title: 'ADR012: Use Luxon.toLocaleString and date/time presets' +# prettier-ignore description: Architecture Decision Record (ADR) for using Luxon's toLocaleString method and date/time presets for displaying dates and times --- diff --git a/docs/architecture-decisions/adr013-use-node-fetch.md b/docs/architecture-decisions/adr013-use-node-fetch.md new file mode 100644 index 0000000000..d802988ae4 --- /dev/null +++ b/docs/architecture-decisions/adr013-use-node-fetch.md @@ -0,0 +1,71 @@ +--- +id: adrs-adr013 +title: 'ADR013: Proper use of HTTP fetching libraries' +# prettier-ignore +description: Architecture Decision Record (ADR) for the proper use of fetchApiRef, node-fetch, and cross-fetch for data fetching. +--- + +## Context + +Using multiple HTTP packages for data fetching increases the complexity and the +support burden of keeping said package up to date. + +## Decision + +Backend (node) packages should use the `node-fetch` package for HTTP data +fetching. Example: + +```ts +import fetch from 'node-fetch'; +import { ResponseError } from '@backstage/errors'; + +const response = await fetch('https://example.com/api/v1/users.json'); +if (!response.ok) { + throw await ResponseError.fromResponse(response); +} +const users = await response.json(); +``` + +Frontend plugins and packages should prefer to use the +[`fetchApiRef`](https://backstage.io/docs/reference/core-plugin-api.fetchapiref). +It uses `cross-fetch` internally. Example: + +```ts +import { useApi } from '@backstage/core-plugin-api'; +const { fetch } = useApi(fetchApiRef); + +const response = await fetch('https://example.com/api/v1/users.json'); +if (!response.ok) { + throw await ResponseError.fromResponse(response); +} +const users = await response.json(); +``` + +Isomorphic packages should have a dependency on the `cross-fetch` package for +mocking and type definitions. Preferably, classes and functions in isomorphic +packages should accept an argument of type `typeof fetch` to let callers supply +their preferred implementation of `fetch`. This lets them adorn the calls with +auth or other information, and track metrics etc, in a cross-platform way. +Example: + +```ts +import crossFetch from 'cross-fetch'; + +export class MyClient { + private readonly fetch: typeof crossFetch; + + constructor(options: { fetch?: typeof crossFetch }) { + this.fetch = options.fetch || crossFetch; + } + + async users() { + return await this.fetch('https://example.com/api/v1/users.json'); + } +} +``` + +## Consequences + +We will gradually transition away from third party packages such as `axios`, +`got` and others. Once we have transitioned to `node-fetch` we will add lint +rules to enforce this decision. diff --git a/docs/architecture-decisions/index.md b/docs/architecture-decisions/index.md index f852170b1e..15d1b0e9d5 100644 --- a/docs/architecture-decisions/index.md +++ b/docs/architecture-decisions/index.md @@ -2,6 +2,7 @@ id: adrs-overview title: Architecture Decision Records (ADR) sidebar_label: Overview +# prettier-ignore description: Overview of Architecture Decision Records (ADR) --- diff --git a/docs/assets/architecture-overview/package-architecture.drawio.svg b/docs/assets/architecture-overview/package-architecture.drawio.svg new file mode 100644 index 0000000000..df8c0f8820 --- /dev/null +++ b/docs/assets/architecture-overview/package-architecture.drawio.svg @@ -0,0 +1,746 @@ + + + + + + + + + + + + + + + + + +
+
+
+ app +
+
+
+
+ + app + +
+
+ + + + + + + + + + +
+
+
+ backend +
+
+
+
+ + backend + +
+
+ + + + + + + + + + +
+
+
+ plugin-<plugin-id> +
+
+
+
+ + plugin-<plugin-id> + +
+
+ + + + + + + + + + +
+
+
+ plugin-<plugin-id>-backend +
+
+
+
+ + plugin-<plugin-id>-backend + +
+
+ + + + + + Backend Libraries + + + + + + +
+
+
+ @backstage/backend-common +
+
+
+
+ + @backstage/backend-common + +
+
+ + + + +
+
+
+ @backstage/backend-test-utils +
+
+
+
+ + @backstage/backend-test-utils + +
+
+ + + + +
+
+
+ @backstage/backend-tasks +
+
+
+
+ + @backstage/backend-tasks + +
+
+ + + + + + Common Libraries + + + + + + +
+
+
+ @backstage/catalog-client +
+
+
+
+ + @backstage/catalog-client + +
+
+ + + + +
+
+
+ @backstage/types +
+
+
+
+ + @backstage/types + +
+
+ + + + +
+
+
+ @backstage/config +
+
+
+
+ + @backstage/config + +
+
+ + + + +
+
+
+ @backstage/errors +
+
+
+
+ + @backstage/errors + +
+
+ + + + +
+
+
+ @backstage/catalog-model +
+
+
+
+ + @backstage/catalog-model + +
+
+ + + + +
+
+
+ @backstage/integration +
+
+
+
+ + @backstage/integration + +
+
+ + + + + + Frontend App Core + + + + + + +
+
+
+ @backstage/core-app-api +
+
+
+
+ + @backstage/core-app-api + +
+
+ + + + +
+
+
+ @backstage/app-defaults +
+
+
+
+ + @backstage/app-defaults + +
+
+ + + + + + + + + + + + + +
+
+
+ plugin-<plugin-id>-backend-module-<module-id> +
+
+
+
+ + plugin-<plugin-id>-backend-module-<module-id> + +
+
+ + + + + + + + +
+
+
+ plugin-<plugin-id>-module-<module-id> +
+
+
+
+ + plugin-<plugin-id>-module-<module-id> + +
+
+ + + + + + Common Tooling + + + + + + +
+
+
+ @backstage/cli +
+
+
+
+ + @backstage/cli + +
+
+ + + + + + + + + + External Plugin Libraries + + + + + + +
+
+
+ plugin-<other-plugin-id>-react +
+
+
+
+ + plugin-<other-plugin-id>-react + +
+
+ + + + +
+
+
+ plugin-<other-plugin-id>-common +
+
+
+
+ + plugin-<other-plugin-id>-common + +
+
+ + + + +
+
+
+ plugin-<other-plugin-id>-node +
+
+
+
+ + plugin-<other-plugin-id>-node + +
+
+ + + + + + + + + + + + Plugin Libraries + + + + + + +
+
+
+ plugin-<plugin-id>-react +
+
+
+
+ + plugin-<plugin-id>-react + +
+
+ + + + +
+
+
+ plugin-<plugin-id>-common +
+
+
+
+ + plugin-<plugin-id>-common + +
+
+ + + + +
+
+
+ plugin-<plugin-id>-node +
+
+
+
+ + plugin-<plugin-id>-node + +
+
+ + + + + + + + + Frontend Plugin Core + + + + + + +
+
+
+ @backstage/core-plugin-api +
+
+
+
+ + @backstage/core-plugin-api + +
+
+ + + + +
+
+
+ @backstage/test-utils +
+
+
+
+ + @backstage/test-utils + +
+
+ + + + +
+
+
+ @backstage/dev-utils +
+
+
+
+ + @backstage/dev-utils + +
+
+ + + + + + Frontend Libraries + + + + + + +
+
+
+ @backstage/integration-react +
+
+
+
+ + @backstage/integration-react + +
+
+ + + + +
+
+
+ @backstage/core-components +
+
+
+
+ + @backstage/core-components + +
+
+ + + + +
+
+
+ @backstage/theme +
+
+
+
+ + @backstage/theme + +
+
+ + + + + + + +
+
+
+ Frontend Package +
+
+
+
+ + Frontend Package + +
+
+ + + +
+
+
+ Isomorphic Package +
+
+
+
+ + Isomorphic Package + +
+
+ + + +
+
+
+ Backend Package +
+
+
+
+ + Backend Package + +
+
+ + + + +
+
+
+ CLI Package +
+
+
+
+ + CLI Package + +
+
+ + + + + + + + + + + + + + + + + + + +
+
+
+ Compatibility +
+
+
+
+ + Compatibility + +
+
+ + + + +
+ + + + + Viewer does not support full SVG 1.1 + + + +
diff --git a/docs/assets/getting-started/b-existing-1.png b/docs/assets/getting-started/b-existing-1.png new file mode 100644 index 0000000000..40562ac29c Binary files /dev/null and b/docs/assets/getting-started/b-existing-1.png differ diff --git a/docs/assets/getting-started/b-existing-2.png b/docs/assets/getting-started/b-existing-2.png new file mode 100644 index 0000000000..b1a9a83037 Binary files /dev/null and b/docs/assets/getting-started/b-existing-2.png differ diff --git a/docs/assets/getting-started/b-existing-3.png b/docs/assets/getting-started/b-existing-3.png new file mode 100644 index 0000000000..cad6894d86 Binary files /dev/null and b/docs/assets/getting-started/b-existing-3.png differ diff --git a/docs/assets/getting-started/b-existing-4.png b/docs/assets/getting-started/b-existing-4.png new file mode 100644 index 0000000000..33ebe353b5 Binary files /dev/null and b/docs/assets/getting-started/b-existing-4.png differ diff --git a/docs/assets/getting-started/b-scaffold-1.png b/docs/assets/getting-started/b-scaffold-1.png new file mode 100644 index 0000000000..094b104b7c Binary files /dev/null and b/docs/assets/getting-started/b-scaffold-1.png differ diff --git a/docs/assets/getting-started/b-scaffold-2.png b/docs/assets/getting-started/b-scaffold-2.png new file mode 100644 index 0000000000..db66b83a26 Binary files /dev/null and b/docs/assets/getting-started/b-scaffold-2.png differ diff --git a/docs/assets/getting-started/b-scaffold-3.png b/docs/assets/getting-started/b-scaffold-3.png new file mode 100644 index 0000000000..b98ec2d8e3 Binary files /dev/null and b/docs/assets/getting-started/b-scaffold-3.png differ diff --git a/docs/assets/getting-started/gh-oauth.png b/docs/assets/getting-started/gh-oauth.png new file mode 100644 index 0000000000..dbe89c4070 Binary files /dev/null and b/docs/assets/getting-started/gh-oauth.png differ diff --git a/docs/assets/getting-started/gh-pat.png b/docs/assets/getting-started/gh-pat.png new file mode 100644 index 0000000000..a5b8079225 Binary files /dev/null and b/docs/assets/getting-started/gh-pat.png differ diff --git a/docs/auth/bitbucket/provider.md b/docs/auth/bitbucket/provider.md index 63dfb815e0..ee87c2d4e6 100644 --- a/docs/auth/bitbucket/provider.md +++ b/docs/auth/bitbucket/provider.md @@ -50,3 +50,41 @@ The Bitbucket provider is a structure with two configuration keys: To add the provider to the frontend, add the `bitbucketAuthApi` reference and `SignInPage` component as shown in [Adding the provider to the sign-in page](../index.md#adding-the-provider-to-the-sign-in-page). + +## Using Bitbucket for sign-in + +In order to use the Bitbucket provider for sign-in, you must configure it with a +`signIn.resolver`. See the +[Sign-In Resolver documentation](../identity-resolver.md) for more details on +how this is done. Note that for the Bitbucket provider, you'll want to use +`bitbucket` as the provider ID, and `createBitbucketProvider` for the provider +factory. + +The `@backstage/plugin-auth-backend` plugin also comes with two built-in +resolves that can be used if desired. The first one is the +`bitbucketUsernameSignInResolver`, which identifies users by matching their +Bitbucket username to `bitbucket.org/username` annotations of `User` entities in +the catalog. Note that you must populate your catalog with matching entities or +users will not be able to sign in. + +The second resolver is the `bitbucketUsernameSignInResolver`, which works the +same way, but uses the Bitbucket user ID instead, and matches on the +`bitbucket.org/user-id` annotation. + +The following is an example of how to use one of the built-in resolvers: + +```ts +import { + createBitbucketProvider, + bitbucketUsernameSignInResolver, +} from '@backstage/plugin-auth-backend'; + +// ... + providerFactories: { + bitbucket: createBitbucketProvider({ + signIn: { + resolver: bitbucketUsernameSignInResolver, + }, + }), + }, +``` diff --git a/docs/auth/microsoft/provider.md b/docs/auth/microsoft/provider.md index 1e24235f1a..ef79127223 100644 --- a/docs/auth/microsoft/provider.md +++ b/docs/auth/microsoft/provider.md @@ -48,6 +48,6 @@ The Microsoft provider is a structure with three configuration keys: ## Adding the provider to the Backstage frontend -To add the provider to the frontend, add the `microsoftAuthApi` reference and +To add the provider to the frontend, add the `microsoftAuthApiRef` reference and `SignInPage` component as shown in [Adding the provider to the sign-in page](../index.md#adding-the-provider-to-the-sign-in-page). diff --git a/docs/conf/writing.md b/docs/conf/writing.md index 7945d6c980..a4da1e3df0 100644 --- a/docs/conf/writing.md +++ b/docs/conf/writing.md @@ -67,7 +67,7 @@ production build. ## Configuration Files -It is possible to have multiple configuration files (bundled and/or remote), +It is possible to have multiple configuration files (bundled and/or remote\*), both to support different environments, but also to define configuration that is local to specific packages. The configuration files to load are selected using a `--config ` flag, and it is possible to load any number of @@ -77,6 +77,9 @@ root when running the backend, you would use `--config ../../my-config.yaml`, and for config file on a config server you would use `--config https://some.domain.io/app-config.yaml` +**Note**: In case URLs are passed, it is also needed to set the remote option in +the loadBackendConfig call. + If no `config` flags are specified, the default behavior is to load `app-config.yaml` and, if it exists, `app-config.local.yaml` from the repo root. In the provided project setup, `app-config.local.yaml` is `.gitignore`'d, making diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 07a12f54a0..492cd86022 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -39,6 +39,7 @@ kubernetes: region: 'europe-west1' skipTLSVerify: true skipMetricsLookup: true + exposeDashboard: true ``` ### `serviceLocatorMethod` @@ -113,9 +114,13 @@ kubectl -n get secret $(kubectl -n get sa ``` + +## How to limit what can be searched in the Software Catalog + +The Software Catalog includes a wealth of information about the components, +systems, groups, users, and other aspects of your software ecosystem. However, +you may not always want _every_ aspect to appear when a user searches the +catalog. Examples include: + +- Entities of kind `Location`, which are often not useful to Backstage users. +- Entities of kind `User` or `Group`, if you'd prefer that users and groups be + exposed to search in a different way (or not at all). + +It's possible to write your own [Collator](./concepts.md#collators) to control +exactly what's available to search, (or a [Decorator](./concepts.md#decorators) +to filter things out here and there), but the `DefaultCatalogCollator` that's +provided by `@backstage/plugin-catalog-backend` offers some configuration too! + +```diff +// packages/backend/src/plugins/search.ts + +indexBuilder.addCollator({ + defaultRefreshIntervalSeconds: 600, + collator: DefaultCatalogCollator.fromConfig(config, { + discovery, + tokenManager, ++ filter: { ++ kind: ['API', 'Component', 'Domain', 'Group', 'System', 'User'], ++ }, + }), +}); +``` + +As shown above, you can add a catalog entity filter to narrow down what catalog +entities are indexed by the search engine. diff --git a/docs/features/search/search-engines.md b/docs/features/search/search-engines.md index 1331c73b72..8342c74096 100644 --- a/docs/features/search/search-engines.md +++ b/docs/features/search/search-engines.md @@ -90,6 +90,18 @@ within your instance. The configuration options are documented in the The underlying functionality is using official ElasticSearch client version 7.x, meaning that ElasticSearch version 7 is the only one confirmed to be supported. +Should you need to create your own bespoke search experiences that require more +than just a query translator (such as faceted search or Relay pagination), you +can access the configuration of the search engine in order to create new elastic +search clients. The version of the client need not be the same as one used +internally by the elastic search engine plugin. For example: + +```typescript +import { Client } from '@elastic/elastic-search'; + +const client = searchEngine.newClient(options => new Client(options)); +``` + ## Example configurations ### AWS diff --git a/docs/features/software-catalog/catalog-customization.md b/docs/features/software-catalog/catalog-customization.md index e80e8a1842..821f39ff6e 100644 --- a/docs/features/software-catalog/catalog-customization.md +++ b/docs/features/software-catalog/catalog-customization.md @@ -10,8 +10,7 @@ and find catalog entities. This is already set up by default by `@backstage/create-app`. If you want to change the default index page - such as to add a custom filter to -the catalog - you can replace the routing in `App.tsx` to point to your own -`CatalogIndexPage`. +the catalog - you can create your own `CatalogIndexPage`. > Note: The catalog index page is designed to have a minimal code footprint to > support easy customization, but creating a copy does introduce a possibility @@ -21,23 +20,25 @@ the catalog - you can replace the routing in `App.tsx` to point to your own For example, suppose that I want to allow filtering by a custom annotation added to entities, `company.com/security-tier`. To start, I'll copy the code for the -default catalog page and create a component in a -[new plugin](../../plugins/create-a-plugin.md): +default catalog page and create a component. ```tsx // imports, etc omitted for brevity. for full source see: -// https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +// https://github.com/backstage/backstage/blob/master/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx export const CustomCatalogPage = ({ columns, actions, initiallySelectedFilter = 'owned', }: CatalogPageProps) => { + const createComponentLink = useRouteRef( + catalogPlugin.externalRoutes.createComponent, + ); return ( }> - + All your software catalog entities @@ -167,21 +168,7 @@ export const CustomCatalogPage = ({ }; ``` -This page itself can be exported as a routable extension in the plugin: - -```ts -export const CustomCatalogIndexPage = myPlugin.provide( - createRoutableExtension({ - name: 'CustomCatalogIndexPage', - component: () => - import('./components/CustomCatalogPage').then(m => m.CustomCatalogPage), - mountPoint: catalogRouteRef, - }), -); -``` - -Finally, we can replace the catalog route in the Backstage application with our -new `CustomCatalogIndexPage`. +Finally, we can apply our new `CustomCatalogPage`. ```diff # packages/app/src/App.tsx @@ -189,7 +176,9 @@ const routes = ( - } /> -+ } /> ++ }> ++ ++ ``` The same method can be used to customize the _default_ filters with a different diff --git a/docs/features/software-templates/writing-custom-field-extensions.md b/docs/features/software-templates/writing-custom-field-extensions.md index ebb7af4398..fab2e1e2cb 100644 --- a/docs/features/software-templates/writing-custom-field-extensions.md +++ b/docs/features/software-templates/writing-custom-field-extensions.md @@ -26,7 +26,7 @@ You can create your own Field Extension by using the `API` like below: ```tsx -//packages/app/scaffolder/MyCustomExtension/MyCustomExtension.tsx +//packages/app/src/scaffolder/MyCustomExtension/MyCustomExtension.tsx import React from 'react'; import { FieldProps, FieldValidation } from '@rjsf/core'; import FormControl from '@material-ui/core/FormControl'; @@ -68,7 +68,7 @@ export const myCustomValidation = ( ``` ```tsx -// packages/app/scaffolder/MyCustomExtension/extensions.ts +// packages/app/src/scaffolder/MyCustomExtension/extensions.ts /* This is where the magic happens and creates the custom field extension. @@ -94,7 +94,7 @@ export const MyCustomFieldExtension = plugin.provide( ``` ```tsx -// packages/app/scaffolder/MyCustomExtension/index.ts +// packages/app/src/scaffolder/MyCustomExtension/index.ts export { MyCustomFieldExtension } from './extension'; ``` @@ -102,7 +102,7 @@ export { MyCustomFieldExtension } from './extension'; Once all these files are in place, you then need to provide your custom extension to the `scaffolder` plugin. -You do this in `packages/app/App.tsx`. You need to provide the +You do this in `packages/app/src/App.tsx`. You need to provide the `customFieldExtensions` as children to the `ScaffolderPage`. ```tsx @@ -118,7 +118,7 @@ const routes = ( Should look something like this instead: ```tsx -import { MyCustomFieldExtension } from './scafffolder/MyCustomExtension'; +import { MyCustomFieldExtension } from './scaffolder/MyCustomExtension'; const routes = ( ... diff --git a/docs/features/techdocs/configuring-ci-cd.md b/docs/features/techdocs/configuring-ci-cd.md index 0dec7ec24e..96d841eadf 100644 --- a/docs/features/techdocs/configuring-ci-cd.md +++ b/docs/features/techdocs/configuring-ci-cd.md @@ -10,7 +10,7 @@ TechDocs reads the static generated documentation files from a cloud storage bucket (GCS, AWS S3, etc.). The documentation site is generated on the CI/CD workflow associated with the repository containing the documentation files. This document explains the steps needed to generate docs on CI and publish to a cloud -storage using [`techdocs-cli`](https://github.com/backstage/techdocs-cli). +storage using [`techdocs-cli`](./cli.md). The steps here target all kinds of CI providers (GitHub Actions, CircleCI, Jenkins, etc.). Specific tools for individual providers will also be made @@ -40,9 +40,8 @@ techdocs-cli publish --publisher-type awsS3 --storage-name -- That's it! -Take a look at -[`techdocs-cli` README](https://github.com/backstage/techdocs-cli) for the -complete command reference, details, and options. +Take a look at [`techdocs-cli`](./cli.md) for the complete command reference, +details, and options. ## Steps @@ -74,7 +73,7 @@ Install [`npx`](https://www.npmjs.com/package/npx) to use it for running `techdocs-cli`. Or you can install using `npm install -g @techdocs/cli`. We are going to use the -[`techdocs-cli generate`](https://github.com/backstage/techdocs-cli#generate-techdocs-site-from-a-documentation-project) +[`techdocs-cli generate`](./cli.md#generate-techdocs-site-from-a-documentation-project) command in this step. ```sh @@ -93,8 +92,7 @@ necessary authentication environment variables. - [AWS authentication](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html) And then run the -[`techdocs-cli publish`](https://github.com/backstage/techdocs-cli#publish-generated-techdocs-sites) -command. +[`techdocs-cli publish`](./cli.md#publish-generated-techdocs-sites) command. ```sh npx @techdocs/cli publish --publisher-type --storage-name --entity --directory ./site diff --git a/docs/features/techdocs/getting-started.md b/docs/features/techdocs/getting-started.md index d79f6bb891..37e135d1dc 100644 --- a/docs/features/techdocs/getting-started.md +++ b/docs/features/techdocs/getting-started.md @@ -230,7 +230,7 @@ You can do so by including the following lines in the last step of your ```Dockerfile RUN apt-get update && apt-get install -y python3 python3-pip -RUN pip3 install mkdocs-techdocs-core==0.0.16 +RUN pip3 install mkdocs-techdocs-core==0.2.2 ``` Please be aware that the version requirement could change, you need to check our diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index 8ff486af37..d9a8ffb93a 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -421,3 +421,24 @@ folder (/docs) or replace the content in this file. > on how you have configured your `template.yaml` Done! You now have support for TechDocs in your own software template! + +## how to enable iframes in TechDocs + +Techdocs uses the [DOMPurify](https://github.com/cure53/DOMPurify) to sanitizes +HTML and prevents XSS attacks + +It's possible to allow some iframes based on a list of allowed hosts. To do +this, add the allowed hosts in the `techdocs.sanitizer.allowedIframeHosts` +configuration of your `app-config.yaml` + +E.g. + +```yaml +techdocs: + sanitizer: + allowedIframeHosts: + - drive.google.com +``` + +This way, all iframes where the host of src attribute is in the +`sanitizer.allowedIframeHosts` list will be displayed diff --git a/docs/getting-started/app-custom-theme.md b/docs/getting-started/app-custom-theme.md index 241ae7ef03..d05a14cc35 100644 --- a/docs/getting-started/app-custom-theme.md +++ b/docs/getting-started/app-custom-theme.md @@ -53,8 +53,10 @@ To add a custom theme to your Backstage app, you pass it as configuration to For example, adding the theme that we created in the previous section can be done like this: -```ts -import { createApp } from '@backstage/core-app-api'; +```tsx +import { createApp } from '@backstage/app-defaults'; +import { ThemeProvider } from '@material-ui/core/styles'; +import CssBaseline from '@material-ui/core/CssBaseline'; const app = createApp({ apis: ..., @@ -63,7 +65,11 @@ const app = createApp({ id: 'my-theme', title: 'My Custom Theme', variant: 'light', - theme: myTheme, + Provider: ({ children }) => ( + + {children} + + ), }] }) ``` @@ -76,60 +82,67 @@ want to use the default themes, they are exported as `lightTheme` and ## Example of a custom theme ```ts -const themeOptions = createThemeOptions({ +import { + createTheme, + genPageTheme, + lightTheme, + shapes, +} from '@backstage/theme'; + +const myTheme = createTheme({ palette: { ...lightTheme.palette, primary: { - main: '#123456', + main: '#343b58', }, secondary: { - main: '#123456', + main: '#565a6e', }, error: { - main: '#123456', + main: '#8c4351', }, warning: { - main: '#123456', + main: '#8f5e15', }, info: { - main: '#123456', + main: '#34548a', }, success: { - main: '#123456', + main: '#485e30', }, background: { - default: '#123456', - paper: '#123456', + default: '#d5d6db', + paper: '#d5d6db', }, banner: { - info: '#123456', - error: '#123456', - text: '#123456', - link: '#123456', + info: '#34548a', + error: '#8c4351', + text: '#343b58', + link: '#565a6e', }, - errorBackground: '#123456', - warningBackground: '#123456', - infoBackground: '#123456', + errorBackground: '#8c4351', + warningBackground: '#8f5e15', + infoBackground: '#343b58', navigation: { - background: '#123456', - indicator: '#123456', - color: '#123456', - selectedColor: '#123456', + background: '#343b58', + indicator: '#8f5e15', + color: '#d5d6db', + selectedColor: '#ffffff', }, }, defaultPageTheme: 'home', - fontFamily: 'Comic Sans', + fontFamily: 'Comic Sans MS', /* below drives the header colors */ pageTheme: { - home: genPageTheme(['#123456', '#123456'], shapes.wave), - documentation: genPageTheme(['#123456', '#123456'], shapes.wave2), - tool: genPageTheme(['#123456', '#123456'], shapes.round), - service: genPageTheme(['#123456', '#123456'], shapes.wave), - website: genPageTheme(['#123456', '#123456'], shapes.wave), - library: genPageTheme(['#123456', '#123456'], shapes.wave), - other: genPageTheme(['#123456', '#123456'], shapes.wave), - app: genPageTheme(['#123456', '#123456'], shapes.wave), - apis: genPageTheme(['#123456', '#123456'], shapes.wave), + home: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + documentation: genPageTheme(['#8c4351', '#343b58'], shapes.wave2), + tool: genPageTheme(['#8c4351', '#343b58'], shapes.round), + service: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + website: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + library: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + other: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + app: genPageTheme(['#8c4351', '#343b58'], shapes.wave), + apis: genPageTheme(['#8c4351', '#343b58'], shapes.wave), }, }); ``` @@ -162,7 +175,7 @@ wouldn't be enough to alter the `box-shadow` property or to add css rules that aren't already defined like a margin. For these cases you should also create an override. -```ts +```tsx import { createApp } from '@backstage/core-app-api'; import { BackstageTheme, lightTheme } from '@backstage/theme'; /** @@ -187,6 +200,16 @@ export const createCustomThemeOverrides = ( }; }; +const customTheme: BackstageTheme = { + ...lightTheme, + overrides: { + // These are the overrides that Backstage applies to `material-ui` components + ...lightTheme.overrides, + // These are your custom overrides, either to `material-ui` or Backstage components. + ...createCustomThemeOverrides(lightTheme), + }, +}; + const app = createApp({ apis: ..., plugins: ..., @@ -194,15 +217,11 @@ const app = createApp({ id: 'my-theme', title: 'My Custom Theme', variant: 'light', - theme: { - ...lightTheme, - overrides: { - // These are the overrides that Backstage applies to `material-ui` components - ...lightTheme.overrides, - // These are your custom overrides, either to `material-ui` or Backstage components. - ...createCustomThemeOverrides(lightTheme), - }, - }, + Provider: ({ children }) => ( + + {children} + + ), }] }); ``` @@ -234,3 +253,73 @@ const LogoFull = () => { return ; }; ``` + +## Custom Homepage + +In addition to a custom theme, a custom logo, you can also customize the +homepage of your app. To do that we need to go through a few steps. + +### Setting up the Home Page + +1. Create a Home Page Component that will be used for composition. + +`packages/app/src/components/home/HomePage.tsx` + +```tsx +import React from 'react'; + +export const HomePage = () => { + return { + /* TODO: Compose a Home Page here */ + }; +}; +``` + +2. Add a route where the homepage will live, presumably `/`. + +`packages/app/src/App.tsx` + +```tsx +import { HomepageCompositionRoot } from '@backstage/plugin-home'; +import { HomePage } from './components/home/HomePage'; + +// ... +}> + +; +// ... +``` + +### Composing your Home Page + +Composing a Home Page is no different from creating a regular React Component, +i.e. the App Integrator is free to include whatever content they like. However, +there are components developed with the Home Page in mind. If you are looking +for components to use when composing your homepage, you can take a look at the +[collection of Homepage components](https://backstage.io/?path=/story/plugins-home-components) +in storybook. If you don't find a component that suits your needs but want to +contribute, check the +[Contributing documentation](https://github.com/backstage/backstage/blob/master/plugins/home/README.md#contributing). + +!!! tip If you want to use one of the available homepage templates you can find +the +[templates](https://backstage.io/storybook/?path=/story/plugins-home-templates) +in the storybook under the "Home" plugin. And if you would like to contribute a +template, please see the +[Contributing documentation](https://github.com/backstage/backstage/blob/master/plugins/home/README.md#contributing) + +```tsx +import React from 'react'; +import Grid from '@material-ui/core/Grid'; +import { HomePageCompanyLogo } from '@backstage/plugin-home'; + +export const HomePage = () => { + return ( + + + + + + ); +}; +``` diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md new file mode 100644 index 0000000000..55285e7f4e --- /dev/null +++ b/docs/getting-started/configuration.md @@ -0,0 +1,311 @@ +--- +id: configuration +title: Getting Started, configuring Backstage +description: Getting started with your initial Backstage configuration +--- + +This is part two of the Getting Started documentation of Backstage. The steps in +this tutorial assume you've installed Backstage app from the npm repository, +like in the [Getting Started guide](./index.md) and want to configure Backstage. + +At the end of this tutorial, you can expect: + +- Backstage to use a PostgreSQL database +- You'll authenticate using one of the auth providers +- The Backstage GitHub integration to be configured +- You're able to use Software Templates + +### Prerequisites + +- Access to a Linux-based operating system, such as Linux, MacOS or + [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/) +- An account with elevated rights to install prerequisites on your operating + system +- If the database is not hosted on the same server as the Backstage app, the + PostgreSQL port needs to be accessible (the default is 5432 or 5433) + +### Install and configure PostgreSQL + +These instructions can be skipped if you already have a PostgreSQL server +installed and created a schema and user. The example below is for Linux, but +luckily there's detailed instructions on how to +[install PostgreSQL](https://www.postgresql.org/download/) to help you get +started. + +```shell +sudo apt-get install postgresql +``` + +Test if your database is working: + +```shell +sudo -u postgres psql +``` + +You should see a very welcoming message, like: + +```shell +psql (12.9 (Ubuntu 12.9-0ubuntu0.20.04.1)) +Type "help" for help. + +postgres=# +``` + +For this tutorial we're going to use the existing postgres user. The next step +is to set the password for this user: + +```shell +postgres=# ALTER USER postgres PASSWORD 'secret'; +``` + +That's enough database administration to get started. Type `\q`, followed by +pressing the enter key. Then again type `exit` and press enter. Next, you need +to install and configure the client. + +Stop Backstage, and go to the root directory of your freshly installed Backstage +App. Use the following commands to start the PostgreSQL client installation: + +```shell +# From your Backstage root directory +cd packages/backend +yarn add pg +``` + +Use your favorite editor to open `app-config.yaml` and add your PostgreSQL +configuration. in the root directory of your Backstage app using the credentials +from the previous steps. + +```diff +backend: + database: +- client: sqlite3 +- connection: ':memory:' ++ # config options: https://node-postgres.com/api/client ++ client: pg ++ connection: ++ host: ${POSTGRES_HOST} ++ port: ${POSTGRES_PORT} ++ user: ${POSTGRES_USER} ++ password: ${POSTGRES_PASSWORD} ++ # https://node-postgres.com/features/ssl ++ #ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require) ++ #ca: # if you have a CA file and want to verify it you can uncomment this section ++ #$file: /ca/server.crt +``` + +You'll use the connection details from the previous step. You can either set the +`POSTGRES_` environment variables prior to launching Backstage, or remove the +`${...}` values and set actual values in this configuration file. + +The default port for PostgreSQL is `5432` or `5433`, and the host name could be +`127.0.0.1` if installed locally. A word of caution: In general, using +connection details in a configuration file is not recommended. + +Start the Backstage app: + +```shell +yarn dev +``` + +After Backstage is completely started you'll notice the catalog is populated +with the information, still coming from the configuration files. If you add a +new component, or register an existing one it will be saved in the database. +Later in this tutorial you'll add a service, and you can test if it's persistent +as advertised. + +If you want to read more about the database configuration, here's some helpful +links: + +- [Configuring Plugin Databases](../tutorials/configuring-plugin-databases.md#privileges) +- [Read more about Knex](http://knexjs.org/), which is the library we use for + the database backend + +### Setting up authentication + +There's multiple authentication providers available for you to use with +Backstage, feel free to follow +[the instructions for adding authentication](../auth/). + +For this tutorial we choose to use GitHub, a free service most of you might be +familiar with. For other options, see +[the auth provider documentation](../auth/github/provider.md#create-an-oauth-app-on-github). + +Go to +[https://github.com/settings/applications/new](https://github.com/settings/applications/new) +to create your OAuth App. The `Homepage URL` should point to Backstage's +frontend, in our tutorial it would be `http://127.0.0.1:3000`. The +`Authorization callback URL` will point to the auth backend, which will most +likely be `http://127.0.0.1:7007/api/auth/github/handler/frame`. + +

+ Screenshot of the GitHub OAuth creation page +

+ +Take note of the `Client ID` and the `Client Secret`. Open `app-config.yaml`, +and add your `clientId` and `clientSecret` to this file. It should end up +looking like this: + +```yaml +auth: + # see https://backstage.io/docs/auth/ to learn about auth providers + environment: development + providers: + github: + development: + clientId: YOUR CLIENT ID + clientSecret: YOUR CLIENT SECRET +``` + +Backstage will re-read the configuration. If there's no errors, that's great! We +can continue with the last part of the configuration. The next step is needed to +change the sign-in page, this you actually need to add in the source code. + +Open `packages/app/src/App.tsx` and below the last `import` line, add: + +```typescript +import { githubAuthApiRef } from '@backstage/core-plugin-api'; +import { SignInProviderConfig, SignInPage } from '@backstage/core-components'; + +const githubProvider: SignInProviderConfig = { + id: 'github-auth-provider', + title: 'GitHub', + message: 'Sign in using GitHub', + apiRef: githubAuthApiRef, +}; +``` + +Search for `const app = createApp({` in this file, and below `apis,` add: + +```typescript +components: { + SignInPage: props => ( + + ), + }, +``` + +That should be it. You can stop your Backstage App. When you start it again and +go to your Backstage portal in your browser, you should have your login prompt! + +To learn more about Authentication in Backstage, there's the following docs you +could read: + +- [Adding Authentication](../auth/) +- [Adding a new Authentication Provider](../auth/add-auth-provider.md) +- [Using authentication and identity](../auth/using-auth.md) +- [Using organizational data from GitHub](../integrations/github/org.md) + +### Setting up a GitHub Integration + +The GitHub integration supports loading catalog entities from GitHub or GitHub +Enterprise. Entities can be added to static catalog configuration, registered +with the catalog-import plugin, or discovered from a GitHub organization. Users +and Groups can also be loaded from an organization. While using GitHub Apps +might be the best way to set up integrations, for this tutorial you'll use a +Personal Access Token. + +Create your Personal Access Token by opening the +[the GitHub token creation page](https://github.com/settings/tokens/new). Use a +name to identify this token and put it in the notes field. Choose a number of +days for expiration. If you have a hard time picking a number, we suggest to go +for 7 days, it's a lucky number. + +

+ Screenshot of the GitHub Personal Access Token creation page +

+ +Set the scope to your likings. For this tutorial, selecting "repo" should be +enough. + +In the `app-config.yaml`, search for `integrations:` and add your token, like we +did in below example: + +```yaml +integrations: + github: + - host: github.com + token: ghp_urtokendeinfewinfiwebfweb +``` + +That's settled. This information will be leveraged by other plugins. + +Some helpful links, for if you want to learn more about: + +- [Other available integrations](../integrations/) +- [Using GitHub Apps instead of a Personal Access Token](../plugins/github-apps.md#docsNav) + +### Explore what we've done so far + +## Login to Backstage and check profile + +Open your Backstage frontend. You should see your login screen if you're not +logged in yet. As soon as you've logged in, go to Settings, you'll see your +profile. Hopefully you'll recognize the profile picture and name on your screen, +otherwise something went terribly wrong. + +## Register an existing component + +- Register a new component, by going to `create` and choose + `Register existing component` + +

+ Software template main screen, with a blue button to add an existing component +

+ +- As URL use `https://github.com/backstage/demo/blob/master/catalog-info.yaml`. + This is used by our [demo site](https://demo.backstage.io). + +

+ Register a new component wizard, asking for an URL to the existing component YAML file +

+- Hit `Analyze` and review the changes. Apply them if correct + +

+ Register a new component wizard, showing the metadata for the component YAML we use in this tutorial +

+ +- You should receive a message that your entities have been added. +- If you go back to `Home`, you should be able to find `demo`. You should be + able to click it and see the details + +## Create a new component using a software template + +- Go to `create` and choose to create a website with the `React SSR Template` +- Type in a name, let's use `tutorial` +- Select the group `group-a` which will own this new website, and go to the next + step + +

+ Software template deployment input screen asking for a name, the group owning this, and a description +

+ +- For the location, we're going to use the default +- As owner, type your GitHub username +- For the repository name, type `tutorial`. Go to the next step + +

+ Software template deployment input screen asking for the GitHub username, and name of the new repo to create +

+ +- Review the details of this new service, and press `Create` if you want to + deploy it like this. + - You can follow along with the progress, and as soon as every step is + finished, you can take a look at your new service + +Achievement unlocked. You've set up an installation of the core Backstage App, +made it persistent, and configured it so you are now able to use software +templates. + +Let us know how your experience was: [on discord](https://discord.gg/EBHEGzX), +file issues for any +[feature](https://github.com/backstage/backstage/issues/new?labels=help+wanted&template=feature_template.md) +or +[plugin suggestions](https://github.com/backstage/backstage/issues/new?labels=plugin&template=plugin_template.md&title=%5BPlugin%5D+THE+PLUGIN+NAME), +or +[bugs](https://github.com/backstage/backstage/issues/new?labels=bug&template=bug_template.md) +you have, and feel free to +[contribute](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md)! diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md index 42b334c62b..a622313739 100644 --- a/docs/getting-started/index.md +++ b/docs/getting-started/index.md @@ -87,14 +87,11 @@ carry on with the database steps. Screenshot of the Backstage portal.

-The most common next steps are to move to a persistent database, configure -authentication, and add a plugin: +In the next part of this tutorial, you'll learn how to change to a persistent +database, configure authentication, and add your first integration. Continue +with [getting started: Configuring Backstage](configuration.md). -- [Switching from SQLite to PostgresQL](https://backstage.io/docs/tutorials/switching-sqlite-postgres) -- [Setting up Authentication](https://backstage.io/docs/auth/) -- [Adding a plugin](https://backstage.io/docs/getting-started/configure-app-with-plugins) - -Congratulations! That should be it. Let us know how it went: +Share your experiences, comments, or suggestions with us: [on discord](https://discord.gg/EBHEGzX), file issues for any [feature](https://github.com/backstage/backstage/issues/new?labels=help+wanted&template=feature_template.md) or diff --git a/docs/getting-started/keeping-backstage-updated.md b/docs/getting-started/keeping-backstage-updated.md index ffe4f4dcd5..107119aace 100644 --- a/docs/getting-started/keeping-backstage-updated.md +++ b/docs/getting-started/keeping-backstage-updated.md @@ -22,6 +22,13 @@ yarn backstage-cli versions:bump The reason for bumping all `@backstage` packages at once is to maintain the dependencies that they have between each other. +If you are using other plugins you can pass in the `--pattern` option to update +more than just the `@backstage/*` dependencies. + +```bash +yarn backstage-cli versions:bump --pattern '@{backstage,roadiehq}/*' +``` + ## Following create-app template changes The `@backstage/create-app` command creates the initial structure of your diff --git a/docs/integrations/aws-s3/locations.md b/docs/integrations/aws-s3/locations.md index fe1c6050c2..b0c6829e2c 100644 --- a/docs/integrations/aws-s3/locations.md +++ b/docs/integrations/aws-s3/locations.md @@ -20,8 +20,7 @@ To use this integration, add configuration to your `app-config.yaml`: ```yaml integrations: awsS3: - - host: amazonaws.com - accessKeyId: ${AWS_ACCESS_KEY_ID} + - accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} ``` @@ -35,8 +34,21 @@ instruct the AWS S3 reader to assume a role before accessing S3: ```yaml integrations: awsS3: - - host: amazonaws.com - accessKeyId: ${AWS_ACCESS_KEY_ID} + - accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} roleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/example-role' ``` + +Configuration allows specifying custom S3 endpoint, along with +[path-style access](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html) +to support integration with providers like +[LocalStack](https://github.com/localstack/localstack): + +```yaml +integrations: + awsS3: + - endpoint: 'http://localhost:4566' + s3ForcePathStyle: true + accessKeyId: ${AWS_ACCESS_KEY_ID} + secretAccessKey: ${AWS_SECRET_ACCESS_KEY} +``` diff --git a/docs/local-dev/cli-commands.md b/docs/local-dev/cli-commands.md index 318b37f34e..caec60ed70 100644 --- a/docs/local-dev/cli-commands.md +++ b/docs/local-dev/cli-commands.md @@ -434,7 +434,8 @@ Usage: backstage-cli build [options] Options: --outputs <formats> List of formats to output [types,cjs,esm] - -h, --help display help for command + --minify Minify the generated code + -h, --help display help for command ``` ## lint @@ -593,6 +594,7 @@ Usage: backstage-cli versions:bump [options] Options: -h, --help display help for command + -p, --pattern Override glob for matching packages to upgrade ``` ## versions:check diff --git a/docs/overview/architecture-overview.md b/docs/overview/architecture-overview.md index 3425b02db9..d3f171e4f8 100644 --- a/docs/overview/architecture-overview.md +++ b/docs/overview/architecture-overview.md @@ -164,12 +164,104 @@ https://circleci.com. ![CircleCI plugin talking to proxy talking to SaaS Circle CI](../assets/architecture-overview/circle-ci-plugin-architecture.png) +## Package Architecture + +Backstage relies heavily on NPM packages, both for distribution of libraries, +and structuring of code within projects. While the way you structure your +Backstage project is up to you, there is a set of established patterns that we +encourage you to follow. These patterns can help set up a sound project +structure as well as provide familiarity between different Backstage projects. + +The following diagram shows an overview of the package architecture of +Backstage. It takes the point of view of an individual plugin and all of the +packages that it may contain, indicated by the thicker border and italic text. +Surrounding the plugin are different package groups which are the different +possible interface points of the plugin. Note that not all library package lists +are complete as packages have been omitted for brevity. + +![Package architecture](../assets/architecture-overview/package-architecture.drawio.svg) + +### Overview + +The arrows in the diagram above indicate a runtime dependency on the code of the +target package. This strict dependency graph only applies to runtime +`dependencies`, and there may be `devDependencies` that break the rules of this +table for the purpose of testing. While there are some arrows that show a +dependency on a collection of frontend, backend and isomorphic packages, those +still have to abide by important compatibility rules shown in the bottom left. + +The `app` and `backend` packages are the entry points of a Backstage project. +The `app` package is the frontend application that brings together a collection +of frontend plugins and customizes them to fit an organization, while the +`backend` package is the backend service that powers the Backstage application. +Worth noting is that there can be more than one instance of each of these +packages within a project. Particularly the `backend` packages can benefit from +being split up into smaller deployment units that each serve their own purpose +with a smaller collection of plugins. + +### Plugin Packages + +A typical plugin consists of up to five packages, two frontend ones, two +backend, and one isomorphic packages. All packages within the plugin must share +a common prefix, typically of the form `@/plugin-`, but +alternatives like `backstage-plugin-` or +`@scope/backstage-plugin-` are also valid. Along with this prefix, +each of the packages have their own unique suffix that denotes their role. In +addition to these five plugin packages it's also possible for to a plugin to +have additional frontend and backend modules that can be installed to enable +optional features. For a full list of suffixes and their roles, see the +[Plugin Package Structure ADR](../architecture-decisions/adr011-plugin-package-structure.md). + +The `-react`, `-common`, and `-node` plugin packages together form the external +library of a plugin. The plugin library enables other plugins to build on top of +and extend a plugin, and likewise allows the plugin to depend on and extend +other plugins. Because of this, it is preferable that plugin library packages +allow duplicate installations of themselves, as you may end up with a mix of +versions being installed as dependencies of various plugins. It is also +forbidden for plugins to directly import non-library packages from other +plugins, all communication between plugins must be handled through libraries and +the application itself. + +### Frontend Packages + +The frontend packages are grouped into two main groups. The first one is +"Frontend App Core", which is the set of packages that are only used by the +`app` package itself. These packages help build up the core structure of the app +as well as provide a foundation for the plugin libraries to rely upon. + +The second group is the rest of the shared packages, further divided into +"Frontend Plugin Core" and "Frontend Libraries". The core packages that are +considered particularly stable and form the core of the frontend framework. +Their most important role is to form the boundary around each plugin and provide +a set of tools that helps you combine a collection of plugins into a running +application. The rest of the frontend packages are more traditional libraries +that serve as building blocks to create plugins. + +### Backend Packages + +The backend library packages do not currently share a similar plugin +architecture as the frontend packages. They are instead simply a collection of +building blocks and patterns that help you build backend services. This is +however likely to change in the future. + +### Common Packages + +The common packages are the packages are effectively depended on by all other +pages. This is a much smaller set of packages but they are also very pervasive. +Because the common packages are isomorphic and must execute both in the frontend +and backend, they are never allowed to depend on any of the frontend of backend +packages. + +The Backstage CLI is in a category of its own and is depended on by virtually +all other packages. It's not a library in itself though, and must always be a +development dependency only. + ## Databases As we have seen, both the `lighthouse-audit-service` and `catalog-backend` require a database to work with. -The Backstage backend and its builtin plugins are based on the +The Backstage backend and its built-in plugins are based on the [Knex](http://knexjs.org/) library, and set up a separate logical database per plugin. This gives great isolation and lets them perform migrations and evolve separate from each other. @@ -184,7 +276,7 @@ yet. ## Cache -The Backstage backend and its builtin plugins are also able to leverage cache +The Backstage backend and its built-in plugins are also able to leverage cache stores as a means of improving performance or reliability. Similar to how databases are supported, plugins receive logically separated cache connections, which are powered by [Keyv](https://github.com/lukechilds/keyv) under the hood. diff --git a/docs/overview/roadmap.md b/docs/overview/roadmap.md index fa34ca3d9a..4fde1662eb 100644 --- a/docs/overview/roadmap.md +++ b/docs/overview/roadmap.md @@ -65,11 +65,6 @@ cycle will vary based on maintainer schedules. The following features are planned for release: -- **Composable homepage:** We’re seeing lots of interest from the community in - reusable components to build a homepage experience where users can easily - surface what they might find useful to start their tasks. Check out the - [milestone](https://github.com/backstage/backstage/milestone/34) for further - details. - **Improved responsiveness:** Check out the [RFC here](https://github.com/backstage/backstage/issues/6318) for further details on how to improve the responsiveness for Backstage's UI. @@ -120,23 +115,6 @@ The following features are planned for release: strong caching mechanism. The current version often requires fetching a relevant amount of data, especially at scale. -### Search - -The following features are planned for release: - -- ElasticSearch integration: Add ElasticSearch to the Search Platform as the - underlying search engine. Check out the - [milestone here](https://github.com/backstage/backstage/milestone/27) for - further details. - -### TechDocs - -The following features are planned for release: - -- **TechDocs beta release:** Fix remaining bugs to get TechDocs to Beta. Check - out the [milestone here](https://github.com/backstage/backstage/milestone/29) - for further details. - ## Future work The following feature list doesn’t represent a commitment to develop and the @@ -165,11 +143,6 @@ the maintainers’ radar, with clear interest expressed by the community. bottleneck many concurrent projects created simultaneously. - **API discovery and documentation:** Add better support for the [gRPC](https://grpc.io/). -- **Adding TechDocs search to the Search Platform:** Having this capability in - place will provide a better and new major version of the Search Platform - (v3.0). You can refer to the - [milestone here](https://github.com/backstage/backstage/milestone/28) for - further details. - **TechDocs GA release:** Work toward enhancements necessary to get TechDocs to general availability. Check out the [milestone here](https://github.com/backstage/backstage/milestone/30) for @@ -179,6 +152,10 @@ the maintainers’ radar, with clear interest expressed by the community. Read more about the completed (and released) features for reference. +- [[Search] ElasticSearch integration](https://backstage.io/docs/features/search/search-engines#elasticsearch) +- [[Search] TechDocs search capabilities](https://backstage.io/docs/features/search/how-to-guides#how-to-index-techdocs-documents) +- [TechDocs Beta](https://backstage.spotify.com/blog/product-updates/techdocs-beta-has-landed) +- [[Home] Composable homepage](https://github.com/backstage/backstage/milestone/34) - [[Search] Out-of-the-Box Implementation (Alpha)](https://github.com/backstage/backstage/milestone/26) - [Deploy a product demo at `demo.backstage.io`](https://demo.backstage.io) - [Kubernetes plugin - v1](https://github.com/backstage/backstage/tree/master/plugins/kubernetes) diff --git a/docs/overview/what-is-backstage.md b/docs/overview/what-is-backstage.md index 1d9310541a..1197c37cc7 100644 --- a/docs/overview/what-is-backstage.md +++ b/docs/overview/what-is-backstage.md @@ -15,6 +15,8 @@ high-quality code quickly — without compromising autonomy. Backstage unifies all your infrastructure tooling, services, and documentation to create a streamlined development environment from end to end. + + Out of the box, Backstage includes: - [Backstage Software Catalog](../features/software-catalog/index.md) for diff --git a/docs/plugins/analytics.md b/docs/plugins/analytics.md index ace9a89968..7fbd256e86 100644 --- a/docs/plugins/analytics.md +++ b/docs/plugins/analytics.md @@ -55,10 +55,11 @@ learn how to contribute the integration yourself! The following table summarizes events that, depending on the plugins you have installed, may be captured. -| Action | Provided By | Subject | -| ---------- | -------------- | ----------------------------------------- | -| `navigate` | Backstage Core | The URL of the page that was navigated to | -| `click` | Backstage Core | The text of the link that was clicked on | +| Action | Provided By | Subject | +| ---------- | -------------- | --------------------------------------------------- | +| `navigate` | Backstage Core | The URL of the page that was navigated to | +| `click` | Backstage Core | The text of the link that was clicked on | +| `search` | Backstage Core | The search term entered in any search bar component | If there is an event you'd like to see captured, please [open an issue][add-event] describing the event you want to see and the questions it diff --git a/docs/plugins/composability.md b/docs/plugins/composability.md index 33568ac561..05af512f92 100644 --- a/docs/plugins/composability.md +++ b/docs/plugins/composability.md @@ -368,7 +368,7 @@ The following is an example of creation and usage of a parameterized route: ```tsx // Creation of a parameterized route const myRouteRef = createRouteRef({ - title: 'My Named Route', + id: 'myroute', params: ['name'] }) diff --git a/docs/tutorials/backend-to-backend-auth.md b/docs/tutorials/backend-to-backend-auth.md index 3cb72a4827..cd73a95c89 100644 --- a/docs/tutorials/backend-to-backend-auth.md +++ b/docs/tutorials/backend-to-backend-auth.md @@ -22,6 +22,10 @@ resulting value. node -p 'require("crypto").randomBytes(24).toString("base64")' ``` +**NOTE**: For ease of development, we auto-generate a key for you if you haven't +configured a secret in dev mode. You _must set your own secret_ in order for +backend-to-backend authentication to work in production. + Requests originating from a backend plugin can be authenticated by decorating them with a backend token. Backend tokens can be generated using a `TokenManager`, which can be passed to plugin backends via the @@ -43,7 +47,7 @@ function makeCreateEnv(config: Config) { const cacheManager = CacheManager.fromConfig(config); const databaseManager = DatabaseManager.fromConfig(config); - const tokenManager = ServerTokenManager.noop(); -+ const tokenManager = ServerTokenManager.fromConfig(config); ++ const tokenManager = ServerTokenManager.fromConfig(config, { logger: root }); ``` With this `tokenManager`, you can then generate a server token for requests: diff --git a/docs/tutorials/journey.md b/docs/tutorials/journey.md index 249507ddf0..126bb5ae0d 100644 --- a/docs/tutorials/journey.md +++ b/docs/tutorials/journey.md @@ -48,7 +48,6 @@ that implements the `OAuthApi` type, it's now working in the frontend too. ```ts const spotifyAuthApiRef = createApiRef({ id: 'core.auth.spotify', - description: 'Provides authentication towards Spotify APIs', }); ``` diff --git a/docs/tutorials/quickstart-app-plugin.md b/docs/tutorials/quickstart-app-plugin.md index 938a57198a..d1ca61a11f 100644 --- a/docs/tutorials/quickstart-app-plugin.md +++ b/docs/tutorials/quickstart-app-plugin.md @@ -135,7 +135,7 @@ changes, let's start by wiping this component clean. ```tsx import React from 'react'; -import { useAsync } from 'react-use'; +import useAsync from 'react-use/lib/useAsync'; import Alert from '@material-ui/lab/Alert'; import { Table, TableColumn, Progress } from '@backstage/core-components'; import { githubAuthApiRef, useApi } from '@backstage/core-plugin-api'; diff --git a/docs/tutorials/using-backstage-proxy-within-plugin.md b/docs/tutorials/using-backstage-proxy-within-plugin.md index b0c6bef8ef..771aa7a652 100644 --- a/docs/tutorials/using-backstage-proxy-within-plugin.md +++ b/docs/tutorials/using-backstage-proxy-within-plugin.md @@ -99,7 +99,6 @@ export interface MyAwesomeApi { export const myAwesomeApiRef = createApiRef({ id: 'plugin.my-awesome-api.service', - description: 'Example API definition', }); ``` diff --git a/microsite/blog/2021-12-20-backstage-wrapped-2021.md b/microsite/blog/2021-12-20-backstage-wrapped-2021.md new file mode 100644 index 0000000000..2a6234a9f6 --- /dev/null +++ b/microsite/blog/2021-12-20-backstage-wrapped-2021.md @@ -0,0 +1,145 @@ +--- +title: Backstage Wrapped 2021 +author: Lee Mills, Spotify +authorURL: https://github.com/leemills83 +authorImageURL: https://avatars1.githubusercontent.com/u/1236238?s=460&v=4 +--- + +![Backstage in 2021: 75+ public adopters, 500+ contributors, almost 2,000 forks, 9,000+ contributions, 4,000+ Discord members](assets/21-12-20/backstage-wrapped-2021.png) + +What a year 2021 has been for the Backstage project and community. As the year comes to a close, we can look back at some of the happenings, the successes, and welcome all the newcomers to our growing community. + +In a year that has had its fair share of ups and downs, this community has been something that has brought me so much in the support you provide each other, your eagerness, passion, and willingness to share. Thank you to all of you for creating such a great community, and welcome to everyone joining us. I can’t wait to meet you all and see what great things we can create together in the new year. + +In 2021 we’ve seen the project and community grow in every dimension, reaching over 75 public adopters, over 500 contributors from around the world all bringing new ideas and perspectives. We’ve had so many of you sharing and demoing your hard work in our monthly community sessions, added new plugins, built new features and really started to see Backstage have an impact for engineering teams across so many of our users. + +Now let’s hear from the maintainers and look at the stats! + + + +## The community grew…and grew + +This year, Netflix, [Expedia][metrics], Wayfair, Peloton, [Box][10], [DAZN][dazn], TELUS, and Unity all officially joined the community — along with more than 50 other public [adopters][md]. Contributors grew by leaps and bounds, too. + +Patrik Oldsberg ([@Rugvip][rugvip]): + +> It’s been awesome to see the engagement by the community grow even more in 2021, especially the way people within the community support each other. Thanks to our growing number of stable, experienced, and knowledgeable contributors it’s now possible to get help in places like Discord anytime, day or night. + +### More adopters, more contributors + +![Accelerated growth of Public Backstage Adopters, from July 2020–December 2021.](assets/21-12-20/public-backstage-adopters-2021.png) + +In January, Backstage had 17 public adopters. By September, [we had 50][50]. And the curve only got steeper from there. + +- **75+ public adopters** +- **500+ contributors** +- **4,000+ Discord members** +- **9,000+ PRs & issues** + +### A very busy repo + +Along with the growth in contributors, PRs, and issues, our active, thriving community has crossed (or is just about to cross) other big milestones on GitHub, too. + +- **Nearly 2,000 forks** +- **20,000+ commits** +- **14,000+ GitHub stars** + +### Where in the world is the Backstage community? + +Watch the visualization below to see where in the world all those contributions came from this past year. + + + +### What does 9,000 contributions look like? + + + +Can you spot your name in the video above? + +Picking up from the end of 2020, the video shows every single contribution to the Backstage source code over this past year. The visualization was built using [Gource.io][gource]: + +> Software projects are displayed by Gource as an animated tree with the root directory of the project at its centre. Directories appear as branches with files as leaves. Developers can be seen working on the tree at the times they contributed to the project. + +And if your name isn’t in there, it’s never too late to get started [contributing][contributing] — so that you too can become a bright, sparkling, laser-beam-shooting spider-node thing in 2022! + +## Other 2021 milestones + +As the community grew, so did the product — with the addition of new features as well as important performance and stability improvements to the core. + +Ben Lambert ([@benjdlambert][blam]): + +> We’ve had a lot of priorities this year. Our first priority was rebuilding the catalog to make it more efficient. Then, toward the later part of the year, we’ve been stabilizing the core with deprecations and API changes ahead of our 1.0 release of the Core Framework next year. +> +> It’s been a super productive year for us all as Core Maintainers, and the product has come on leaps and bounds with the help of everyone involved in the project! + +### New features + +These new features were built with the community, and made with customization and extensibility in mind. + +- **Kubernetes Service Monitoring ([RFC][k8s])** +- **Search Platform ([Alpha][search])** +- **Composable Homepage ([README][home])** +- **Authorization Framework ([RFC][auth])** + +### Major stability updates + +As we get the ball rolling for [CNCF Incubation][cncf], we’ve been busy updating, refining, documenting, deprecating, and stabilizing the core. + +- **Software Templates ([Beta][scaffolder])** +- **TechDocs ([Beta][techdocs])** +- **API Reference ([docs][api])** + +### 50+ open source plugins + +We reached [50+ plugins][plugins] built by the community this year, including official plugins (**Snyk**, **FireHydrant**), highly requested plugins (**PagerDuty**, **Prometheus**), and plugins based on new ideas and functionality (**XCMetrics**, **[Tech Insights][techrfc]**) — all tailor-made for Backstage. + +### In the spotlight + +This year Backstage was center stage at both community-organized events and at major conferences. + +- **New (and [expanded][09]) Community Sessions** +- **Backstage Users Unconference + [Open Mic][openmic]** +- **KubeCon + CloudNativeCon [Europe][europe] & [North America][na]** +- **GitHub Universe 2021 [Keynote][day2]** + +Find more talks, podcasts, blog posts, and Backstage in the news [here][news]. + +## Goodbye, 2021. Hello, 2022! + +Lastly, thanks to everyone in the global Backstage community who contributed to the open source project in 2021. + +This was the first year Spotify hosted [Backstage Community Sessions][meetups], and it’s been a great source of inspiration, motivation, and joy getting to know all the people behind the contributions. We look forward to seeing all your faces again in 2022 — and hopefully many new ones as well. + +Until then, [grab this Backstage Zoom background][zoom] to use at the next Community Session. + +![Backstage Zoom Background](assets/21-12-20/Backstage-background-02-2021.png) + +See you then! Happy holidays from everyone on the Backstage team at Spotify! + +[metrics]: https://backstage.spotify.com/blog/measuring-backstage-proof-of-value-at-expedia/ +[10]: https://backstage.spotify.com/blog/community-session/10-box-and-spotify-paid-plugins/ +[dazn]: https://backstage.spotify.com/blog/adopter-spotlight/dazn/ +[md]: https://github.com/backstage/backstage/blob/master/ADOPTERS.md +[rugvip]: https://github.com/Rugvip +[50]: https://backstage.io/blog/2021/09/30/50-public-adopters +[gource]: https://gource.io +[contributing]: https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md +[blam]: https://github.com/benjdlambert +[k8s]: https://github.com/backstage/backstage/issues/2857 +[search]: https://backstage.io/blog/2021/06/24/announcing-backstage-search-platform +[home]: https://github.com/backstage/backstage/blob/master/plugins/home/README.md +[auth]: https://backstage.spotify.com/blog/authorization-framework-rfc/ +[scaffolder]: https://backstage.io/blog/2021/07/26/software-templates-are-now-in-beta +[techdocs]: https://backstage.io/blog/2021/09/16/the-techdocs-beta-has-landed +[api]: https://backstage.io/docs/reference/ +[cncf]: https://github.com/cncf/toc/pull/717 +[plugins]: https://backstage.io/plugins +[techrfc]: https://github.com/backstage/backstage/issues/7576 +[09]: https://backstage.spotify.com/blog/community-session/09-prometheus-homepage-templates/ +[openmic]: https://backstage-openmic.com +[europe]: https://www.youtube.com/watch?v=aIURaocR5D8 +[na]: https://backstage.spotify.com/blog/kubecon-na-2021/ +[day2]: https://www.youtube.com/watch?v=7yQJlYvpoYs&t=269s +[news]: https://github.com/backstage/community#newsletters +[meetups]: https://github.com/backstage/community#meetups +[zoom]: https://drive.google.com/file/d/14wOPXEBZ5Qmi29ms4Sqp1m56dM0AIHbB/view?usp=sharing diff --git a/microsite/blog/assets/21-12-20/Backstage-background-02-2021.png b/microsite/blog/assets/21-12-20/Backstage-background-02-2021.png new file mode 100644 index 0000000000..bf3c72ba70 Binary files /dev/null and b/microsite/blog/assets/21-12-20/Backstage-background-02-2021.png differ diff --git a/microsite/blog/assets/21-12-20/backstage-wrapped-2021.png b/microsite/blog/assets/21-12-20/backstage-wrapped-2021.png new file mode 100644 index 0000000000..6ac5d5f67c Binary files /dev/null and b/microsite/blog/assets/21-12-20/backstage-wrapped-2021.png differ diff --git a/microsite/blog/assets/21-12-20/public-backstage-adopters-2021.png b/microsite/blog/assets/21-12-20/public-backstage-adopters-2021.png new file mode 100644 index 0000000000..aac981d5f9 Binary files /dev/null and b/microsite/blog/assets/21-12-20/public-backstage-adopters-2021.png differ diff --git a/microsite/data/plugins/airbrake.yaml b/microsite/data/plugins/airbrake.yaml new file mode 100644 index 0000000000..96de75c002 --- /dev/null +++ b/microsite/data/plugins/airbrake.yaml @@ -0,0 +1,9 @@ +--- +title: Airbrake +author: Simply Business +authorUrl: https://github.com/simplybusiness/ +category: Monitoring +description: Access Airbrake error monitoring and other integrations from within Backstage +documentation: https://github.com/backstage/backstage/blob/master/plugins/airbrake/README.md +iconUrl: https://wp-assets.airbrake.io/wp-content/uploads/2020/10/05222904/Square-white-A-on-Orange.png +npmPackageName: '@backstage/plugin-airbrake' diff --git a/microsite/data/plugins/azure-pipelines.yaml b/microsite/data/plugins/azure-pipelines.yaml new file mode 100644 index 0000000000..c591591478 --- /dev/null +++ b/microsite/data/plugins/azure-pipelines.yaml @@ -0,0 +1,9 @@ +--- +title: 'Azure Pipelines' +author: Keyloop +authorUrl: https://keyloop.com/ +category: CI/CD +description: Easily view your Azure Pipelines within the Software Catalog +documentation: https://github.com/backstage/backstage/blob/master/plugins/azure-devops/README.md +iconUrl: img/azure-pipelines.svg +npmPackageName: '@backstage/plugin-azure-devops' diff --git a/microsite/data/plugins/newrelic-dashboard.yaml b/microsite/data/plugins/newrelic-dashboard.yaml new file mode 100644 index 0000000000..c314d4c458 --- /dev/null +++ b/microsite/data/plugins/newrelic-dashboard.yaml @@ -0,0 +1,15 @@ +--- +title: New Relic Dashboard +author: '@mufaddal7' +authorUrl: https://github.com/mufaddal7 +category: Monitoring +description: Easily view your New Relic Dashboards in Backstage, via real-time snapshots of your dashboards +documentation: https://github.com/backstage/backstage/tree/master/plugins/newrelic-dashboard +iconUrl: https://newrelic.com/themes/custom/curio/assets/mediakit/NR_logo_Horizontal_Rev.svg +npmPackageName: '@backstage/plugin-newrelic-dashboard' +tags: + - performance + - monitoring + - errors + - alerting + - dashboards diff --git a/microsite/sidebars.json b/microsite/sidebars.json index 89eb282d14..6c4c5261d9 100644 --- a/microsite/sidebars.json +++ b/microsite/sidebars.json @@ -14,6 +14,7 @@ ], "Getting Started": [ "getting-started/index", + "getting-started/configuration", "getting-started/create-an-app", "getting-started/running-backstage-locally", { @@ -270,7 +271,8 @@ "tutorials/migrating-away-from-core", "tutorials/configuring-plugin-databases", "tutorials/switching-sqlite-postgres", - "tutorials/using-backstage-proxy-within-plugin" + "tutorials/using-backstage-proxy-within-plugin", + "tutorials/backend-to-backend-auth" ], "Architecture Decision Records (ADRs)": [ "architecture-decisions/adrs-overview", @@ -285,7 +287,8 @@ "architecture-decisions/adrs-adr009", "architecture-decisions/adrs-adr010", "architecture-decisions/adrs-adr011", - "architecture-decisions/adrs-adr012" + "architecture-decisions/adrs-adr012", + "architecture-decisions/adrs-adr013" ], "FAQ": ["FAQ"] } diff --git a/microsite/static/img/azure-pipelines.svg b/microsite/static/img/azure-pipelines.svg new file mode 100644 index 0000000000..d60daf69e5 --- /dev/null +++ b/microsite/static/img/azure-pipelines.svg @@ -0,0 +1,5 @@ +Azure Pipelines + + diff --git a/mkdocs.yml b/mkdocs.yml index 2eed377819..81dad55b84 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -64,6 +64,7 @@ nav: - Backstage Search: - Overview: 'features/search/README.md' - Getting Started: 'features/search/getting-started.md' + - Getting Started, configuring Backstage: 'features/search/configuration.md' - Concepts: 'features/search/concepts.md' - Search Architecture: 'features/search/architecture.md' - Search Engines: 'features/search/search-engines.md' @@ -185,6 +186,8 @@ nav: - ADR009 - Entity References: 'architecture-decisions/adr009-entity-references.md' - ADR010 - Luxon Date Library: 'architecture-decisions/adr010-luxon-date-library.md' - ADR011 - Plugin Package Structure: 'architecture-decisions/adr011-plugin-package-structure.md' + - ADR012 - Plugin Package Structure: 'architecture-decisions/adr012-use-luxon-locale-and-date-presets.md' + - ADR013 - Plugin Package Structure: 'architecture-decisions/adr013-use-node-fetch.md' - Support: - Backstage Project Structure: 'support/project-structure.md' - Glossary: glossary.md diff --git a/package.json b/package.json index 57cf603090..fe5876dd97 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "yarn workspace example-app start", "start-backend": "yarn workspace example-backend start", "build": "lerna run build", - "build:api-reports": "yarn tsc:full && yarn build:api-reports:only", + "build:api-reports": "yarn build:api-reports:only --tsc", "build:api-reports:only": "ts-node -T -P scripts/tsconfig.json scripts/api-extractor.ts", "build:api-docs": "yarn build:api-reports --docs", "tsc": "tsc", @@ -55,6 +55,7 @@ }, "version": "1.0.0", "dependencies": { + "@manypkg/get-packages": "^1.1.3", "@microsoft/api-documenter": "^7.13.77", "@microsoft/api-extractor": "^7.19.2", "@microsoft/api-extractor-model": "^7.15.1", @@ -68,7 +69,7 @@ "@types/webpack": "^5.28.0", "command-exists": "^1.2.9", "cross-env": "^7.0.0", - "concurrently": "^6.0.0", + "concurrently": "^7.0.0", "eslint-plugin-notice": "^0.9.10", "fs-extra": "9.1.0", "husky": "^6.0.0", diff --git a/packages/app-defaults/CHANGELOG.md b/packages/app-defaults/CHANGELOG.md index b9a84d500c..751b758984 100644 --- a/packages/app-defaults/CHANGELOG.md +++ b/packages/app-defaults/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/app-defaults +## 0.1.3 + +### Patch Changes + +- 7927005152: Add `FetchApi` and related `fetchApiRef` which implement fetch, with an added Backstage token header when available. +- 1e49c23eb7: Added an instance of PermissionApi to the apis included by default in createApp. +- 68f8b10ccd: - Removed deprecation configuration option `theme` from `AppTheme` of the `AppThemeApi` + - Removed reference to `theme` in the `app-defaults` default `AppTheme` + - Removed logic in `AppThemeProvider` that creates `ThemeProvider` from `appTheme.theme` +- Updated dependencies + - @backstage/core-app-api@0.3.0 + - @backstage/core-plugin-api@0.4.0 + - @backstage/plugin-permission-react@0.2.0 + - @backstage/core-components@0.8.2 + ## 0.1.2 ### Patch Changes diff --git a/packages/app-defaults/package.json b/packages/app-defaults/package.json index fc1bca2104..89d83ae91f 100644 --- a/packages/app-defaults/package.json +++ b/packages/app-defaults/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/app-defaults", "description": "Provides the default wiring of a Backstage App", - "version": "0.1.2", + "version": "0.1.3", "private": false, "publishConfig": { "access": "public", @@ -29,9 +29,10 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/core-components": "^0.8.0", - "@backstage/core-app-api": "^0.2.0", - "@backstage/core-plugin-api": "^0.3.0", + "@backstage/core-components": "^0.8.2", + "@backstage/core-app-api": "^0.3.0", + "@backstage/core-plugin-api": "^0.4.0", + "@backstage/plugin-permission-react": "^0.2.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -41,8 +42,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.1", - "@backstage/test-utils": "^0.1.24", + "@backstage/cli": "^0.10.3", + "@backstage/test-utils": "^0.2.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@types/jest": "^26.0.7", diff --git a/packages/app-defaults/src/defaults/apis.ts b/packages/app-defaults/src/defaults/apis.ts index d3c76d52bd..f26c298fb1 100644 --- a/packages/app-defaults/src/defaults/apis.ts +++ b/packages/app-defaults/src/defaults/apis.ts @@ -34,6 +34,8 @@ import { OneLoginAuth, UnhandledErrorForwarder, AtlassianAuth, + createFetchApi, + FetchMiddlewares, } from '@backstage/core-app-api'; import { @@ -42,6 +44,8 @@ import { analyticsApiRef, errorApiRef, discoveryApiRef, + fetchApiRef, + identityApiRef, oauthRequestApiRef, googleAuthApiRef, githubAuthApiRef, @@ -58,6 +62,10 @@ import { bitbucketAuthApiRef, atlassianAuthApiRef, } from '@backstage/core-plugin-api'; +import { + permissionApiRef, + IdentityPermissionApi, +} from '@backstage/plugin-permission-react'; export const apis = [ createApiFactory({ @@ -92,6 +100,27 @@ export const apis = [ deps: { errorApi: errorApiRef }, factory: ({ errorApi }) => WebStorage.create({ errorApi }), }), + createApiFactory({ + api: fetchApiRef, + deps: { + configApi: configApiRef, + identityApi: identityApiRef, + discoveryApi: discoveryApiRef, + }, + factory: ({ configApi, identityApi, discoveryApi }) => { + return createFetchApi({ + middleware: [ + FetchMiddlewares.resolvePluginProtocol({ + discoveryApi, + }), + FetchMiddlewares.injectIdentityAuth({ + identityApi, + config: configApi, + }), + ], + }); + }, + }), createApiFactory({ api: oauthRequestApiRef, deps: {}, @@ -271,4 +300,14 @@ export const apis = [ }); }, }), + createApiFactory({ + api: permissionApiRef, + deps: { + discovery: discoveryApiRef, + identity: identityApiRef, + config: configApiRef, + }, + factory: ({ config, discovery, identity }) => + IdentityPermissionApi.create({ config, discovery, identity }), + }), ]; diff --git a/packages/app-defaults/src/defaults/components.tsx b/packages/app-defaults/src/defaults/components.tsx index 139bea4862..93a5d9cd50 100644 --- a/packages/app-defaults/src/defaults/components.tsx +++ b/packages/app-defaults/src/defaults/components.tsx @@ -73,7 +73,7 @@ const DefaultErrorBoundaryFallback = ({ }; /** - * Creates a set of default components to pass along to {@link @backstage/core-app-api#createApp}. + * Creates a set of default components to pass along to {@link @backstage/core-app-api#createSpecializedApp}. * * @public */ diff --git a/packages/app-defaults/src/defaults/themes.tsx b/packages/app-defaults/src/defaults/themes.tsx index 90a4a0f47f..397c160168 100644 --- a/packages/app-defaults/src/defaults/themes.tsx +++ b/packages/app-defaults/src/defaults/themes.tsx @@ -28,7 +28,6 @@ export const themes: AppTheme[] = [ title: 'Light Theme', variant: 'light', icon: , - theme: lightTheme, Provider: ({ children }) => ( {children} @@ -40,7 +39,6 @@ export const themes: AppTheme[] = [ title: 'Dark Theme', variant: 'dark', icon: , - theme: darkTheme, Provider: ({ children }) => ( {children} diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 3f3ac75853..c14db343bc 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,114 @@ # example-app +## 0.2.59 + +### Patch Changes + +- Updated dependencies + - @backstage/cli@0.10.5 + - @backstage/plugin-search@0.5.4 + - @backstage/plugin-techdocs@0.12.13 + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/plugin-kubernetes@0.5.3 + - @backstage/core-app-api@0.3.1 + - @backstage/core-components@0.8.3 + - @backstage/plugin-apache-airflow@0.1.2 + - @backstage/plugin-azure-devops@0.1.9 + - @backstage/plugin-badges@0.2.18 + - @backstage/plugin-catalog@0.7.7 + - @backstage/plugin-catalog-graph@0.2.5 + - @backstage/plugin-catalog-import@0.7.8 + - @backstage/plugin-circleci@0.2.33 + - @backstage/plugin-cloudbuild@0.2.31 + - @backstage/plugin-code-coverage@0.1.21 + - @backstage/plugin-cost-insights@0.11.16 + - @backstage/plugin-explore@0.3.24 + - @backstage/plugin-gcp-projects@0.3.12 + - @backstage/plugin-github-actions@0.4.30 + - @backstage/plugin-graphiql@0.2.26 + - @backstage/plugin-home@0.4.9 + - @backstage/plugin-jenkins@0.5.16 + - @backstage/plugin-kafka@0.2.24 + - @backstage/plugin-lighthouse@0.2.33 + - @backstage/plugin-newrelic@0.3.12 + - @backstage/plugin-newrelic-dashboard@0.1.2 + - @backstage/plugin-org@0.3.33 + - @backstage/plugin-pagerduty@0.3.21 + - @backstage/plugin-rollbar@0.3.22 + - @backstage/plugin-scaffolder@0.11.17 + - @backstage/plugin-sentry@0.3.32 + - @backstage/plugin-shortcuts@0.1.18 + - @backstage/plugin-tech-insights@0.1.4 + - @backstage/plugin-tech-radar@0.5.1 + - @backstage/plugin-user-settings@0.3.15 + - @backstage/plugin-api-docs@0.6.21 + +## 0.2.58 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-search@0.5.2 + - @backstage/app-defaults@0.1.3 + - @backstage/core-app-api@0.3.0 + - @backstage/core-plugin-api@0.4.0 + - @backstage/plugin-user-settings@0.3.14 + - @backstage/plugin-scaffolder@0.11.15 + - @backstage/plugin-catalog-react@0.6.8 + - @backstage/plugin-kubernetes@0.5.2 + - @backstage/core-components@0.8.2 + - @backstage/cli@0.10.3 + - @backstage/plugin-tech-radar@0.5.0 + - @backstage/plugin-tech-insights@0.1.2 + - @backstage/plugin-org@0.3.32 + - @backstage/plugin-catalog@0.7.5 + - @backstage/plugin-newrelic-dashboard@0.1.1 + - @backstage/plugin-home@0.4.8 + - @backstage/plugin-circleci@0.2.32 + - @backstage/plugin-cloudbuild@0.2.30 + - @backstage/plugin-github-actions@0.4.28 + - @backstage/plugin-jenkins@0.5.15 + - @backstage/plugin-lighthouse@0.2.32 + - @backstage/plugin-sentry@0.3.31 + - @backstage/plugin-apache-airflow@0.1.1 + - @backstage/plugin-api-docs@0.6.19 + - @backstage/plugin-azure-devops@0.1.8 + - @backstage/plugin-badges@0.2.17 + - @backstage/plugin-catalog-graph@0.2.4 + - @backstage/plugin-catalog-import@0.7.6 + - @backstage/plugin-code-coverage@0.1.20 + - @backstage/plugin-cost-insights@0.11.14 + - @backstage/plugin-explore@0.3.23 + - @backstage/plugin-gcp-projects@0.3.11 + - @backstage/plugin-graphiql@0.2.25 + - @backstage/plugin-kafka@0.2.23 + - @backstage/plugin-newrelic@0.3.11 + - @backstage/plugin-pagerduty@0.3.20 + - @backstage/plugin-rollbar@0.3.21 + - @backstage/plugin-shortcuts@0.1.16 + - @backstage/plugin-techdocs@0.12.11 + - @backstage/plugin-todo@0.1.17 + - @backstage/integration-react@0.1.16 + +## 0.2.57 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-github-actions@0.4.27 + - @backstage/core-app-api@0.2.1 + - @backstage/plugin-kubernetes@0.5.1 + - @backstage/core-plugin-api@0.3.1 + - @backstage/core-components@0.8.1 + - @backstage/plugin-org@0.3.31 + - @backstage/plugin-azure-devops@0.1.7 + - @backstage/cli@0.10.2 + - @backstage/catalog-model@0.9.8 + - @backstage/plugin-techdocs@0.12.10 + - @backstage/plugin-catalog-react@0.6.7 + - @backstage/plugin-apache-airflow@0.1.0 + ## 0.2.56 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index 99b90952e3..bbfd903484 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,59 +1,61 @@ { "name": "example-app", - "version": "0.2.56", + "version": "0.2.59", "private": true, "bundled": true, "dependencies": { - "@backstage/app-defaults": "^0.1.2", - "@backstage/catalog-model": "^0.9.7", - "@backstage/cli": "^0.10.1", - "@backstage/core-app-api": "^0.2.0", - "@backstage/core-components": "^0.8.0", - "@backstage/core-plugin-api": "^0.3.0", - "@backstage/integration-react": "^0.1.15", - "@backstage/plugin-api-docs": "^0.6.18", - "@backstage/plugin-azure-devops": "^0.1.6", - "@backstage/plugin-apache-airflow": "^0.0.0", - "@backstage/plugin-badges": "^0.2.16", - "@backstage/plugin-catalog": "^0.7.4", - "@backstage/plugin-catalog-graph": "^0.2.3", - "@backstage/plugin-catalog-import": "^0.7.5", - "@backstage/plugin-catalog-react": "^0.6.5", - "@backstage/plugin-circleci": "^0.2.31", - "@backstage/plugin-cloudbuild": "^0.2.29", - "@backstage/plugin-code-coverage": "^0.1.19", - "@backstage/plugin-cost-insights": "^0.11.13", - "@backstage/plugin-explore": "^0.3.22", - "@backstage/plugin-gcp-projects": "^0.3.10", - "@backstage/plugin-github-actions": "^0.4.26", - "@backstage/plugin-graphiql": "^0.2.24", - "@backstage/plugin-home": "^0.4.7", - "@backstage/plugin-jenkins": "^0.5.14", - "@backstage/plugin-kafka": "^0.2.22", - "@backstage/plugin-kubernetes": "^0.5.0", - "@backstage/plugin-lighthouse": "^0.2.31", - "@backstage/plugin-newrelic": "^0.3.10", - "@backstage/plugin-org": "^0.3.30", - "@backstage/plugin-pagerduty": "0.3.19", - "@backstage/plugin-rollbar": "^0.3.20", - "@backstage/plugin-scaffolder": "^0.11.14", - "@backstage/plugin-search": "^0.5.1", - "@backstage/plugin-sentry": "^0.3.30", - "@backstage/plugin-shortcuts": "^0.1.15", - "@backstage/plugin-tech-radar": "^0.4.13", - "@backstage/plugin-techdocs": "^0.12.9", - "@backstage/plugin-todo": "^0.1.16", - "@backstage/plugin-user-settings": "^0.3.13", + "@backstage/app-defaults": "^0.1.3", + "@backstage/catalog-model": "^0.9.8", + "@backstage/cli": "^0.10.5", + "@backstage/core-app-api": "^0.3.1", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", + "@backstage/integration-react": "^0.1.16", + "@backstage/plugin-airbrake": "^0.0.0", + "@backstage/plugin-api-docs": "^0.6.21", + "@backstage/plugin-azure-devops": "^0.1.9", + "@backstage/plugin-apache-airflow": "^0.1.2", + "@backstage/plugin-badges": "^0.2.18", + "@backstage/plugin-catalog": "^0.7.7", + "@backstage/plugin-catalog-graph": "^0.2.5", + "@backstage/plugin-catalog-import": "^0.7.8", + "@backstage/plugin-catalog-react": "^0.6.10", + "@backstage/plugin-circleci": "^0.2.33", + "@backstage/plugin-cloudbuild": "^0.2.31", + "@backstage/plugin-code-coverage": "^0.1.21", + "@backstage/plugin-cost-insights": "^0.11.16", + "@backstage/plugin-explore": "^0.3.24", + "@backstage/plugin-gcp-projects": "^0.3.12", + "@backstage/plugin-github-actions": "^0.4.30", + "@backstage/plugin-graphiql": "^0.2.26", + "@backstage/plugin-home": "^0.4.9", + "@backstage/plugin-jenkins": "^0.5.16", + "@backstage/plugin-kafka": "^0.2.24", + "@backstage/plugin-kubernetes": "^0.5.3", + "@backstage/plugin-lighthouse": "^0.2.33", + "@backstage/plugin-newrelic": "^0.3.12", + "@backstage/plugin-newrelic-dashboard": "^0.1.2", + "@backstage/plugin-org": "^0.3.33", + "@backstage/plugin-pagerduty": "0.3.21", + "@backstage/plugin-rollbar": "^0.3.22", + "@backstage/plugin-scaffolder": "^0.11.17", + "@backstage/plugin-search": "^0.5.4", + "@backstage/plugin-sentry": "^0.3.32", + "@backstage/plugin-shortcuts": "^0.1.18", + "@backstage/plugin-tech-radar": "^0.5.1", + "@backstage/plugin-techdocs": "^0.12.13", + "@backstage/plugin-todo": "^0.1.17", + "@backstage/plugin-user-settings": "^0.3.15", "@backstage/search-common": "^0.2.0", - "@backstage/plugin-tech-insights": "^0.1.1", + "@backstage/plugin-tech-insights": "^0.1.4", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", "@octokit/rest": "^18.5.3", - "@roadiehq/backstage-plugin-github-insights": "^1.1.23", - "@roadiehq/backstage-plugin-github-pull-requests": "^1.0.13", - "@roadiehq/backstage-plugin-travis-ci": "^1.0.11", + "@roadiehq/backstage-plugin-github-insights": "^1.4.2", + "@roadiehq/backstage-plugin-github-pull-requests": "^1.3.2", + "@roadiehq/backstage-plugin-travis-ci": "^1.3.2", "history": "^5.0.0", "prop-types": "^15.7.2", "react": "^16.13.1", @@ -65,7 +67,7 @@ "zen-observable": "^0.8.15" }, "devDependencies": { - "@backstage/test-utils": "^0.1.24", + "@backstage/test-utils": "^0.2.0", "@rjsf/core": "^3.2.1", "@testing-library/cypress": "^8.0.2", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/app/public/index.html b/packages/app/public/index.html index d86f09f0b0..885fb6c228 100644 --- a/packages/app/public/index.html +++ b/packages/app/public/index.html @@ -42,18 +42,12 @@ href="<%= publicPath %>/safari-pinned-tab.svg" color="#5bbad5" /> - - <%= app.title %> + <%= config.getString('app.title') %> - <% if (app.googleAnalyticsTrackingId && typeof - app.googleAnalyticsTrackingId==='string' ) { %> + <% if (config.has('app.googleAnalyticsTrackingId')) { %> - <% } %> <% if (app.datadogRum.clientToken && app.datadogRum.applicationId ) - { %> + <% } %> <% if (config.has('app.datadogRum')) { %> + ``` + + ```diff + - gtag('config', '<%= app.googleAnalyticsTrackingId %>'); + + gtag( + + 'config', + + '<%= config.getString("app.googleAnalyticsTrackingId") %>', + + ); + ``` + +## 0.4.8 + +### Patch Changes + +- 25dfc2d483: Updated the root `package.json` to include files with `.cjs` and `.mjs` extensions in the `"lint-staged"` configuration. + + To make this change to an existing app, apply the following changes to the `package.json` file: + + ```diff + "lint-staged": { + - "*.{js,jsx,ts,tsx}": [ + + "*.{js,jsx,ts,tsx,mjs,cjs}": [ + ``` + ## 0.4.7 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index e5108f540b..639e0370d7 100644 --- a/packages/create-app/package.json +++ b/packages/create-app/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/create-app", "description": "A CLI that helps you create your own Backstage app", - "version": "0.4.7", + "version": "0.4.11", "private": false, "publishConfig": { "access": "public" @@ -49,6 +49,7 @@ }, "peerDependencies": { "@backstage/backend-common": "*", + "@backstage/backend-tasks": "*", "@backstage/catalog-client": "*", "@backstage/catalog-model": "*", "@backstage/cli": "*", @@ -66,6 +67,8 @@ "@backstage/plugin-explore": "*", "@backstage/plugin-github-actions": "*", "@backstage/plugin-lighthouse": "*", + "@backstage/plugin-permission-common": "*", + "@backstage/plugin-permission-node": "*", "@backstage/plugin-proxy-backend": "*", "@backstage/plugin-rollbar-backend": "*", "@backstage/plugin-scaffolder": "*", diff --git a/packages/create-app/src/lib/tasks.ts b/packages/create-app/src/lib/tasks.ts index 2793088892..4bd7050fc2 100644 --- a/packages/create-app/src/lib/tasks.ts +++ b/packages/create-app/src/lib/tasks.ts @@ -167,8 +167,8 @@ export async function checkAppExistsTask(rootDir: string, name: string) { /** * Verify that application `path` exists, otherwise create the directory * - * @param {string} path - target to create directory - * @throws {Error} if `path` is a file, or `fs.mkdir` fails + * @param path - target to create directory + * @throws if `path` is a file, or `fs.mkdir` fails */ export async function checkPathExistsTask(path: string) { await Task.forItem('checking', path, async () => { @@ -184,8 +184,8 @@ export async function checkPathExistsTask(path: string) { /** * Create a folder to store templated files * - * @param {string} tempDir - target temporary directory - * @throws {Error} if `fs.mkdir` fails + * @param tempDir - target temporary directory + * @throws if `fs.mkdir` fails */ export async function createTemporaryAppFolderTask(tempDir: string) { await Task.forItem('creating', 'temporary directory', async () => { @@ -200,7 +200,7 @@ export async function createTemporaryAppFolderTask(tempDir: string) { /** * Run `yarn install` and `run tsc` in application directory * - * @param {string} appDir - location of application to build + * @param appDir - location of application to build */ export async function buildAppTask(appDir: string) { const runCmd = async (cmd: string) => { @@ -221,10 +221,10 @@ export async function buildAppTask(appDir: string) { /** * Move temporary directory to destination application folder * - * @param {string} tempDir source path to copy files from - * @param {string} destination target path to copy files - * @param {string} id - * @throws {Error} if `fs.move` fails + * @param tempDir - source path to copy files from + * @param destination - target path to copy files + * @param id - item ID + * @throws if `fs.move` fails */ export async function moveAppTask( tempDir: string, diff --git a/packages/create-app/src/lib/versions.ts b/packages/create-app/src/lib/versions.ts index 6c85652c64..f89ff7f391 100644 --- a/packages/create-app/src/lib/versions.ts +++ b/packages/create-app/src/lib/versions.ts @@ -32,6 +32,7 @@ leaving any imports in place. import { version as appDefaults } from '../../../app-defaults/package.json'; import { version as backendCommon } from '../../../backend-common/package.json'; +import { version as backendTasks } from '../../../backend-tasks/package.json'; import { version as catalogClient } from '../../../catalog-client/package.json'; import { version as catalogModel } from '../../../catalog-model/package.json'; import { version as cli } from '../../../cli/package.json'; @@ -56,6 +57,8 @@ import { version as pluginExplore } from '../../../../plugins/explore/package.js import { version as pluginGithubActions } from '../../../../plugins/github-actions/package.json'; import { version as pluginLighthouse } from '../../../../plugins/lighthouse/package.json'; import { version as pluginOrg } from '../../../../plugins/org/package.json'; +import { version as pluginPermissionCommon } from '../../../../plugins/permission-common/package.json'; +import { version as pluginPermissionNode } from '../../../../plugins/permission-node/package.json'; import { version as pluginProxyBackend } from '../../../../plugins/proxy-backend/package.json'; import { version as pluginRollbarBackend } from '../../../../plugins/rollbar-backend/package.json'; import { version as pluginScaffolder } from '../../../../plugins/scaffolder/package.json'; @@ -71,6 +74,7 @@ import { version as pluginUserSettings } from '../../../../plugins/user-settings export const packageVersions = { '@backstage/app-defaults': appDefaults, '@backstage/backend-common': backendCommon, + '@backstage/backend-tasks': backendTasks, '@backstage/catalog-client': catalogClient, '@backstage/catalog-model': catalogModel, '@backstage/cli': cli, @@ -92,6 +96,8 @@ export const packageVersions = { '@backstage/plugin-github-actions': pluginGithubActions, '@backstage/plugin-lighthouse': pluginLighthouse, '@backstage/plugin-org': pluginOrg, + '@backstage/plugin-permission-common': pluginPermissionCommon, + '@backstage/plugin-permission-node': pluginPermissionNode, '@backstage/plugin-proxy-backend': pluginProxyBackend, '@backstage/plugin-rollbar-backend': pluginRollbarBackend, '@backstage/plugin-scaffolder': pluginScaffolder, diff --git a/packages/create-app/templates/default-app/packages/app/public/index.html b/packages/create-app/templates/default-app/packages/app/public/index.html index b93896c6da..a936c73602 100644 --- a/packages/create-app/templates/default-app/packages/app/public/index.html +++ b/packages/create-app/templates/default-app/packages/app/public/index.html @@ -42,17 +42,11 @@ href="<%= publicPath %>/safari-pinned-tab.svg" color="#5bbad5" /> - - <%= app.title %> - <% if (app.googleAnalyticsTrackingId && typeof app.googleAnalyticsTrackingId - === 'string') { %> + <%= config.getString('app.title') %> + <% if (config.has('app.googleAnalyticsTrackingId')) { %> <% } %> - +
- - diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index e15249bf91..c08bbc61fd 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/dev-utils +## 0.2.16 + +### Patch Changes + +- 4ce51ab0f1: Internal refactor of the `react-use` imports to use `react-use/lib/*` instead. +- Updated dependencies + - @backstage/core-plugin-api@0.4.1 + - @backstage/plugin-catalog-react@0.6.10 + - @backstage/core-app-api@0.3.1 + - @backstage/core-components@0.8.3 + +## 0.2.15 + +### Patch Changes + +- Updated dependencies + - @backstage/app-defaults@0.1.3 + - @backstage/core-app-api@0.3.0 + - @backstage/core-plugin-api@0.4.0 + - @backstage/plugin-catalog-react@0.6.8 + - @backstage/core-components@0.8.2 + - @backstage/test-utils@0.2.0 + - @backstage/integration-react@0.1.16 + ## 0.2.14 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 8f77f4a72d..75b34baf32 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/dev-utils", "description": "Utilities for developing Backstage plugins.", - "version": "0.2.14", + "version": "0.2.16", "private": false, "publishConfig": { "access": "public", @@ -29,14 +29,14 @@ "clean": "backstage-cli clean" }, "dependencies": { - "@backstage/app-defaults": "^0.1.2", - "@backstage/core-app-api": "^0.2.0", - "@backstage/core-components": "^0.8.0", - "@backstage/core-plugin-api": "^0.3.0", + "@backstage/app-defaults": "^0.1.3", + "@backstage/core-app-api": "^0.3.1", + "@backstage/core-components": "^0.8.3", + "@backstage/core-plugin-api": "^0.4.1", "@backstage/catalog-model": "^0.9.7", - "@backstage/integration-react": "^0.1.15", - "@backstage/plugin-catalog-react": "^0.6.5", - "@backstage/test-utils": "^0.1.24", + "@backstage/integration-react": "^0.1.16", + "@backstage/plugin-catalog-react": "^0.6.10", + "@backstage/test-utils": "^0.2.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -55,7 +55,7 @@ "react-dom": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.10.1", + "@backstage/cli": "^0.10.5", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.test.tsx b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.test.tsx index 43eaa6218c..9229bc61dc 100644 --- a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.test.tsx +++ b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.test.tsx @@ -16,7 +16,6 @@ import { AppThemeApi, appThemeApiRef } from '@backstage/core-plugin-api'; import { renderInTestApp, TestApiProvider } from '@backstage/test-utils'; -import { BackstageTheme } from '@backstage/theme'; import userEvent from '@testing-library/user-event'; import React from 'react'; import ObservableImpl from 'zen-observable'; @@ -41,13 +40,13 @@ describe('SidebarThemeSwitcher', () => { id: 'dark', title: 'Dark Theme', variant: 'dark', - theme: {} as unknown as BackstageTheme, + Provider: jest.fn(), }, { id: 'light', title: 'Light Theme', variant: 'light', - theme: {} as unknown as BackstageTheme, + Provider: jest.fn(), }, ]); }); diff --git a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx index e13554bbf7..585fef2db4 100644 --- a/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx +++ b/packages/dev-utils/src/devApp/SidebarThemeSwitcher.tsx @@ -18,7 +18,7 @@ import { appThemeApiRef, useApi } from '@backstage/core-plugin-api'; import { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core'; import AutoIcon from '@material-ui/icons/BrightnessAuto'; import React, { cloneElement, useCallback, useState } from 'react'; -import { useObservable } from 'react-use'; +import useObservable from 'react-use/lib/useObservable'; type ThemeIconProps = { active?: boolean; diff --git a/packages/dev-utils/src/devApp/render.tsx b/packages/dev-utils/src/devApp/render.tsx index adea9e14f2..36d6abcfd1 100644 --- a/packages/dev-utils/src/devApp/render.tsx +++ b/packages/dev-utils/src/devApp/render.tsx @@ -159,7 +159,7 @@ export class DevAppBuilder { * Build a DevApp component using the resources registered so far */ build(): ComponentType<{}> { - const dummyRouteRef = createRouteRef({ title: 'Page of another plugin' }); + const dummyRouteRef = createRouteRef({ id: 'dummy' }); const DummyPage = () => Page belonging to another plugin.; attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef); diff --git a/packages/e2e-test/src/lib/helpers.ts b/packages/e2e-test/src/lib/helpers.ts index 350898234d..ccedf52ade 100644 --- a/packages/e2e-test/src/lib/helpers.ts +++ b/packages/e2e-test/src/lib/helpers.ts @@ -90,7 +90,7 @@ export function exitWithError(err: Error & { code?: unknown }) { * Waits for fn() to be true * Checks every 100ms * .cancel() is available - * @returns {Promise} Promise of resolution + * @returns Promise of resolution */ export function waitFor(fn: () => boolean, maxSeconds: number = 120) { let count = 0; diff --git a/packages/embedded-techdocs-app/CHANGELOG.md b/packages/embedded-techdocs-app/CHANGELOG.md index f1ae8abdf5..aa0e9ce955 100644 --- a/packages/embedded-techdocs-app/CHANGELOG.md +++ b/packages/embedded-techdocs-app/CHANGELOG.md @@ -1,5 +1,20 @@ # embedded-techdocs-app +## 0.2.58 + +### Patch Changes + +- Updated dependencies + - @backstage/app-defaults@0.1.3 + - @backstage/core-app-api@0.3.0 + - @backstage/core-plugin-api@0.4.0 + - @backstage/core-components@0.8.2 + - @backstage/cli@0.10.3 + - @backstage/test-utils@0.2.0 + - @backstage/plugin-catalog@0.7.5 + - @backstage/plugin-techdocs@0.12.11 + - @backstage/integration-react@0.1.16 + ## 0.2.56 ### Patch Changes diff --git a/packages/embedded-techdocs-app/package.json b/packages/embedded-techdocs-app/package.json index 6a13acf37f..a1ffd9f858 100644 --- a/packages/embedded-techdocs-app/package.json +++ b/packages/embedded-techdocs-app/package.json @@ -1,20 +1,20 @@ { "name": "embedded-techdocs-app", - "version": "0.2.56", + "version": "0.2.58", "private": true, "bundled": true, "dependencies": { - "@backstage/app-defaults": "^0.1.2", + "@backstage/app-defaults": "^0.1.3", "@backstage/catalog-model": "^0.9.7", - "@backstage/cli": "^0.10.1", + "@backstage/cli": "^0.10.3", "@backstage/config": "^0.1.10", - "@backstage/core-app-api": "^0.2.0", - "@backstage/core-components": "^0.8.0", - "@backstage/core-plugin-api": "^0.3.0", - "@backstage/integration-react": "^0.1.15", - "@backstage/plugin-catalog": "^0.7.4", - "@backstage/plugin-techdocs": "^0.12.9", - "@backstage/test-utils": "^0.1.24", + "@backstage/core-app-api": "^0.3.0", + "@backstage/core-components": "^0.8.2", + "@backstage/core-plugin-api": "^0.4.0", + "@backstage/integration-react": "^0.1.16", + "@backstage/plugin-catalog": "^0.7.5", + "@backstage/plugin-techdocs": "^0.12.11", + "@backstage/test-utils": "^0.2.0", "@backstage/theme": "^0.2.14", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", @@ -26,7 +26,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.10.1", + "@backstage/cli": "^0.10.3", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^13.1.8", diff --git a/packages/embedded-techdocs-app/public/index.html b/packages/embedded-techdocs-app/public/index.html index a6102f010d..b548d8fb70 100644 --- a/packages/embedded-techdocs-app/public/index.html +++ b/packages/embedded-techdocs-app/public/index.html @@ -42,14 +42,9 @@ href="<%= publicPath %>/safari-pinned-tab.svg" color="#5bbad5" /> - - <%= app.title %> + <%= config.getString('app.title') %> - +