diff --git a/.changeset/clever-garlics-rescue.md b/.changeset/clever-garlics-rescue.md index a7dd387042..dcfa258575 100644 --- a/.changeset/clever-garlics-rescue.md +++ b/.changeset/clever-garlics-rescue.md @@ -2,6 +2,38 @@ '@backstage/plugin-catalog-backend': minor --- +**BREAKING**: Removed `GithubDiscoveryProcessor`, `GithubMultiOrgReaderProcessor`, `GitHubOrgEntityProvider`, `GithubOrgReaderProcessor`, and `GithubMultiOrgConfig` which now instead should be imported from `@backstage/plugin-catalog-backend-module-github`. NOTE THAT the `GithubDiscoveryProcessor` and `GithubOrgReaderProcessor` were part of the default set of processors in the catalog backend, and if you are a user of discovery or location based org ingestion on GitLab, you MUST now add them manually in the catalog initialization code of your backend. + +```diff +// In packages/backend/src/plugins/catalog.ts ++import { ++ GithubDiscoveryProcessor, ++ GithubOrgReaderProcessor, ++} from '@backstage/plugin-catalog-backend-module-github'; ++import { ++ ScmIntegrations, ++ DefaultGithubCredentialsProvider ++} from '@backstage/integration'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); ++ const integrations = ScmIntegrations.fromConfig(config); ++ const githubCredentialsProvider = ++ DefaultGithubCredentialsProvider.fromIntegrations(integrations); ++ builder.addProcessor( ++ GithubDiscoveryProcessor.fromConfig(config, { ++ logger, ++ githubCredentialsProvider, ++ }), ++ GithubOrgReaderProcessor.fromConfig(config, { ++ logger, ++ githubCredentialsProvider, ++ }), ++ ); +``` + **BREAKING**: Removed `GitLabDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-gitlab`. NOTE THAT this processor was part of the default set of processors in the catalog backend, and if you are a user of discovery on GitLab, you MUST now add it manually in the catalog initialization code of your backend. ```diff @@ -17,4 +49,21 @@ + ); ``` +**BREAKING**: Removed `BitbucketDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-bitbucket`. NOTE THAT this processor was part of the default set of processors in the catalog backend, and if you are a user of discovery on Bitbucket, you MUST now add it manually in the catalog initialization code of your backend. + +```diff +// In packages/backend/src/plugins/catalog.ts ++import { BitbucketDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-bitbucket'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); ++ builder.addProcessor( ++ BitbucketDiscoveryProcessor.fromConfig(env.config, { logger: env.logger }) ++ ); +``` + **BREAKING**: Removed `AzureDevOpsDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-azure`. This processor was not part of the set of default processors. If you were using it, you should already have a reference to it in your backend code and only need to update the import. + +**BREAKING**: Removed the formerly deprecated type `BitbucketRepositoryParser`, which is instead reintroduced in `@backstage/plugin-catalog-backend-module-bitbucket`. diff --git a/.changeset/dependabot-36562b5.md b/.changeset/dependabot-36562b5.md new file mode 100644 index 0000000000..5e3deda70d --- /dev/null +++ b/.changeset/dependabot-36562b5.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +build(deps-dev): bump `@types/npm-packlist` from 1.1.2 to 3.0.0 diff --git a/.changeset/giant-bottles-eat.md b/.changeset/giant-bottles-eat.md new file mode 100644 index 0000000000..d37343bfe4 --- /dev/null +++ b/.changeset/giant-bottles-eat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-airbrake': patch +--- + +Fix a bug where API calls were being made and errors were being added to the snack bar when no project ID was present. This is a common use case for components that haven't added the Airbrake plugin annotation to their `catalog-info.yaml`. diff --git a/.changeset/gorgeous-trains-clap.md b/.changeset/gorgeous-trains-clap.md new file mode 100644 index 0000000000..d0abf6148a --- /dev/null +++ b/.changeset/gorgeous-trains-clap.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog': patch +--- + +Added an `allowedKinds` option to `CatalogKindHeader` to limit entity kinds available in the dropdown. diff --git a/.changeset/ninety-cheetahs-march.md b/.changeset/ninety-cheetahs-march.md new file mode 100644 index 0000000000..db24c6a820 --- /dev/null +++ b/.changeset/ninety-cheetahs-march.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Fixing the border color for the `FavoriteEntity` star button on the `TemplateCard` diff --git a/.changeset/perfect-moose-appear.md b/.changeset/perfect-moose-appear.md new file mode 100644 index 0000000000..9c5c356e4a --- /dev/null +++ b/.changeset/perfect-moose-appear.md @@ -0,0 +1,5 @@ +--- +'@backstage/backend-tasks': patch +--- + +Add support for cron syntax to configure task frequency - `TaskScheduleDefinition.frequency` can now be both a `Duration` and an object on the form `{ cron: string }`, where the latter is expected to be on standard crontab format (e.g. `'0 */2 * * *'`). diff --git a/.changeset/pink-chicken-smile.md b/.changeset/pink-chicken-smile.md new file mode 100644 index 0000000000..71fd8aad4e --- /dev/null +++ b/.changeset/pink-chicken-smile.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-github': minor +--- + +Added package, moving out GitHub specific functionality from the catalog-backend diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000000..826aa3fa5f --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,215 @@ +{ + "mode": "exit", + "tag": "next", + "initialVersions": { + "example-app": "0.2.67", + "@backstage/app-defaults": "0.2.0", + "example-backend": "0.2.67", + "@backstage/backend-common": "0.12.0", + "@backstage/backend-tasks": "0.1.10", + "@backstage/backend-test-utils": "0.1.20", + "@backstage/catalog-client": "0.8.0", + "@backstage/catalog-model": "0.12.0", + "@backstage/cli": "0.15.0", + "@backstage/cli-common": "0.1.8", + "@backstage/codemods": "0.1.34", + "@backstage/config": "0.1.15", + "@backstage/config-loader": "0.9.6", + "@backstage/core-app-api": "0.6.0", + "@backstage/core-components": "0.9.0", + "@backstage/core-plugin-api": "0.8.0", + "@backstage/create-app": "0.4.22", + "@backstage/dev-utils": "0.2.24", + "e2e-test": "0.2.0", + "@backstage/errors": "0.2.2", + "@backstage/integration": "0.8.0", + "@backstage/integration-react": "0.1.24", + "@backstage/release-manifests": "0.0.2", + "@backstage/search-common": "0.3.0", + "@techdocs/cli": "0.8.16", + "techdocs-cli-embedded-app": "0.2.66", + "@backstage/techdocs-common": "0.11.11", + "@backstage/test-utils": "0.3.0", + "@backstage/theme": "0.2.15", + "@backstage/types": "0.1.3", + "@backstage/version-bridge": "0.1.2", + "@backstage/plugin-airbrake": "0.3.1", + "@backstage/plugin-airbrake-backend": "0.2.1", + "@backstage/plugin-allure": "0.1.17", + "@backstage/plugin-analytics-module-ga": "0.1.12", + "@backstage/plugin-apache-airflow": "0.1.9", + "@backstage/plugin-api-docs": "0.8.1", + "@backstage/plugin-app-backend": "0.3.28", + "@backstage/plugin-auth-backend": "0.12.0", + "@backstage/plugin-auth-node": "0.1.4", + "@backstage/plugin-azure-devops": "0.1.17", + "@backstage/plugin-azure-devops-backend": "0.3.7", + "@backstage/plugin-azure-devops-common": "0.2.2", + "@backstage/plugin-badges": "0.2.25", + "@backstage/plugin-badges-backend": "0.1.22", + "@backstage/plugin-bazaar": "0.1.16", + "@backstage/plugin-bazaar-backend": "0.1.12", + "@backstage/plugin-bitrise": "0.1.28", + "@backstage/plugin-catalog": "0.9.1", + "@backstage/plugin-catalog-backend": "0.23.0", + "@backstage/plugin-catalog-backend-module-aws": "0.1.1", + "@backstage/plugin-catalog-backend-module-azure": "0.0.0", + "@backstage/plugin-catalog-backend-module-gitlab": "0.0.0", + "@backstage/plugin-catalog-backend-module-ldap": "0.3.15", + "@backstage/plugin-catalog-backend-module-msgraph": "0.2.18", + "@backstage/plugin-catalog-common": "0.2.0", + "@backstage/plugin-catalog-graph": "0.2.13", + "@backstage/plugin-catalog-graphql": "0.3.5", + "@backstage/plugin-catalog-import": "0.8.4", + "@backstage/plugin-catalog-react": "0.8.0", + "@backstage/plugin-cicd-statistics": "0.1.3", + "@backstage/plugin-circleci": "0.3.1", + "@backstage/plugin-cloudbuild": "0.3.1", + "@backstage/plugin-code-climate": "0.1.1", + "@backstage/plugin-code-coverage": "0.1.28", + "@backstage/plugin-code-coverage-backend": "0.1.26", + "@backstage/plugin-config-schema": "0.1.24", + "@backstage/plugin-cost-insights": "0.11.23", + "@backstage/plugin-explore": "0.3.32", + "@backstage/plugin-explore-react": "0.0.14", + "@backstage/plugin-firehydrant": "0.1.18", + "@backstage/plugin-fossa": "0.2.33", + "@backstage/plugin-gcp-projects": "0.3.20", + "@backstage/plugin-git-release-manager": "0.3.14", + "@backstage/plugin-github-actions": "0.5.1", + "@backstage/plugin-github-deployments": "0.1.32", + "@backstage/plugin-gitops-profiles": "0.3.19", + "@backstage/plugin-gocd": "0.1.7", + "@backstage/plugin-graphiql": "0.2.33", + "@backstage/plugin-graphql-backend": "0.1.18", + "@backstage/plugin-home": "0.4.17", + "@backstage/plugin-ilert": "0.1.27", + "@backstage/plugin-jenkins": "0.7.0", + "@backstage/plugin-jenkins-backend": "0.1.17", + "@backstage/plugin-jenkins-common": "0.1.0", + "@backstage/plugin-kafka": "0.3.1", + "@backstage/plugin-kafka-backend": "0.2.21", + "@backstage/plugin-kubernetes": "0.6.1", + "@backstage/plugin-kubernetes-backend": "0.4.11", + "@backstage/plugin-kubernetes-common": "0.2.6", + "@backstage/plugin-lighthouse": "0.3.1", + "@backstage/plugin-newrelic": "0.3.19", + "@backstage/plugin-newrelic-dashboard": "0.1.9", + "@backstage/plugin-org": "0.5.1", + "@backstage/plugin-pagerduty": "0.3.28", + "@backstage/plugin-periskop": "0.0.0", + "@backstage/plugin-periskop-backend": "0.0.0", + "@backstage/plugin-permission-backend": "0.5.3", + "@backstage/plugin-permission-common": "0.5.2", + "@backstage/plugin-permission-node": "0.5.3", + "@backstage/plugin-permission-react": "0.3.3", + "@backstage/plugin-proxy-backend": "0.2.22", + "@backstage/plugin-rollbar": "0.4.1", + "@backstage/plugin-rollbar-backend": "0.1.25", + "@backstage/plugin-scaffolder": "0.14.0", + "@backstage/plugin-scaffolder-backend": "0.17.3", + "@backstage/plugin-scaffolder-backend-module-cookiecutter": "0.2.3", + "@backstage/plugin-scaffolder-backend-module-rails": "0.3.3", + "@backstage/plugin-scaffolder-backend-module-yeoman": "0.2.1", + "@backstage/plugin-scaffolder-common": "0.2.3", + "@backstage/plugin-search": "0.7.2", + "@backstage/plugin-search-backend": "0.4.6", + "@backstage/plugin-search-backend-module-elasticsearch": "0.1.0", + "@backstage/plugin-search-backend-module-pg": "0.3.0", + "@backstage/plugin-search-backend-node": "0.5.0", + "@backstage/plugin-search-common": "0.3.0", + "@backstage/plugin-sentry": "0.3.39", + "@backstage/plugin-shortcuts": "0.2.2", + "@backstage/plugin-sonarqube": "0.3.1", + "@backstage/plugin-splunk-on-call": "0.3.25", + "@backstage/plugin-tech-insights": "0.1.11", + "@backstage/plugin-tech-insights-backend": "0.2.8", + "@backstage/plugin-tech-insights-backend-module-jsonfc": "0.1.12", + "@backstage/plugin-tech-insights-common": "0.2.3", + "@backstage/plugin-tech-insights-node": "0.2.6", + "@backstage/plugin-tech-radar": "0.5.8", + "@backstage/plugin-techdocs": "0.15.0", + "@backstage/plugin-techdocs-backend": "0.14.1", + "@backstage/plugin-techdocs-node": "0.11.11", + "@backstage/plugin-todo": "0.2.3", + "@backstage/plugin-todo-backend": "0.1.25", + "@backstage/plugin-user-settings": "0.4.0", + "@backstage/plugin-xcmetrics": "0.2.21" + }, + "changesets": [ + "beige-lies-pay", + "big-meals-fly", + "big-months-deliver", + "brave-brooms-tie", + "brown-points-impress", + "chilly-comics-jam", + "clever-garlics-rescue", + "curvy-forks-cross", + "dependabot-4014eb7", + "dependabot-ae5fb9c", + "dependabot-d2397d3", + "fair-ants-look", + "fair-roses-hide", + "fair-turtles-fetch", + "fifty-brooms-whisper", + "fuzzy-roses-swim", + "gentle-dancers-greet", + "great-hounds-allow", + "kind-experts-lay", + "late-pianos-attend", + "lazy-points-explain", + "many-coins-drive", + "many-swans-sort", + "many-tools-buy", + "mean-panthers-wonder", + "metal-glasses-join", + "modern-windows-brush", + "nasty-seahorses-bathe", + "neat-tools-design", + "new-books-protect", + "nice-windows-push", + "nine-frogs-yell", + "olive-emus-speak", + "olive-roses-sleep", + "pink-poets-grin", + "polite-apples-relax", + "popular-boxes-develop", + "popular-rats-return", + "pretty-vans-unite", + "proud-readers-nail", + "quiet-pens-wait", + "quiet-seals-fix", + "red-kiwis-divide", + "rich-ravens-clap", + "search-byta-namnet", + "search-common-people", + "search-talking-in-code", + "search-wellington-paranormal", + "shaggy-apricots-hug", + "shiny-eels-mix", + "silent-cats-kneel", + "slow-vans-rhyme", + "something-else-here", + "spotty-seals-press", + "spotty-swans-run", + "strong-beds-attack", + "strong-pandas-roll", + "swift-mails-sing", + "tasty-carpets-fold", + "techdocs-byta-namnet", + "techdocs-empty-office", + "techdocs-node-one", + "ten-queens-dance", + "ten-rats-join", + "tender-berries-lie", + "thick-games-dress", + "thick-gifts-cheat", + "twenty-birds-think", + "twenty-fireants-turn", + "twenty-planes-dress", + "two-mails-boil", + "warm-bananas-behave", + "weak-schools-wash", + "young-feet-flow" + ] +} diff --git a/.changeset/real-adults-fold.md b/.changeset/real-adults-fold.md new file mode 100644 index 0000000000..ba09ead60a --- /dev/null +++ b/.changeset/real-adults-fold.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-kubernetes-backend': patch +--- + +refactor kubernetes fetcher diff --git a/.changeset/silent-mugs-roll.md b/.changeset/silent-mugs-roll.md new file mode 100644 index 0000000000..5081022b05 --- /dev/null +++ b/.changeset/silent-mugs-roll.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-bitbucket': minor +--- + +Added package, moving out Bitbucket specific functionality from the catalog-backend diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index 2614dd6b50..3df7a18590 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -24,7 +24,7 @@ backported backporting Bigtable Billett -Bitbucket +bitbucket Bitrise Blackbox bool @@ -61,6 +61,7 @@ const cookiecutter cron cronjobs +crontab css Datadog dataflow @@ -102,7 +103,7 @@ Firekube Firestore Fiverr gitbeaker -GitHub +github gitlab GitLab Gource diff --git a/.github/workflows/deploy_nightly.yml b/.github/workflows/deploy_nightly.yml index ab4c9bcfdb..d5d3659625 100644 --- a/.github/workflows/deploy_nightly.yml +++ b/.github/workflows/deploy_nightly.yml @@ -58,6 +58,10 @@ jobs: - name: build run: yarn backstage-cli repo build + - name: build embedded techdocs app + working-directory: packages/techdocs-cli-embedded-app + run: yarn build + # Prepares a nightly release version of any package with pending changesets # Pre-mode is exited if case we're in it, otherwise it has no effect - name: prepare nightly release diff --git a/ADOPTERS.md b/ADOPTERS.md index d22978cca9..35a0e4ccc3 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -103,3 +103,4 @@ _If you're using Backstage in your organization, please try to add your company | [Snyk](https://snyk.io/) | [@robcresswell](https://github.com/robcresswell) | Developer portal for software discovery, API documentation and templating | | [Stilingue](https://www.stilingue.com.br/) | [@stilingue-inteligencia-artificial](https://github.com/Stilingue-IA), [@bbviana](https://github.com/bbviana) | Developer portal, services catalog and centralization of metrics from Grafana, Sentry and GCP. Furthermore, centralization of documentation and infra details like DNS, Network services, SSL and so on. | | [TUI Group](https://www.tuigroup.com/) | [Simon Stamm](https://github.com/simonstamm), [Christian Rudolph](https://github.com/ChrisRu82) | Developer portal for all engineer to provide discoverability to all internal components, APIs, documentation and to scaffold templates with integrations to our internal tools extended by plugins from our community. | +| [Alliander](https://www.alliander.com/) | [@leon-vg](https://github.com/leon-vg), [@gieljl](https://github.com/gieljl), [@niekteg](https://github.com/niekteg) | Developer portal - software catalog, technical documentation, software templates, tech radar and exploration of used tools/services | diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index 082fbf5b70..26dbca1442 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -133,9 +133,9 @@ familiar with. For other options, see 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 +frontend, in our tutorial it would be `http://localhost: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`. +likely be `http://localhost:7007/api/auth/github/handler/frame`.

Screenshot of the GitHub OAuth creation page diff --git a/docs/integrations/aws-s3/discovery.md b/docs/integrations/aws-s3/discovery.md index 4e72c80b95..5dfaf9dc39 100644 --- a/docs/integrations/aws-s3/discovery.md +++ b/docs/integrations/aws-s3/discovery.md @@ -27,8 +27,14 @@ catalog: Note the `s3-discovery` type, as this is not a regular `url` processor. -As this processor is not one of the default providers, you will also need to add -the below to `packages/backend/src/plugins/catalog.ts`: +As this processor is not one of the default providers, you will first need to install the AWS catalog plugin: + +```shell +cd packages/backend +yarn install @backstage/plugin-catalog-backend-module-aws +``` + +Once you've done that, you'll also need to add the segment below to `packages/backend/src/plugins/catalog.ts`: ```ts /* packages/backend/src/plugins/catalog.ts */ diff --git a/docs/integrations/bitbucket/discovery.md b/docs/integrations/bitbucket/discovery.md index 28b0128f56..c31b3a2eed 100644 --- a/docs/integrations/bitbucket/discovery.md +++ b/docs/integrations/bitbucket/discovery.md @@ -11,6 +11,34 @@ catalog entities located in Bitbucket. The processor will crawl your Bitbucket account and register entities matching the configured path. This can be useful as an alternative to static locations or manually adding things to the catalog. +## Installation + +You will have to add the processor in the catalog initialization code of your +backend. The provider is not installed by default, therefore you have to add a +dependency to `@backstage/plugin-catalog-backend-module-bitbucket` to your backend +package. + +```bash +# From your Backstage root directory +cd packages/backend +yarn add @backstage/plugin-catalog-backend-module-bitbucket +``` + +And then add the processor to your catalog builder: + +```diff +// In packages/backend/src/plugins/catalog.ts ++import { BitbucketDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-bitbucket'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); ++ builder.addProcessor( ++ BitbucketDiscoveryProcessor.fromConfig(env.config, { logger: env.logger }) ++ ); +``` + ## Self-hosted Bitbucket Server To use the discovery processor with a self-hosted Bitbucket Server, you'll need @@ -137,14 +165,11 @@ matching repository is processed. repository. ```typescript -const customRepositoryParser: BitbucketRepositoryParser = - async function* customRepositoryParser({ client, repository }) { - // Custom logic for interpret the matching repository. - // See defaultRepositoryParser for an example - }; - const processor = BitbucketDiscoveryProcessor.fromConfig(env.config, { - parser: customRepositoryParser, + parser: async function* customRepositoryParser({ client, repository }) { + // Custom logic for interpreting the matching repository. + // See defaultRepositoryParser for an example + }, logger: env.logger, }); ``` diff --git a/docs/integrations/github/discovery.md b/docs/integrations/github/discovery.md index 39cb026703..866943e002 100644 --- a/docs/integrations/github/discovery.md +++ b/docs/integrations/github/discovery.md @@ -12,6 +12,53 @@ organization and register entities matching the configured path. This can be useful as an alternative to static locations or manually adding things to the catalog. +## Installation + +You will have to add the processors in the catalog initialization code of your +backend. They are not installed by default, therefore you have to add a +dependency to `@backstage/plugin-catalog-backend-module-github` to your backend +package. + +```bash +# From your Backstage root directory +cd packages/backend +yarn add @backstage/plugin-catalog-backend-module-github +``` + +And then add the processors to your catalog builder: + +```diff +// In packages/backend/src/plugins/catalog.ts ++import { ++ GithubDiscoveryProcessor, ++ GithubOrgReaderProcessor, ++} from '@backstage/plugin-catalog-backend-module-github'; ++import { ++ ScmIntegrations, ++ DefaultGithubCredentialsProvider ++} from '@backstage/integration'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); ++ const integrations = ScmIntegrations.fromConfig(config); ++ const githubCredentialsProvider = ++ DefaultGithubCredentialsProvider.fromIntegrations(integrations); ++ builder.addProcessor( ++ GithubDiscoveryProcessor.fromConfig(config, { ++ logger, ++ githubCredentialsProvider, ++ }), ++ GithubOrgReaderProcessor.fromConfig(config, { ++ logger, ++ githubCredentialsProvider, ++ }), ++ ); +``` + +## Configuration + To use the discovery processor, you'll need a GitHub integration [set up](locations.md) with a `GITHUB_TOKEN`. Then you can add a location target to the catalog configuration: diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md index 5843944e8a..ad0be6d071 100644 --- a/docs/integrations/github/org.md +++ b/docs/integrations/github/org.md @@ -19,8 +19,7 @@ entities that mirror your org setup. ## Installation -The processor that performs the import, `GithubOrgReaderProcessor`, comes -installed with the default setup of Backstage. +See the [discovery](discovery.md) article for installation instructions. ## Configuration diff --git a/package.json b/package.json index 7d38859d35..a880bb25cc 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "resolutions": { "**/@graphql-codegen/cli/**/ws": "^7.4.6" }, - "version": "0.70.0", + "version": "0.71.0-next.0", "dependencies": { "@manypkg/get-packages": "^1.1.3", "@microsoft/api-documenter": "^7.15.0", diff --git a/packages/app-defaults/CHANGELOG.md b/packages/app-defaults/CHANGELOG.md index 33e6c09e2b..6231b61631 100644 --- a/packages/app-defaults/CHANGELOG.md +++ b/packages/app-defaults/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/app-defaults +## 0.2.1-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + ## 0.2.0 ### Minor Changes diff --git a/packages/app-defaults/package.json b/packages/app-defaults/package.json index 78accb414f..8cab2bdf07 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.2.0", + "version": "0.2.1-next.0", "private": false, "publishConfig": { "access": "public", @@ -33,7 +33,7 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-app-api": "^0.6.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/plugin-permission-react": "^0.3.3", @@ -46,7 +46,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 29f77de0b3..114a7f1e2f 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,55 @@ # example-app +## 0.2.68-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/cli@0.15.2-next.0 + - @backstage/plugin-catalog@0.10.0-next.0 + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/plugin-gcp-projects@0.3.21-next.0 + - @backstage/plugin-scaffolder@0.15.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/plugin-rollbar@0.4.2-next.0 + - @backstage/plugin-catalog-graph@0.2.14-next.0 + - @backstage/plugin-catalog-import@0.8.5-next.0 + - @backstage/plugin-explore@0.3.33-next.0 + - @backstage/plugin-catalog-common@0.2.2-next.0 + - @backstage/plugin-search-common@0.3.1-next.0 + - @backstage/plugin-search@0.7.3-next.0 + - @backstage/plugin-tech-radar@0.5.9-next.0 + - @backstage/plugin-org@0.5.2-next.0 + - @backstage/plugin-techdocs@0.15.1-next.0 + - @backstage/app-defaults@0.2.1-next.0 + - @backstage/integration-react@0.1.25-next.0 + - @backstage/plugin-airbrake@0.3.2-next.0 + - @backstage/plugin-apache-airflow@0.1.10-next.0 + - @backstage/plugin-api-docs@0.8.2-next.0 + - @backstage/plugin-azure-devops@0.1.18-next.0 + - @backstage/plugin-badges@0.2.26-next.0 + - @backstage/plugin-circleci@0.3.2-next.0 + - @backstage/plugin-cloudbuild@0.3.2-next.0 + - @backstage/plugin-code-coverage@0.1.29-next.0 + - @backstage/plugin-cost-insights@0.11.24-next.0 + - @backstage/plugin-github-actions@0.5.2-next.0 + - @backstage/plugin-gocd@0.1.8-next.0 + - @backstage/plugin-graphiql@0.2.34-next.0 + - @backstage/plugin-home@0.4.18-next.0 + - @backstage/plugin-jenkins@0.7.1-next.0 + - @backstage/plugin-kafka@0.3.2-next.0 + - @backstage/plugin-kubernetes@0.6.2-next.0 + - @backstage/plugin-lighthouse@0.3.2-next.0 + - @backstage/plugin-newrelic@0.3.20-next.0 + - @backstage/plugin-newrelic-dashboard@0.1.10-next.0 + - @backstage/plugin-pagerduty@0.3.29-next.0 + - @backstage/plugin-sentry@0.3.40-next.0 + - @backstage/plugin-shortcuts@0.2.3-next.0 + - @backstage/plugin-tech-insights@0.1.12-next.0 + - @backstage/plugin-todo@0.2.4-next.0 + - @backstage/plugin-user-settings@0.4.1-next.0 + ## 0.2.67 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index b50922ad60..75898ae772 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,60 +1,60 @@ { "name": "example-app", - "version": "0.2.67", + "version": "0.2.68-next.0", "private": true, "backstage": { "role": "frontend" }, "bundled": true, "dependencies": { - "@backstage/app-defaults": "^0.2.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/cli": "^0.15.0", + "@backstage/app-defaults": "^0.2.1-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/integration-react": "^0.1.24", - "@backstage/plugin-airbrake": "^0.3.1", - "@backstage/plugin-api-docs": "^0.8.1", - "@backstage/plugin-azure-devops": "^0.1.17", - "@backstage/plugin-apache-airflow": "^0.1.9", - "@backstage/plugin-badges": "^0.2.25", - "@backstage/plugin-catalog": "^0.9.1", - "@backstage/plugin-catalog-common": "^0.2.0", - "@backstage/plugin-catalog-graph": "^0.2.13", - "@backstage/plugin-catalog-import": "^0.8.4", - "@backstage/plugin-catalog-react": "^0.8.0", - "@backstage/plugin-circleci": "^0.3.1", - "@backstage/plugin-cloudbuild": "^0.3.1", - "@backstage/plugin-code-coverage": "^0.1.28", - "@backstage/plugin-cost-insights": "^0.11.23", - "@backstage/plugin-explore": "^0.3.32", + "@backstage/integration-react": "^0.1.25-next.0", + "@backstage/plugin-airbrake": "^0.3.2-next.0", + "@backstage/plugin-api-docs": "^0.8.2-next.0", + "@backstage/plugin-azure-devops": "^0.1.18-next.0", + "@backstage/plugin-apache-airflow": "^0.1.10-next.0", + "@backstage/plugin-badges": "^0.2.26-next.0", + "@backstage/plugin-catalog": "^0.10.0-next.0", + "@backstage/plugin-catalog-common": "^0.2.2-next.0", + "@backstage/plugin-catalog-graph": "^0.2.14-next.0", + "@backstage/plugin-catalog-import": "^0.8.5-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", + "@backstage/plugin-circleci": "^0.3.2-next.0", + "@backstage/plugin-cloudbuild": "^0.3.2-next.0", + "@backstage/plugin-code-coverage": "^0.1.29-next.0", + "@backstage/plugin-cost-insights": "^0.11.24-next.0", + "@backstage/plugin-explore": "^0.3.33-next.0", + "@backstage/plugin-gcp-projects": "^0.3.21-next.0", "@backstage/plugin-gcalendar": "^0.1.0", - "@backstage/plugin-gcp-projects": "^0.3.20", - "@backstage/plugin-github-actions": "^0.5.1", - "@backstage/plugin-gocd": "^0.1.7", - "@backstage/plugin-graphiql": "^0.2.33", - "@backstage/plugin-home": "^0.4.17", - "@backstage/plugin-jenkins": "^0.7.0", - "@backstage/plugin-kafka": "^0.3.1", - "@backstage/plugin-kubernetes": "^0.6.1", - "@backstage/plugin-lighthouse": "^0.3.1", - "@backstage/plugin-newrelic": "^0.3.19", - "@backstage/plugin-newrelic-dashboard": "^0.1.9", - "@backstage/plugin-org": "^0.5.1", - "@backstage/plugin-pagerduty": "0.3.28", + "@backstage/plugin-github-actions": "^0.5.2-next.0", + "@backstage/plugin-gocd": "^0.1.8-next.0", + "@backstage/plugin-graphiql": "^0.2.34-next.0", + "@backstage/plugin-home": "^0.4.18-next.0", + "@backstage/plugin-jenkins": "^0.7.1-next.0", + "@backstage/plugin-kafka": "^0.3.2-next.0", + "@backstage/plugin-kubernetes": "^0.6.2-next.0", + "@backstage/plugin-lighthouse": "^0.3.2-next.0", + "@backstage/plugin-newrelic": "^0.3.20-next.0", + "@backstage/plugin-newrelic-dashboard": "^0.1.10-next.0", + "@backstage/plugin-org": "^0.5.2-next.0", + "@backstage/plugin-pagerduty": "0.3.29-next.0", "@backstage/plugin-permission-react": "^0.3.3", - "@backstage/plugin-rollbar": "^0.4.1", - "@backstage/plugin-scaffolder": "^0.14.0", - "@backstage/plugin-search": "^0.7.2", - "@backstage/plugin-search-common": "^0.3.0", - "@backstage/plugin-sentry": "^0.3.39", - "@backstage/plugin-shortcuts": "^0.2.2", - "@backstage/plugin-tech-radar": "^0.5.8", - "@backstage/plugin-techdocs": "^0.15.0", - "@backstage/plugin-todo": "^0.2.3", - "@backstage/plugin-user-settings": "^0.4.0", - "@backstage/plugin-tech-insights": "^0.1.11", + "@backstage/plugin-rollbar": "^0.4.2-next.0", + "@backstage/plugin-scaffolder": "^0.15.0-next.0", + "@backstage/plugin-search": "^0.7.3-next.0", + "@backstage/plugin-search-common": "^0.3.1-next.0", + "@backstage/plugin-sentry": "^0.3.40-next.0", + "@backstage/plugin-shortcuts": "^0.2.3-next.0", + "@backstage/plugin-tech-radar": "^0.5.9-next.0", + "@backstage/plugin-techdocs": "^0.15.1-next.0", + "@backstage/plugin-todo": "^0.2.4-next.0", + "@backstage/plugin-user-settings": "^0.4.1-next.0", + "@backstage/plugin-tech-insights": "^0.1.12-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", diff --git a/packages/backend-common/CHANGELOG.md b/packages/backend-common/CHANGELOG.md index 70b2455a55..64c8034fa4 100644 --- a/packages/backend-common/CHANGELOG.md +++ b/packages/backend-common/CHANGELOG.md @@ -1,5 +1,24 @@ # @backstage/backend-common +## 0.13.0-next.0 + +### Minor Changes + +- ae9d6fb3df: **BREAKING**: + + - Removed the (since way back) deprecated `createDatabase` export, please use `createDatabaseClient` instead. + - Removed the (since way back) deprecated `SingleConnectionDatabaseManager` export, please use `DatabaseManager` instead. + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- aefca2a7e9: add support for ETag at `BitbucketUrlReader.readUrl` +- 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils` +- b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage. +- Updated dependencies + - @backstage/config-loader@0.9.7-next.0 + ## 0.12.1 ### Patch Changes diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 48c2095028..cc14851d94 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-common", "description": "Common functionality library for Backstage backends", - "version": "0.12.0", + "version": "0.13.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -36,7 +36,7 @@ "dependencies": { "@backstage/cli-common": "^0.1.8", "@backstage/config": "^0.1.15", - "@backstage/config-loader": "^0.9.6", + "@backstage/config-loader": "^0.9.7-next.0", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", "@backstage/types": "^0.1.3", @@ -89,8 +89,8 @@ } }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@types/archiver": "^5.1.0", "@types/compression": "^1.7.0", "@types/concat-stream": "^2.0.0", diff --git a/packages/backend-tasks/CHANGELOG.md b/packages/backend-tasks/CHANGELOG.md index 506efa1226..2f41b37562 100644 --- a/packages/backend-tasks/CHANGELOG.md +++ b/packages/backend-tasks/CHANGELOG.md @@ -1,5 +1,20 @@ # @backstage/backend-tasks +## 0.2.0-next.0 + +### Minor Changes + +- 9461f73643: **BREAKING**: The `TaskDefinition` type has been removed, and replaced by the equal pair `TaskScheduleDefinition` and `TaskInvocationDefinition`. The interface for `PluginTaskScheduler.scheduleTask` stays effectively unchanged, so this only affects you if you use the actual types directly. + + Added the method `PluginTaskScheduler.createTaskSchedule`, which returns a `TaskSchedule` wrapper that is convenient to pass down into classes that want to control their task invocations while the caller wants to retain control of the actual schedule chosen. + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- 7290dda9d4: Relaxed the task ID requirement to now support any non-empty string +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + ## 0.1.10 ### Patch Changes diff --git a/packages/backend-tasks/README.md b/packages/backend-tasks/README.md index fe55f37afd..1bfab8a89b 100644 --- a/packages/backend-tasks/README.md +++ b/packages/backend-tasks/README.md @@ -22,7 +22,7 @@ const scheduler = TaskScheduler.fromConfig(rootConfig).forPlugin('my-plugin'); await scheduler.scheduleTask({ id: 'refresh_things', - frequency: Duration.fromObject({ minutes: 10 }), + frequency: { cron: '*/5 * * * *' }, // every 5 minutes, also supports Duration timeout: Duration.fromObject({ minutes: 15 }), fn: async () => { await entityProvider.run(); diff --git a/packages/backend-tasks/api-report.md b/packages/backend-tasks/api-report.md index 98199a55b0..0093616d8f 100644 --- a/packages/backend-tasks/api-report.md +++ b/packages/backend-tasks/api-report.md @@ -36,7 +36,11 @@ export interface TaskRunner { // @public export interface TaskScheduleDefinition { - frequency: Duration; + frequency: + | { + cron: string; + } + | Duration; initialDelay?: Duration; timeout: Duration; } diff --git a/packages/backend-tasks/package.json b/packages/backend-tasks/package.json index f4df77da04..39aa3067a1 100644 --- a/packages/backend-tasks/package.json +++ b/packages/backend-tasks/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-tasks", "description": "Common distributed task management library for Backstage backends", - "version": "0.1.10", + "version": "0.2.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -33,11 +33,12 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@backstage/types": "^0.1.3", "@types/luxon": "^2.0.4", + "cron": "^1.8.2", "knex": "^1.0.2", "lodash": "^4.17.21", "luxon": "^2.0.2", @@ -47,8 +48,9 @@ "zod": "^3.9.5" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", + "@types/cron": "^1.7.3", "jest": "^26.0.1", "wait-for-expect": "^3.0.2" }, diff --git a/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.test.ts b/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.test.ts index 993041bed4..646a2ce737 100644 --- a/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.test.ts +++ b/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.test.ts @@ -40,7 +40,7 @@ describe('PluginTaskManagerImpl', () => { // TaskWorker.test.ts describe('scheduleTask', () => { it.each(databases.eachSupportedId())( - 'can run the happy path, %p', + 'can run the v1 happy path, %p', async databaseId => { const { manager } = await init(databaseId); @@ -58,6 +58,26 @@ describe('PluginTaskManagerImpl', () => { }, 60_000, ); + + it.each(databases.eachSupportedId())( + 'can run the v2 happy path, %p', + async databaseId => { + const { manager } = await init(databaseId); + + const fn = jest.fn(); + await manager.scheduleTask({ + id: 'task2', + timeout: Duration.fromMillis(5000), + frequency: { cron: '* * * * * *' }, + fn, + }); + + await waitForExpect(() => { + expect(fn).toBeCalled(); + }); + }, + 60_000, + ); }); // This is just to test the wrapper code; most of the actual tests are in diff --git a/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.ts b/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.ts index 8d50298ffd..8c3166b441 100644 --- a/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.ts +++ b/packages/backend-tasks/src/tasks/PluginTaskSchedulerImpl.ts @@ -40,13 +40,16 @@ export class PluginTaskSchedulerImpl implements PluginTaskScheduler { validateId(task.id); const knex = await this.databaseFactory(); - const worker = new TaskWorker(task.id, task.fn, knex, this.logger); + await worker.start( { - version: 1, + version: 2, + cadence: + 'cron' in task.frequency + ? task.frequency.cron + : task.frequency.toISO(), initialDelayDuration: task.initialDelay?.toISO(), - recurringAtMostEveryDuration: task.frequency.toISO(), timeoutAfterDuration: task.timeout.toISO(), }, { diff --git a/packages/backend-tasks/src/tasks/TaskScheduler.test.ts b/packages/backend-tasks/src/tasks/TaskScheduler.test.ts index ce8e797503..2a5deddb19 100644 --- a/packages/backend-tasks/src/tasks/TaskScheduler.test.ts +++ b/packages/backend-tasks/src/tasks/TaskScheduler.test.ts @@ -39,7 +39,7 @@ describe('TaskScheduler', () => { } it.each(databases.eachSupportedId())( - 'can return a working plugin impl, %p', + 'can return a working v1 plugin impl, %p', async databaseId => { const database = await createDatabase(databaseId); const manager = new TaskScheduler(database, logger).forPlugin('test'); @@ -58,4 +58,25 @@ describe('TaskScheduler', () => { }, 60_000, ); + + it.each(databases.eachSupportedId())( + 'can return a working v2 plugin impl, %p', + async databaseId => { + const database = await createDatabase(databaseId); + const manager = new TaskScheduler(database, logger).forPlugin('test'); + const fn = jest.fn(); + + await manager.scheduleTask({ + id: 'task2', + timeout: Duration.fromMillis(5000), + frequency: { cron: '* * * * * *' }, + fn, + }); + + await waitForExpect(() => { + expect(fn).toBeCalled(); + }); + }, + 60_000, + ); }); diff --git a/packages/backend-tasks/src/tasks/TaskWorker.test.ts b/packages/backend-tasks/src/tasks/TaskWorker.test.ts index 7c8dad08bf..793e679c39 100644 --- a/packages/backend-tasks/src/tasks/TaskWorker.test.ts +++ b/packages/backend-tasks/src/tasks/TaskWorker.test.ts @@ -21,7 +21,7 @@ import waitForExpect from 'wait-for-expect'; import { migrateBackendTasks } from '../database/migrateBackendTasks'; import { DbTasksRow, DB_TASKS_TABLE } from '../database/tables'; import { TaskWorker } from './TaskWorker'; -import { TaskSettingsV1 } from './types'; +import { TaskSettingsV2 } from './types'; describe('TaskWorker', () => { const logger = getVoidLogger(); @@ -42,11 +42,11 @@ describe('TaskWorker', () => { const fn = jest.fn( async () => new Promise(resolve => setTimeout(resolve, 50)), ); - const settings: TaskSettingsV1 = { - version: 1, - initialDelayDuration: Duration.fromMillis(1000).toISO(), - recurringAtMostEveryDuration: Duration.fromMillis(2000).toISO(), - timeoutAfterDuration: Duration.fromMillis(60000).toISO(), + const settings: TaskSettingsV2 = { + version: 2, + cadence: '*/2 * * * * *', + initialDelayDuration: Duration.fromObject({ seconds: 1 }).toISO(), + timeoutAfterDuration: Duration.fromObject({ minutes: 1 }).toISO(), }; const worker = new TaskWorker('task1', fn, knex, logger); @@ -62,10 +62,10 @@ describe('TaskWorker', () => { }), ); expect(JSON.parse(row.settings_json)).toEqual({ - version: 1, + version: 2, + cadence: '*/2 * * * * *', initialDelayDuration: 'PT1S', - recurringAtMostEveryDuration: 'PT2S', - timeoutAfterDuration: 'PT60S', + timeoutAfterDuration: 'PT1M', }); await expect(worker.findReadyTask()).resolves.toEqual({ @@ -125,10 +125,10 @@ describe('TaskWorker', () => { await migrateBackendTasks(knex); const fn = jest.fn().mockRejectedValue(new Error('failed')); - const settings: TaskSettingsV1 = { - version: 1, + const settings: TaskSettingsV2 = { + version: 2, initialDelayDuration: undefined, - recurringAtMostEveryDuration: Duration.fromMillis(0).toISO(), + cadence: '* * * * * *', timeoutAfterDuration: Duration.fromMillis(60000).toISO(), }; @@ -151,18 +151,23 @@ describe('TaskWorker', () => { const fn = jest.fn( async () => new Promise(resolve => setTimeout(resolve, 50)), ); - const settings: TaskSettingsV1 = { - version: 1, - recurringAtMostEveryDuration: Duration.fromMillis(0).toISO(), + const settings: TaskSettingsV2 = { + version: 2, + initialDelayDuration: undefined, + cadence: '* * * * * *', timeoutAfterDuration: Duration.fromMillis(60000).toISO(), }; const worker = new TaskWorker('task1', fn, knex, logger); await worker.persistTask(settings); - await expect(worker.findReadyTask()).resolves.toEqual({ - result: 'ready', - settings, + + await waitForExpect(async () => { + await expect(worker.findReadyTask()).resolves.toEqual({ + result: 'ready', + settings, + }); }); + await expect(worker.tryClaimTask('ticket', settings)).resolves.toBe(true); let row = (await knex(DB_TASKS_TABLE))[0]; @@ -203,9 +208,10 @@ describe('TaskWorker', () => { await migrateBackendTasks(knex); const fn = jest.fn(async () => {}); - const settings: TaskSettingsV1 = { - version: 1, - recurringAtMostEveryDuration: Duration.fromMillis(0).toISO(), + const settings: TaskSettingsV2 = { + version: 2, + initialDelayDuration: undefined, + cadence: '* * * * * *', timeoutAfterDuration: Duration.fromMillis(60000).toISO(), }; @@ -218,10 +224,14 @@ describe('TaskWorker', () => { const worker2 = new TaskWorker('task2', fn, knex, logger); await worker2.persistTask(settings); - await expect(worker2.findReadyTask()).resolves.toEqual({ - result: 'ready', - settings, + + await waitForExpect(async () => { + await expect(worker2.findReadyTask()).resolves.toEqual({ + result: 'ready', + settings, + }); }); + await knex(DB_TASKS_TABLE).where('id', '=', 'task2').delete(); await expect(worker2.tryClaimTask('ticket', settings)).resolves.toBe( false, @@ -229,10 +239,14 @@ describe('TaskWorker', () => { const worker3 = new TaskWorker('task3', fn, knex, logger); await worker3.persistTask(settings); - await expect(worker3.findReadyTask()).resolves.toEqual({ - result: 'ready', - settings, + + await waitForExpect(async () => { + await expect(worker3.findReadyTask()).resolves.toEqual({ + result: 'ready', + settings, + }); }); + await expect(worker3.tryClaimTask('ticket', settings)).resolves.toBe( true, ); diff --git a/packages/backend-tasks/src/tasks/TaskWorker.ts b/packages/backend-tasks/src/tasks/TaskWorker.ts index 5d33bfa7a1..84f45a7fe6 100644 --- a/packages/backend-tasks/src/tasks/TaskWorker.ts +++ b/packages/backend-tasks/src/tasks/TaskWorker.ts @@ -15,13 +15,14 @@ */ import { Knex } from 'knex'; -import { Duration } from 'luxon'; +import { DateTime, Duration } from 'luxon'; import { AbortSignal } from 'node-abort-controller'; import { v4 as uuid } from 'uuid'; import { Logger } from 'winston'; import { DbTasksRow, DB_TASKS_TABLE } from '../database/tables'; -import { TaskFunction, TaskSettingsV1, taskSettingsV1Schema } from './types'; +import { TaskFunction, TaskSettingsV2, taskSettingsV2Schema } from './types'; import { delegateAbortController, nowPlus, sleep } from './util'; +import { CronTime } from 'cron'; const WORK_CHECK_FREQUENCY = Duration.fromObject({ seconds: 5 }); @@ -43,7 +44,7 @@ export class TaskWorker { this.logger = logger; } - async start(settings: TaskSettingsV1, options?: { signal?: AbortSignal }) { + async start(settings: TaskSettingsV2, options?: { signal?: AbortSignal }) { try { await this.persistTask(settings); } catch (e) { @@ -123,22 +124,39 @@ export class TaskWorker { /** * Perform the initial store of the task info */ - async persistTask(settings: TaskSettingsV1) { + async persistTask(settings: TaskSettingsV2) { // Perform an initial parse to ensure that we will definitely be able to // read it back again. - taskSettingsV1Schema.parse(settings); + taskSettingsV2Schema.parse(settings); - const settingsJson = JSON.stringify(settings); - const startAt = settings.initialDelayDuration - ? nowPlus(Duration.fromISO(settings.initialDelayDuration), this.knex) - : this.knex.fn.now(); + const isCron = !settings?.cadence.startsWith('P'); + + let startAt: Knex.Raw; + if (settings.initialDelayDuration) { + startAt = nowPlus( + Duration.fromISO(settings.initialDelayDuration), + this.knex, + ); + } else if (isCron) { + const time = new CronTime(settings.cadence) + .sendAt() + .add({ seconds: -1 }) // immediately, if "* * * * * *" + .toISOString(); + startAt = this.knex.client.config.client.includes('sqlite3') + ? this.knex.raw('datetime(?)', [time]) + : this.knex.raw(`?`, [time]); + } else { + startAt = this.knex.fn.now(); + } + + this.logger.debug(`task: ${this.taskId} configured to run at: ${startAt}`); // It's OK if the task already exists; if it does, just replace its // settings with the new value and start the loop as usual. await this.knex(DB_TASKS_TABLE) .insert({ id: this.taskId, - settings_json: settingsJson, + settings_json: JSON.stringify(settings), next_run_start_at: startAt, }) .onConflict('id') @@ -151,15 +169,14 @@ export class TaskWorker { async findReadyTask(): Promise< | { result: 'not-ready-yet' } | { result: 'abort' } - | { result: 'ready'; settings: TaskSettingsV1 } + | { result: 'ready'; settings: TaskSettingsV2 } > { const [row] = await this.knex(DB_TASKS_TABLE) .where('id', '=', this.taskId) .select({ settingsJson: 'settings_json', ready: this.knex.raw( - ` - CASE + `CASE WHEN next_run_start_at <= ? AND current_run_ticket IS NULL THEN TRUE ELSE FALSE END`, @@ -177,7 +194,8 @@ export class TaskWorker { } try { - const settings = taskSettingsV1Schema.parse(JSON.parse(row.settingsJson)); + const obj = JSON.parse(row.settingsJson); + const settings = taskSettingsV2Schema.parse(obj); return { result: 'ready', settings }; } catch (e) { this.logger.info( @@ -199,7 +217,7 @@ export class TaskWorker { */ async tryClaimTask( ticket: string, - settings: TaskSettingsV1, + settings: TaskSettingsV2, ): Promise { const startedAt = this.knex.fn.now(); const expiresAt = settings.timeoutAfterDuration @@ -220,27 +238,37 @@ export class TaskWorker { async tryReleaseTask( ticket: string, - settings: TaskSettingsV1, + settings: TaskSettingsV2, ): Promise { - const { recurringAtMostEveryDuration } = settings; + const isCron = !settings?.cadence.startsWith('P'); - // We make an effort to keep the datetime calculations in the database - // layer, making sure to not have to perform conversions back and forth and - // leaning on the database as a central clock source - const dbNull = this.knex.raw('null'); - const dt = Duration.fromISO(recurringAtMostEveryDuration).as('seconds'); - const nextRun = this.knex.client.config.client.includes('sqlite3') - ? this.knex.raw('datetime(next_run_start_at, ?)', [`+${dt} seconds`]) - : this.knex.raw(`next_run_start_at + interval '${dt} seconds'`); + let nextRun: Knex.Raw; + if (isCron) { + const time = new CronTime(settings.cadence).sendAt().toISOString(); + this.logger.debug(`task: ${this.taskId} will next occur around ${time}`); + nextRun = this.knex.client.config.client.includes('sqlite3') + ? this.knex.raw('datetime(?)', [time]) + : this.knex.raw(`?`, [time]); + } else { + const dt = Duration.fromISO(settings.cadence).as('seconds'); + this.logger.debug( + `task: ${this.taskId} will next occur around ${DateTime.now().plus({ + seconds: dt, + })}`, + ); + nextRun = this.knex.client.config.client.includes('sqlite3') + ? this.knex.raw('datetime(next_run_start_at, ?)', [`+${dt} seconds`]) + : this.knex.raw(`next_run_start_at + interval '${dt} seconds'`); + } const rows = await this.knex(DB_TASKS_TABLE) .where('id', '=', this.taskId) .where('current_run_ticket', '=', ticket) .update({ next_run_start_at: nextRun, - current_run_ticket: dbNull, - current_run_started_at: dbNull, - current_run_expires_at: dbNull, + current_run_ticket: this.knex.raw('null'), + current_run_started_at: this.knex.raw('null'), + current_run_expires_at: this.knex.raw('null'), }); return rows === 1; diff --git a/packages/backend-tasks/src/tasks/types.ts b/packages/backend-tasks/src/tasks/types.ts index 35b5598700..acd651adcf 100644 --- a/packages/backend-tasks/src/tasks/types.ts +++ b/packages/backend-tasks/src/tasks/types.ts @@ -17,6 +17,7 @@ import { Duration } from 'luxon'; import { AbortSignal } from 'node-abort-controller'; import { z } from 'zod'; +import { CronTime } from 'cron'; /** * A function that can be called as a scheduled task. @@ -37,18 +38,8 @@ export type TaskFunction = */ export interface TaskScheduleDefinition { /** - * The maximum amount of time that a single task invocation can take, before - * it's considered timed out and gets "released" such that a new invocation - * is permitted to take place (possibly, then, on a different worker). - * - * If no value is given for this field then there is no timeout. This is - * potentially dangerous. - */ - timeout: Duration; - - /** - * The amount of time that should pass between task invocation starts. - * Essentially, this equals roughly how often you want the task to run. + * How often you want the task to run. The system does its best to avoid + * overlapping invocations. * * This is a best effort value; under some circumstances there can be * deviations. For example, if the task runtime is longer than the frequency @@ -56,12 +47,37 @@ export interface TaskScheduleDefinition { * invocation of this task will be delayed until after the previous one * finishes. * - * The system does its best to avoid overlapping invocations. - * - * If no value is given for this field then the task will only be invoked - * once (on any worker) and then unscheduled automatically. + * This is a required field. */ - frequency: Duration; + frequency: + | { + /** + * A crontab style string. + * + * Overview: + * + * ``` + * ┌────────────── second (optional) + * │ ┌──────────── minute + * │ │ ┌────────── hour + * │ │ │ ┌──────── day of month + * │ │ │ │ ┌────── month + * │ │ │ │ │ ┌──── day of week + * │ │ │ │ │ │ + * │ │ │ │ │ │ + * * * * * * * + * ``` + */ + cron: string; + } + | Duration; + + /** + * The maximum amount of time that a single task invocation can take, before + * it's considered timed out and gets "released" such that a new invocation + * is permitted to take place (possibly, then, on a different worker). + */ + timeout: Duration; /** * The amount of time that should pass before the first invocation happens. @@ -70,7 +86,7 @@ export interface TaskScheduleDefinition { * compute jobs. * * If no value is given for this field then the first invocation will happen - * as soon as possible. + * as soon as possible according to the cadence. */ initialDelay?: Duration; } @@ -152,7 +168,21 @@ export interface PluginTaskScheduler { function isValidOptionalDurationString(d: string | undefined): boolean { try { - return !d || Duration.fromISO(d).isValid === true; + return !d || Duration.fromISO(d).isValid; + } catch { + return false; + } +} + +function isValidCronFormat(c: string | undefined): boolean { + try { + if (!c) { + return false; + } + // parse cron format to ensure it's a valid format. + // eslint-disable-next-line no-new + new CronTime(c); + return true; } catch { return false; } @@ -163,16 +193,46 @@ export const taskSettingsV1Schema = z.object({ initialDelayDuration: z .string() .optional() - .refine(isValidOptionalDurationString, { message: 'Invalid duration' }), + .refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), recurringAtMostEveryDuration: z .string() - .refine(isValidOptionalDurationString, { message: 'Invalid duration' }), - timeoutAfterDuration: z - .string() - .refine(isValidOptionalDurationString, { message: 'Invalid duration' }), + .refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), + timeoutAfterDuration: z.string().refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), }); /** * The properties that control a scheduled task (version 1). */ export type TaskSettingsV1 = z.infer; + +export const taskSettingsV2Schema = z.object({ + version: z.literal(2), + cadence: z + .string() + .refine(isValidCronFormat, { message: 'Invalid cron' }) + .or( + z.string().refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), + ), + timeoutAfterDuration: z.string().refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), + initialDelayDuration: z + .string() + .optional() + .refine(isValidOptionalDurationString, { + message: 'Invalid duration, expecting ISO Period', + }), +}); + +/** + * The properties that control a scheduled task (version 2). + */ +export type TaskSettingsV2 = z.infer; diff --git a/packages/backend-test-utils/CHANGELOG.md b/packages/backend-test-utils/CHANGELOG.md index 6f1e921875..a7dbcbd51f 100644 --- a/packages/backend-test-utils/CHANGELOG.md +++ b/packages/backend-test-utils/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/backend-test-utils +## 0.1.21-next.0 + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- 3c2bc73901: Add `setupRequestMockHandlers` which sets up a good `msw` server foundation, copied from `@backstage/test-utils` which is a frontend-only package and should not be used from backends. +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/cli@0.15.2-next.0 + ## 0.1.20 ### Patch Changes diff --git a/packages/backend-test-utils/package.json b/packages/backend-test-utils/package.json index 4a9f8cd903..d5e0feac35 100644 --- a/packages/backend-test-utils/package.json +++ b/packages/backend-test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/backend-test-utils", "description": "Test helpers library for Backstage backends", - "version": "0.1.20", + "version": "0.1.21-next.0", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -34,8 +34,8 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/cli": "^0.15.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/config": "^0.1.15", "@vscode/sqlite3": "^5.0.7", "knex": "^1.0.2", @@ -46,7 +46,7 @@ "uuid": "^8.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "jest": "^26.0.1" }, "files": [ diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 2e483882b9..d6500304c0 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,42 @@ # example-backend +## 0.2.68-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/backend-tasks@0.2.0-next.0 + - @backstage/plugin-app-backend@0.3.29-next.0 + - @backstage/plugin-auth-backend@0.12.1-next.0 + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/plugin-scaffolder-backend@0.18.0-next.0 + - @backstage/plugin-scaffolder-backend-module-rails@0.3.4-next.0 + - @backstage/plugin-kubernetes-backend@0.4.12-next.0 + - @backstage/plugin-rollbar-backend@0.1.26-next.0 + - @backstage/plugin-techdocs-backend@0.14.2-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/plugin-badges-backend@0.1.23-next.0 + - @backstage/plugin-search-backend-module-elasticsearch@0.1.1-next.0 + - @backstage/plugin-search-backend-module-pg@0.3.1-next.0 + - @backstage/plugin-search-backend-node@0.5.1-next.0 + - @backstage/plugin-search-backend@0.4.7-next.0 + - @backstage/catalog-client@0.9.0-next.0 + - @backstage/plugin-auth-node@0.1.5-next.0 + - @backstage/plugin-azure-devops-backend@0.3.8-next.0 + - @backstage/plugin-code-coverage-backend@0.1.27-next.0 + - @backstage/plugin-graphql-backend@0.1.19-next.0 + - @backstage/plugin-jenkins-backend@0.1.18-next.0 + - @backstage/plugin-kafka-backend@0.2.22-next.0 + - @backstage/plugin-permission-backend@0.5.4-next.0 + - @backstage/plugin-permission-node@0.5.4-next.0 + - @backstage/plugin-proxy-backend@0.2.23-next.0 + - @backstage/plugin-tech-insights-backend@0.2.9-next.0 + - @backstage/plugin-tech-insights-backend-module-jsonfc@0.1.13-next.0 + - @backstage/plugin-tech-insights-node@0.2.7-next.0 + - @backstage/plugin-todo-backend@0.1.26-next.0 + - example-app@0.2.68-next.0 + ## 0.2.67 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index dc07124910..50e7a9c3fb 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.2.67", + "version": "0.2.68-next.0", "main": "dist/index.cjs.js", "types": "src/index.ts", "license": "Apache-2.0", @@ -27,39 +27,39 @@ "migrate:create": "knex migrate:make -x ts" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/backend-tasks": "^0.1.10", - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/backend-tasks": "^0.2.0-next.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/integration": "^0.8.0", - "@backstage/plugin-app-backend": "^0.3.28", - "@backstage/plugin-auth-backend": "^0.12.0", - "@backstage/plugin-auth-node": "^0.1.4", - "@backstage/plugin-azure-devops-backend": "^0.3.7", - "@backstage/plugin-badges-backend": "^0.1.22", - "@backstage/plugin-catalog-backend": "^0.23.0", - "@backstage/plugin-code-coverage-backend": "^0.1.26", - "@backstage/plugin-graphql-backend": "^0.1.18", - "@backstage/plugin-jenkins-backend": "^0.1.17", - "@backstage/plugin-kubernetes-backend": "^0.4.11", - "@backstage/plugin-kafka-backend": "^0.2.21", - "@backstage/plugin-permission-backend": "^0.5.3", + "@backstage/plugin-app-backend": "^0.3.29-next.0", + "@backstage/plugin-auth-backend": "^0.12.1-next.0", + "@backstage/plugin-auth-node": "^0.1.5-next.0", + "@backstage/plugin-azure-devops-backend": "^0.3.8-next.0", + "@backstage/plugin-badges-backend": "^0.1.23-next.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", + "@backstage/plugin-code-coverage-backend": "^0.1.27-next.0", + "@backstage/plugin-graphql-backend": "^0.1.19-next.0", + "@backstage/plugin-jenkins-backend": "^0.1.18-next.0", + "@backstage/plugin-kubernetes-backend": "^0.4.12-next.0", + "@backstage/plugin-kafka-backend": "^0.2.22-next.0", + "@backstage/plugin-permission-backend": "^0.5.4-next.0", "@backstage/plugin-permission-common": "^0.5.2", - "@backstage/plugin-permission-node": "^0.5.3", - "@backstage/plugin-proxy-backend": "^0.2.22", - "@backstage/plugin-rollbar-backend": "^0.1.25", - "@backstage/plugin-scaffolder-backend": "^0.17.3", - "@backstage/plugin-scaffolder-backend-module-rails": "^0.3.3", - "@backstage/plugin-search-backend": "^0.4.6", - "@backstage/plugin-search-backend-node": "^0.5.0", - "@backstage/plugin-search-backend-module-elasticsearch": "^0.1.0", - "@backstage/plugin-search-backend-module-pg": "^0.3.0", - "@backstage/plugin-techdocs-backend": "^0.14.1", - "@backstage/plugin-tech-insights-backend": "^0.2.8", - "@backstage/plugin-tech-insights-node": "^0.2.6", - "@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.12", - "@backstage/plugin-todo-backend": "^0.1.25", + "@backstage/plugin-permission-node": "^0.5.4-next.0", + "@backstage/plugin-proxy-backend": "^0.2.23-next.0", + "@backstage/plugin-rollbar-backend": "^0.1.26-next.0", + "@backstage/plugin-scaffolder-backend": "^0.18.0-next.0", + "@backstage/plugin-scaffolder-backend-module-rails": "^0.3.4-next.0", + "@backstage/plugin-search-backend": "^0.4.7-next.0", + "@backstage/plugin-search-backend-node": "^0.5.1-next.0", + "@backstage/plugin-search-backend-module-elasticsearch": "^0.1.1-next.0", + "@backstage/plugin-search-backend-module-pg": "^0.3.1-next.0", + "@backstage/plugin-techdocs-backend": "^0.14.2-next.0", + "@backstage/plugin-tech-insights-backend": "^0.2.9-next.0", + "@backstage/plugin-tech-insights-node": "^0.2.7-next.0", + "@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.13-next.0", + "@backstage/plugin-todo-backend": "^0.1.26-next.0", "@gitbeaker/node": "^35.1.0", "@octokit/rest": "^18.5.3", "@vscode/sqlite3": "^5.0.7", @@ -76,7 +76,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/dockerode": "^3.3.0", "@types/express": "^4.17.6", "@types/express-serve-static-core": "^4.17.5" diff --git a/packages/catalog-client/CHANGELOG.md b/packages/catalog-client/CHANGELOG.md index 6e1cc280a8..f3b74c4d4d 100644 --- a/packages/catalog-client/CHANGELOG.md +++ b/packages/catalog-client/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/catalog-client +## 0.9.0-next.0 + +### Minor Changes + +- bf95bb806c: **BREAKING**: Removed previously deprecated `CatalogApi.getEntityByName`, please use `getEntityByRef` instead. +- a3eb3d2afa: **BREAKING**: Removed `CatalogClient.getLocationByEntity` and `CatalogClient.getOriginLocationByEntity` which had previously been deprecated. Please use `CatalogApi.getLocationByRef` instead. Note that this only affects you if you were using `CatalogClient` (the class) directly, rather than `CatalogApi` (the interface), since it has been removed from the interface in an earlier release. + +### Patch Changes + +- Updated dependencies + - @backstage/catalog-model@0.13.0-next.0 + ## 0.8.0 ### Minor Changes diff --git a/packages/catalog-client/package.json b/packages/catalog-client/package.json index 2eca878e9f..cf9246d5a2 100644 --- a/packages/catalog-client/package.json +++ b/packages/catalog-client/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/catalog-client", "description": "An isomorphic client for the catalog backend", - "version": "0.8.0", + "version": "0.9.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,12 +33,12 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/errors": "^0.2.2", "cross-fetch": "^3.1.5" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/jest": "^26.0.7", "msw": "^0.35.0" }, diff --git a/packages/catalog-model/CHANGELOG.md b/packages/catalog-model/CHANGELOG.md index bea5f18f09..8a35937c07 100644 --- a/packages/catalog-model/CHANGELOG.md +++ b/packages/catalog-model/CHANGELOG.md @@ -1,5 +1,29 @@ # @backstage/catalog-model +## 0.13.0-next.0 + +### Minor Changes + +- 51a9f8f122: **BREAKING**: + + - Removed the previously deprecated type `EntityRef`. Please use `string` for stringified entity refs, `CompoundEntityRef` for compound kind-namespace-name triplet objects, or custom objects like `{ kind?: string; namespace?: string; name: string }` and similar if you have need for partial types. + - Removed the previously deprecated type `LocationSpec` type, which has been moved to `@backstage/plugin-catalog-backend`. + - Removed the previously deprecated function `parseEntityName`. Please use `parseEntityRef` instead. + +- d1d488e371: **BREAKING**: The default validator for `metadata.tags` now permits the colon (`:`) character as well. + +### Patch Changes + +- 2952566587: Updated `parseEntityRef` to allow `:` and `/` in the entity name. For example, parsing `'component:default/foo:bar'` will result in the name `'foo:bar'`. + + Note that only parsing `'foo:bar'` itself will result in the name `'bar'` and the entity kind `'foo'`, meaning this is a particularly nasty trap for user defined entity references. For this reason it is strongly discouraged to use names that contain these characters, and the catalog model does not allow it by default. However, this change now makes is possible to use these names if the default catalog validation is replaced, and in particular a high level of automation of the catalog population can limit issues that it might otherwise cause. + +- b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage. +- d1d488e371: **DEPRECATION**: + + - Deprecated `CommonValidatorFunctions.isValidString`, please use `isNonEmptyString` instead which is equivalent but better named. + - Deprecated `CommonValidatorFunctions.isValidTag`, with no replacement. Its purpose was too specific and not reusable, so it will be removed. + ## 0.12.1 ### Patch Changes diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index 32416f7bb0..bd0e88acbf 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/catalog-model", "description": "Types and validators that help describe the model of a Backstage Catalog", - "version": "0.12.0", + "version": "0.13.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -43,7 +43,7 @@ "uuid": "^8.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/jest": "^26.0.7", "@types/json-schema": "^7.0.5", "@types/lodash": "^4.14.151", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 10f7ce1d69..b3ab3fc0e7 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,31 @@ # @backstage/cli +## 0.15.2-next.0 + +### Patch Changes + +- 2c528506aa: Added `--since ` flag for `repo build` command.` +- d3d1b82198: chore(deps): bump `minimatch` from 5.0.0 to 5.0.1 +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- 44cc7c3b95: Added a new ESLint configuration setup for packages, which utilizes package roles to generate the correct configuration. The new configuration is available at `@backstage/cli/config/eslint-factory`. + + Introduced a new `backstage-cli migrate package-lint-configs` command, which migrates old lint configurations to use `@backstage/cli/config/eslint-factory`. + +- b1aacbf96a: Applied the fix from version `0.15.1` of this package, which was part of the `v0.70.1` release of Backstage. +- d2ecde959b: Package roles are now marked as stable and migration is encouraged. Please check out the [migration guide](https://backstage.io/docs/tutorials/package-role-migration). + + The new `package`, `repo`, and `migrate` command categories are now marked as stable. + + Marked all commands that are being replaced by the new `package` and `repo` commands as deprecated. + + The package templates used by the `create` command have all been updated to use package roles. + +- f06da37290: The backend development setup now ignores the `"browser"` and `"module"` entry points in `package.json`, and instead always uses `"main"`. +- 6a1fe077ad: Changed the logic for how modules are marked as external in the Rollup build of packages. Rather than only marking dependencies and build-in Node.js modules as external, all non-relative imports are now considered external. +- dc6002a7b9: The `--since` flag of repo commands now silently falls back to using the provided `ref` directly if no merge base is available. +- Updated dependencies + - @backstage/config-loader@0.9.7-next.0 + ## 0.15.1 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index dc7070eafd..39fd0c56fc 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/cli", "description": "CLI for developing Backstage plugins and apps", - "version": "0.15.0", + "version": "0.15.2-next.0", "private": false, "publishConfig": { "access": "public" @@ -33,7 +33,7 @@ "dependencies": { "@backstage/cli-common": "^0.1.8", "@backstage/config": "^0.1.15", - "@backstage/config-loader": "^0.9.6", + "@backstage/config-loader": "^0.9.7-next.0", "@backstage/errors": "^0.2.2", "@backstage/release-manifests": "^0.0.2", "@backstage/types": "^0.1.3", @@ -121,12 +121,12 @@ "zod": "^3.11.6" }, "devDependencies": { - "@backstage/backend-common": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", "@backstage/config": "^0.1.15", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@backstage/theme": "^0.2.15", "@types/diff": "^5.0.0", @@ -137,7 +137,7 @@ "@types/minimatch": "^3.0.5", "@types/mock-fs": "^4.13.0", "@types/node": "^14.14.32", - "@types/npm-packlist": "^1.1.2", + "@types/npm-packlist": "^3.0.0", "@types/recursive-readdir": "^2.2.0", "@types/rollup-plugin-peer-deps-external": "^2.2.0", "@types/rollup-plugin-postcss": "^3.1.4", diff --git a/packages/codemods/CHANGELOG.md b/packages/codemods/CHANGELOG.md index 603fa1075e..5bf6535a62 100644 --- a/packages/codemods/CHANGELOG.md +++ b/packages/codemods/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/codemods +## 0.1.35-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + ## 0.1.35 ### Patch Changes diff --git a/packages/codemods/package.json b/packages/codemods/package.json index c4d2eedb4d..1c863db6cf 100644 --- a/packages/codemods/package.json +++ b/packages/codemods/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/codemods", "description": "A collection of codemods for Backstage projects", - "version": "0.1.34", + "version": "0.1.35-next.0", "private": false, "publishConfig": { "access": "public", @@ -36,7 +36,7 @@ "dependencies": { "@backstage/cli-common": "^0.1.8", "@backstage/core-app-api": "*", - "@backstage/core-components": "*", + "@backstage/core-components": "0.9.1-next.0", "@backstage/core-plugin-api": "*", "chalk": "^4.0.0", "jscodeshift": "^0.13.0", diff --git a/packages/config-loader/CHANGELOG.md b/packages/config-loader/CHANGELOG.md index d9bd7be8ba..362edc78cf 100644 --- a/packages/config-loader/CHANGELOG.md +++ b/packages/config-loader/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/config-loader +## 0.9.7-next.0 + +### Patch Changes + +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 + ## 0.9.6 ### Patch Changes diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 03c0a6d0f2..71a0e4e650 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/config-loader", "description": "Config loading functionality used by Backstage backend, and CLI", - "version": "0.9.6", + "version": "0.9.7-next.0", "private": false, "publishConfig": { "access": "public", diff --git a/packages/core-app-api/package.json b/packages/core-app-api/package.json index 57ee14e1d0..f0776fcb85 100644 --- a/packages/core-app-api/package.json +++ b/packages/core-app-api/package.json @@ -49,7 +49,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-components/CHANGELOG.md b/packages/core-components/CHANGELOG.md index 65407daef6..64a3d0614d 100644 --- a/packages/core-components/CHANGELOG.md +++ b/packages/core-components/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/core-components +## 0.9.1-next.0 + +### Patch Changes + +- 23568dd328: chore(deps): bump `@react-hookz/web` from 12.3.0 to 13.0.0 +- 95667624c1: Add names to sidebar sub menu styles for customization + ## 0.9.0 ### Minor Changes diff --git a/packages/core-components/package.json b/packages/core-components/package.json index 4e896fd178..d71bcff3cf 100644 --- a/packages/core-components/package.json +++ b/packages/core-components/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/core-components", "description": "Core components used by Backstage plugins and apps", - "version": "0.9.0", + "version": "0.9.1-next.0", "private": false, "publishConfig": { "access": "public", @@ -79,7 +79,7 @@ }, "devDependencies": { "@backstage/core-app-api": "^0.6.0", - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/core-plugin-api/package.json b/packages/core-plugin-api/package.json index 50a87056f6..dd7056c8de 100644 --- a/packages/core-plugin-api/package.json +++ b/packages/core-plugin-api/package.json @@ -46,7 +46,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", diff --git a/packages/create-app/CHANGELOG.md b/packages/create-app/CHANGELOG.md index cd4fde3851..c9b83a1157 100644 --- a/packages/create-app/CHANGELOG.md +++ b/packages/create-app/CHANGELOG.md @@ -1,5 +1,73 @@ # @backstage/create-app +## 0.4.23-next.0 + +### Patch Changes + +- f9c7bdd899: Builtin support for cookiecutter based templates has been removed from `@backstage/plugin-scaffolder-backend`. Due to this, the `containerRunner` argument to its `createRouter` has also been removed. + + If you do not use cookiecutter templates and are fine with removing support from it in your own installation, update your `packages/backend/src/plugins/scaffolder.ts` file as follows: + + ```diff + -import { DockerContainerRunner } from '@backstage/backend-common'; + import { CatalogClient } from '@backstage/catalog-client'; + import { createRouter } from '@backstage/plugin-scaffolder-backend'; + -import Docker from 'dockerode'; + import { Router } from 'express'; + import type { PluginEnvironment } from '../types'; + + export default async function createPlugin({ + reader, + discovery, + }: PluginEnvironment): Promise { + - const dockerClient = new Docker(); + - const containerRunner = new DockerContainerRunner({ dockerClient }); + - + const catalogClient = new CatalogClient({ discoveryApi: discovery }); + - + return await createRouter({ + - containerRunner, + logger, + config, + // ... + ``` + + If you want to retain cookiecutter support, please use the `@backstage/plugin-scaffolder-backend-module-cookiecutter` package explicitly (see [its README](https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend-module-cookiecutter) for installation instructions). + +- 8a57b6595b: Removed the `cookiecutter-golang` template from the default `create-app` install as we no longer provide `cookiecutter` action out of the box. + + You can remove the template by removing the following lines from your `app-config.yaml` under `catalog.locations`: + + ```diff + - - type: url + - target: https://github.com/spotify/cookiecutter-golang/blob/master/template.yaml + - rules: + - - allow: [Template] + ``` + +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- 1201383b60: Updated the template to write the Backstage release version to `backstage.json`, rather than the version of `@backstage/create-app`. This change is applied automatically when running `backstage-cli versions:bump` in the latest version of the Backstage CLI. +- c543fe3ff2: Postgres-based search is now installed when PG is chosen as the desired database for Backstage. + + There is no need to make this change in an existing Backstage backend. See [supported search engines](https://backstage.io/docs/features/search/search-engines) for details about production-ready search engines. + +- 55150919ed: - **BREAKING**: Support for `backstage.io/v1beta2` Software Templates has been removed. Please migrate your legacy templates to the new `scaffolder.backstage.io/v1beta3` `apiVersion` by following the [migration guide](https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3) +- bde30664c4: Updated template to use package roles. To apply this change to an existing app, check out the [migration guide](https://backstage.io/docs/tutorials/package-role-migration). + + Specifically the following scripts in the root `package.json` have also been updated: + + ```diff + - "build": "lerna run build", + + "build": "backstage-cli repo build --all", + + ... + + - "lint": "lerna run lint --since origin/master --", + - "lint:all": "lerna run lint --", + + "lint": "backstage-cli repo lint --since origin/master", + + "lint:all": "backstage-cli repo lint", + ``` + ## 0.4.22 ### Patch Changes diff --git a/packages/create-app/package.json b/packages/create-app/package.json index 457e7efce1..838d54b0f4 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.22", + "version": "0.4.23-next.0", "private": false, "publishConfig": { "access": "public" diff --git a/packages/dev-utils/CHANGELOG.md b/packages/dev-utils/CHANGELOG.md index 72717e3891..32fbf7e9cb 100644 --- a/packages/dev-utils/CHANGELOG.md +++ b/packages/dev-utils/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/dev-utils +## 0.2.25-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/app-defaults@0.2.1-next.0 + - @backstage/integration-react@0.1.25-next.0 + ## 0.2.24 ### Patch Changes diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 60876d47e0..f9c3bbc166 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.24", + "version": "0.2.25-next.0", "private": false, "publishConfig": { "access": "public", @@ -33,13 +33,13 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/app-defaults": "^0.2.0", + "@backstage/app-defaults": "^0.2.1-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/integration-react": "^0.1.24", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/integration-react": "^0.1.25-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/test-utils": "^0.3.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", @@ -59,7 +59,7 @@ "react-dom": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/jest": "^26.0.7", "@types/node": "^14.14.32" }, diff --git a/packages/errors/package.json b/packages/errors/package.json index e612ade21b..de20e7b5f2 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -38,7 +38,7 @@ "serialize-error": "^8.0.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/jest": "^26.0.7" }, "files": [ diff --git a/packages/integration-react/CHANGELOG.md b/packages/integration-react/CHANGELOG.md index 4ea916b8bd..082b8ba701 100644 --- a/packages/integration-react/CHANGELOG.md +++ b/packages/integration-react/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/integration-react +## 0.1.25-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + ## 0.1.24 ### Patch Changes diff --git a/packages/integration-react/package.json b/packages/integration-react/package.json index c929b2799d..16863b2ef2 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/integration-react", "description": "Frontend package for managing integrations towards external systems", - "version": "0.1.24", + "version": "0.1.25-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -25,7 +25,7 @@ }, "dependencies": { "@backstage/config": "^0.1.15", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/integration": "^0.8.0", "@backstage/theme": "^0.2.15", @@ -38,8 +38,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/integration/package.json b/packages/integration/package.json index de232307ad..880cb8c1cf 100644 --- a/packages/integration/package.json +++ b/packages/integration/package.json @@ -42,8 +42,8 @@ "lodash": "^4.17.21" }, "devDependencies": { - "@backstage/cli": "^0.15.0", - "@backstage/config-loader": "^0.9.6", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/config-loader": "^0.9.7-next.0", "@backstage/test-utils": "^0.3.0", "@types/jest": "^26.0.7", "@types/luxon": "^2.0.4", diff --git a/packages/search-common/CHANGELOG.md b/packages/search-common/CHANGELOG.md index 112d3d583a..3b1b082083 100644 --- a/packages/search-common/CHANGELOG.md +++ b/packages/search-common/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/search-common +## 0.3.1-next.0 + +### Patch Changes + +- d52155466a: **DEPRECATION** + + The `@backstage/search-common` package is being renamed `@backstage/plugin-search-common`. We may continue to publish changes to `@backstage/search-common` for a time, but will stop doing so in the near future. If you depend on this package, you should update your dependencies to point at the renamed package. + +- Updated dependencies + - @backstage/plugin-search-common@0.3.1-next.0 + ## 0.3.0 ### Minor Changes diff --git a/packages/search-common/package.json b/packages/search-common/package.json index e85ed2dd83..d84bda9edc 100644 --- a/packages/search-common/package.json +++ b/packages/search-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/search-common", "description": "Common functionalities for Search, to be shared between various search-enabled plugins", - "version": "0.3.0", + "version": "0.3.1-next.0", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -39,7 +39,7 @@ "url": "https://github.com/backstage/backstage/issues" }, "dependencies": { - "@backstage/plugin-search-common": "^0.3.0" + "@backstage/plugin-search-common": "^0.3.1-next.0" }, "devDependencies": {}, "jest": { diff --git a/packages/techdocs-cli-embedded-app/CHANGELOG.md b/packages/techdocs-cli-embedded-app/CHANGELOG.md index 50b2c11542..51f0bc8b00 100644 --- a/packages/techdocs-cli-embedded-app/CHANGELOG.md +++ b/packages/techdocs-cli-embedded-app/CHANGELOG.md @@ -1,5 +1,18 @@ # techdocs-cli-embedded-app +## 0.2.67-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/cli@0.15.2-next.0 + - @backstage/plugin-catalog@0.10.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/plugin-techdocs@0.15.1-next.0 + - @backstage/app-defaults@0.2.1-next.0 + - @backstage/integration-react@0.1.25-next.0 + ## 0.2.66 ### Patch Changes diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index 81ad2a1bc4..700036dd3c 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -1,22 +1,22 @@ { "name": "techdocs-cli-embedded-app", - "version": "0.2.66", + "version": "0.2.67-next.0", "private": true, "backstage": { "role": "frontend" }, "bundled": true, "dependencies": { - "@backstage/app-defaults": "^0.2.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/cli": "^0.15.0", + "@backstage/app-defaults": "^0.2.1-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/config": "^0.1.15", "@backstage/core-app-api": "^0.6.0", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/integration-react": "^0.1.24", - "@backstage/plugin-catalog": "^0.9.1", - "@backstage/plugin-techdocs": "^0.15.0", + "@backstage/integration-react": "^0.1.25-next.0", + "@backstage/plugin-catalog": "^0.10.0-next.0", + "@backstage/plugin-techdocs": "^0.15.1-next.0", "@backstage/test-utils": "^0.3.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.11.0", @@ -29,7 +29,7 @@ "react-use": "^17.2.4" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/user-event": "^13.1.8", diff --git a/packages/techdocs-cli/CHANGELOG.md b/packages/techdocs-cli/CHANGELOG.md index aa360b1781..e668940718 100644 --- a/packages/techdocs-cli/CHANGELOG.md +++ b/packages/techdocs-cli/CHANGELOG.md @@ -1,5 +1,16 @@ # @techdocs/cli +## 0.8.17-next.0 + +### Patch Changes + +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- 91bf1e6c1a: Use `@backstage/plugin-techdocs-node` package instead of `@backstage/techdocs-common`. +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/plugin-techdocs-node@0.11.12-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.8.16 ### Patch Changes diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index f080cbee78..758cab9856 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -1,7 +1,7 @@ { "name": "@techdocs/cli", "description": "Utility CLI for managing TechDocs sites in Backstage.", - "version": "0.8.16", + "version": "0.8.17-next.0", "private": false, "publishConfig": { "access": "public" @@ -37,7 +37,7 @@ "techdocs-cli": "bin/techdocs-cli" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/commander": "^2.12.2", "@types/fs-extra": "^9.0.6", "@types/http-proxy": "^1.17.4", @@ -62,11 +62,11 @@ "ext": "ts" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/cli-common": "^0.1.8", "@backstage/config": "^0.1.15", - "@backstage/plugin-techdocs-node": "^0.11.11", + "@backstage/plugin-techdocs-node": "^0.11.12-next.0", "@types/dockerode": "^3.3.0", "commander": "^6.1.0", "dockerode": "^3.3.1", diff --git a/packages/techdocs-common/CHANGELOG.md b/packages/techdocs-common/CHANGELOG.md index f41c944a89..87c6ea0da9 100644 --- a/packages/techdocs-common/CHANGELOG.md +++ b/packages/techdocs-common/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/techdocs-common +## 0.11.12-next.0 + +### Patch Changes + +- cea6f10b97: **DEPRECATION** + + The `@backstage/techdocs-common` package is being renamed `@backstage/plugin-techdocs-node`. We may continue to publish changes to `@backstage/techdocs-common` for a time, but will stop doing so in the near future. If you depend on this package, you should update your dependencies to point at the renamed package. + +- Updated dependencies + - @backstage/plugin-techdocs-node@0.11.12-next.0 + ## 0.11.11 ### Patch Changes diff --git a/packages/techdocs-common/package.json b/packages/techdocs-common/package.json index 1d37974f29..6d897a2f08 100644 --- a/packages/techdocs-common/package.json +++ b/packages/techdocs-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/techdocs-common", "description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", - "version": "0.11.11", + "version": "0.11.12-next.0", "main": "src/index.ts", "types": "src/index.ts", "private": false, @@ -40,7 +40,7 @@ "url": "https://github.com/backstage/backstage/issues" }, "dependencies": { - "@backstage/plugin-techdocs-node": "^0.11.11" + "@backstage/plugin-techdocs-node": "^0.11.12-next.0" }, "devDependencies": {}, "jest": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index baf4e0dd37..2f0aa0e988 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -55,7 +55,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/jest": "^26.0.7", "@types/node": "^14.14.32", "msw": "^0.35.0" diff --git a/packages/theme/package.json b/packages/theme/package.json index db54e495e6..cab489444a 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -36,7 +36,7 @@ "@material-ui/core": "^4.12.2" }, "devDependencies": { - "@backstage/cli": "^0.15.0" + "@backstage/cli": "^0.15.2-next.0" }, "files": [ "dist" diff --git a/packages/types/package.json b/packages/types/package.json index c71fbd9d47..e71e32a6c2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -34,7 +34,7 @@ }, "dependencies": {}, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/zen-observable": "^0.8.0", "zen-observable": "^0.8.15" }, diff --git a/packages/version-bridge/package.json b/packages/version-bridge/package.json index 377f08621f..463e7841ed 100644 --- a/packages/version-bridge/package.json +++ b/packages/version-bridge/package.json @@ -37,7 +37,7 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", "@testing-library/react-hooks": "^7.0.2" diff --git a/plugins/airbrake-backend/CHANGELOG.md b/plugins/airbrake-backend/CHANGELOG.md index 8726260060..9826c90e72 100644 --- a/plugins/airbrake-backend/CHANGELOG.md +++ b/plugins/airbrake-backend/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-airbrake-backend +## 0.2.2-next.0 + +### Patch Changes + +- 4f79204c47: Added `backstage.role` to `package.json` +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + ## 0.2.1 ### Patch Changes diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index c086a822ae..c8c87dd117 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-airbrake-backend", - "version": "0.2.1", + "version": "0.2.2-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -22,7 +22,7 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@types/express": "*", "express": "^4.17.1", @@ -33,7 +33,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/http-proxy-middleware": "^0.19.3", "@types/supertest": "^2.0.8", "supertest": "^6.1.6", diff --git a/plugins/airbrake/CHANGELOG.md b/plugins/airbrake/CHANGELOG.md index 0e458b9522..374cdc7c7c 100644 --- a/plugins/airbrake/CHANGELOG.md +++ b/plugins/airbrake/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-airbrake +## 0.3.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/dev-utils@0.2.25-next.0 + ## 0.3.1 ### Patch Changes diff --git a/plugins/airbrake/package.json b/plugins/airbrake/package.json index 5ccd9033d5..52e1244230 100644 --- a/plugins/airbrake/package.json +++ b/plugins/airbrake/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-airbrake", - "version": "0.3.1", + "version": "0.3.2-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,11 +23,11 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/dev-utils": "^0.2.24", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/dev-utils": "^0.2.25-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/test-utils": "^0.3.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/app-defaults": "^0.2.0", - "@backstage/cli": "^0.15.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/app-defaults": "^0.2.1-next.0", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.test.tsx b/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.test.tsx index ee14a17f9a..a7243f5f0f 100644 --- a/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.test.tsx +++ b/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.test.tsx @@ -18,23 +18,21 @@ import React from 'react'; import { EntityAirbrakeWidget } from './EntityAirbrakeWidget'; import exampleData from '../../api/mock/airbrakeGroupsApiMock.json'; import { - MockErrorApi, renderInTestApp, setupRequestMockHandlers, TestApiProvider, } from '@backstage/test-utils'; -import { createEntity } from '../../api'; import { airbrakeApiRef, + createEntity, localDiscoveryApi, MockAirbrakeApi, ProductionAirbrakeApi, } from '../../api'; -import { errorApiRef } from '@backstage/core-plugin-api'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; -describe('EntityAirbrakeContent', () => { +describe('EntityAirbrakeWidget', () => { const worker = setupServer(); setupRequestMockHandlers(worker); @@ -47,20 +45,25 @@ describe('EntityAirbrakeContent', () => { expect(exampleData.groups.length).toBeGreaterThan(0); for (const group of exampleData.groups) { expect( - await widget.getByText(group.errors[0].message), + await widget.findByText(group.errors[0].message), ).toBeInTheDocument(); } }); - it('states that the annotation is missing if no project ID annotation is provided', async () => { + it('states that the annotation is missing if no project ID annotation is provided but does not error', async () => { const widget = await renderInTestApp( - + , ); await expect( widget.findByText('Missing Annotation'), ).resolves.toBeInTheDocument(); + expect( + widget.queryByText(/.*Failed fetching Airbrake groups.*/), + ).not.toBeInTheDocument(); }); it('states that an error occurred if the API call fails', async () => { @@ -72,14 +75,10 @@ describe('EntityAirbrakeContent', () => { }, ), ); - const mockErrorApi = new MockErrorApi({ collect: true }); const widget = await renderInTestApp( , @@ -88,9 +87,10 @@ describe('EntityAirbrakeContent', () => { await expect( widget.findByText(/.*there was an issue communicating with Airbrake.*/), ).resolves.toBeInTheDocument(); - expect(mockErrorApi.getErrors().length).toBe(1); - expect(mockErrorApi.getErrors()[0].error.message).toStrictEqual( - 'Failed fetching Airbrake groups', - ); + expect( + widget.getByRole('heading', { + name: /.*Failed fetching Airbrake groups.*/, + }), + ).toBeInTheDocument(); }); }); diff --git a/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.tsx b/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.tsx index b11116aeef..6c2e4b8686 100644 --- a/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.tsx +++ b/plugins/airbrake/src/components/EntityAirbrakeWidget/EntityAirbrakeWidget.tsx @@ -14,10 +14,11 @@ * limitations under the License. */ import { Entity } from '@backstage/catalog-model'; -import React, { useEffect } from 'react'; +import React from 'react'; import { Grid, Typography } from '@material-ui/core'; import { EmptyState, + ErrorPanel, InfoCard, MissingAnnotationEmptyState, Progress, @@ -25,7 +26,7 @@ import { import hash from 'object-hash'; import { makeStyles } from '@material-ui/core/styles'; import { BackstageTheme } from '@backstage/theme'; -import { ErrorApi, errorApiRef, useApi } from '@backstage/core-plugin-api'; +import { useApi } from '@backstage/core-plugin-api'; import { airbrakeApiRef } from '../../api'; import useAsync from 'react-use/lib/useAsync'; import { AIRBRAKE_PROJECT_ID_ANNOTATION, useProjectId } from '../useProjectId'; @@ -40,55 +41,50 @@ export const EntityAirbrakeWidget = ({ entity }: { entity: Entity }) => { const classes = useStyles(); const projectId = useProjectId(entity); - const errorApi = useApi(errorApiRef); const airbrakeApi = useApi(airbrakeApiRef); - const { loading, value, error } = useAsync( - () => airbrakeApi.fetchGroups(projectId), - [airbrakeApi, projectId], - ); - - useEffect(() => { - if (error) { - errorApi.post(error); + const { loading, value, error } = useAsync(() => { + if (!projectId) { + return Promise.resolve(undefined); } - }, [error, errorApi]); - if (loading || !projectId || error) { + return airbrakeApi.fetchGroups(projectId); + }, [airbrakeApi, projectId]); + + if (!projectId) { return ( - - {loading && } - - {!loading && !projectId && ( - - )} - - {!loading && error && ( - - )} - + + ); + } else if (loading) { + return ; + } else if (value) { + return ( + + {value.groups?.map(group => ( + + {group.errors?.map(groupError => ( + + + {groupError.message} + + + ))} + + ))} + ); } return ( - - {value?.groups?.map(group => ( - - {group.errors?.map(groupError => ( - - - {groupError.message} - - - ))} - - ))} - + <> + {error && } + + ); }; diff --git a/plugins/allure/CHANGELOG.md b/plugins/allure/CHANGELOG.md index 70050127a7..6520fef7f4 100644 --- a/plugins/allure/CHANGELOG.md +++ b/plugins/allure/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-allure +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.1.17 ### Patch Changes diff --git a/plugins/allure/package.json b/plugins/allure/package.json index f5f9f81025..ade58d7180 100644 --- a/plugins/allure/package.json +++ b/plugins/allure/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-allure", "description": "A Backstage plugin that integrates with Allure", - "version": "0.1.17", + "version": "0.1.18-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -25,10 +25,10 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -40,9 +40,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/analytics-module-ga/CHANGELOG.md b/plugins/analytics-module-ga/CHANGELOG.md index aed1945ca5..fdf4f1704a 100644 --- a/plugins/analytics-module-ga/CHANGELOG.md +++ b/plugins/analytics-module-ga/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-analytics-module-ga +## 0.1.13-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + ## 0.1.12 ### Patch Changes diff --git a/plugins/analytics-module-ga/package.json b/plugins/analytics-module-ga/package.json index 07dbcc91ba..f3d684dce3 100644 --- a/plugins/analytics-module-ga/package.json +++ b/plugins/analytics-module-ga/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-analytics-module-ga", - "version": "0.1.12", + "version": "0.1.13-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -25,7 +25,7 @@ }, "dependencies": { "@backstage/config": "^0.1.15", - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", @@ -38,9 +38,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/apache-airflow/CHANGELOG.md b/plugins/apache-airflow/CHANGELOG.md index 968ecefc71..f1e24ae6d5 100644 --- a/plugins/apache-airflow/CHANGELOG.md +++ b/plugins/apache-airflow/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-apache-airflow +## 0.1.10-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + ## 0.1.9 ### Patch Changes diff --git a/plugins/apache-airflow/package.json b/plugins/apache-airflow/package.json index 4de1e87d28..5e36dcca52 100644 --- a/plugins/apache-airflow/package.json +++ b/plugins/apache-airflow/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-apache-airflow", - "version": "0.1.9", + "version": "0.1.10-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,7 +23,7 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/core-components": "^0.9.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -36,9 +36,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/api-docs/CHANGELOG.md b/plugins/api-docs/CHANGELOG.md index bca082d38e..f145c80222 100644 --- a/plugins/api-docs/CHANGELOG.md +++ b/plugins/api-docs/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-api-docs +## 0.8.2-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog@0.10.0-next.0 + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.8.1 ### Patch Changes diff --git a/plugins/api-docs/package.json b/plugins/api-docs/package.json index b21b5aff9f..0edaa58731 100644 --- a/plugins/api-docs/package.json +++ b/plugins/api-docs/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-api-docs", "description": "A Backstage plugin that helps represent API entities in the frontend", - "version": "0.8.1", + "version": "0.8.2-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,11 +34,11 @@ }, "dependencies": { "@asyncapi/react-component": "1.0.0-next.33", - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/plugin-catalog": "^0.9.1", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog": "^0.10.0-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -56,9 +56,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/app-backend/CHANGELOG.md b/plugins/app-backend/CHANGELOG.md index 0763fd7995..c93408d321 100644 --- a/plugins/app-backend/CHANGELOG.md +++ b/plugins/app-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-app-backend +## 0.3.29-next.0 + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/config-loader@0.9.7-next.0 + ## 0.3.28 ### Patch Changes diff --git a/plugins/app-backend/package.json b/plugins/app-backend/package.json index 43d9cd06b5..3ff2b14a19 100644 --- a/plugins/app-backend/package.json +++ b/plugins/app-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-app-backend", "description": "A Backstage backend plugin that serves the Backstage frontend app", - "version": "0.3.28", + "version": "0.3.29-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,8 +33,8 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/config-loader": "^0.9.6", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/config-loader": "^0.9.7-next.0", "@backstage/config": "^0.1.15", "@backstage/types": "^0.1.3", "@types/express": "^4.17.6", @@ -50,8 +50,8 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/types": "^0.1.3", "@types/supertest": "^2.0.8", "mock-fs": "^5.1.0", diff --git a/plugins/auth-backend/CHANGELOG.md b/plugins/auth-backend/CHANGELOG.md index f9d05aecc1..6ee4b7d146 100644 --- a/plugins/auth-backend/CHANGELOG.md +++ b/plugins/auth-backend/CHANGELOG.md @@ -1,5 +1,19 @@ # @backstage/plugin-auth-backend +## 0.12.1-next.0 + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- bf95bb806c: Remove usages of now-removed `CatalogApi.getEntityByName` +- 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils` +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + - @backstage/plugin-auth-node@0.1.5-next.0 + ## 0.12.0 ### Minor Changes diff --git a/plugins/auth-backend/package.json b/plugins/auth-backend/package.json index dda5715b4e..5a1df93c93 100644 --- a/plugins/auth-backend/package.json +++ b/plugins/auth-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-auth-backend", "description": "A Backstage backend plugin that handles authentication", - "version": "0.12.0", + "version": "0.12.1-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,10 +33,10 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/plugin-auth-node": "^0.1.4", - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/plugin-auth-node": "^0.1.5-next.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@backstage/types": "^0.1.3", @@ -76,8 +76,8 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@types/body-parser": "^1.19.0", "@types/cookie-parser": "^1.4.2", "@types/express-session": "^1.17.2", diff --git a/plugins/auth-node/CHANGELOG.md b/plugins/auth-node/CHANGELOG.md index 5cf6aebac9..dbb8316cf2 100644 --- a/plugins/auth-node/CHANGELOG.md +++ b/plugins/auth-node/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-auth-node +## 0.1.5-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.1.4 ### Patch Changes diff --git a/plugins/auth-node/package.json b/plugins/auth-node/package.json index 1c80b6ca8a..a302feca9e 100644 --- a/plugins/auth-node/package.json +++ b/plugins/auth-node/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-auth-node", - "version": "0.1.4", + "version": "0.1.5-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,8 +23,8 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "jose": "^1.27.1", @@ -32,7 +32,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "msw": "^0.35.0", "uuid": "^8.0.0" }, diff --git a/plugins/azure-devops-backend/CHANGELOG.md b/plugins/azure-devops-backend/CHANGELOG.md index 8d473a84c7..c841ec0e4d 100644 --- a/plugins/azure-devops-backend/CHANGELOG.md +++ b/plugins/azure-devops-backend/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-azure-devops-backend +## 0.3.8-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + ## 0.3.7 ### Patch Changes diff --git a/plugins/azure-devops-backend/package.json b/plugins/azure-devops-backend/package.json index 73a7dd57e2..6a94a2b4d3 100644 --- a/plugins/azure-devops-backend/package.json +++ b/plugins/azure-devops-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-azure-devops-backend", - "version": "0.3.7", + "version": "0.3.8-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,7 +23,7 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/plugin-azure-devops-common": "^0.2.2", "@types/express": "^4.17.6", @@ -35,7 +35,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/supertest": "^2.0.8", "supertest": "^6.1.6", "msw": "^0.35.0" diff --git a/plugins/azure-devops-common/package.json b/plugins/azure-devops-common/package.json index b3755f40e6..24936f883a 100644 --- a/plugins/azure-devops-common/package.json +++ b/plugins/azure-devops-common/package.json @@ -32,7 +32,7 @@ "clean": "backstage-cli package clean" }, "devDependencies": { - "@backstage/cli": "^0.15.0" + "@backstage/cli": "^0.15.2-next.0" }, "files": [ "dist" diff --git a/plugins/azure-devops/CHANGELOG.md b/plugins/azure-devops/CHANGELOG.md index 1d120382f1..339539a7ea 100644 --- a/plugins/azure-devops/CHANGELOG.md +++ b/plugins/azure-devops/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-azure-devops +## 0.1.18-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.1.17 ### Patch Changes diff --git a/plugins/azure-devops/package.json b/plugins/azure-devops/package.json index ae90a2c42d..fcfc97ce9d 100644 --- a/plugins/azure-devops/package.json +++ b/plugins/azure-devops/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-azure-devops", - "version": "0.1.17", + "version": "0.1.18-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,12 +30,12 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", "@backstage/plugin-azure-devops-common": "^0.2.2", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -49,9 +49,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/badges-backend/CHANGELOG.md b/plugins/badges-backend/CHANGELOG.md index 46c51d8833..a26b98d2e6 100644 --- a/plugins/badges-backend/CHANGELOG.md +++ b/plugins/badges-backend/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-badges-backend +## 0.1.23-next.0 + +### Patch Changes + +- bf95bb806c: Remove usages of now-removed `CatalogApi.getEntityByName` +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + ## 0.1.22 ### Patch Changes diff --git a/plugins/badges-backend/package.json b/plugins/badges-backend/package.json index 384c22fb5a..d5e3fe3dcf 100644 --- a/plugins/badges-backend/package.json +++ b/plugins/badges-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-badges-backend", "description": "A Backstage backend plugin that generates README badges for your entities", - "version": "0.1.22", + "version": "0.1.23-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,9 +34,9 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@types/express": "^4.17.6", @@ -48,7 +48,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/supertest": "^2.0.8", "supertest": "^6.1.3" }, diff --git a/plugins/badges/CHANGELOG.md b/plugins/badges/CHANGELOG.md index 0e257e78ac..df3b511cb7 100644 --- a/plugins/badges/CHANGELOG.md +++ b/plugins/badges/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-badges +## 0.2.26-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.2.25 ### Patch Changes diff --git a/plugins/badges/package.json b/plugins/badges/package.json index e0d756d990..c058989e94 100644 --- a/plugins/badges/package.json +++ b/plugins/badges/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-badges", "description": "A Backstage plugin that generates README badges for your entities", - "version": "0.2.25", + "version": "0.2.26-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -30,11 +30,11 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -46,9 +46,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/bazaar-backend/CHANGELOG.md b/plugins/bazaar-backend/CHANGELOG.md index 10de02dfa9..e161516d5f 100644 --- a/plugins/bazaar-backend/CHANGELOG.md +++ b/plugins/bazaar-backend/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-bazaar-backend +## 0.1.13-next.0 + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/backend-test-utils@0.1.21-next.0 + ## 0.1.12 ### Patch Changes diff --git a/plugins/bazaar-backend/package.json b/plugins/bazaar-backend/package.json index c9b1af2139..6224e6d869 100644 --- a/plugins/bazaar-backend/package.json +++ b/plugins/bazaar-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-bazaar-backend", - "version": "0.1.12", + "version": "0.1.13-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -23,8 +23,8 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/backend-test-utils": "^0.1.20", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", "@backstage/config": "^0.1.15", "@types/express": "^4.17.6", "express": "^4.17.1", @@ -34,7 +34,7 @@ "yn": "^4.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0" + "@backstage/cli": "^0.15.2-next.0" }, "files": [ "dist", diff --git a/plugins/bazaar/CHANGELOG.md b/plugins/bazaar/CHANGELOG.md index 779baa5650..1ad604fd9d 100644 --- a/plugins/bazaar/CHANGELOG.md +++ b/plugins/bazaar/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-bazaar +## 0.1.17-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/cli@0.15.2-next.0 + - @backstage/plugin-catalog@0.10.0-next.0 + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + ## 0.1.16 ### Patch Changes diff --git a/plugins/bazaar/package.json b/plugins/bazaar/package.json index 961ce38460..6e44067bd7 100644 --- a/plugins/bazaar/package.json +++ b/plugins/bazaar/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-bazaar", - "version": "0.1.16", + "version": "0.1.17-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -24,13 +24,13 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/cli": "^0.15.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/plugin-catalog": "^0.9.1", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog": "^0.10.0-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@date-io/luxon": "1.x", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -47,8 +47,8 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/dev-utils": "^0.2.25-next.0", "@testing-library/jest-dom": "^5.10.1", "cross-fetch": "^3.1.5" }, diff --git a/plugins/bitrise/CHANGELOG.md b/plugins/bitrise/CHANGELOG.md index 551f04310a..26ce2d20b1 100644 --- a/plugins/bitrise/CHANGELOG.md +++ b/plugins/bitrise/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-bitrise +## 0.1.29-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.1.28 ### Patch Changes diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json index dc5c71d5d7..16b58ba129 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-bitrise", "description": "A Backstage plugin that integrates towards Bitrise", - "version": "0.1.28", + "version": "0.1.29-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -24,10 +24,10 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -43,9 +43,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-backend-module-aws/CHANGELOG.md b/plugins/catalog-backend-module-aws/CHANGELOG.md index 9ef634a3d1..8e15c16546 100644 --- a/plugins/catalog-backend-module-aws/CHANGELOG.md +++ b/plugins/catalog-backend-module-aws/CHANGELOG.md @@ -1,5 +1,15 @@ # @backstage/plugin-catalog-backend-module-aws +## 0.1.2-next.0 + +### Patch Changes + +- f115a7f8fd: Added `AwsS3DiscoveryProcessor`, which was moved here from `@backstage/plugin-catalog-backend` where it previously resided. +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.1.1 ### Patch Changes diff --git a/plugins/catalog-backend-module-aws/package.json b/plugins/catalog-backend-module-aws/package.json index 3f8149a6f7..72324483d9 100644 --- a/plugins/catalog-backend-module-aws/package.json +++ b/plugins/catalog-backend-module-aws/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend-module-aws", "description": "A Backstage catalog backend module that helps integrate towards AWS", - "version": "0.1.1", + "version": "0.1.2-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,11 +33,11 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", - "@backstage/plugin-catalog-backend": "^0.23.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", "@backstage/types": "^0.1.3", "aws-sdk": "^2.840.0", "lodash": "^4.17.21", @@ -45,7 +45,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/lodash": "^4.14.151", "aws-sdk-mock": "^5.2.1", "yaml": "^1.9.2" diff --git a/plugins/catalog-backend-module-azure/.eslintrc.js b/plugins/catalog-backend-module-azure/.eslintrc.js index 16a033dbc6..e2a53a6ad2 100644 --- a/plugins/catalog-backend-module-azure/.eslintrc.js +++ b/plugins/catalog-backend-module-azure/.eslintrc.js @@ -1,3 +1 @@ -module.exports = { - extends: [require.resolve('@backstage/cli/config/eslint.backend')], -}; +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-azure/CHANGELOG.md b/plugins/catalog-backend-module-azure/CHANGELOG.md new file mode 100644 index 0000000000..f6f876ca9f --- /dev/null +++ b/plugins/catalog-backend-module-azure/CHANGELOG.md @@ -0,0 +1,14 @@ +# @backstage/plugin-catalog-backend-module-azure + +## 0.1.0-next.0 + +### Minor Changes + +- 66ba5d9023: Added package, moving out azure specific functionality from the catalog-backend + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 diff --git a/plugins/catalog-backend-module-azure/package.json b/plugins/catalog-backend-module-azure/package.json index a6d9bfbcc9..91e421633d 100644 --- a/plugins/catalog-backend-module-azure/package.json +++ b/plugins/catalog-backend-module-azure/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend-module-azure", "description": "A Backstage catalog backend module that helps integrate towards Azure", - "version": "0.0.0", + "version": "0.1.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,12 +33,12 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", - "@backstage/plugin-catalog-backend": "^0.23.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", "@backstage/types": "^0.1.3", "lodash": "^4.17.21", "msw": "^0.35.0", @@ -46,8 +46,8 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@types/lodash": "^4.14.151" }, "files": [ diff --git a/plugins/catalog-backend-module-bitbucket/.eslintrc.js b/plugins/catalog-backend-module-bitbucket/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/catalog-backend-module-bitbucket/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-bitbucket/README.md b/plugins/catalog-backend-module-bitbucket/README.md new file mode 100644 index 0000000000..ae22c7a427 --- /dev/null +++ b/plugins/catalog-backend-module-bitbucket/README.md @@ -0,0 +1,8 @@ +# Catalog Backend Module for Bitbucket + +This is an extension module to the plugin-catalog-backend plugin, providing extensions targeted at Bitbucket offerings. + +## Getting started + +See [Backstage documentation](https://backstage.io/docs/integrations/bitbucket/discovery) for details on how to install +and configure the plugin. diff --git a/plugins/catalog-backend-module-bitbucket/api-report.md b/plugins/catalog-backend-module-bitbucket/api-report.md new file mode 100644 index 0000000000..34acd6e76d --- /dev/null +++ b/plugins/catalog-backend-module-bitbucket/api-report.md @@ -0,0 +1,47 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-bitbucket" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BitbucketIntegration } from '@backstage/integration'; +import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; +import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; +import { CatalogProcessorResult } from '@backstage/plugin-catalog-backend'; +import { Config } from '@backstage/config'; +import { LocationSpec } from '@backstage/plugin-catalog-backend'; +import { Logger } from 'winston'; +import { ScmIntegrationRegistry } from '@backstage/integration'; + +// @public (undocumented) +export class BitbucketDiscoveryProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrationRegistry; + parser?: BitbucketRepositoryParser; + logger: Logger; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + parser?: BitbucketRepositoryParser; + logger: Logger; + }, + ): BitbucketDiscoveryProcessor; + // (undocumented) + getProcessorName(): string; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public +export type BitbucketRepositoryParser = (options: { + integration: BitbucketIntegration; + target: string; + presence?: 'optional' | 'required'; + logger: Logger; +}) => AsyncIterable; +``` diff --git a/plugins/catalog-backend-module-bitbucket/package.json b/plugins/catalog-backend-module-bitbucket/package.json new file mode 100644 index 0000000000..56a7cd2894 --- /dev/null +++ b/plugins/catalog-backend-module-bitbucket/package.json @@ -0,0 +1,56 @@ +{ + "name": "@backstage/plugin-catalog-backend-module-bitbucket", + "description": "A Backstage catalog backend module that helps integrate towards Bitbucket", + "version": "0.0.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "private": false, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "backend-plugin-module" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-backend-module-bitbucket" + }, + "keywords": [ + "backstage" + ], + "scripts": { + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "clean": "backstage-cli package clean", + "start": "backstage-cli package start" + }, + "dependencies": { + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/config": "^0.1.15", + "@backstage/errors": "^0.2.2", + "@backstage/integration": "^0.8.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", + "@backstage/types": "^0.1.3", + "lodash": "^4.17.21", + "msw": "^0.35.0", + "node-fetch": "^2.6.7", + "winston": "^3.2.1" + }, + "devDependencies": { + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", + "@types/lodash": "^4.14.151" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.test.ts b/plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.test.ts similarity index 99% rename from plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.test.ts rename to plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.test.ts index a25a5da89e..5f441b787c 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.test.ts +++ b/plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.test.ts @@ -15,12 +15,15 @@ */ import { getVoidLogger } from '@backstage/backend-common'; -import { BitbucketDiscoveryProcessor } from './BitbucketDiscoveryProcessor'; import { ConfigReader } from '@backstage/config'; +import { + LocationSpec, + processingResult, +} from '@backstage/plugin-catalog-backend'; import { RequestHandler, rest } from 'msw'; import { setupServer } from 'msw/node'; +import { BitbucketDiscoveryProcessor } from './BitbucketDiscoveryProcessor'; import { BitbucketRepository20, PagedResponse, PagedResponse20 } from './lib'; -import { LocationSpec, processingResult } from '../../api'; const server = setupServer(); diff --git a/plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.ts b/plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.ts similarity index 93% rename from plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.ts rename to plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.ts index 49fa05a762..5553de7f02 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/BitbucketDiscoveryProcessor.ts +++ b/plugins/catalog-backend-module-bitbucket/src/BitbucketDiscoveryProcessor.ts @@ -14,28 +14,27 @@ * limitations under the License. */ -import { Logger } from 'winston'; import { Config } from '@backstage/config'; - import { BitbucketIntegration, ScmIntegrationRegistry, ScmIntegrations, } from '@backstage/integration'; +import { + CatalogProcessor, + CatalogProcessorEmit, + LocationSpec, +} from '@backstage/plugin-catalog-backend'; +import { Logger } from 'winston'; import { BitbucketClient, + BitbucketRepository, + BitbucketRepository20, + BitbucketRepositoryParser, defaultRepositoryParser, paginated, paginated20, - BitbucketRepository, - BitbucketRepository20, } from './lib'; -import { - CatalogProcessor, - CatalogProcessorEmit, - CatalogProcessorResult, - LocationSpec, -} from '../../api'; const DEFAULT_BRANCH = 'master'; const DEFAULT_CATALOG_LOCATION = '/catalog-info.yaml'; @@ -43,23 +42,13 @@ const DEFAULT_CATALOG_LOCATION = '/catalog-info.yaml'; /** @public */ export class BitbucketDiscoveryProcessor implements CatalogProcessor { private readonly integrations: ScmIntegrationRegistry; - private readonly parser: (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; - }) => AsyncIterable; + private readonly parser: BitbucketRepositoryParser; private readonly logger: Logger; static fromConfig( config: Config, options: { - parser?: (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; - }) => AsyncIterable; + parser?: BitbucketRepositoryParser; logger: Logger; }, ) { @@ -73,12 +62,7 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { constructor(options: { integrations: ScmIntegrationRegistry; - parser?: (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; - }) => AsyncIterable; + parser?: BitbucketRepositoryParser; logger: Logger; }) { this.integrations = options.integrations; @@ -123,7 +107,7 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { const { scanned, matches } = isBitbucketCloud ? await this.processCloudRepositories(processOptions) - : await this.processOrganisationRepositories(processOptions); + : await this.processOrganizationRepositories(processOptions); const duration = ((Date.now() - startTimestamp) / 1000).toFixed(1); this.logger.debug( @@ -160,7 +144,7 @@ export class BitbucketDiscoveryProcessor implements CatalogProcessor { }; } - private async processOrganisationRepositories( + private async processOrganizationRepositories( options: ProcessOptions, ): Promise { const { client, location, integration, emit } = options; diff --git a/plugins/catalog-backend-module-bitbucket/src/index.ts b/plugins/catalog-backend-module-bitbucket/src/index.ts new file mode 100644 index 0000000000..5bbda25dea --- /dev/null +++ b/plugins/catalog-backend-module-bitbucket/src/index.ts @@ -0,0 +1,24 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A Backstage catalog backend module that helps integrate towards Bitbucket + * + * @packageDocumentation + */ + +export { BitbucketDiscoveryProcessor } from './BitbucketDiscoveryProcessor'; +export type { BitbucketRepositoryParser } from './lib/BitbucketRepositoryParser'; diff --git a/plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.test.ts b/plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.test.ts similarity index 95% rename from plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.test.ts rename to plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.test.ts index 9f2d8b2daa..58845fc3d1 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.test.ts +++ b/plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { processingResult } from '../../../api'; +import { processingResult } from '@backstage/plugin-catalog-backend'; import { defaultRepositoryParser } from './BitbucketRepositoryParser'; describe('BitbucketRepositoryParser', () => { diff --git a/plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.ts b/plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.ts similarity index 88% rename from plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.ts rename to plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.ts index 8fdcb8f73a..57a162e1e4 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/lib/BitbucketRepositoryParser.ts +++ b/plugins/catalog-backend-module-bitbucket/src/lib/BitbucketRepositoryParser.ts @@ -15,12 +15,17 @@ */ import { BitbucketIntegration } from '@backstage/integration'; +import { + CatalogProcessorResult, + processingResult, +} from '@backstage/plugin-catalog-backend'; import { Logger } from 'winston'; -import { CatalogProcessorResult, processingResult } from '../../../api'; /** + * A custom callback that reacts to finding a repository by yielding processing + * results. + * * @public - * @deprecated type inlined. */ export type BitbucketRepositoryParser = (options: { integration: BitbucketIntegration; diff --git a/plugins/catalog-backend/src/modules/bitbucket/lib/client.ts b/plugins/catalog-backend-module-bitbucket/src/lib/client.ts similarity index 100% rename from plugins/catalog-backend/src/modules/bitbucket/lib/client.ts rename to plugins/catalog-backend-module-bitbucket/src/lib/client.ts index 0ef6558719..a3ee4ab8a6 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/lib/client.ts +++ b/plugins/catalog-backend-module-bitbucket/src/lib/client.ts @@ -14,11 +14,11 @@ * limitations under the License. */ -import fetch from 'node-fetch'; import { BitbucketIntegrationConfig, getBitbucketRequestOptions, } from '@backstage/integration'; +import fetch from 'node-fetch'; import { BitbucketRepository20 } from './types'; export class BitbucketClient { diff --git a/plugins/catalog-backend/src/modules/bitbucket/lib/index.ts b/plugins/catalog-backend-module-bitbucket/src/lib/index.ts similarity index 100% rename from plugins/catalog-backend/src/modules/bitbucket/lib/index.ts rename to plugins/catalog-backend-module-bitbucket/src/lib/index.ts index a819bb3c64..309ec0bce5 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/lib/index.ts +++ b/plugins/catalog-backend-module-bitbucket/src/lib/index.ts @@ -14,8 +14,8 @@ * limitations under the License. */ -export { BitbucketClient, paginated, paginated20 } from './client'; export { defaultRepositoryParser } from './BitbucketRepositoryParser'; +export type { BitbucketRepositoryParser } from './BitbucketRepositoryParser'; +export { BitbucketClient, paginated, paginated20 } from './client'; export type { PagedResponse, PagedResponse20 } from './client'; export type { BitbucketRepository, BitbucketRepository20 } from './types'; -export type { BitbucketRepositoryParser } from './BitbucketRepositoryParser'; diff --git a/plugins/catalog-backend/src/modules/bitbucket/lib/types.ts b/plugins/catalog-backend-module-bitbucket/src/lib/types.ts similarity index 100% rename from plugins/catalog-backend/src/modules/bitbucket/lib/types.ts rename to plugins/catalog-backend-module-bitbucket/src/lib/types.ts diff --git a/plugins/catalog-backend/src/modules/bitbucket/index.ts b/plugins/catalog-backend-module-bitbucket/src/setupTests.ts similarity index 76% rename from plugins/catalog-backend/src/modules/bitbucket/index.ts rename to plugins/catalog-backend-module-bitbucket/src/setupTests.ts index 0e39083520..d3232290a7 100644 --- a/plugins/catalog-backend/src/modules/bitbucket/index.ts +++ b/plugins/catalog-backend-module-bitbucket/src/setupTests.ts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Backstage Authors + * 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. @@ -14,5 +14,4 @@ * limitations under the License. */ -export { BitbucketDiscoveryProcessor } from './BitbucketDiscoveryProcessor'; -export type { BitbucketRepositoryParser } from './lib'; +export {}; diff --git a/plugins/catalog-backend-module-github/.eslintrc.js b/plugins/catalog-backend-module-github/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/catalog-backend-module-github/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-github/README.md b/plugins/catalog-backend-module-github/README.md new file mode 100644 index 0000000000..0d923d992c --- /dev/null +++ b/plugins/catalog-backend-module-github/README.md @@ -0,0 +1,8 @@ +# Catalog Backend Module for GitHub + +This is an extension module to the plugin-catalog-backend plugin, providing extensions targeted at GitHub offerings. + +## Getting started + +See [Backstage documentation](https://backstage.io/docs/integrations/github/discovery) for details on how to install +and configure the plugin. diff --git a/plugins/catalog-backend-module-github/api-report.md b/plugins/catalog-backend-module-github/api-report.md new file mode 100644 index 0000000000..a1b3d34058 --- /dev/null +++ b/plugins/catalog-backend-module-github/api-report.md @@ -0,0 +1,126 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-github" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { CatalogProcessor } from '@backstage/plugin-catalog-backend'; +import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend'; +import { Config } from '@backstage/config'; +import { EntityProvider } from '@backstage/plugin-catalog-backend'; +import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; +import { GithubCredentialsProvider } from '@backstage/integration'; +import { GitHubIntegrationConfig } from '@backstage/integration'; +import { LocationSpec } from '@backstage/plugin-catalog-backend'; +import { Logger } from 'winston'; +import { ScmIntegrationRegistry } from '@backstage/integration'; + +// @public +export class GithubDiscoveryProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrationRegistry; + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }, + ): GithubDiscoveryProcessor; + // (undocumented) + getProcessorName(): string; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public +export type GithubMultiOrgConfig = Array<{ + name: string; + groupNamespace: string; + userNamespace: string | undefined; +}>; + +// @public +export class GithubMultiOrgReaderProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrationRegistry; + logger: Logger; + orgs: GithubMultiOrgConfig; + githubCredentialsProvider?: GithubCredentialsProvider; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }, + ): GithubMultiOrgReaderProcessor; + // (undocumented) + getProcessorName(): string; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} + +// @public (undocumented) +export class GitHubOrgEntityProvider implements EntityProvider { + constructor(options: { + id: string; + orgUrl: string; + gitHubConfig: GitHubIntegrationConfig; + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }); + // (undocumented) + connect(connection: EntityProviderConnection): Promise; + // (undocumented) + static fromConfig( + config: Config, + options: { + id: string; + orgUrl: string; + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }, + ): GitHubOrgEntityProvider; + // (undocumented) + getProviderName(): string; + // (undocumented) + read(): Promise; +} + +// @public +export class GithubOrgReaderProcessor implements CatalogProcessor { + constructor(options: { + integrations: ScmIntegrationRegistry; + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }); + // (undocumented) + static fromConfig( + config: Config, + options: { + logger: Logger; + githubCredentialsProvider?: GithubCredentialsProvider; + }, + ): GithubOrgReaderProcessor; + // (undocumented) + getProcessorName(): string; + // (undocumented) + readLocation( + location: LocationSpec, + _optional: boolean, + emit: CatalogProcessorEmit, + ): Promise; +} +``` diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json new file mode 100644 index 0000000000..fe4607ac16 --- /dev/null +++ b/plugins/catalog-backend-module-github/package.json @@ -0,0 +1,57 @@ +{ + "name": "@backstage/plugin-catalog-backend-module-github", + "description": "A Backstage catalog backend module that helps integrate towards GitHub", + "version": "0.0.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "private": false, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "backend-plugin-module" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-backend-module-github" + }, + "keywords": [ + "backstage" + ], + "scripts": { + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "clean": "backstage-cli package clean", + "start": "backstage-cli package start" + }, + "dependencies": { + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/config": "^0.1.15", + "@backstage/errors": "^0.2.2", + "@backstage/integration": "^0.8.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", + "@backstage/types": "^0.1.3", + "@octokit/graphql": "^4.5.8", + "lodash": "^4.17.21", + "msw": "^0.35.0", + "node-fetch": "^2.6.7", + "winston": "^3.2.1" + }, + "devDependencies": { + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", + "@types/lodash": "^4.14.151" + }, + "files": [ + "dist" + ] +} diff --git a/plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.test.ts b/plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.test.ts similarity index 98% rename from plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.test.ts rename to plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.test.ts index dd3bf490fb..3086386af8 100644 --- a/plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.test.ts +++ b/plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.test.ts @@ -20,8 +20,8 @@ import { GithubCredentialsProvider, GitHubIntegrationConfig, } from '@backstage/integration'; +import { EntityProviderConnection } from '@backstage/plugin-catalog-backend'; import { graphql } from '@octokit/graphql'; -import { EntityProviderConnection } from '../../api'; import { GitHubOrgEntityProvider, withLocations, diff --git a/plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.ts b/plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.ts similarity index 97% rename from plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.ts rename to plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.ts index 76389968ae..5bf501aff0 100644 --- a/plugins/catalog-backend/src/modules/github/GitHubOrgEntityProvider.ts +++ b/plugins/catalog-backend-module-github/src/GitHubOrgEntityProvider.ts @@ -27,16 +27,20 @@ import { ScmIntegrations, SingleInstanceGithubCredentialsProvider, } from '@backstage/integration'; +import { + EntityProvider, + EntityProviderConnection, +} from '@backstage/plugin-catalog-backend'; import { graphql } from '@octokit/graphql'; import { merge } from 'lodash'; import { Logger } from 'winston'; -import { EntityProvider, EntityProviderConnection } from '../../api'; import { + assignGroupsToUsers, + buildOrgHierarchy, getOrganizationTeams, getOrganizationUsers, parseGitHubOrgUrl, } from './lib'; -import { assignGroupsToUsers, buildOrgHierarchy } from '../util/org'; // TODO: Consider supporting an (optional) webhook that reacts on org changes /** @public */ diff --git a/plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.test.ts b/plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.test.ts similarity index 99% rename from plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.test.ts rename to plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.test.ts index 5440539b27..b18e3baf75 100644 --- a/plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.test.ts +++ b/plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.test.ts @@ -20,7 +20,7 @@ import { DefaultGithubCredentialsProvider, ScmIntegrations, } from '@backstage/integration'; -import { LocationSpec } from '../../api'; +import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { GithubDiscoveryProcessor, parseUrl } from './GithubDiscoveryProcessor'; import { getOrganizationRepositories } from './lib'; diff --git a/plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.ts b/plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.ts similarity index 99% rename from plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.ts rename to plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.ts index 4aff470f52..78a1bca169 100644 --- a/plugins/catalog-backend/src/modules/github/GithubDiscoveryProcessor.ts +++ b/plugins/catalog-backend-module-github/src/GithubDiscoveryProcessor.ts @@ -21,15 +21,15 @@ import { ScmIntegrationRegistry, ScmIntegrations, } from '@backstage/integration'; -import { graphql } from '@octokit/graphql'; -import { Logger } from 'winston'; -import { getOrganizationRepositories } from './lib'; import { CatalogProcessor, CatalogProcessorEmit, LocationSpec, processingResult, -} from '../../api'; +} from '@backstage/plugin-catalog-backend'; +import { graphql } from '@octokit/graphql'; +import { Logger } from 'winston'; +import { getOrganizationRepositories } from './lib'; /** * Extracts repositories out of a GitHub org. diff --git a/plugins/catalog-backend/src/modules/github/GithubMultiOrgReaderProcessor.ts b/plugins/catalog-backend-module-github/src/GithubMultiOrgReaderProcessor.ts similarity index 98% rename from plugins/catalog-backend/src/modules/github/GithubMultiOrgReaderProcessor.ts rename to plugins/catalog-backend-module-github/src/GithubMultiOrgReaderProcessor.ts index dbd858fc0d..321e9cc8f8 100644 --- a/plugins/catalog-backend/src/modules/github/GithubMultiOrgReaderProcessor.ts +++ b/plugins/catalog-backend-module-github/src/GithubMultiOrgReaderProcessor.ts @@ -23,21 +23,21 @@ import { ScmIntegrationRegistry, ScmIntegrations, } from '@backstage/integration'; -import { graphql } from '@octokit/graphql'; -import { Logger } from 'winston'; -import { - getOrganizationTeams, - getOrganizationUsers, - GithubMultiOrgConfig, - readGithubMultiOrgConfig, -} from './lib'; import { CatalogProcessor, CatalogProcessorEmit, LocationSpec, processingResult, -} from '../../api'; -import { buildOrgHierarchy } from '../util/org'; +} from '@backstage/plugin-catalog-backend'; +import { graphql } from '@octokit/graphql'; +import { Logger } from 'winston'; +import { + buildOrgHierarchy, + getOrganizationTeams, + getOrganizationUsers, + GithubMultiOrgConfig, + readGithubMultiOrgConfig, +} from './lib'; /** * Extracts teams and users out of a multiple GitHub orgs namespaced per org. diff --git a/plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.test.ts b/plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.test.ts similarity index 98% rename from plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.test.ts rename to plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.test.ts index 9ce278ac44..2bb0c538eb 100644 --- a/plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.test.ts +++ b/plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.test.ts @@ -17,12 +17,12 @@ import { getVoidLogger } from '@backstage/backend-common'; import { ConfigReader } from '@backstage/config'; import { - ScmIntegrations, GithubCredentialsProvider, + ScmIntegrations, } from '@backstage/integration'; +import { LocationSpec } from '@backstage/plugin-catalog-backend'; import { graphql } from '@octokit/graphql'; import { GithubOrgReaderProcessor } from './GithubOrgReaderProcessor'; -import { LocationSpec } from '../../api'; jest.mock('@octokit/graphql'); diff --git a/plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.ts b/plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.ts similarity index 97% rename from plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.ts rename to plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.ts index e85e7b874d..84c12e82ba 100644 --- a/plugins/catalog-backend/src/modules/github/GithubOrgReaderProcessor.ts +++ b/plugins/catalog-backend-module-github/src/GithubOrgReaderProcessor.ts @@ -16,26 +16,27 @@ import { Config } from '@backstage/config'; import { + DefaultGithubCredentialsProvider, + GithubCredentialsProvider, GithubCredentialType, ScmIntegrationRegistry, ScmIntegrations, - GithubCredentialsProvider, - DefaultGithubCredentialsProvider, } from '@backstage/integration'; -import { graphql } from '@octokit/graphql'; -import { Logger } from 'winston'; -import { - getOrganizationTeams, - getOrganizationUsers, - parseGitHubOrgUrl, -} from './lib'; import { CatalogProcessor, CatalogProcessorEmit, LocationSpec, processingResult, -} from '../../api'; -import { assignGroupsToUsers, buildOrgHierarchy } from '../util/org'; +} from '@backstage/plugin-catalog-backend'; +import { graphql } from '@octokit/graphql'; +import { Logger } from 'winston'; +import { + assignGroupsToUsers, + buildOrgHierarchy, + getOrganizationTeams, + getOrganizationUsers, + parseGitHubOrgUrl, +} from './lib'; type GraphQL = typeof graphql; diff --git a/plugins/catalog-backend/src/modules/github/index.ts b/plugins/catalog-backend-module-github/src/index.ts similarity index 85% rename from plugins/catalog-backend/src/modules/github/index.ts rename to plugins/catalog-backend-module-github/src/index.ts index 7958818096..1394fcd21b 100644 --- a/plugins/catalog-backend/src/modules/github/index.ts +++ b/plugins/catalog-backend-module-github/src/index.ts @@ -1,5 +1,5 @@ /* - * Copyright 2022 The Backstage Authors + * 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. @@ -14,6 +14,12 @@ * limitations under the License. */ +/** + * A Backstage catalog backend module that helps integrate towards GitHub + * + * @packageDocumentation + */ + export { GithubDiscoveryProcessor } from './GithubDiscoveryProcessor'; export { GithubMultiOrgReaderProcessor } from './GithubMultiOrgReaderProcessor'; export { GitHubOrgEntityProvider } from './GitHubOrgEntityProvider'; diff --git a/plugins/catalog-backend/src/modules/github/lib/config.test.ts b/plugins/catalog-backend-module-github/src/lib/config.test.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/config.test.ts rename to plugins/catalog-backend-module-github/src/lib/config.test.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/config.ts b/plugins/catalog-backend-module-github/src/lib/config.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/config.ts rename to plugins/catalog-backend-module-github/src/lib/config.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/github.test.ts b/plugins/catalog-backend-module-github/src/lib/github.test.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/github.test.ts rename to plugins/catalog-backend-module-github/src/lib/github.test.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/github.ts b/plugins/catalog-backend-module-github/src/lib/github.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/github.ts rename to plugins/catalog-backend-module-github/src/lib/github.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/index.ts b/plugins/catalog-backend-module-github/src/lib/index.ts similarity index 93% rename from plugins/catalog-backend/src/modules/github/lib/index.ts rename to plugins/catalog-backend-module-github/src/lib/index.ts index 3e31d9e00c..26ec3e8516 100644 --- a/plugins/catalog-backend/src/modules/github/lib/index.ts +++ b/plugins/catalog-backend-module-github/src/lib/index.ts @@ -21,4 +21,5 @@ export { getOrganizationTeams, getOrganizationUsers, } from './github'; +export { assignGroupsToUsers, buildOrgHierarchy } from './org'; export { parseGitHubOrgUrl } from './util'; diff --git a/plugins/catalog-backend/src/modules/util/org.test.ts b/plugins/catalog-backend-module-github/src/lib/org.test.ts similarity index 100% rename from plugins/catalog-backend/src/modules/util/org.test.ts rename to plugins/catalog-backend-module-github/src/lib/org.test.ts diff --git a/plugins/catalog-backend/src/modules/util/org.ts b/plugins/catalog-backend-module-github/src/lib/org.ts similarity index 100% rename from plugins/catalog-backend/src/modules/util/org.ts rename to plugins/catalog-backend-module-github/src/lib/org.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/util.test.ts b/plugins/catalog-backend-module-github/src/lib/util.test.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/util.test.ts rename to plugins/catalog-backend-module-github/src/lib/util.test.ts diff --git a/plugins/catalog-backend/src/modules/github/lib/util.ts b/plugins/catalog-backend-module-github/src/lib/util.ts similarity index 100% rename from plugins/catalog-backend/src/modules/github/lib/util.ts rename to plugins/catalog-backend-module-github/src/lib/util.ts diff --git a/plugins/catalog-backend-module-github/src/setupTests.ts b/plugins/catalog-backend-module-github/src/setupTests.ts new file mode 100644 index 0000000000..d3232290a7 --- /dev/null +++ b/plugins/catalog-backend-module-github/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export {}; diff --git a/plugins/catalog-backend-module-gitlab/.eslintrc.js b/plugins/catalog-backend-module-gitlab/.eslintrc.js index 16a033dbc6..e2a53a6ad2 100644 --- a/plugins/catalog-backend-module-gitlab/.eslintrc.js +++ b/plugins/catalog-backend-module-gitlab/.eslintrc.js @@ -1,3 +1 @@ -module.exports = { - extends: [require.resolve('@backstage/cli/config/eslint.backend')], -}; +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-gitlab/CHANGELOG.md b/plugins/catalog-backend-module-gitlab/CHANGELOG.md new file mode 100644 index 0000000000..09f6df6fe4 --- /dev/null +++ b/plugins/catalog-backend-module-gitlab/CHANGELOG.md @@ -0,0 +1,14 @@ +# @backstage/plugin-catalog-backend-module-gitlab + +## 0.1.0-next.0 + +### Minor Changes + +- 66ba5d9023: Added package, moving out GitLab specific functionality from the catalog-backend + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 diff --git a/plugins/catalog-backend-module-gitlab/package.json b/plugins/catalog-backend-module-gitlab/package.json index fd73d2c879..7073291d2b 100644 --- a/plugins/catalog-backend-module-gitlab/package.json +++ b/plugins/catalog-backend-module-gitlab/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend-module-gitlab", "description": "A Backstage catalog backend module that helps integrate towards GitLab", - "version": "0.0.0", + "version": "0.1.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,12 +33,12 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", - "@backstage/plugin-catalog-backend": "^0.23.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", "@backstage/types": "^0.1.3", "lodash": "^4.17.21", "msw": "^0.35.0", @@ -46,8 +46,8 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@types/lodash": "^4.14.151" }, "files": [ diff --git a/plugins/catalog-backend-module-ldap/CHANGELOG.md b/plugins/catalog-backend-module-ldap/CHANGELOG.md index 94af4a78e9..6933b4e6c5 100644 --- a/plugins/catalog-backend-module-ldap/CHANGELOG.md +++ b/plugins/catalog-backend-module-ldap/CHANGELOG.md @@ -1,5 +1,44 @@ # @backstage/plugin-catalog-backend-module-ldap +## 0.4.0-next.0 + +### Minor Changes + +- 9461f73643: **BREAKING**: Added a `schedule` field to `LdapOrgEntityProvider.fromConfig`, which is required. If you want to retain the old behavior of scheduling the provider manually, you can set it to the string value `'manual'`. But you may want to leverage the ability to instead pass in the recurring task schedule information directly. This will allow you to simplify your backend setup code to not need an intermediate variable and separate scheduling code at the bottom. + + All things said, a typical setup might now look as follows: + + ```diff + // packages/backend/src/plugins/catalog.ts + +import { Duration } from 'luxon'; + +import { LdapOrgEntityProvider } from '@backstage/plugin-catalog-backend-module-ldap'; + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); + + // The target parameter below needs to match the ldap.providers.target + + // value specified in your app-config. + + builder.addEntityProvider( + + LdapOrgEntityProvider.fromConfig(env.config, { + + id: 'our-ldap-master', + + target: 'ldaps://ds.example.net', + + logger: env.logger, + + schedule: env.scheduler.createScheduledTaskRunner({ + + frequency: Duration.fromObject({ minutes: 60 }), + + timeout: Duration.fromObject({ minutes: 15 }), + + }), + + }), + + ); + ``` + +### Patch Changes + +- f751e84572: Ignore search referrals instead of throwing an error. +- Updated dependencies + - @backstage/backend-tasks@0.2.0-next.0 + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.3.15 ### Patch Changes diff --git a/plugins/catalog-backend-module-ldap/package.json b/plugins/catalog-backend-module-ldap/package.json index d1c9e764fd..a09f93536f 100644 --- a/plugins/catalog-backend-module-ldap/package.json +++ b/plugins/catalog-backend-module-ldap/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend-module-ldap", "description": "A Backstage catalog backend module that helps integrate towards LDAP", - "version": "0.3.15", + "version": "0.4.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -33,11 +33,11 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/backend-tasks": "^0.1.10", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-tasks": "^0.2.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", - "@backstage/plugin-catalog-backend": "^0.23.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", "@backstage/types": "^0.1.3", "@types/ldapjs": "^2.2.0", "ldapjs": "^2.2.0", @@ -46,7 +46,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@types/lodash": "^4.14.151" }, "files": [ diff --git a/plugins/catalog-backend-module-msgraph/CHANGELOG.md b/plugins/catalog-backend-module-msgraph/CHANGELOG.md index 1c24d03bea..7b8a358517 100644 --- a/plugins/catalog-backend-module-msgraph/CHANGELOG.md +++ b/plugins/catalog-backend-module-msgraph/CHANGELOG.md @@ -1,5 +1,14 @@ # @backstage/plugin-catalog-backend-module-msgraph +## 0.2.19-next.0 + +### Patch Changes + +- 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils` +- Updated dependencies + - @backstage/plugin-catalog-backend@0.24.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + ## 0.2.18 ### Patch Changes diff --git a/plugins/catalog-backend-module-msgraph/package.json b/plugins/catalog-backend-module-msgraph/package.json index f9220ac41c..5de78b3ec4 100644 --- a/plugins/catalog-backend-module-msgraph/package.json +++ b/plugins/catalog-backend-module-msgraph/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend-module-msgraph", "description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph", - "version": "0.2.18", + "version": "0.2.19-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,9 +34,9 @@ }, "dependencies": { "@azure/msal-node": "^1.1.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", - "@backstage/plugin-catalog-backend": "^0.23.0", + "@backstage/plugin-catalog-backend": "^0.24.0-next.0", "@microsoft/microsoft-graph-types": "^2.6.0", "@types/node-fetch": "^2.5.12", "lodash": "^4.17.21", @@ -46,9 +46,9 @@ "qs": "^6.9.4" }, "devDependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@types/lodash": "^4.14.151", "msw": "^0.35.0" }, diff --git a/plugins/catalog-backend/CHANGELOG.md b/plugins/catalog-backend/CHANGELOG.md index d4a7d8b8d6..664f58ffe5 100644 --- a/plugins/catalog-backend/CHANGELOG.md +++ b/plugins/catalog-backend/CHANGELOG.md @@ -1,5 +1,54 @@ # @backstage/plugin-catalog-backend +## 0.24.0-next.0 + +### Minor Changes + +- 66ba5d9023: **BREAKING**: Removed `GitLabDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-gitlab`. NOTE THAT this processor was part of the default set of processors in the catalog backend, and if you are a user of discovery on GitLab, you MUST now add it manually in the catalog initialization code of your backend. + + ```diff + // In packages/backend/src/plugins/catalog.ts + +import { GitLabDiscoveryProcessor } from '@backstage/plugin-catalog-backend-module-gitlab'; + + export default async function createPlugin( + env: PluginEnvironment, + ): Promise { + const builder = await CatalogBuilder.create(env); + + builder.addProcessor( + + GitLabDiscoveryProcessor.fromConfig(env.config, { logger: env.logger }) + + ); + ``` + + **BREAKING**: Removed `AzureDevOpsDiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-azure`. This processor was not part of the set of default processors. If you were using it, you should already have a reference to it in your backend code and only need to update the import. + +- f115a7f8fd: **BREAKING**: Removed `AwsS3DiscoveryProcessor`, which now instead should be imported from `@backstage/plugin-catalog-backend-module-aws`. +- 55150919ed: - **BREAKING**: Support for `backstage.io/v1beta2` Software Templates has been removed. Please migrate your legacy templates to the new `scaffolder.backstage.io/v1beta3` `apiVersion` by following the [migration guide](https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3) + +### Patch Changes + +- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912) +- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1 +- 616f02ade2: support Bitbucket Cloud's code search to discover catalog files (multiple per repo, Location entities for existing files only) +- e421d77536: **BREAKING**: + + - Removed the previously deprecated `runPeriodically` export. Please use the `@backstage/backend-tasks` package instead, or copy [the actual implementation](https://github.com/backstage/backstage/blob/02875d4d56708c60f86f6b0a5b3da82e24988354/plugins/catalog-backend/src/util/runPeriodically.ts#L29) into your own code if you explicitly do not want coordination of task runs across your worker nodes. + - Removed the previously deprecated `CatalogProcessorLocationResult.optional` field. Please set the corresponding `LocationSpec.presence` field to `'optional'` instead. + - Related to the previous point, the `processingResult.location` function no longer has a second boolean `optional` argument. Please set the corresponding `LocationSpec.presence` field to `'optional'` instead. + - Removed the previously deprecated `StaticLocationProcessor`. It has not been in use for some time; its functionality is covered by `ConfigLocationEntityProvider` instead. + +- 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils` +- c1168bb440: Fixed display of the location in the log message that is printed when entity envelope validation fails. +- b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage. +- 3e54f6c436: Use `@backstage/plugin-search-common` package instead of `@backstage/search-common`. +- Updated dependencies + - @backstage/backend-common@0.13.0-next.0 + - @backstage/plugin-scaffolder-common@0.3.0-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/plugin-catalog-common@0.2.2-next.0 + - @backstage/plugin-search-common@0.3.1-next.0 + - @backstage/catalog-client@0.9.0-next.0 + - @backstage/plugin-permission-node@0.5.4-next.0 + ## 0.23.1 ### Patch Changes diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index 2a007fc52c..714fdffb87 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -5,7 +5,6 @@ ```ts /// -import { BitbucketIntegration } from '@backstage/integration'; import { CatalogApi } from '@backstage/catalog-client'; import { CatalogEntityDocument as CatalogEntityDocument_2 } from '@backstage/plugin-catalog-common'; import { CompoundEntityRef } from '@backstage/catalog-model'; @@ -17,8 +16,6 @@ import { Entity } from '@backstage/catalog-model'; import { EntityPolicy } from '@backstage/catalog-model'; import express from 'express'; import { GetEntitiesRequest } from '@backstage/catalog-client'; -import { GithubCredentialsProvider } from '@backstage/integration'; -import { GitHubIntegrationConfig } from '@backstage/integration'; import { JsonObject } from '@backstage/types'; import { JsonValue } from '@backstage/types'; import { Location as Location_2 } from '@backstage/catalog-client'; @@ -97,49 +94,6 @@ export class AnnotateScmSlugEntityProcessor implements CatalogProcessor { preProcessEntity(entity: Entity, location: LocationSpec): Promise; } -// @public (undocumented) -export class BitbucketDiscoveryProcessor implements CatalogProcessor { - constructor(options: { - integrations: ScmIntegrationRegistry; - parser?: (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; - }) => AsyncIterable; - logger: Logger; - }); - // (undocumented) - static fromConfig( - config: Config, - options: { - parser?: (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; - }) => AsyncIterable; - logger: Logger; - }, - ): BitbucketDiscoveryProcessor; - // (undocumented) - getProcessorName(): string; - // (undocumented) - readLocation( - location: LocationSpec, - _optional: boolean, - emit: CatalogProcessorEmit, - ): Promise; -} - -// @public @deprecated (undocumented) -export type BitbucketRepositoryParser = (options: { - integration: BitbucketIntegration; - target: string; - presence?: 'optional' | 'required'; - logger: Logger; -}) => AsyncIterable; - // @public (undocumented) export class BuiltinKindsEntityProcessor implements CatalogProcessor { // (undocumented) @@ -639,116 +593,6 @@ function generalError( message: string, ): CatalogProcessorResult; -// @public -export class GithubDiscoveryProcessor implements CatalogProcessor { - constructor(options: { - integrations: ScmIntegrationRegistry; - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }); - // (undocumented) - static fromConfig( - config: Config, - options: { - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }, - ): GithubDiscoveryProcessor; - // (undocumented) - getProcessorName(): string; - // (undocumented) - readLocation( - location: LocationSpec, - _optional: boolean, - emit: CatalogProcessorEmit, - ): Promise; -} - -// @public -export type GithubMultiOrgConfig = Array<{ - name: string; - groupNamespace: string; - userNamespace: string | undefined; -}>; - -// @public -export class GithubMultiOrgReaderProcessor implements CatalogProcessor { - constructor(options: { - integrations: ScmIntegrationRegistry; - logger: Logger; - orgs: GithubMultiOrgConfig; - githubCredentialsProvider?: GithubCredentialsProvider; - }); - // (undocumented) - static fromConfig( - config: Config, - options: { - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }, - ): GithubMultiOrgReaderProcessor; - // (undocumented) - getProcessorName(): string; - // (undocumented) - readLocation( - location: LocationSpec, - _optional: boolean, - emit: CatalogProcessorEmit, - ): Promise; -} - -// @public (undocumented) -export class GitHubOrgEntityProvider implements EntityProvider { - constructor(options: { - id: string; - orgUrl: string; - gitHubConfig: GitHubIntegrationConfig; - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }); - // (undocumented) - connect(connection: EntityProviderConnection): Promise; - // (undocumented) - static fromConfig( - config: Config, - options: { - id: string; - orgUrl: string; - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }, - ): GitHubOrgEntityProvider; - // (undocumented) - getProviderName(): string; - // (undocumented) - read(): Promise; -} - -// @public -export class GithubOrgReaderProcessor implements CatalogProcessor { - constructor(options: { - integrations: ScmIntegrationRegistry; - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }); - // (undocumented) - static fromConfig( - config: Config, - options: { - logger: Logger; - githubCredentialsProvider?: GithubCredentialsProvider; - }, - ): GithubOrgReaderProcessor; - // (undocumented) - getProcessorName(): string; - // (undocumented) - readLocation( - location: LocationSpec, - _optional: boolean, - emit: CatalogProcessorEmit, - ): Promise; -} - // @public @deprecated (undocumented) function inputError( atLocation: LocationSpec, diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index a5dd2cb7be..e9aee074f3 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-backend", "description": "The Backstage backend plugin that provides the Backstage catalog", - "version": "0.23.0", + "version": "0.24.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,19 +34,18 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/backend-common": "^0.12.0", - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", + "@backstage/backend-common": "^0.13.0-next.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", - "@backstage/plugin-catalog-common": "^0.2.0", + "@backstage/plugin-catalog-common": "^0.2.2-next.0", "@backstage/plugin-permission-common": "^0.5.2", - "@backstage/plugin-permission-node": "^0.5.3", - "@backstage/plugin-scaffolder-common": "^0.2.3", - "@backstage/plugin-search-common": "^0.3.0", + "@backstage/plugin-permission-node": "^0.5.4-next.0", + "@backstage/plugin-scaffolder-common": "^0.3.0-next.0", + "@backstage/plugin-search-common": "^0.3.1-next.0", "@backstage/types": "^0.1.3", - "@octokit/graphql": "^4.5.8", "@types/express": "^4.17.6", "codeowners-utils": "^1.0.2", "core-js": "^3.6.5", @@ -69,10 +68,10 @@ "zod": "^3.11.6" }, "devDependencies": { - "@backstage/backend-test-utils": "^0.1.20", - "@backstage/cli": "^0.15.0", + "@backstage/backend-test-utils": "^0.1.21-next.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/plugin-permission-common": "^0.5.2", - "@backstage/plugin-search-backend-node": "0.5.0", + "@backstage/plugin-search-backend-node": "0.5.1-next.0", "@types/core-js": "^2.5.4", "@types/git-url-parse": "^9.0.0", "@types/lodash": "^4.14.151", diff --git a/plugins/catalog-backend/src/modules/index.ts b/plugins/catalog-backend/src/modules/index.ts index c541250c46..10ebf65fed 100644 --- a/plugins/catalog-backend/src/modules/index.ts +++ b/plugins/catalog-backend/src/modules/index.ts @@ -14,7 +14,5 @@ * limitations under the License. */ -export * from './bitbucket'; export * from './codeowners'; export * from './core'; -export * from './github'; diff --git a/plugins/catalog-backend/src/service/CatalogBuilder.ts b/plugins/catalog-backend/src/service/CatalogBuilder.ts index 768118404e..79edf3b221 100644 --- a/plugins/catalog-backend/src/service/CatalogBuilder.ts +++ b/plugins/catalog-backend/src/service/CatalogBuilder.ts @@ -28,11 +28,7 @@ import { stringifyEntityRef, Validators, } from '@backstage/catalog-model'; -import { - GithubCredentialsProvider, - ScmIntegrations, - DefaultGithubCredentialsProvider, -} from '@backstage/integration'; +import { ScmIntegrations } from '@backstage/integration'; import { createHash } from 'crypto'; import { Router } from 'express'; import lodash, { keyBy } from 'lodash'; @@ -45,12 +41,9 @@ import { } from '../api'; import { AnnotateLocationEntityProcessor, - BitbucketDiscoveryProcessor, BuiltinKindsEntityProcessor, CodeOwnersProcessor, FileReaderProcessor, - GithubDiscoveryProcessor, - GithubOrgReaderProcessor, PlaceholderProcessor, PlaceholderResolver, UrlReaderProcessor, @@ -352,20 +345,9 @@ export class CatalogBuilder { getDefaultProcessors(): CatalogProcessor[] { const { config, logger, reader } = this.env; const integrations = ScmIntegrations.fromConfig(config); - const githubCredentialsProvider: GithubCredentialsProvider = - DefaultGithubCredentialsProvider.fromIntegrations(integrations); return [ new FileReaderProcessor(), - BitbucketDiscoveryProcessor.fromConfig(config, { logger }), - GithubDiscoveryProcessor.fromConfig(config, { - logger, - githubCredentialsProvider, - }), - GithubOrgReaderProcessor.fromConfig(config, { - logger, - githubCredentialsProvider, - }), new UrlReaderProcessor({ reader, logger }), CodeOwnersProcessor.fromConfig(config, { logger, reader }), new AnnotateLocationEntityProcessor({ integrations }), @@ -567,6 +549,8 @@ export class CatalogBuilder { // Add the ones (if any) that the user added processors.push(...this.processors); + this.checkMissingExternalProcessors(processors); + return processors; } @@ -595,4 +579,88 @@ export class CatalogBuilder { ); } } + + // TODO(freben): This can be removed no sooner than June 2022, after adopters have had some time to adapt to the new package structure + private checkMissingExternalProcessors(processors: CatalogProcessor[]) { + const skipCheckVarName = 'BACKSTAGE_CATALOG_SKIP_MISSING_PROCESSORS_CHECK'; + if (process.env[skipCheckVarName]) { + return; + } + + const locationTypes = new Set( + this.env.config + .getOptionalConfigArray('catalog.locations') + ?.map(l => l.getString('type')) ?? [], + ); + const processorNames = new Set(processors.map(p => p.getProcessorName())); + + function check( + locationType: string, + processorName: string, + installationUrl: string, + ) { + if ( + locationTypes.has(locationType) && + !processorNames.has(processorName) + ) { + throw new Error( + [ + `Your config contains a "catalog.locations" entry of type ${locationType},`, + `but does not have the corresponding catalog processor ${processorName} installed.`, + `This processor used to be built into the catalog itself, but is now moved to an`, + `external module that has to be installed manually. Please follow the installation`, + `instructions at ${installationUrl} if you are using this ability, or remove the`, + `location from your app config if you do not. You can also silence this check entirely`, + `by setting the environment variable ${skipCheckVarName} to 'true'.`, + ].join(' '), + ); + } + } + + check( + 'aws-cloud-accounts', + 'AwsOrganizationCloudAccountProcessor', + 'https://backstage.io/docs/integrations', + ); + check( + 's3-discovery', + 'AwsS3DiscoveryProcessor', + 'https://backstage.io/docs/integrations/aws-s3/discovery', + ); + check( + 'azure-discovery', + 'AzureDevOpsDiscoveryProcessor', + 'https://backstage.io/docs/integrations/azure/discovery', + ); + check( + 'bitbucket-discovery', + 'BitbucketDiscoveryProcessor', + 'https://backstage.io/docs/integrations/bitbucket/discovery', + ); + check( + 'github-discovery', + 'GithubDiscoveryProcessor', + 'https://backstage.io/docs/integrations/github/discovery', + ); + check( + 'github-org', + 'GithubOrgReaderProcessor', + 'https://backstage.io/docs/integrations/github/org', + ); + check( + 'gitlab-discovery', + 'GitLabDiscoveryProcessor', + 'https://backstage.io/docs/integrations/gitlab/discovery', + ); + check( + 'ldap-org', + 'LdapOrgReaderProcessor', + 'https://backstage.io/docs/integrations/ldap/org', + ); + check( + 'microsoft-graph-org', + 'MicrosoftGraphOrgReaderProcessor', + 'https://backstage.io/docs/integrations/azure/org', + ); + } } diff --git a/plugins/catalog-common/CHANGELOG.md b/plugins/catalog-common/CHANGELOG.md index badffd5f0a..be795cc898 100644 --- a/plugins/catalog-common/CHANGELOG.md +++ b/plugins/catalog-common/CHANGELOG.md @@ -1,5 +1,13 @@ # @backstage/plugin-catalog-common +## 0.2.2-next.0 + +### Patch Changes + +- b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage. +- Updated dependencies + - @backstage/search-common@0.3.1-next.0 + ## 0.2.1 ### Patch Changes diff --git a/plugins/catalog-common/package.json b/plugins/catalog-common/package.json index 471893abc4..9a6b11e517 100644 --- a/plugins/catalog-common/package.json +++ b/plugins/catalog-common/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-common", "description": "Common functionalities for the catalog plugin", - "version": "0.2.0", + "version": "0.2.2-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -35,10 +35,10 @@ }, "dependencies": { "@backstage/plugin-permission-common": "^0.5.2", - "@backstage/search-common": "^0.3.0" + "@backstage/search-common": "^0.3.1-next.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0" + "@backstage/cli": "^0.15.2-next.0" }, "files": [ "dist", diff --git a/plugins/catalog-graph/CHANGELOG.md b/plugins/catalog-graph/CHANGELOG.md index f319a8e23a..84006ba4de 100644 --- a/plugins/catalog-graph/CHANGELOG.md +++ b/plugins/catalog-graph/CHANGELOG.md @@ -1,5 +1,16 @@ # @backstage/plugin-catalog-graph +## 0.2.14-next.0 + +### Patch Changes + +- bf95bb806c: Remove usages of now-removed `CatalogApi.getEntityByName` +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + ## 0.2.13 ### Patch Changes diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index 46de988621..d3b65d1151 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-catalog-graph", - "version": "0.2.13", + "version": "0.2.14-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -24,11 +24,11 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", @@ -45,10 +45,10 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", - "@backstage/plugin-catalog": "^0.9.1", + "@backstage/cli": "^0.15.2-next.0", + "@backstage/plugin-catalog": "^0.10.0-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-graphql/CHANGELOG.md b/plugins/catalog-graphql/CHANGELOG.md index fe0e4c61e2..542b272a02 100644 --- a/plugins/catalog-graphql/CHANGELOG.md +++ b/plugins/catalog-graphql/CHANGELOG.md @@ -1,5 +1,12 @@ # @backstage/plugin-catalog-graphql +## 0.3.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/catalog-model@0.13.0-next.0 + ## 0.3.5 ### Patch Changes diff --git a/plugins/catalog-graphql/package.json b/plugins/catalog-graphql/package.json index 78b0600d17..7afbab0698 100644 --- a/plugins/catalog-graphql/package.json +++ b/plugins/catalog-graphql/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-graphql", "description": "An experimental Backstage catalog GraphQL module", - "version": "0.3.5", + "version": "0.3.6-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,7 +34,7 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-model": "^0.12.0", + "@backstage/catalog-model": "^0.13.0-next.0", "@backstage/config": "^0.1.15", "@backstage/types": "^0.1.3", "graphql-modules": "^2.0.0", @@ -46,7 +46,7 @@ "winston": "^3.2.1" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/test-utils": "^0.3.0", "@graphql-codegen/cli": "^2.3.1", "@graphql-codegen/typescript": "^2.4.2", diff --git a/plugins/catalog-import/CHANGELOG.md b/plugins/catalog-import/CHANGELOG.md index 4808443a14..db8d59eb51 100644 --- a/plugins/catalog-import/CHANGELOG.md +++ b/plugins/catalog-import/CHANGELOG.md @@ -1,5 +1,17 @@ # @backstage/plugin-catalog-import +## 0.8.5-next.0 + +### Patch Changes + +- bf95bb806c: Remove usages of now-removed `CatalogApi.getEntityByName` +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + - @backstage/integration-react@0.1.25-next.0 + ## 0.8.4 ### Patch Changes diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index a4d0c39a64..566602f5ba 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-import", "description": "A Backstage plugin the helps you import entities into your catalog", - "version": "0.8.4", + "version": "0.8.5-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,15 +34,15 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/config": "^0.1.15", "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", - "@backstage/integration-react": "^0.1.24", - "@backstage/plugin-catalog-react": "^0.8.0", + "@backstage/integration-react": "^0.1.25-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", @@ -60,9 +60,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog-react/CHANGELOG.md b/plugins/catalog-react/CHANGELOG.md index b93a2f7451..3bffeeef99 100644 --- a/plugins/catalog-react/CHANGELOG.md +++ b/plugins/catalog-react/CHANGELOG.md @@ -1,5 +1,34 @@ # @backstage/plugin-catalog-react +## 0.9.0-next.0 + +### Minor Changes + +- b0af81726d: **BREAKING**: Removed `reduceCatalogFilters` and `reduceEntityFilters` due to low external utility value. +- 7ffb2c73c9: **BREAKING**: Removed the deprecated `loadCatalogOwnerRefs` function. Usages of this function can be directly replaced with `ownershipEntityRefs` from `identityApi.getBackstageIdentity()`. + + This also affects the `useEntityOwnership` hook in that it no longer uses `loadCatalogOwnerRefs`, meaning it will no longer load in additional relations and instead only rely on the `ownershipEntityRefs` from the `IdentityApi`. + +- dd88d1e3ac: **BREAKING**: Removed `useEntityFromUrl`. +- 9844d4d2bd: **BREAKING**: Removed `useEntityCompoundName`, use `useRouteRefParams(entityRouteRef)` instead. +- 2b8c986ce0: **BREAKING**: Removed `useEntityListProvider` use `useEntityList` instead. +- f3a7a9de6d: **BREAKING**: Removed `useOwnedEntities` and moved its usage internally to the scaffolder-backend where it's used. + + **BREAKING**: Removed `EntityTypeReturn` type which is now inlined. + +- cf1ff5b438: **BREAKING**: Removed the `useEntityKinds` hook, use `catalogApi.getEntityFacets({ facets: ['kind'] })` instead. +- fc6290a76d: **BREAKING**: Removed the deprecated `useOwnUser` hook. Existing usage can be replaced with `identityApi.getBackstageIdentity()`, followed by a call to `catalogClient.getEntityByRef(identity.userEntityRef)`. + +### Patch Changes + +- b1aacbf96a: Applied the fix for the `/alpha` entry point resolution that was part of the `v0.70.1` release of Backstage. +- 2986f8e09d: Fixed EntityOwnerPicker and OwnershipCard url filter issue with more than 21 owners +- f3a7a9de6d: Internalized usage of `useOwnedEntities` hook. +- Updated dependencies + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/catalog-client@0.9.0-next.0 + ## 0.8.1 ### Patch Changes diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 75639d21ee..f7c17d74ac 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog-react", "description": "A frontend library that helps other Backstage plugins interact with the catalog", - "version": "0.8.0", + "version": "0.9.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,9 +34,9 @@ "start": "backstage-cli package start" }, "dependencies": { - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", @@ -61,10 +61,10 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/plugin-catalog-common": "^0.2.0", - "@backstage/plugin-scaffolder-common": "^0.2.3", + "@backstage/plugin-catalog-common": "^0.2.2-next.0", + "@backstage/plugin-scaffolder-common": "^0.3.0-next.0", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/plugins/catalog/CHANGELOG.md b/plugins/catalog/CHANGELOG.md index cae922f26a..ed10e6723b 100644 --- a/plugins/catalog/CHANGELOG.md +++ b/plugins/catalog/CHANGELOG.md @@ -1,5 +1,26 @@ # @backstage/plugin-catalog +## 0.10.0-next.0 + +### Minor Changes + +- 51856359bf: **BREAKING**: Removed the `AboutCard` component which has been replaced by `EntityAboutCard`. +- 5ea9509e6a: **BREAKING**: Removed `CatalogResultListItemProps` and `CatalogResultListItem`, replaced by `CatalogSearchResultListItemProps` and `CatalogSearchResultListItem`. + +### Patch Changes + +- 251688a75e: Updated `CatalogKindHeader` to respond to external changes to query parameters in the URL, such as two sidebar links that apply different catalog filters. +- 9844d4d2bd: Removed usage of removed hook. +- 3e54f6c436: Use `@backstage/plugin-search-common` package instead of `@backstage/search-common`. +- Updated dependencies + - @backstage/plugin-catalog-react@0.9.0-next.0 + - @backstage/core-components@0.9.1-next.0 + - @backstage/catalog-model@0.13.0-next.0 + - @backstage/plugin-catalog-common@0.2.2-next.0 + - @backstage/plugin-search-common@0.3.1-next.0 + - @backstage/catalog-client@0.9.0-next.0 + - @backstage/integration-react@0.1.25-next.0 + ## 0.9.1 ### Patch Changes diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 3223d6aa59..43cde23c57 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -74,7 +74,7 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps): JSX.Element; // @public export interface CatalogKindHeaderProps { - // (undocumented) + allowedKinds?: string[]; initialFilter?: string; } diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 07477316fa..971152a08d 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -1,7 +1,7 @@ { "name": "@backstage/plugin-catalog", "description": "The Backstage plugin for browsing the Backstage catalog", - "version": "0.9.1", + "version": "0.10.0-next.0", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -34,15 +34,15 @@ "clean": "backstage-cli package clean" }, "dependencies": { - "@backstage/catalog-client": "^0.8.0", - "@backstage/catalog-model": "^0.12.0", - "@backstage/core-components": "^0.9.0", + "@backstage/catalog-client": "^0.9.0-next.0", + "@backstage/catalog-model": "^0.13.0-next.0", + "@backstage/core-components": "^0.9.1-next.0", "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", - "@backstage/integration-react": "^0.1.24", - "@backstage/plugin-catalog-common": "^0.2.0", - "@backstage/plugin-catalog-react": "^0.8.0", - "@backstage/plugin-search-common": "^0.3.0", + "@backstage/integration-react": "^0.1.25-next.0", + "@backstage/plugin-catalog-common": "^0.2.2-next.0", + "@backstage/plugin-catalog-react": "^0.9.0-next.0", + "@backstage/plugin-search-common": "^0.3.1-next.0", "@backstage/theme": "^0.2.15", "@backstage/types": "^0.1.2", "@material-ui/core": "^4.12.2", @@ -60,9 +60,9 @@ "react": "^16.13.1 || ^17.0.0" }, "devDependencies": { - "@backstage/cli": "^0.15.0", + "@backstage/cli": "^0.15.2-next.0", "@backstage/core-app-api": "^0.6.0", - "@backstage/dev-utils": "^0.2.24", + "@backstage/dev-utils": "^0.2.25-next.0", "@backstage/plugin-permission-react": "^0.3.3", "@backstage/test-utils": "^0.3.0", "@testing-library/jest-dom": "^5.10.1", diff --git a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx index a7dc18eae2..15d41f3ab3 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx +++ b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.test.tsx @@ -169,4 +169,47 @@ describe('', () => { kind: new EntityKindFilter('template'), }); }); + + it('limits kinds when allowedKinds is set', async () => { + const rendered = await renderWithEffects( + + + + + , + ); + + const input = rendered.getByText('Components'); + fireEvent.mouseDown(input); + + expect( + rendered.getByRole('option', { name: 'Components' }), + ).toBeInTheDocument(); + expect( + rendered.getByRole('option', { name: 'Systems' }), + ).toBeInTheDocument(); + expect( + rendered.queryByRole('option', { name: 'Templates' }), + ).not.toBeInTheDocument(); + }); + + it('renders kind from the query parameter even when not in allowedKinds', async () => { + const rendered = await renderWithEffects( + + + + + , + ); + + expect(rendered.getByText('Frobs')).toBeInTheDocument(); + const input = rendered.getByText('Frobs'); + fireEvent.mouseDown(input); + + expect( + rendered.getByRole('option', { name: 'Systems' }), + ).toBeInTheDocument(); + }); }); diff --git a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx index 27184bafef..67eedb9acc 100644 --- a/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx +++ b/plugins/catalog/src/components/CatalogKindHeader/CatalogKindHeader.tsx @@ -46,12 +46,21 @@ const useStyles = makeStyles((theme: Theme) => * @public */ export interface CatalogKindHeaderProps { + /** + * Entity kinds to show in the dropdown; by default all kinds are fetched from the catalog and + * displayed. + */ + allowedKinds?: string[]; + /** + * The initial kind to select; defaults to 'component'. A kind filter entered directly in the + * query parameter will override this value. + */ initialFilter?: string; } /** @public */ export function CatalogKindHeader(props: CatalogKindHeaderProps) { - const { initialFilter = 'component' } = props; + const { initialFilter = 'component', allowedKinds } = props; const classes = useStyles(); const catalogApi = useApi(catalogApiRef); const { value: allKinds } = useAsync(async () => { @@ -65,7 +74,7 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps) { } = useEntityList(); const queryParamKind = useMemo( - () => [kindParameter].flat()[0], + () => [kindParameter].flat()[0]?.toLocaleLowerCase('en-US'), [kindParameter], ); const [selectedKind, setSelectedKind] = useState( @@ -91,13 +100,19 @@ export function CatalogKindHeader(props: CatalogKindHeaderProps) { // enforced casing from the catalog-backend. This makes a key/value record for the Select options, // including selectedKind if it's unknown - but allows the selectedKind to get clobbered by the // more proper catalog kind if it exists. - const options = [capitalize(selectedKind)] - .concat(allKinds ?? []) - .sort() - .reduce((acc, kind) => { - acc[kind.toLocaleLowerCase('en-US')] = kind; - return acc; - }, {} as Record); + const availableKinds = [capitalize(selectedKind)].concat( + allKinds?.filter(k => + allowedKinds + ? allowedKinds.some( + a => a.toLocaleLowerCase('en-US') === k.toLocaleLowerCase('en-US'), + ) + : true, + ) ?? [], + ); + const options = availableKinds.sort().reduce((acc, kind) => { + acc[kind.toLocaleLowerCase('en-US')] = kind; + return acc; + }, {} as Record); return (