diff --git a/.changeset/dirty-chefs-listen.md b/.changeset/dirty-chefs-listen.md new file mode 100644 index 0000000000..84b684b977 --- /dev/null +++ b/.changeset/dirty-chefs-listen.md @@ -0,0 +1,7 @@ +--- +'@backstage/config-loader': minor +--- + +Loading invalid TypeScript configuration schemas will now throw an error rather than silently being ignored. + +In particular this includes defining any additional types other than `Config` in the schema file, or use of unsupported types such as `Record` or `Partial`. diff --git a/.changeset/hungry-shrimps-care.md b/.changeset/hungry-shrimps-care.md new file mode 100644 index 0000000000..665a7bfc82 --- /dev/null +++ b/.changeset/hungry-shrimps-care.md @@ -0,0 +1,91 @@ +--- +'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch +'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch +'@backstage/plugin-events-backend-module-bitbucket-cloud': patch +'@backstage/plugin-search-backend-module-elasticsearch': patch +'@backstage/plugin-catalog-backend-module-unprocessed': patch +'@backstage/plugin-scaffolder-backend-module-sentry': patch +'@backstage/plugin-scaffolder-backend-module-yeoman': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +'@backstage/plugin-search-backend-module-techdocs': patch +'@backstage/plugin-cicd-statistics-module-gitlab': patch +'@backstage/plugin-events-backend-module-aws-sqs': patch +'@backstage/plugin-search-backend-module-catalog': patch +'@backstage/plugin-search-backend-module-explore': patch +'@backstage/plugin-events-backend-module-gerrit': patch +'@backstage/plugin-events-backend-module-github': patch +'@backstage/plugin-events-backend-module-gitlab': patch +'@backstage/plugin-events-backend-module-azure': patch +'@backstage/plugin-events-backend-test-utils': patch +'@backstage/plugin-search-backend-module-pg': patch +'@backstage/plugin-entity-feedback-backend': patch +'@backstage/backend-openapi-utils': patch +'@backstage/plugin-bitbucket-cloud-common': patch +'@backstage/plugin-entity-feedback-common': patch +'@backstage/plugin-code-coverage-backend': patch +'@backstage/plugin-user-settings-backend': patch +'@backstage/plugin-analytics-module-ga4': patch +'@backstage/plugin-azure-devops-backend': patch +'@backstage/plugin-analytics-module-ga': patch +'@backstage/plugin-git-release-manager': patch +'@backstage/plugin-search-backend-node': patch +'@backstage/integration-react': patch +'@backstage/plugin-github-deployments': patch +'@backstage/plugin-microsoft-calendar': patch +'@backstage/plugin-newrelic-dashboard': patch +'@backstage/plugin-permission-backend': patch +'@backstage/plugin-entity-validation': patch +'@backstage/plugin-sonarqube-backend': patch +'@backstage/plugin-airbrake-backend': patch +'@backstage/plugin-devtools-backend': patch +'@backstage/plugin-linguist-backend': patch +'@backstage/plugin-periskop-backend': patch +'@backstage/plugin-playlist-backend': patch +'@backstage/plugin-apollo-explorer': patch +'@backstage/plugin-devtools-common': patch +'@backstage/plugin-entity-feedback': patch +'@backstage/plugin-explore-backend': patch +'@backstage/plugin-graphql-voyager': patch +'@backstage/plugin-jenkins-backend': patch +'@backstage/plugin-linguist-common': patch +'@backstage/plugin-playlist-common': patch +'@backstage/plugin-scaffolder-node': patch +'@backstage/plugin-apache-airflow': patch +'@backstage/plugin-bazaar-backend': patch +'@backstage/plugin-events-backend': patch +'@backstage/plugin-jenkins-common': patch +'@backstage/plugin-octopus-deploy': patch +'@backstage/plugin-search-backend': patch +'@backstage/plugin-stack-overflow': patch +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-code-coverage': patch +'@backstage/plugin-config-schema': patch +'@backstage/plugin-github-issues': patch +'@backstage/plugin-nomad-backend': patch +'@backstage/plugin-tech-insights': patch +'@backstage/plugin-catalog-node': patch +'@backstage/plugin-code-climate': patch +'@backstage/plugin-events-node': patch +'@backstage/plugin-firehydrant': patch +'@backstage/cli-node': patch +'@backstage/plugin-auth-node': patch +'@backstage/plugin-codescene': patch +'@backstage/plugin-dynatrace': patch +'@backstage/plugin-gcalendar': patch +'@backstage/plugin-org-react': patch +'@backstage/plugin-shortcuts': patch +'@backstage/plugin-xcmetrics': patch +'@backstage/plugin-airbrake': patch +'@backstage/plugin-periskop': patch +'@backstage/plugin-playlist': patch +'@backstage/plugin-bitrise': patch +'@backstage/plugin-allure': patch +'@backstage/plugin-bazaar': patch +'@backstage/plugin-ilert': patch +'@backstage/plugin-kafka': patch +'@backstage/plugin-nomad': patch +'@backstage/plugin-adr': patch +'@backstage/plugin-org': patch +--- + +Add package repository and homepage metadata diff --git a/.changeset/khaki-flies-draw.md b/.changeset/khaki-flies-draw.md new file mode 100644 index 0000000000..ada45dea06 --- /dev/null +++ b/.changeset/khaki-flies-draw.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-gitlab': patch +--- + +Added option to skip forked repos in GitlabDiscoveryEntityProvider diff --git a/.changeset/kind-cougars-allow.md b/.changeset/kind-cougars-allow.md new file mode 100644 index 0000000000..d37c4c5cf2 --- /dev/null +++ b/.changeset/kind-cougars-allow.md @@ -0,0 +1,14 @@ +--- +'@backstage/plugin-devtools-backend': patch +--- + +Add DevTools configuration to enable dependency listing to be filtered with custom prefixes. For instance, in your `app-config.yaml`: + +```yaml +devTools: + info: + packagePrefixes: + - @backstage/ + - @roadiehq/backstage- + - @spotify/backstage- +``` diff --git a/.changeset/large-vans-cross.md b/.changeset/large-vans-cross.md new file mode 100644 index 0000000000..f50b432742 --- /dev/null +++ b/.changeset/large-vans-cross.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-sonarqube': patch +--- + +Remove sonarQube card disable class diff --git a/.changeset/neat-coins-raise.md b/.changeset/neat-coins-raise.md new file mode 100644 index 0000000000..c3045634bf --- /dev/null +++ b/.changeset/neat-coins-raise.md @@ -0,0 +1,17 @@ +--- +'@backstage/plugin-catalog-backend-module-bitbucket-server': patch +'@backstage/plugin-catalog-backend-module-bitbucket-cloud': patch +'@backstage/plugin-catalog-backend-module-puppetdb': patch +'@backstage/plugin-catalog-backend-module-msgraph': patch +'@backstage/plugin-catalog-backend-module-gerrit': patch +'@backstage/plugin-catalog-backend-module-github': patch +'@backstage/plugin-catalog-backend-module-gitlab': patch +'@backstage/plugin-events-backend-module-aws-sqs': patch +'@backstage/plugin-catalog-backend-module-azure': patch +'@backstage/plugin-catalog-backend-module-aws': patch +'@backstage/backend-common': patch +'@backstage/plugin-jenkins-backend': patch +'@backstage/plugin-proxy-backend': patch +--- + +Fixed invalid configuration schema. The configuration schema may be more strict as a result. diff --git a/.changeset/odd-avocados-buy.md b/.changeset/odd-avocados-buy.md new file mode 100644 index 0000000000..9e71c19fc0 --- /dev/null +++ b/.changeset/odd-avocados-buy.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-confluence-to-markdown': patch +--- + +Use `fetchContents` directly instead of a `fetchPlainAction` diff --git a/.changeset/popular-fans-camp.md b/.changeset/popular-fans-camp.md new file mode 100644 index 0000000000..47fc095ef8 --- /dev/null +++ b/.changeset/popular-fans-camp.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Updated config schema to match what was being used in code diff --git a/.changeset/rich-zoos-occur.md b/.changeset/rich-zoos-occur.md new file mode 100644 index 0000000000..979acb93c6 --- /dev/null +++ b/.changeset/rich-zoos-occur.md @@ -0,0 +1,6 @@ +--- +'@backstage/backend-plugin-api': minor +'@backstage/backend-defaults': minor +--- + +**BREAKING**: Removing shared environments concept from the new experimental backend system. diff --git a/.changeset/slimy-kids-jam.md b/.changeset/slimy-kids-jam.md new file mode 100644 index 0000000000..c02daf325e --- /dev/null +++ b/.changeset/slimy-kids-jam.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend': minor +--- + +Added OpenTelemetry spans for catalog processing diff --git a/.changeset/stale-wombats-talk.md b/.changeset/stale-wombats-talk.md new file mode 100644 index 0000000000..f4e0b852f8 --- /dev/null +++ b/.changeset/stale-wombats-talk.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-aws': patch +--- + +Added option to configure AWS `accountId` in `AwsS3EntityProvider` diff --git a/.changeset/tough-dolphins-care.md b/.changeset/tough-dolphins-care.md new file mode 100644 index 0000000000..7d9739ec10 --- /dev/null +++ b/.changeset/tough-dolphins-care.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-gcp': minor +--- + +Added GCP catalog plugin with GKE provider diff --git a/.changeset/wild-timers-sparkle.md b/.changeset/wild-timers-sparkle.md new file mode 100644 index 0000000000..3df14f3a69 --- /dev/null +++ b/.changeset/wild-timers-sparkle.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-microsoft-calendar': patch +--- + +README update - example of apiRef definition and fixed component name diff --git a/ADOPTERS.md b/ADOPTERS.md index 926c303313..9c76b01ff3 100644 --- a/ADOPTERS.md +++ b/ADOPTERS.md @@ -254,3 +254,5 @@ _You can do this by using the [Adopter form](https://info.backstage.spotify.com/ | [Celonis](https://celonis.com) | [@georgeyord](https://github.com/georgeyord), [@LauraMoraB](https://github.com/LauraMoraB), [@mariosant](https://github.com/mariosant), [@Rbillon59](https://github.com/Rbillon59) | Internal developer and product portal implementation. | | [Rabobank](https://www.rabobank.com) | [Willem Dekker](https://github.com/wdekker), [Sridhar Gnanasekaran](https://github.com/srid99), [Ruben Ernst](https://github.com/Ruben-E) | At Rabobank, our mission is to make life better for engineers. After exploring various options in the market, we've discovered that Backstage provides the perfect foundation for creating a platform that meets our engineers' needs and helps us achieve our goals. We want to make our engineers happy by offering standardized services, freeing them up to focus on delivering value. Our vision is to create a one-stop platform where engineers can find everything related to software and services. In practice, we're excited about using all the cool features in Backstage, and we're even planning to build our own plugins. | | [JB Hi-Fi](https://www.jbhifi.com.au) | [@bahman](https://github.com/bahman-jb/) | We use Backstage as a central place for all of our components/apis across multiple teams. It helps us to quickly identify the ownership of a component/api, find the related links and have a quick access to CI/CD pipelines. | +| [Zenklub](https://www.zenklub.com.br) | [@zenklub](https://github.com/zenklub), [@gioufop](https://github.com/gioufop) | Developer portal, services catalog and centralization of metrics from Grafana Stack and AWS. Furthermore, centralization of documentation and infra details like Tools, Network services and so on. | +| [Platzi](https://platzi.com/) | [@juancarestre](https://github.com/juancarestre/), [Engineering at Platzi](https://github.com/PlatziDev/) | Backstage allow our developers to get easily engaged with all the internal components, technical documentations and software templates. All new developers reduce its onboarding time via Backstage, and after a couple of integrations it allowed us to create new components with in a couple of clicks. | diff --git a/app-config.yaml b/app-config.yaml index 2b562ee689..8dcd052e61 100644 --- a/app-config.yaml +++ b/app-config.yaml @@ -211,7 +211,7 @@ integrations: # clientEmail: 'example@example.com' # privateKey: ${GCS_PRIVATE_KEY} awsS3: - - host: amazonaws.com + - endpoint: ${AWS_S3_ENDPOINT} accessKeyId: ${AWS_ACCESS_KEY_ID} secretAccessKey: ${AWS_SECRET_ACCESS_KEY} @@ -352,8 +352,6 @@ auth: metadataUrl: ${AUTH_OIDC_METADATA_URL} clientId: ${AUTH_OIDC_CLIENT_ID} clientSecret: ${AUTH_OIDC_CLIENT_SECRET} - authorizationUrl: ${AUTH_OIDC_AUTH_URL} - tokenUrl: ${AUTH_OIDC_TOKEN_URL} tokenEndpointAuthMethod: ${AUTH_OIDC_TOKEN_ENDPOINT_AUTH_METHOD} # default='client_secret_basic' tokenSignedResponseAlg: ${AUTH_OIDC_TOKEN_SIGNED_RESPONSE_ALG} # default='RS256' scope: ${AUTH_OIDC_SCOPE} # default='openid profile email' @@ -434,8 +432,10 @@ costInsights: kind: 'PINTS_OF_ICE_CREAM' unit: 'ice cream pint' rate: 5.5 -pagerduty: + +pagerDuty: eventsBaseUrl: 'https://events.pagerduty.com/v2' + jenkins: instances: - name: default diff --git a/contrib/docs/tutorials/aws-alb-aad-oidc-auth.md b/contrib/docs/tutorials/aws-alb-aad-oidc-auth.md index 1bdf9cc367..f28a62c018 100644 --- a/contrib/docs/tutorials/aws-alb-aad-oidc-auth.md +++ b/contrib/docs/tutorials/aws-alb-aad-oidc-auth.md @@ -58,6 +58,7 @@ When using ALB authentication Backstage will only be loaded once the user has su import React from 'react'; import { UserIdentity } from '@backstage/core-components'; import { SignInPageProps } from '@backstage/core-app-api'; +import { useApi, configApiRef } from '@backstage/core-plugin-api'; const SampleSignInComponent: any = (props: SignInPageProps) => { const [error, setError] = React.useState(); @@ -90,8 +91,8 @@ const SampleSignInComponent: any = (props: SignInPageProps) => { }, }), ); - } catch (err) { - setError(err.message); + } catch (err: any) { + setError(err.message as string); } } }, [config]); @@ -135,12 +136,14 @@ export default async function createPlugin({ database, config, discovery, + tokenManager, }: PluginEnvironment): Promise { return await createRouter({ logger, config, database, discovery, + tokenManager, providerFactories: { awsalb: providers.awsAlb.create({ authHandler: async ({ fullProfile }) => { @@ -168,25 +171,29 @@ export default async function createPlugin({ }; }, signIn: { - resolver: async ({ profile: { email } }, ctx) => { - const [id] = email?.split('@') ?? ''; - // Fetch from an external system that returns entity claims like: - // ['user:default/breanna.davison', ...] - const userEntityRef = stringifyEntityRef({ + resolver: async ({ profile }, ctx) => { + if (!profile.email) { + throw new Error('Profile contained no email'); + } + + const [id] = profile.email.split('@'); + if (!id) { + throw new Error('Invalid email format'); + } + + const userRef = stringifyEntityRef({ kind: 'User', - namespace: DEFAULT_NAMESPACE, name: id, + namespace: DEFAULT_NAMESPACE, }); - // Resolve group membership from the Backstage catalog - const fullEnt = - await ctx.catalogIdentityClient.resolveCatalogMembership({ - entityRefs: [id].concat([userEntityRef]), - logger: ctx.logger, - }); - const token = await ctx.tokenIssuer.issueToken({ - claims: { sub: userEntityRef, ent: fullEnt }, + const { token } = await ctx.issueToken({ + claims: { + sub: userRef, + ent: [userRef], + }, }); + return { id, token }; }, }, diff --git a/docs/backend-system/architecture/01-index.md b/docs/backend-system/architecture/01-index.md index aff730b0d1..256d43bc4c 100644 --- a/docs/backend-system/architecture/01-index.md +++ b/docs/backend-system/architecture/01-index.md @@ -59,7 +59,7 @@ Just like plugins, modules also have access to services and can depend on their A detailed explanation of the package architecture can be found in the [Backstage Architecture -Overview](../../overview/architecture-overview.md#package-architecture). The +Overview](../../overview/architecture-overview/#package-architecture). The most important packages to consider for this system are the following: - `plugin--backend` houses the implementation of the backend plugins diff --git a/docs/backend-system/architecture/02-backends.md b/docs/backend-system/architecture/02-backends.md index b6079d71b4..70ea8f7836 100644 --- a/docs/backend-system/architecture/02-backends.md +++ b/docs/backend-system/architecture/02-backends.md @@ -37,4 +37,4 @@ At a high level, when you call `createBackend`, it will create a new backend ins Underneath the hood, `createBackend` calls `createSpecializedBackend` from `@backstage/backend-app-api` which is responsible for actually creating the backend instance, but with no services or no features. You can think of `createBackend` more of a 'batteries included' approach, and `createSpecializedBackend` a little more low level. -As mentioned previously there's also the ability to create multiple of these backends in your project so that you can split apart your backend and deploy different backends that can scale independently of each other. For instance you might choose to deploy a backend with only the catalog plugin enabled, and one with just the scaffolder plugin enabled. We've provided some tools to be able to share services and defaults across your backend system, and you can find out more about that in the [shared environments docs](../building-backends/01-index.md#shared-environments). +As mentioned previously there's also the ability to create multiple of these backends in your project so that you can split apart your backend and deploy different backends that can scale independently of each other. For instance you might choose to deploy a backend with only the catalog plugin enabled, and one with just the scaffolder plugin enabled. diff --git a/docs/backend-system/building-backends/01-index.md b/docs/backend-system/building-backends/01-index.md index 66bf68ab07..0f23ae0006 100644 --- a/docs/backend-system/building-backends/01-index.md +++ b/docs/backend-system/building-backends/01-index.md @@ -148,35 +148,3 @@ backend.start(); ``` We've now split the backend into two separate deployments, but we still need to make sure that they can communicate with each other. This is the hard and somewhat tedious part, as Backstage currently doesn't provide an out of the box solution that solves this. You'll need to manually configure the two backends with custom implementations of the `DiscoveryService` and have them return the correct URLs for each other. Likewise, you'll also need to provide a custom implementation of the `DiscoveryApi` in the frontend, unless you surface the two backends via a proxy that handles the routing instead. - -### Shared Environments - -To make it a bit easier to manage multiple backends, it's possible to create a shared environment that can be used across multiple backends. You would typically house it in a separate package that can be referenced by backends in your monorepo, or published to a package registry for broader use. - -A shared environment contains a set of service implementations that should be used across all backends. These services will override the default ones, but if a service is provided directly to the backend, it will override the one in the shared environment. - -A shared environment is defined using `createSharedEnvironment`. In this example we place it in a new and separate package called `backend-env`: - -```ts -// packages/backend-env/src/index.ts -import { createSharedEnvironment } from '@backstage/backend-plugin-api'; -import { customDiscoveryServiceFactory } from './customDiscoveryServiceFactory'; - -export const env = createSharedEnvironment({ - services: [ - customDiscoveryServiceFactory(), // custom DiscoveryService implementation - ], -}); -``` - -And passed on to backends using the `env` option: - -```ts -// packages/backend-b/src/index.ts, imports omitted -import { env } from '@internal/backend-env'; - -const backend = createBackend({ env }); - -backend.add(scaffolderPlugin()); -backend.start(); -``` diff --git a/docs/features/search/how-to-guides.md b/docs/features/search/how-to-guides.md index 7de37cb624..382221d781 100644 --- a/docs/features/search/how-to-guides.md +++ b/docs/features/search/how-to-guides.md @@ -51,7 +51,7 @@ The TechDocs plugin has supported integrations to Search, meaning that it provides a default collator factory ready to be used. The purpose of this guide is to walk you through how to register the -[DefaultTechDocsCollatorFactory](https://github.com/backstage/backstage/blob/de294ce5c410c9eb56da6870a1fab795268f60e3/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts) +[DefaultTechDocsCollatorFactory](https://github.com/backstage/backstage/blob/1adc2c7/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.ts) in your App, so that you can get TechDocs documents indexed. If you have been through the @@ -61,10 +61,10 @@ so, you can go ahead and follow this guide - if not, start by going through the getting started guide. 1. Import the `DefaultTechDocsCollatorFactory` from - `@backstage/plugin-techdocs-backend`. + `@backstage/plugin-search-backend-module-techdocs`. ```typescript - import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-techdocs-backend'; + import { DefaultTechDocsCollatorFactory } from '@backstage/plugin-search-backend-module-techdocs'; ``` 2. If there isn't an existing schedule you'd like to run the collator on, be diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index 4ddb0413b0..235d93ab03 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -23,6 +23,7 @@ catalog: host: gitlab-host # Identifies one of the hosts set up in the integrations branch: main # Optional. Used to discover on a specific branch fallbackBranch: main # Optional. Fallback to be used if there is no default branch configured at the Gitlab repository. It is only used, if `branch` is undefined. Uses `master` as default + skipForkedRepos: false # Optional. If the project is a fork, skip repository group: example-group # Optional. Group and subgroup (if needed) to look for repositories. If not present the whole instance will be scanned entityFilename: catalog-info.yaml # Optional. Defaults to `catalog-info.yaml` projectPattern: '[\s\S]*' # Optional. Filters found projects based on provided patter. Defaults to `[\s\S]*`, which means to not filter anything diff --git a/microsite/blog/2023-02-15-backend-system-alpha.mdx b/microsite/blog/2023-02-15-backend-system-alpha.mdx index 2aef5596a0..28ff7bdf6b 100644 --- a/microsite/blog/2023-02-15-backend-system-alpha.mdx +++ b/microsite/blog/2023-02-15-backend-system-alpha.mdx @@ -26,7 +26,6 @@ When we set out on this project, we had a few primary goals. First, we intended - Make it easier to create and maintain backend installations. - Align how plugins provide points of customization and how those customizations are installed. - Make it much easier to maintain plugins, in particular keeping the API stable. -- Simplify the process of splitting plugins out into separate deployments with shared environments. - Improve the local development and testing experience. Prioritizing simplicity is often a guiding principle that we use for designs that span multiple ownership roles. We decide on which parts of the system that we think are the most important to have as simple as possible, or, viewed from the opposite end, where in the system we put necessary complexity. In this case, we optimized for keeping the backend setup as simple as possible, followed by modules and plugins, then libraries, and lastly the framework itself. What this guidance means in practice is that when there is complexity that needs to be added to implement a certain feature, we place as much of it as possible within the framework itself, then libraries, plugins and modules, and if absolutely needed, the backend setup. diff --git a/microsite/blog/2023-07-28-frontside-adopter-post.mdx b/microsite/blog/2023-07-28-frontside-adopter-post.mdx new file mode 100644 index 0000000000..c6f3cba403 --- /dev/null +++ b/microsite/blog/2023-07-28-frontside-adopter-post.mdx @@ -0,0 +1,51 @@ +--- +# prettier-ignore +title: "Five common traits of successful Backstage adopters" +author: Taras Mankovski, CXO, Frontside +--- + +![backstage header](assets/2023-07-28/header.png) + +At [Frontside](https://frontside.com/), our goal is to help cloud-native teams create cohesive development experiences. We've been at the Backstage party since the beginning helping companies adopt and extend Backstage to fit the needs of their unique ecosystems. + +Through our experience, we've uncovered five common traits of organizations that have improved developer experience through successful Backstage implementation and adoption. In this blog, we'll dive into these traits with some thoughts on how you can follow their blueprint. + +{/* truncate */} + +## **1) They take a product-centric approach** + +The biggest factor for successful adopters of Backstage is their approach. There is a high correlation of success within organizations that approach building a developer portal like they're building a product. Some organizations will jump straight into solutioning instead of taking their time to identify what the problems are, how they affect users, and how those issues can be addressed. + +The team building out Backstage should assess or work from existing insights on the core challenges that developers are facing in their organization — both qualitative and quantitative data counts here — and connect those issues to a product roadmap with initial use cases and adoption milestones marked. By doing their research in advance, successful orgs have a clear vision of what they want to accomplish with their Backstage instance. They know exactly what goals need to be met and have pressure-tested potential issues and barriers. + +If you've already started your Backstage adoption journey but haven't mapped a Product Requirements Document (or PRD), don't panic! There is always time to do the foundational knowledge-building necessary to deploy something successful. + +## **2) They tie Backstage to a larger platform journey** + +Platform engineering has emerged in response to the growing complexity of cloud-native software architecture. Backstage has a huge role to play in implementing a platform strategy but its part of a larger story. Having buy-in from both higher ups and the teams tasked with platform goals is an essential step in successful Backstage adoption. Without the support at the top, it can be difficult to implement platforming as a priority within your organization. + +And by "the top", we don't necessarily mean your CTO needs to rubber stamp your Backstage POC. But it's important that higher-level Platform goals have been set among VPs and directors with the understanding that a well-constructed developer portal can be the catalyst to achieving not only better developer experience but broader cultural shifts. + +Having this kind of executive buy-in means more than just getting stakeholders on board with a portal build or clearing pathways towards Backstage adoption; it also means ensuring they understand the realities of your organization's journey. + +## **3) They prioritize developer experience** + +Having a dedicated developer experience or DevOps team tasked not only with building out a Backstage instance — but with leading adoption — is another big factor to success. + +Competing platforms are very common at big companies, with many teams doing different things or serving different parts of a business. But developer experience teams usually have a very clear mandate and are often one of the only commonalities between these competing teams. This team should have the bandwidth available to oversee the adoption process from start to finish, and partner with the right folks (research, design, internal comms and marketing) to create an effective adoption plan tailored specifically for a company's needs. + +If you don't have ‌established developer experience resources in place, then the questions the team leading the Backstage work needs to ask are "what are the common problems to be solved at a platform level?" and "once we've proved our initial use cases, how are we internally evangelizing this amongst our competing teams?" + +## **4) They collaborate with other platform teams** + +A developer experience team can not single-handedly transform an organization's development structures, processes, and culture. It requires collaboration with teams responsible for other aspects of the platform. Successful adopters collaborate with other teams to bring them along on the journey of improving developer experience. They use Backstage as an opportunity to foster their inner-source contribution practice by allowing multiple platform teams to contribute plugins to their portal. + +The developer experience team takes on the role of host in that collaborative process. They support other teams in integrating their features into the portal, provide guidance on best practices, and advocate for the needs of developers. + +## **5) They engage, learn, and grow with the community** + +One of the key benefits of building a developer platform based off an open source framework is leveraging the contributions and best practices from the community. The Backstage community is the largest gathering of developer experience practitioners in the world. There are now [thousands of adopters](https://github.com/backstage/backstage/blob/63aa3a65ec05f638ba76c06878d6635194620b34/ADOPTERS.md#L4) with a wealth of experience and best practices to learn from — and they are excited to share! + +By participating in the community, developer experience leaders can learn from their peers at other companies about strategies that work and can keep up with the latest features of the ever-evolving Backstage platform. They're aware of what solutions exist within the open source framework and plugin marketplace as well as what they may need to build in-house. + +In short, successful Backstage adopters engage within the Backstage community and their peer group to find solutions that fit their common challenges as well as their unique needs. diff --git a/microsite/blog/assets/2023-07-28/header.png b/microsite/blog/assets/2023-07-28/header.png new file mode 100644 index 0000000000..69036b6038 Binary files /dev/null and b/microsite/blog/assets/2023-07-28/header.png differ diff --git a/packages/app/package.json b/packages/app/package.json index 3163995632..96cbf0c1c5 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -6,6 +6,12 @@ "role": "frontend" }, "bundled": true, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/app" + }, "dependencies": { "@backstage/app-defaults": "workspace:^", "@backstage/catalog-model": "workspace:^", diff --git a/packages/backend-common/config.d.ts b/packages/backend-common/config.d.ts index 3fd886874e..e5b193c543 100644 --- a/packages/backend-common/config.d.ts +++ b/packages/backend-common/config.d.ts @@ -77,17 +77,17 @@ export interface Config { */ connection: | string - | Partial<{ + | { /** * Password that belongs to the client User * @visibility secret */ - password: string; + password?: string; /** * Other connection settings */ [key: string]: unknown; - }>; + }; /** Database name prefix override */ prefix?: string; /** diff --git a/packages/backend-defaults/api-report.md b/packages/backend-defaults/api-report.md index 07218f610e..6cc58de663 100644 --- a/packages/backend-defaults/api-report.md +++ b/packages/backend-defaults/api-report.md @@ -5,15 +5,12 @@ ```ts import { Backend } from '@backstage/backend-app-api'; import { ServiceFactoryOrFunction } from '@backstage/backend-plugin-api'; -import { SharedBackendEnvironment } from '@backstage/backend-plugin-api'; // @public (undocumented) export function createBackend(options?: CreateBackendOptions): Backend; // @public (undocumented) export interface CreateBackendOptions { - // (undocumented) - env?: SharedBackendEnvironment; // (undocumented) services?: ServiceFactoryOrFunction[]; } diff --git a/packages/backend-defaults/src/CreateBackend.test.ts b/packages/backend-defaults/src/CreateBackend.test.ts index 946de90b2b..de04d4e350 100644 --- a/packages/backend-defaults/src/CreateBackend.test.ts +++ b/packages/backend-defaults/src/CreateBackend.test.ts @@ -16,17 +16,10 @@ import { coreServices, - createBackendPlugin, createServiceFactory, - createServiceRef, - createSharedEnvironment, } from '@backstage/backend-plugin-api'; -import { mockServices } from '@backstage/backend-test-utils'; import { createBackend } from './CreateBackend'; -const fooServiceRef = createServiceRef({ id: 'foo', scope: 'root' }); -const barServiceRef = createServiceRef({ id: 'bar', scope: 'root' }); - describe('createBackend', () => { it('should not throw when overriding a default service implementation', () => { expect(() => @@ -85,91 +78,4 @@ describe('createBackend', () => { }), ).toThrow('The core.pluginMetadata service cannot be overridden'); }); - - it('should throw if an unsupported InternalSharedEnvironment version is passed in', () => { - expect(() => - createBackend({ - env: {} as any, - }), - ).toThrow( - "Shared environment version 'undefined' is invalid or not supported", - ); - expect(() => - createBackend({ - env: { version: {} } as any, - }), - ).toThrow( - "Shared environment version '[object Object]' is invalid or not supported", - ); - expect(() => - createBackend({ - env: { version: 'v2' } as any, - }), - ).toThrow("Shared environment version 'v2' is invalid or not supported"); - }); - - it('should prioritize services correctly', async () => { - const backend = createBackend({ - env: createSharedEnvironment({ - services: [ - createServiceFactory({ - service: coreServices.rootHttpRouter, - deps: {}, - async factory() { - return { - use() {}, - }; - }, - }), - mockServices.config.factory({ - data: { root: 'root-env' }, - }), - createServiceFactory({ - service: fooServiceRef, - deps: {}, - async factory() { - return 'foo-env'; - }, - }), - createServiceFactory({ - service: barServiceRef, - deps: {}, - async factory() { - return 'bar-env'; - }, - }), - ], - })(), - services: [ - createServiceFactory({ - service: fooServiceRef, - deps: {}, - factory: async () => 'foo-backend', - }), - ], - }); - - expect.assertions(3); - backend.add( - createBackendPlugin({ - pluginId: 'test', - register(reg) { - reg.registerInit({ - deps: { - config: coreServices.config, - foo: fooServiceRef, - bar: barServiceRef, - }, - async init({ config, foo, bar }) { - expect(config.get('root')).toBe('root-env'); - expect(foo).toBe('foo-backend'); - expect(bar).toBe('bar-env'); - }, - }); - }, - })(), - ); - - await backend.start(); - }); }); diff --git a/packages/backend-defaults/src/CreateBackend.ts b/packages/backend-defaults/src/CreateBackend.ts index 480f365216..7051b58ae5 100644 --- a/packages/backend-defaults/src/CreateBackend.ts +++ b/packages/backend-defaults/src/CreateBackend.ts @@ -36,13 +36,8 @@ import { import { ServiceFactory, ServiceFactoryOrFunction, - SharedBackendEnvironment, } from '@backstage/backend-plugin-api'; -// Internal import of the type to avoid needing to export this. -// eslint-disable-next-line @backstage/no-forbidden-package-imports -import type { InternalSharedBackendEnvironment } from '@backstage/backend-plugin-api/src/wiring/createSharedEnvironment'; - export const defaultServiceFactories = [ cacheServiceFactory(), configServiceFactory(), @@ -65,7 +60,6 @@ export const defaultServiceFactories = [ * @public */ export interface CreateBackendOptions { - env?: SharedBackendEnvironment; services?: ServiceFactoryOrFunction[]; } @@ -81,22 +75,6 @@ export function createBackend(options?: CreateBackendOptions): Backend { ); services.push(...providedServices); - // Middle priority: Services from the shared environment - if (options?.env) { - const env = options.env as unknown as InternalSharedBackendEnvironment; - if (env.version !== 'v1') { - throw new Error( - `Shared environment version '${env.version}' is invalid or not supported`, - ); - } - - const environmentServices = - env.services?.filter( - sf => !services.some(({ service }) => sf.service.id === service.id), - ) ?? []; - services.push(...environmentServices); - } - // Lowest priority: Default services that are not already provided by environment or directly to createBackend const defaultServices = defaultServiceFactories.filter( sf => !services.some(({ service }) => service.id === sf.service.id), diff --git a/packages/backend-openapi-utils/package.json b/packages/backend-openapi-utils/package.json index 85a1677adb..9c83356c83 100644 --- a/packages/backend-openapi-utils/package.json +++ b/packages/backend-openapi-utils/package.json @@ -11,6 +11,12 @@ "module": "dist/index.esm.js", "types": "dist/index.d.ts" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/backend-openapi-utils" + }, "backstage": { "role": "node-library" }, diff --git a/packages/backend-plugin-api/api-report.md b/packages/backend-plugin-api/api-report.md index b3cbef993c..093b4acec4 100644 --- a/packages/backend-plugin-api/api-report.md +++ b/packages/backend-plugin-api/api-report.md @@ -222,15 +222,6 @@ export function createServiceRef( config: ServiceRefConfig, ): ServiceRef; -// @public -export function createSharedEnvironment< - TOptions extends [options?: object] = [], ->( - config: - | SharedBackendEnvironmentConfig - | ((...params: TOptions) => SharedBackendEnvironmentConfig), -): (...options: TOptions) => SharedBackendEnvironment; - // @public export interface DatabaseService { getClient(): Promise; @@ -476,18 +467,6 @@ export interface ServiceRefConfig { scope?: TScope; } -// @public -export interface SharedBackendEnvironment { - // (undocumented) - $$type: '@backstage/SharedBackendEnvironment'; -} - -// @public -export interface SharedBackendEnvironmentConfig { - // (undocumented) - services?: ServiceFactoryOrFunction[]; -} - // @public export interface TokenManagerService { authenticate(token: string): Promise; diff --git a/packages/backend-plugin-api/src/wiring/createSharedEnvironment.test.ts b/packages/backend-plugin-api/src/wiring/createSharedEnvironment.test.ts deleted file mode 100644 index 381a4799d2..0000000000 --- a/packages/backend-plugin-api/src/wiring/createSharedEnvironment.test.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2023 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. - */ - -import { - createServiceFactory, - createServiceRef, - ServiceFactoryOrFunction, -} from '../services'; -import { - createSharedEnvironment, - InternalSharedBackendEnvironment, -} from './createSharedEnvironment'; - -const fooService = createServiceRef({ id: 'foo', scope: 'root' }); -const fooFactory = createServiceFactory({ - service: fooService, - deps: {}, - async factory() { - return 'foo'; - }, -}); - -const barService = createServiceRef({ id: 'bar', scope: 'root' }); -const barFactory = createServiceFactory({ - service: barService, - deps: {}, - async factory() { - return 0xba5; - }, -}); - -describe('createSharedEnvironment', () => { - it('should create an empty shared environment', () => { - const env = createSharedEnvironment({}); - expect(env).toBeDefined(); - const internalEnv = env() as unknown as InternalSharedBackendEnvironment; - expect(internalEnv).toEqual({ - $$type: '@backstage/SharedBackendEnvironment', - version: 'v1', - services: undefined, - }); - }); - - it('should create a shared environment with services', () => { - const env = createSharedEnvironment({ - services: [fooFactory, barFactory()], - }); - const internalEnv = env() as unknown as InternalSharedBackendEnvironment; - expect(internalEnv.version).toBe('v1'); - expect(internalEnv.services?.length).toBe(2); - expect(internalEnv.services?.[0]?.service.id).toBe('foo'); - expect(internalEnv.services?.[1]?.service.id).toBe('bar'); - }); - - it('should create a shared environment with options', () => { - const env = createSharedEnvironment((options?: { withFoo?: boolean }) => { - const services = new Array(); - if (options?.withFoo) { - services.push(fooFactory()); - } - services.push(barFactory); - return { services }; - }); - const internalEnv1 = env() as unknown as InternalSharedBackendEnvironment; - expect(internalEnv1.version).toBe('v1'); - expect(internalEnv1.services?.length).toBe(1); - expect(internalEnv1.services?.[0]?.service.id).toBe('bar'); - - const internalEnv2 = env({ - withFoo: true, - }) as unknown as InternalSharedBackendEnvironment; - expect(internalEnv2.version).toBe('v1'); - expect(internalEnv2.services?.length).toBe(2); - expect(internalEnv2.services?.[0]?.service.id).toBe('foo'); - expect(internalEnv2.services?.[1]?.service.id).toBe('bar'); - }); - - it('should not allow duplicate service factories', () => { - expect(() => - createSharedEnvironment({ - services: [fooFactory, fooFactory()], - })(), - ).toThrow( - "Duplicate service implementations provided in shared environment for 'foo'", - ); - }); -}); diff --git a/packages/backend-plugin-api/src/wiring/createSharedEnvironment.ts b/packages/backend-plugin-api/src/wiring/createSharedEnvironment.ts deleted file mode 100644 index 57f0533523..0000000000 --- a/packages/backend-plugin-api/src/wiring/createSharedEnvironment.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2023 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. - */ - -import { ServiceFactory, ServiceFactoryOrFunction } from '../services'; - -/** - * The configuration options passed to {@link createSharedEnvironment}. - * - * @public - */ -export interface SharedBackendEnvironmentConfig { - services?: ServiceFactoryOrFunction[]; -} - -/** - * An opaque type that represents the contents of a shared backend environment. - * - * @public - */ -export interface SharedBackendEnvironment { - $$type: '@backstage/SharedBackendEnvironment'; - - // NOTE: This type is opaque in order to allow for future API evolution without - // cluttering the external API. For example we might want to add support - // for more powerful callback based backend modifications. - // - // By making this opaque we also ensure that the type doesn't become an input - // type that we need to care about, as it would otherwise be possible to pass - // a custom environment definition to `createBackend`, which we don't want. -} - -/** - * This type is NOT supposed to be used by anyone except internally by the - * backend-app-api package. - * - * @internal - */ -export interface InternalSharedBackendEnvironment { - version: 'v1'; - services?: ServiceFactory[]; -} - -/** - * Creates a shared backend environment which can be used to create multiple - * backends. - * - * @public - */ -export function createSharedEnvironment< - TOptions extends [options?: object] = [], ->( - config: - | SharedBackendEnvironmentConfig - | ((...params: TOptions) => SharedBackendEnvironmentConfig), -): (...options: TOptions) => SharedBackendEnvironment { - const configCallback = typeof config === 'function' ? config : () => config; - - return (...options) => { - const actualConfig = configCallback(...options); - const services = actualConfig?.services?.map(sf => - typeof sf === 'function' ? sf() : sf, - ); - - const exists = new Set(); - const duplicates = new Set(); - for (const { service } of services ?? []) { - if (exists.has(service.id)) { - duplicates.add(service.id); - } else { - exists.add(service.id); - } - } - - if (duplicates.size > 0) { - const dupStr = [...duplicates].map(id => `'${id}'`).join(', '); - throw new Error( - `Duplicate service implementations provided in shared environment for ${dupStr}`, - ); - } - - // Here to ensure type safety in this internal implementation. - const env: SharedBackendEnvironment & InternalSharedBackendEnvironment = { - $$type: '@backstage/SharedBackendEnvironment', - version: 'v1', - services, - }; - return env; - }; -} diff --git a/packages/backend-plugin-api/src/wiring/index.ts b/packages/backend-plugin-api/src/wiring/index.ts index 242301ea4d..9cb767b8ac 100644 --- a/packages/backend-plugin-api/src/wiring/index.ts +++ b/packages/backend-plugin-api/src/wiring/index.ts @@ -14,11 +14,6 @@ * limitations under the License. */ -export { createSharedEnvironment } from './createSharedEnvironment'; -export type { - SharedBackendEnvironment, - SharedBackendEnvironmentConfig, -} from './createSharedEnvironment'; export type { BackendModuleConfig, BackendPluginConfig, diff --git a/packages/cli-node/package.json b/packages/cli-node/package.json index c59a8930c0..b5ba1855a8 100644 --- a/packages/cli-node/package.json +++ b/packages/cli-node/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/cli-node" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/packages/config-loader/src/schema/collect.ts b/packages/config-loader/src/schema/collect.ts index ac3e4af341..7120c12d90 100644 --- a/packages/config-loader/src/schema/collect.ts +++ b/packages/config-loader/src/schema/collect.ts @@ -15,6 +15,7 @@ */ import fs from 'fs-extra'; +import { EOL } from 'os'; import { resolve as resolvePath, relative as relativePath, @@ -163,7 +164,7 @@ async function compileTsSchemas(paths: string[]) { // Lazy loaded, because this brings up all of TypeScript and we don't // want that eagerly loaded in tests - const { getProgramFromFiles, generateSchema } = await import( + const { getProgramFromFiles, buildGenerator } = await import( 'typescript-json-schema' ); @@ -183,17 +184,40 @@ async function compileTsSchemas(paths: string[]) { const tsSchemas = paths.map(path => { let value; try { - value = generateSchema( + const generator = buildGenerator( program, - // All schemas should export a `Config` symbol - 'Config', // This enables the use of these tags in TSDoc comments { required: true, validationKeywords: ['visibility', 'deepVisibility', 'deprecated'], }, [path.split(sep).join('/')], // Unix paths are expected for all OSes here - ) as JsonObject | null; + ); + + // All schemas should export a `Config` symbol + value = generator?.getSchemaForSymbol('Config') as JsonObject | null; + + // This makes sure that no additional symbols are defined in the schema. We don't allow + // this because they share a global namespace and will be merged together, leading to + // unpredictable behavior. + const userSymbols = new Set(generator?.getUserSymbols()); + userSymbols.delete('Config'); + if (userSymbols.size !== 0) { + const names = Array.from(userSymbols).join("', '"); + throw new Error( + `Invalid configuration schema in ${path}, additional symbol definitions are not allowed, found '${names}'`, + ); + } + + // This makes sure that no unsupported types are used in the schema, for example `Record<,>`. + // The generator will extract these as a schema reference, which will in turn be broken for our usage. + const reffedDefs = Object.keys(generator?.ReffedDefinitions ?? {}); + if (reffedDefs.length !== 0) { + const lines = reffedDefs.join(`${EOL} `); + throw new Error( + `Invalid configuration schema in ${path}, the following definitions are not supported:${EOL}${EOL} ${lines}`, + ); + } } catch (error) { assertError(error); if (error.message !== 'type Config not found') { diff --git a/packages/integration-react/package.json b/packages/integration-react/package.json index 616826b430..b39d4fcb0c 100644 --- a/packages/integration-react/package.json +++ b/packages/integration-react/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "web-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/integration-react" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index 3bbef65e68..1b6af7f9e9 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -6,6 +6,12 @@ "role": "frontend" }, "bundled": true, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/techdocs-cli-embedded-app" + }, "dependencies": { "@backstage/app-defaults": "workspace:^", "@backstage/catalog-model": "workspace:^", diff --git a/plugins/adr/package.json b/plugins/adr/package.json index 486ea800a2..b032ccad7b 100644 --- a/plugins/adr/package.json +++ b/plugins/adr/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/adr" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/airbrake-backend/package.json b/plugins/airbrake-backend/package.json index 06e5183a44..226126531b 100644 --- a/plugins/airbrake-backend/package.json +++ b/plugins/airbrake-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/airbrake-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/airbrake/package.json b/plugins/airbrake/package.json index 48a825f93b..8a156c775d 100644 --- a/plugins/airbrake/package.json +++ b/plugins/airbrake/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/airbrake" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/allure/package.json b/plugins/allure/package.json index f4809128ff..7a65d9f707 100644 --- a/plugins/allure/package.json +++ b/plugins/allure/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/allure" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/analytics-module-ga/package.json b/plugins/analytics-module-ga/package.json index 302ee1cd86..8fb8d42a9e 100644 --- a/plugins/analytics-module-ga/package.json +++ b/plugins/analytics-module-ga/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/analytics-module-ga" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/analytics-module-ga4/package.json b/plugins/analytics-module-ga4/package.json index 85f34468b1..09e7240142 100644 --- a/plugins/analytics-module-ga4/package.json +++ b/plugins/analytics-module-ga4/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/plugins/analytics-module-ga4" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/apache-airflow/package.json b/plugins/apache-airflow/package.json index b30abb3bc9..60afaa9a24 100644 --- a/plugins/apache-airflow/package.json +++ b/plugins/apache-airflow/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/apache-airflow" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/apollo-explorer/package.json b/plugins/apollo-explorer/package.json index 0b43fd63ba..b9eba3278d 100644 --- a/plugins/apollo-explorer/package.json +++ b/plugins/apollo-explorer/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/apollo-explorer" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/auth-backend/config.d.ts b/plugins/auth-backend/config.d.ts index c6579e08f8..d059f2ec04 100644 --- a/plugins/auth-backend/config.d.ts +++ b/plugins/auth-backend/config.d.ts @@ -152,6 +152,8 @@ export interface Config { clientSecret: string; callbackUrl?: string; metadataUrl: string; + tokenEndpointAuthMethod?: string; + tokenSignedResponseAlg?: string; scope?: string; prompt?: string; }; diff --git a/plugins/auth-node/package.json b/plugins/auth-node/package.json index 07b9adacb4..c5846d60b4 100644 --- a/plugins/auth-node/package.json +++ b/plugins/auth-node/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/auth-node" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/azure-devops-backend/package.json b/plugins/azure-devops-backend/package.json index 0a34ab449b..706274df6d 100644 --- a/plugins/azure-devops-backend/package.json +++ b/plugins/azure-devops-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/azure-devops-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/bazaar-backend/package.json b/plugins/bazaar-backend/package.json index 6e960f384c..d41127a9fa 100644 --- a/plugins/bazaar-backend/package.json +++ b/plugins/bazaar-backend/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/bazaar-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build --experimental-type-build", diff --git a/plugins/bazaar/package.json b/plugins/bazaar/package.json index 0536367512..3181e99833 100644 --- a/plugins/bazaar/package.json +++ b/plugins/bazaar/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/bazaar" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/bitbucket-cloud-common/package.json b/plugins/bitbucket-cloud-common/package.json index ffbe670094..38ba256c35 100644 --- a/plugins/bitbucket-cloud-common/package.json +++ b/plugins/bitbucket-cloud-common/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/bitbucket-cloud-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/bitrise/package.json b/plugins/bitrise/package.json index fe7f1f1591..5388bb3542 100644 --- a/plugins/bitrise/package.json +++ b/plugins/bitrise/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/bitrise" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/catalog-backend-module-aws/config.d.ts b/plugins/catalog-backend-module-aws/config.d.ts index b3610ccfc5..4c9c98512e 100644 --- a/plugins/catalog-backend-module-aws/config.d.ts +++ b/plugins/catalog-backend-module-aws/config.d.ts @@ -54,14 +54,19 @@ export interface Config { * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html */ region?: string; + /** + * (Optional) AWS Account id. + * If not set, main account is used. + * @see https://github.com/backstage/backstage/blob/master/packages/integration-aws-node/README.md + */ + accountId?: string; /** * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; } - | Record< - string, - { + | { + [name: string]: { /** * (Required) AWS S3 Bucket Name */ @@ -77,12 +82,18 @@ export interface Config { * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html */ region?: string; + /** + * (Optional) AWS Account id. + * If not set, main account is used. + * @see https://github.com/backstage/backstage/blob/master/packages/integration-aws-node/README.md + */ + accountId?: string; /** * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProvider.ts b/plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProvider.ts index 4a87a42e75..4df92b58c2 100644 --- a/plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProvider.ts +++ b/plugins/catalog-backend-module-aws/src/providers/AwsS3EntityProvider.ts @@ -146,20 +146,22 @@ export class AwsS3EntityProvider implements EntityProvider { /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */ async connect(connection: EntityProviderConnection): Promise { this.connection = connection; - const credProvider = - await this.awsCredentialsManager.getCredentialProvider(); + const { accountId, region, bucketName } = this.config; + const credProvider = await this.awsCredentialsManager.getCredentialProvider( + accountId ? { accountId } : undefined, + ); this.s3 = new S3({ apiVersion: '2006-03-01', credentialDefaultProvider: () => credProvider.sdkCredentialProvider, endpoint: this.integration.config.endpoint, - region: this.config.region, + region, forcePathStyle: this.integration.config.s3ForcePathStyle, }); // https://github.com/aws/aws-sdk-js-v3/issues/4122#issuecomment-1298968804 const endpoint = await getEndpointFromInstructions( { - Bucket: this.config.bucketName, + Bucket: bucketName, }, ListObjectsV2Command, this.s3.config as unknown as Record, diff --git a/plugins/catalog-backend-module-aws/src/providers/config.ts b/plugins/catalog-backend-module-aws/src/providers/config.ts index 5ef2729bf0..1ab52f9fd4 100644 --- a/plugins/catalog-backend-module-aws/src/providers/config.ts +++ b/plugins/catalog-backend-module-aws/src/providers/config.ts @@ -46,6 +46,7 @@ function readAwsS3Config(id: string, config: Config): AwsS3Config { const bucketName = config.getString('bucketName'); const region = config.getOptionalString('region'); const prefix = config.getOptionalString('prefix'); + const accountId = config.getOptionalString('accountId'); const schedule = config.has('schedule') ? readTaskScheduleDefinitionFromConfig(config.getConfig('schedule')) @@ -57,5 +58,6 @@ function readAwsS3Config(id: string, config: Config): AwsS3Config { region, prefix, schedule, + accountId, }; } diff --git a/plugins/catalog-backend-module-aws/src/providers/types.ts b/plugins/catalog-backend-module-aws/src/providers/types.ts index 204fa154c6..8e12b5f096 100644 --- a/plugins/catalog-backend-module-aws/src/providers/types.ts +++ b/plugins/catalog-backend-module-aws/src/providers/types.ts @@ -22,4 +22,5 @@ export type AwsS3Config = { prefix?: string; region?: string; schedule?: TaskScheduleDefinition; + accountId?: string; }; diff --git a/plugins/catalog-backend-module-azure/config.d.ts b/plugins/catalog-backend-module-azure/config.d.ts index 940695c8ea..757ed2bfd3 100644 --- a/plugins/catalog-backend-module-azure/config.d.ts +++ b/plugins/catalog-backend-module-azure/config.d.ts @@ -16,35 +16,6 @@ import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks'; -interface AzureDevOpsConfig { - /** - * (Optional) The DevOps host; leave empty for `dev.azure.com`, otherwise set to your self-hosted instance host. - */ - host: string; - /** - * (Required) Your organization slug. - */ - organization: string; - /** - * (Required) Your project slug. - */ - project: string; - /** - * (Optional) The repository name. Wildcards are supported as show on the examples above. - * If not set, all repositories will be searched. - */ - repository?: string; - /** - * (Optional) Where to find catalog-info.yaml files. Wildcards are supported. - * If not set, defaults to /catalog-info.yaml. - */ - path?: string; - /** - * (Optional) TaskScheduleDefinition for the refresh. - */ - schedule?: TaskScheduleDefinitionConfig; -} - export interface Config { catalog?: { /** @@ -54,7 +25,36 @@ export interface Config { /** * AzureDevopsEntityProvider configuration */ - azureDevOps?: Record; + azureDevOps?: { + [name: string]: { + /** + * (Optional) The DevOps host; leave empty for `dev.azure.com`, otherwise set to your self-hosted instance host. + */ + host: string; + /** + * (Required) Your organization slug. + */ + organization: string; + /** + * (Required) Your project slug. + */ + project: string; + /** + * (Optional) The repository name. Wildcards are supported as show on the examples above. + * If not set, all repositories will be searched. + */ + repository?: string; + /** + * (Optional) Where to find catalog-info.yaml files. Wildcards are supported. + * If not set, defaults to /catalog-info.yaml. + */ + path?: string; + /** + * (Optional) TaskScheduleDefinition for the refresh. + */ + schedule?: TaskScheduleDefinitionConfig; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-bitbucket-cloud/config.d.ts b/plugins/catalog-backend-module-bitbucket-cloud/config.d.ts index 8fa58413c0..fa7c070042 100644 --- a/plugins/catalog-backend-module-bitbucket-cloud/config.d.ts +++ b/plugins/catalog-backend-module-bitbucket-cloud/config.d.ts @@ -45,24 +45,23 @@ export interface Config { */ filters?: { /** - * (Optional) Filter for the repository slug. + * (Optional) Regular expression filter for the repository slug. * @visibility frontend */ - repoSlug?: RegExp; + repoSlug?: string; /** - * (Optional) Filter for the project key. + * (Optional) Regular expression filter for the project key. * @visibility frontend */ - projectKey?: RegExp; + projectKey?: string; }; /** * (Optional) TaskScheduleDefinition for the discovery. */ schedule?: TaskScheduleDefinitionConfig; } - | Record< - string, - { + | { + [name: string]: { /** * (Optional) Path to the catalog file. Default to "/catalog-info.yaml". * @visibility frontend @@ -79,22 +78,22 @@ export interface Config { */ filters?: { /** - * (Optional) Filter for the repository slug. + * (Optional) Regular expression filter for the repository slug. * @visibility frontend */ - repoSlug?: RegExp; + repoSlug?: string; /** - * (Optional) Filter for the project key. + * (Optional) Regular expression filter for the project key. * @visibility frontend */ - projectKey?: RegExp; + projectKey?: string; }; /** * (Optional) TaskScheduleDefinition for the discovery. */ schedule?: TaskScheduleDefinitionConfig; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-bitbucket-server/config.d.ts b/plugins/catalog-backend-module-bitbucket-server/config.d.ts index 67f694d419..57a94550e9 100644 --- a/plugins/catalog-backend-module-bitbucket-server/config.d.ts +++ b/plugins/catalog-backend-module-bitbucket-server/config.d.ts @@ -37,24 +37,23 @@ export interface Config { */ filters?: { /** - * (Optional) Filter for the repository slug. + * (Optional) Regular expression filter for the repository slug. * @visibility frontend */ - repoSlug?: RegExp; + repoSlug?: string; /** - * (Optional) Filter for the project key. + * (Optional) Regular expression filter for the project key. * @visibility frontend */ - projectKey?: RegExp; + projectKey?: string; }; /** * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; } - | Record< - string, - { + | { + [name: string]: { /** * (Optional) Path to the catalog file. Default to "/catalog-info.yaml". * @visibility frontend @@ -66,22 +65,22 @@ export interface Config { */ filters?: { /** - * (Optional) Filter for the repository slug. + * (Optional) Regular expression filter for the repository slug. * @visibility frontend */ - repoSlug?: RegExp; + repoSlug?: string; /** - * (Optional) Filter for the project key. + * (Optional) Regular expression filter for the project key. * @visibility frontend */ - projectKey?: RegExp; + projectKey?: string; }; /** * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-gcp/.eslintrc.js b/plugins/catalog-backend-module-gcp/.eslintrc.js new file mode 100644 index 0000000000..e2a53a6ad2 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/catalog-backend-module-gcp/README.md b/plugins/catalog-backend-module-gcp/README.md new file mode 100644 index 0000000000..d1ef926310 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/README.md @@ -0,0 +1,41 @@ +# Catalog Backend Module for GCP + +This is an extension module to the plugin-catalog-backend plugin, containing catalog processors and providers to ingest GCP resources as `Resource` kind entities. + +## installation + +Register the plugin in `catalog.ts`` + +```typescript +import { GkeEntityProvider } from '@backstage/plugin-catalog-backend-module-gcp'; + +... + +builder.addEntityProvider( + GkeEntityProvider.fromConfig({ + logger: env.logger, + scheduler: env.scheduler, + config: env.config + }) +); +``` + +Update `app-config.yaml` as follows: + +```yaml +catalog: + providers: + gcp: + gke: + parents: + # consult https://cloud.google.com/kubernetes-engine/docs/ for valid values + # list all clusters in the project + - 'projects/some-project/locations/-' + # list all clusters in the region, in the project + - 'projects/some-other-project/locations/some-region' + schedule: # optional; same options as in TaskScheduleDefinition + # supports cron, ISO duration, "human duration" as used in code + frequency: { minutes: 30 } + # supports ISO duration, "human duration" as used in code + timeout: { minutes: 3 } +``` diff --git a/plugins/catalog-backend-module-gcp/alpha-api-report.md b/plugins/catalog-backend-module-gcp/alpha-api-report.md new file mode 100644 index 0000000000..6e6f0427e9 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/alpha-api-report.md @@ -0,0 +1,7 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-gcp" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +``` diff --git a/plugins/catalog-backend-module-gcp/api-report.md b/plugins/catalog-backend-module-gcp/api-report.md new file mode 100644 index 0000000000..6f963ed51d --- /dev/null +++ b/plugins/catalog-backend-module-gcp/api-report.md @@ -0,0 +1,48 @@ +## API Report File for "@backstage/plugin-catalog-backend-module-gcp" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; +import { Config } from '@backstage/config'; +import * as container from '@google-cloud/container'; +import { EntityProvider } from '@backstage/plugin-catalog-node'; +import { EntityProviderConnection } from '@backstage/plugin-catalog-node'; +import { Logger } from 'winston'; +import { SchedulerService } from '@backstage/backend-plugin-api'; + +// @public +export const catalogModuleGcpGkeEntityProvider: () => BackendFeature; + +// @public +export class GkeEntityProvider implements EntityProvider { + // (undocumented) + connect(connection: EntityProviderConnection): Promise; + // (undocumented) + static fromConfig({ + logger, + scheduler, + config, + }: { + logger: Logger; + scheduler: SchedulerService; + config: Config; + }): GkeEntityProvider; + // (undocumented) + static fromConfigWithClient({ + logger, + scheduler, + config, + clusterManagerClient, + }: { + logger: Logger; + scheduler: SchedulerService; + config: Config; + clusterManagerClient: container.v1.ClusterManagerClient; + }): GkeEntityProvider; + // (undocumented) + getProviderName(): string; + // (undocumented) + refresh(): Promise; +} +``` diff --git a/plugins/catalog-backend-module-gcp/config.d.ts b/plugins/catalog-backend-module-gcp/config.d.ts new file mode 100644 index 0000000000..d6884d32ce --- /dev/null +++ b/plugins/catalog-backend-module-gcp/config.d.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2023 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. + */ + +import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks'; + +export interface Config { + catalog?: { + /** + * List of provider-specific options and attributes + */ + providers?: { + /** + * GCPCatalogModuleConfig configuration + */ + gcp?: { + /** + * Config for GKE clusters + */ + gke?: { + /** + * Locations to list clusters from + */ + parents: string[]; + /** + * (Optional) TaskScheduleDefinition for the refresh. + */ + schedule: TaskScheduleDefinitionConfig; + }; + }; + }; + }; +} diff --git a/plugins/catalog-backend-module-gcp/package.json b/plugins/catalog-backend-module-gcp/package.json new file mode 100644 index 0000000000..12285d26eb --- /dev/null +++ b/plugins/catalog-backend-module-gcp/package.json @@ -0,0 +1,66 @@ +{ + "name": "@backstage/plugin-catalog-backend-module-gcp", + "description": "A Backstage catalog backend module that helps integrate towards GCP", + "version": "0.0.0", + "main": "src/index.ts", + "types": "src/index.ts", + "license": "Apache-2.0", + "publishConfig": { + "access": "public" + }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.ts" + ], + "package.json": [ + "package.json" + ] + } + }, + "backstage": { + "role": "backend-plugin-module" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-backend-module-gcp" + }, + "keywords": [ + "backstage" + ], + "scripts": { + "start": "backstage-cli package start", + "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" + }, + "dependencies": { + "@backstage/backend-common": "workspace:^", + "@backstage/backend-plugin-api": "workspace:^", + "@backstage/backend-tasks": "workspace:^", + "@backstage/config": "workspace:^", + "@backstage/plugin-catalog-node": "workspace:^", + "@backstage/plugin-kubernetes-common": "workspace:^", + "@google-cloud/container": "^4.15.0", + "winston": "^3.2.1" + }, + "devDependencies": { + "@backstage/backend-test-utils": "workspace:^", + "@backstage/cli": "workspace:^" + }, + "files": [ + "config.d.ts", + "dist" + ], + "configSchema": "config.d.ts" +} diff --git a/plugins/catalog-backend-module-gcp/src/alpha.ts b/plugins/catalog-backend-module-gcp/src/alpha.ts new file mode 100644 index 0000000000..9eec69e76f --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/alpha.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2023 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 GCP + * + * @packageDocumentation + */ + +export {}; diff --git a/plugins/catalog-backend-module-gcp/src/index.ts b/plugins/catalog-backend-module-gcp/src/index.ts new file mode 100644 index 0000000000..fb3984a04d --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/index.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2023 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 GCP + * + * @packageDocumentation + */ + +export * from './providers'; +export * from './module'; diff --git a/plugins/catalog-backend-module-gcp/src/module/catalogModuleGcpGkeEntityProvider.ts b/plugins/catalog-backend-module-gcp/src/module/catalogModuleGcpGkeEntityProvider.ts new file mode 100644 index 0000000000..c13c6cbe0e --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/module/catalogModuleGcpGkeEntityProvider.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2022 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. + */ + +import { loggerToWinstonLogger } from '@backstage/backend-common'; +import { + coreServices, + createBackendModule, +} from '@backstage/backend-plugin-api'; +import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha'; +import { GkeEntityProvider } from '../providers/GkeEntityProvider'; + +/** + * Registers the GcpGkeEntityProvider with the catalog processing extension point. + * + * @public + */ +export const catalogModuleGcpGkeEntityProvider = createBackendModule({ + pluginId: 'catalog', + moduleId: 'gcpGkeEntityProvider', + register(env) { + env.registerInit({ + deps: { + config: coreServices.config, + catalog: catalogProcessingExtensionPoint, + logger: coreServices.logger, + scheduler: coreServices.scheduler, + }, + async init({ config, catalog, logger, scheduler }) { + catalog.addEntityProvider( + GkeEntityProvider.fromConfig({ + logger: loggerToWinstonLogger(logger), + scheduler, + config, + }), + ); + }, + }); + }, +}); diff --git a/plugins/catalog-backend-module-gcp/src/module/index.ts b/plugins/catalog-backend-module-gcp/src/module/index.ts new file mode 100644 index 0000000000..c7cd310c97 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/module/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 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 { catalogModuleGcpGkeEntityProvider } from './catalogModuleGcpGkeEntityProvider'; diff --git a/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.test.ts b/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.test.ts new file mode 100644 index 0000000000..20e91a85bf --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.test.ts @@ -0,0 +1,251 @@ +/* + * Copyright 2023 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. + */ + +import { GkeEntityProvider } from './GkeEntityProvider'; +import { TaskRunner } from '@backstage/backend-tasks'; +import { + ANNOTATION_KUBERNETES_API_SERVER, + ANNOTATION_KUBERNETES_API_SERVER_CA, + ANNOTATION_KUBERNETES_AUTH_PROVIDER, +} from '@backstage/plugin-kubernetes-common'; +import * as container from '@google-cloud/container'; +import { ConfigReader } from '@backstage/config'; + +describe('GkeEntityProvider', () => { + const clusterManagerClientMock = { + listClusters: jest.fn(), + }; + const connectionMock = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const taskRunner = { + createScheduleFn: jest.fn(), + run: jest.fn(), + } as TaskRunner; + const schedulerMock = { + createScheduledTaskRunner: jest.fn(), + } as any; + const logger = { + info: jest.fn(), + error: jest.fn(), + }; + let gkeEntityProvider: GkeEntityProvider; + + beforeEach(async () => { + jest.resetAllMocks(); + schedulerMock.createScheduledTaskRunner.mockReturnValue(taskRunner); + gkeEntityProvider = GkeEntityProvider.fromConfigWithClient({ + logger: logger as any, + config: new ConfigReader({ + catalog: { + providers: { + gcp: { + gke: { + parents: ['parent1', 'parent2'], + schedule: { + frequency: { + minutes: 3, + }, + timeout: { + minutes: 3, + }, + }, + }, + }, + }, + }, + }), + scheduler: schedulerMock, + clusterManagerClient: clusterManagerClientMock as any, + }); + await gkeEntityProvider.connect(connectionMock); + }); + + it('should return clusters as Resources', async () => { + clusterManagerClientMock.listClusters.mockImplementation(req => { + if (req.parent === 'parent1') { + return [ + { + clusters: [ + { + name: 'some-cluster', + endpoint: 'http://127.0.0.1:1234', + location: 'some-location', + selfLink: 'http://127.0.0.1/some-link', + masterAuth: { + clusterCaCertificate: 'abcdefg', + }, + }, + ], + }, + ]; + } else if (req.parent === 'parent2') { + return [ + { + clusters: [ + { + name: 'some-other-cluster', + endpoint: 'http://127.0.0.1:5678', + location: 'some-other-location', + selfLink: 'http://127.0.0.1/some-other-link', + masterAuth: { + // no CA cert is ok + }, + }, + ], + }, + ]; + } + + throw new Error(`unexpected parent ${req.parent}`); + }); + await gkeEntityProvider.refresh(); + expect(connectionMock.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: [ + { + locationKey: 'gcp-gke:some-location', + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Resource', + metadata: { + annotations: { + [ANNOTATION_KUBERNETES_API_SERVER]: 'http://127.0.0.1:1234', + [ANNOTATION_KUBERNETES_API_SERVER_CA]: 'abcdefg', + [ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'google', + 'backstage.io/managed-by-location': 'gcp-gke:some-location', + 'backstage.io/managed-by-origin-location': + 'gcp-gke:some-location', + }, + name: 'some-cluster', + namespace: 'default', + }, + spec: { + type: 'kubernetes-cluster', + owner: 'unknown', + }, + }, + }, + { + locationKey: 'gcp-gke:some-other-location', + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Resource', + metadata: { + annotations: { + [ANNOTATION_KUBERNETES_API_SERVER]: 'http://127.0.0.1:5678', + [ANNOTATION_KUBERNETES_API_SERVER_CA]: '', + [ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'google', + 'backstage.io/managed-by-location': + 'gcp-gke:some-other-location', + 'backstage.io/managed-by-origin-location': + 'gcp-gke:some-other-location', + }, + name: 'some-other-cluster', + namespace: 'default', + }, + spec: { + type: 'kubernetes-cluster', + owner: 'unknown', + }, + }, + }, + ], + }); + }); + + const ignoredPartialClustersTests: [ + string, + container.protos.google.container.v1.ICluster, + ][] = [ + [ + 'no-cluster-name', + { + endpoint: 'http://127.0.0.1:1234', + location: 'some-location', + selfLink: 'http://127.0.0.1/some-link', + masterAuth: { + clusterCaCertificate: 'abcdefg', + }, + }, + ], + [ + 'no-self-link', + { + // no selfLink + name: 'some-name', + endpoint: 'http://127.0.0.1:1234', + location: 'some-location', + masterAuth: { + clusterCaCertificate: 'abcdefg', + }, + }, + ], + [ + 'no-endpoint', + { + name: 'some-name', + location: 'some-location', + selfLink: 'http://127.0.0.1/some-link', + masterAuth: { + clusterCaCertificate: 'abcdefg', + }, + }, + ], + [ + 'no-location', + { + name: 'some-name', + endpoint: 'http://127.0.0.1:1234', + selfLink: 'http://127.0.0.1/some-link', + masterAuth: { + clusterCaCertificate: 'abcdefg', + }, + }, + ], + ]; + + it.each(ignoredPartialClustersTests)( + 'ignore cluster - %s', + async (_name, ignoredCluster) => { + clusterManagerClientMock.listClusters.mockImplementation(req => { + if (req.parent === 'parent1') { + return [ignoredCluster]; + } + return [ + { + clusters: [], + }, + ]; + }); + await gkeEntityProvider.refresh(); + expect(connectionMock.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: [], + }); + }, + ); + + it('should log GKE API errors', async () => { + clusterManagerClientMock.listClusters.mockRejectedValue( + new Error('some-error'), + ); + await gkeEntityProvider.refresh(); + expect(connectionMock.applyMutation).toHaveBeenCalledTimes(0); + expect(logger.error).toHaveBeenCalledTimes(1); + }); +}); diff --git a/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.ts b/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.ts new file mode 100644 index 0000000000..0130955737 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/providers/GkeEntityProvider.ts @@ -0,0 +1,223 @@ +/* + * Copyright 2023 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. + */ +import { + TaskRunner, + readTaskScheduleDefinitionFromConfig, +} from '@backstage/backend-tasks'; +import { + DeferredEntity, + EntityProvider, + EntityProviderConnection, +} from '@backstage/plugin-catalog-node'; + +import { Logger } from 'winston'; +import * as container from '@google-cloud/container'; +import { + ANNOTATION_KUBERNETES_API_SERVER, + ANNOTATION_KUBERNETES_API_SERVER_CA, + ANNOTATION_KUBERNETES_AUTH_PROVIDER, +} from '@backstage/plugin-kubernetes-common'; +import { Config } from '@backstage/config'; +import { SchedulerService } from '@backstage/backend-plugin-api'; + +/** + * Catalog provider to ingest GKE clusters + * + * @public + */ +export class GkeEntityProvider implements EntityProvider { + private readonly logger: Logger; + private readonly scheduleFn: () => Promise; + private readonly gkeParents: string[]; + private readonly clusterManagerClient: container.v1.ClusterManagerClient; + private connection?: EntityProviderConnection; + + private constructor( + logger: Logger, + taskRunner: TaskRunner, + gkeParents: string[], + clusterManagerClient: container.v1.ClusterManagerClient, + ) { + this.logger = logger; + this.scheduleFn = this.createScheduleFn(taskRunner); + this.gkeParents = gkeParents; + this.clusterManagerClient = clusterManagerClient; + } + + public static fromConfig({ + logger, + scheduler, + config, + }: { + logger: Logger; + scheduler: SchedulerService; + config: Config; + }) { + return GkeEntityProvider.fromConfigWithClient({ + logger, + scheduler: scheduler, + config, + clusterManagerClient: new container.v1.ClusterManagerClient(), + }); + } + + public static fromConfigWithClient({ + logger, + scheduler, + config, + clusterManagerClient, + }: { + logger: Logger; + scheduler: SchedulerService; + config: Config; + clusterManagerClient: container.v1.ClusterManagerClient; + }) { + const gkeProviderConfig = config.getConfig('catalog.providers.gcp.gke'); + const schedule = readTaskScheduleDefinitionFromConfig( + gkeProviderConfig.getConfig('schedule'), + ); + return new GkeEntityProvider( + logger, + scheduler.createScheduledTaskRunner(schedule), + gkeProviderConfig.getStringArray('parents'), + clusterManagerClient, + ); + } + + getProviderName(): string { + return `gcp-gke`; + } + + async connect(connection: EntityProviderConnection): Promise { + this.connection = connection; + await this.scheduleFn(); + } + + private filterOutUndefinedDeferredEntity( + e: DeferredEntity | undefined, + ): e is DeferredEntity { + return e !== undefined; + } + + private filterOutUndefinedCluster( + c: container.protos.google.container.v1.ICluster | null | undefined, + ): c is container.protos.google.container.v1.ICluster { + return c !== undefined && c !== null; + } + + private clusterToResource( + cluster: container.protos.google.container.v1.ICluster, + ): DeferredEntity | undefined { + const location = `${this.getProviderName()}:${cluster.location}`; + + if (!cluster.name || !cluster.selfLink || !location || !cluster.endpoint) { + this.logger.warn( + `ignoring partial cluster, one of name=${cluster.name}, endpoint=${cluster.endpoint}, selfLink=${cluster.selfLink} or location=${cluster.location} is missing`, + ); + return undefined; + } + + // TODO fix location type + return { + locationKey: location, + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Resource', + metadata: { + annotations: { + [ANNOTATION_KUBERNETES_API_SERVER]: cluster.endpoint, + [ANNOTATION_KUBERNETES_API_SERVER_CA]: + cluster.masterAuth?.clusterCaCertificate || '', + [ANNOTATION_KUBERNETES_AUTH_PROVIDER]: 'google', + 'backstage.io/managed-by-location': location, + 'backstage.io/managed-by-origin-location': location, + }, + name: cluster.name, + namespace: 'default', + }, + spec: { + type: 'kubernetes-cluster', + owner: 'unknown', + }, + }, + }; + } + + private createScheduleFn(taskRunner: TaskRunner): () => Promise { + return async () => { + const taskId = `${this.getProviderName()}:refresh`; + return taskRunner.run({ + id: taskId, + fn: async () => { + try { + await this.refresh(); + } catch (error) { + this.logger.error(error); + } + }, + }); + }; + } + + private async getClusters(): Promise< + container.protos.google.container.v1.ICluster[] + > { + const clusters = await Promise.all( + this.gkeParents.map(async parent => { + const request = { + parent: parent, + }; + const [response] = await this.clusterManagerClient.listClusters( + request, + ); + return response.clusters?.filter(this.filterOutUndefinedCluster) ?? []; + }), + ); + return clusters.flat(); + } + + async refresh() { + if (!this.connection) { + throw new Error('Not initialized'); + } + + this.logger.info('Discovering GKE clusters'); + + let clusters: container.protos.google.container.v1.ICluster[]; + + try { + clusters = await this.getClusters(); + } catch (e) { + this.logger.error('error fetching GKE clusters', e); + return; + } + const resources = + clusters + .map(c => this.clusterToResource(c)) + .filter(this.filterOutUndefinedDeferredEntity) ?? []; + + this.logger.info( + `Ingesting GKE clusters [${resources + .map(r => r.entity.metadata.name) + .join(', ')}]`, + ); + + await this.connection.applyMutation({ + type: 'full', + entities: resources, + }); + } +} diff --git a/plugins/catalog-backend-module-gcp/src/providers/index.ts b/plugins/catalog-backend-module-gcp/src/providers/index.ts new file mode 100644 index 0000000000..7846afc3ed --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/providers/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2022 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 { GkeEntityProvider } from './GkeEntityProvider'; diff --git a/plugins/catalog-backend-module-gcp/src/setupTests.ts b/plugins/catalog-backend-module-gcp/src/setupTests.ts new file mode 100644 index 0000000000..aa70772592 --- /dev/null +++ b/plugins/catalog-backend-module-gcp/src/setupTests.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2023 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-gerrit/config.d.ts b/plugins/catalog-backend-module-gerrit/config.d.ts index d8b48d2967..a246662b0a 100644 --- a/plugins/catalog-backend-module-gerrit/config.d.ts +++ b/plugins/catalog-backend-module-gerrit/config.d.ts @@ -25,9 +25,8 @@ export interface Config { * * Maps provider id with configuration. */ - gerrit?: Record< - string, - { + gerrit?: { + [name: string]: { /** * (Required) The host of the Gerrit integration to use. */ @@ -42,8 +41,8 @@ export interface Config { * The branch where the provider will try to find entities. Defaults to "master". */ branch?: string; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-github/config.d.ts b/plugins/catalog-backend-module-github/config.d.ts index 5a699e745f..9755504ee2 100644 --- a/plugins/catalog-backend-module-github/config.d.ts +++ b/plugins/catalog-backend-module-github/config.d.ts @@ -118,9 +118,8 @@ export interface Config { */ schedule?: TaskScheduleDefinitionConfig; } - | Record< - string, - { + | { + [name: string]: { /** * (Optional) The hostname of your GitHub Enterprise instance. * Default: `github.com`. @@ -182,8 +181,8 @@ export interface Config { * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-gitlab/config.d.ts b/plugins/catalog-backend-module-gitlab/config.d.ts index 00ad0ef032..7d183b6e58 100644 --- a/plugins/catalog-backend-module-gitlab/config.d.ts +++ b/plugins/catalog-backend-module-gitlab/config.d.ts @@ -22,9 +22,8 @@ export interface Config { /** * GitlabDiscoveryEntityProvider configuration */ - gitlab?: Record< - string, - { + gitlab?: { + [name: string]: { /** * (Required) Gitlab's host name. */ @@ -51,17 +50,21 @@ export interface Config { /** * (Optional) RegExp for the Project Name Pattern */ - projectPattern?: RegExp; + projectPattern?: string; /** * (Optional) RegExp for the User Name Pattern */ - userPattern?: RegExp; + userPattern?: string; /** * (Optional) RegExp for the Group Name Pattern */ - groupPattern?: RegExp; - } - >; + groupPattern?: string; + /** + * (Optional) Skip forked repository + */ + skipForkedRepos?: boolean; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-gitlab/src/lib/types.ts b/plugins/catalog-backend-module-gitlab/src/lib/types.ts index 341e2a9d9a..9b3a68c107 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/types.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/types.ts @@ -90,4 +90,5 @@ export type GitlabProviderConfig = { groupPattern: RegExp; orgEnabled?: boolean; schedule?: TaskScheduleDefinition; + skipForkedRepos?: boolean; }; diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.test.ts index 75a4c6414c..7508b35b84 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.test.ts @@ -343,6 +343,119 @@ describe('GitlabDiscoveryEntityProvider', () => { }); }); + it('should filter fork projects', async () => { + const config = new ConfigReader({ + integrations: { + gitlab: [ + { + host: 'test-gitlab', + apiBaseUrl: 'https://api.gitlab.example/api/v4', + token: '1234', + }, + ], + }, + catalog: { + providers: { + gitlab: { + 'test-id': { + host: 'test-gitlab', + skipForkedRepos: true, + }, + }, + }, + }, + }); + const schedule = new PersistingTaskRunner(); + const entityProviderConnection: EntityProviderConnection = { + applyMutation: jest.fn(), + refresh: jest.fn(), + }; + const provider = GitlabDiscoveryEntityProvider.fromConfig(config, { + logger, + schedule, + })[0]; + + server.use( + rest.get( + `https://api.gitlab.example/api/v4/projects`, + (_req, res, ctx) => { + const response = [ + { + id: 123, + default_branch: 'master', + archived: false, + last_activity_at: new Date().toString(), + web_url: 'https://api.gitlab.example/test-group/test-repo', + path_with_namespace: 'test-group/test-repo', + forked_from_project: { + id: 13083, + }, + }, + { + id: 124, + default_branch: 'master', + archived: false, + last_activity_at: new Date().toString(), + web_url: 'https://api.gitlab.example/john/example', + path_with_namespace: 'john/example', + }, + ]; + return res(ctx.json(response)); + }, + ), + rest.head( + 'https://api.gitlab.example/api/v4/projects/test-group%2Ftest-repo/repository/files/catalog-info.yaml', + (req, res, ctx) => { + if (req.url.searchParams.get('ref') === 'master') { + return res(ctx.status(200)); + } + return res(ctx.status(404, 'Not Found')); + }, + ), + rest.head( + 'https://api.gitlab.example/api/v4/projects/john%2Fexample/repository/files/catalog-info.yaml', + (req, res, ctx) => { + if (req.url.searchParams.get('ref') === 'master') { + return res(ctx.status(200)); + } + return res(ctx.status(404, 'Not Found')); + }, + ), + ); + + await provider.connect(entityProviderConnection); + + await provider.refresh(logger); + + expect(entityProviderConnection.applyMutation).toHaveBeenCalledWith({ + type: 'full', + entities: [ + { + entity: { + apiVersion: 'backstage.io/v1alpha1', + kind: 'Location', + metadata: { + annotations: { + 'backstage.io/managed-by-location': + 'url:https://api.gitlab.example/john/example/-/blob/master/catalog-info.yaml', + 'backstage.io/managed-by-origin-location': + 'url:https://api.gitlab.example/john/example/-/blob/master/catalog-info.yaml', + }, + name: 'generated-2045212e5b3e9e6bacf51cec709e362282e3cda9', + }, + spec: { + presence: 'optional', + target: + 'https://api.gitlab.example/john/example/-/blob/master/catalog-info.yaml', + type: 'url', + }, + }, + locationKey: 'GitlabDiscoveryEntityProvider:test-id', + }, + ], + }); + }); + it('fail without schedule and scheduler', () => { const config = new ConfigReader({ integrations: { diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts index 6001a32a4a..08d2fe48a7 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts @@ -177,6 +177,13 @@ export class GitlabDiscoveryEntityProvider implements EntityProvider { continue; } + if ( + this.config.skipForkedRepos && + project.hasOwnProperty('forked_from_project') + ) { + continue; + } + if ( !this.config.branch && this.config.fallbackBranch === '*' && diff --git a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts index 1035538939..bac56cc6f3 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/config.test.ts @@ -59,6 +59,7 @@ describe('config', () => { userPattern: /[\s\S]*/, orgEnabled: false, schedule: undefined, + skipForkedRepos: false, }), ); }); @@ -95,6 +96,45 @@ describe('config', () => { userPattern: /[\s\S]*/, orgEnabled: false, schedule: undefined, + skipForkedRepos: false, + }), + ); + }); + + it('valid config with skipForkedRepos', () => { + const config = new ConfigReader({ + catalog: { + providers: { + gitlab: { + test: { + group: 'group', + host: 'host', + branch: 'not-master', + fallbackBranch: 'main', + entityFilename: 'custom-file.yaml', + skipForkedRepos: true, + }, + }, + }, + }, + }); + + const result = readGitlabConfigs(config); + expect(result).toHaveLength(1); + result.forEach(r => + expect(r).toStrictEqual({ + id: 'test', + group: 'group', + branch: 'not-master', + fallbackBranch: 'main', + host: 'host', + catalogFile: 'custom-file.yaml', + projectPattern: /[\s\S]*/, + groupPattern: /[\s\S]*/, + userPattern: /[\s\S]*/, + orgEnabled: false, + schedule: undefined, + skipForkedRepos: true, }), ); }); @@ -133,6 +173,7 @@ describe('config', () => { groupPattern: /[\s\S]*/, userPattern: /[\s\S]*/, orgEnabled: false, + skipForkedRepos: false, schedule: { frequency: Duration.fromISO('PT30M'), timeout: { diff --git a/plugins/catalog-backend-module-gitlab/src/providers/config.ts b/plugins/catalog-backend-module-gitlab/src/providers/config.ts index cd15c4825c..c34cb81808 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/config.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/config.ts @@ -43,6 +43,8 @@ function readGitlabConfig(id: string, config: Config): GitlabProviderConfig { config.getOptionalString('groupPattern') ?? /[\s\S]*/, ); const orgEnabled: boolean = config.getOptionalBoolean('orgEnabled') ?? false; + const skipForkedRepos: boolean = + config.getOptionalBoolean('skipForkedRepos') ?? false; const schedule = config.has('schedule') ? readTaskScheduleDefinitionFromConfig(config.getConfig('schedule')) @@ -60,6 +62,7 @@ function readGitlabConfig(id: string, config: Config): GitlabProviderConfig { groupPattern, schedule, orgEnabled, + skipForkedRepos, }; } diff --git a/plugins/catalog-backend-module-msgraph/config.d.ts b/plugins/catalog-backend-module-msgraph/config.d.ts index 904ce1f646..9d341215cd 100644 --- a/plugins/catalog-backend-module-msgraph/config.d.ts +++ b/plugins/catalog-backend-module-msgraph/config.d.ts @@ -209,9 +209,8 @@ export interface Config { */ schedule?: TaskScheduleDefinitionConfig; } - | Record< - string, - { + | { + [name: string]: { /** * The prefix of the target that this matches on, e.g. * "https://graph.microsoft.com/v1.0", with no trailing slash. @@ -296,8 +295,8 @@ export interface Config { * (Optional) TaskScheduleDefinition for the refresh. */ schedule?: TaskScheduleDefinitionConfig; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-puppetdb/config.d.ts b/plugins/catalog-backend-module-puppetdb/config.d.ts index edd7ab3889..8aab239047 100644 --- a/plugins/catalog-backend-module-puppetdb/config.d.ts +++ b/plugins/catalog-backend-module-puppetdb/config.d.ts @@ -46,9 +46,8 @@ export interface Config { */ schedule?: TaskScheduleDefinition; } - | Record< - string, - { + | { + [name: string]: { /** * (Required) The base URL of PuppetDB API instance. */ @@ -61,8 +60,8 @@ export interface Config { * (Optional) Task schedule definition for the refresh. */ schedule?: TaskScheduleDefinition; - } - >; + }; + }; }; }; } diff --git a/plugins/catalog-backend-module-unprocessed/package.json b/plugins/catalog-backend-module-unprocessed/package.json index 9f3f2f0b11..e9ca4662ac 100644 --- a/plugins/catalog-backend-module-unprocessed/package.json +++ b/plugins/catalog-backend-module-unprocessed/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-backend-module-unprocessed" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts index 8e2f8b2f6f..bed1fe6f50 100644 --- a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts +++ b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingEngine.ts @@ -23,7 +23,7 @@ import { assertError, serializeError, stringifyError } from '@backstage/errors'; import { Hash } from 'crypto'; import stableStringify from 'fast-json-stable-stringify'; import { Logger } from 'winston'; -import { metrics } from '@opentelemetry/api'; +import { metrics, trace } from '@opentelemetry/api'; import { ProcessingDatabase, RefreshStateItem } from '../database/types'; import { createCounterMetric, createSummaryMetric } from '../util/metrics'; import { @@ -35,9 +35,16 @@ import { Stitcher } from '../stitching/Stitcher'; import { startTaskPipeline } from './TaskPipeline'; import { PluginTaskScheduler } from '@backstage/backend-tasks'; import { Config } from '@backstage/config'; +import { + addEntityAttributes, + TRACER_ID, + withActiveSpan, +} from '../util/opentelemetry'; const CACHE_TTL = 5; +const tracer = trace.getTracer(TRACER_ID); + export type ProgressTracker = ReturnType; export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { @@ -131,177 +138,181 @@ export class DefaultCatalogProcessingEngine implements CatalogProcessingEngine { } }, processTask: async item => { - const track = this.tracker.processStart(item, this.logger); + await withActiveSpan(tracer, 'ProcessingRun', async span => { + const track = this.tracker.processStart(item, this.logger); + addEntityAttributes(span, item.unprocessedEntity); - try { - const { - id, - state, - unprocessedEntity, - entityRef, - locationKey, - resultHash: previousResultHash, - } = item; - const result = await this.orchestrator.process({ - entity: unprocessedEntity, - state, - }); + try { + const { + id, + state, + unprocessedEntity, + entityRef, + locationKey, + resultHash: previousResultHash, + } = item; + const result = await this.orchestrator.process({ + entity: unprocessedEntity, + state, + }); - track.markProcessorsCompleted(result); + track.markProcessorsCompleted(result); - if (result.ok) { - const { ttl: _, ...stateWithoutTtl } = state ?? {}; - if ( - stableStringify(stateWithoutTtl) !== stableStringify(result.state) - ) { + if (result.ok) { + const { ttl: _, ...stateWithoutTtl } = state ?? {}; + if ( + stableStringify(stateWithoutTtl) !== + stableStringify(result.state) + ) { + await this.processingDatabase.transaction(async tx => { + await this.processingDatabase.updateEntityCache(tx, { + id, + state: { + ttl: CACHE_TTL, + ...result.state, + }, + }); + }); + } + } else { + const maybeTtl = state?.ttl; + const ttl = Number.isInteger(maybeTtl) ? (maybeTtl as number) : 0; await this.processingDatabase.transaction(async tx => { await this.processingDatabase.updateEntityCache(tx, { id, - state: { - ttl: CACHE_TTL, - ...result.state, - }, + state: ttl > 0 ? { ...state, ttl: ttl - 1 } : {}, }); }); } - } else { - const maybeTtl = state?.ttl; - const ttl = Number.isInteger(maybeTtl) ? (maybeTtl as number) : 0; - await this.processingDatabase.transaction(async tx => { - await this.processingDatabase.updateEntityCache(tx, { - id, - state: ttl > 0 ? { ...state, ttl: ttl - 1 } : {}, + + const location = + unprocessedEntity?.metadata?.annotations?.[ANNOTATION_LOCATION]; + for (const error of result.errors) { + this.logger.warn(error.message, { + entity: entityRef, + location, }); - }); - } + } + const errorsString = JSON.stringify( + result.errors.map(e => serializeError(e)), + ); - const location = - unprocessedEntity?.metadata?.annotations?.[ANNOTATION_LOCATION]; - for (const error of result.errors) { - this.logger.warn(error.message, { - entity: entityRef, - location, - }); - } - const errorsString = JSON.stringify( - result.errors.map(e => serializeError(e)), - ); + let hashBuilder = this.createHash().update(errorsString); - let hashBuilder = this.createHash().update(errorsString); - - if (result.ok) { - const { entityRefs: parents } = - await this.processingDatabase.transaction(tx => - this.processingDatabase.listParents(tx, { - entityRef, - }), - ); - - hashBuilder = hashBuilder - .update(stableStringify({ ...result.completedEntity })) - .update(stableStringify([...result.deferredEntities])) - .update(stableStringify([...result.relations])) - .update(stableStringify([...result.refreshKeys])) - .update(stableStringify([...parents])); - } - - const resultHash = hashBuilder.digest('hex'); - if (resultHash === previousResultHash) { - // If nothing changed in our produced outputs, we cannot have any - // significant effect on our surroundings; therefore, we just abort - // without any updates / stitching. - track.markSuccessfulWithNoChanges(); - return; - } - - // If the result was marked as not OK, it signals that some part of the - // processing pipeline threw an exception. This can happen both as part of - // non-catastrophic things such as due to validation errors, as well as if - // something fatal happens inside the processing for other reasons. In any - // case, this means we can't trust that anything in the output is okay. So - // just store the errors and trigger a stich so that they become visible to - // the outside. - if (!result.ok) { - // notify the error listener if the entity can not be processed. - Promise.resolve(undefined) - .then(() => - this.onProcessingError?.({ - unprocessedEntity, - errors: result.errors, - }), - ) - .catch(error => { - this.logger.debug( - `Processing error listener threw an exception, ${stringifyError( - error, - )}`, + if (result.ok) { + const { entityRefs: parents } = + await this.processingDatabase.transaction(tx => + this.processingDatabase.listParents(tx, { + entityRef, + }), ); - }); + hashBuilder = hashBuilder + .update(stableStringify({ ...result.completedEntity })) + .update(stableStringify([...result.deferredEntities])) + .update(stableStringify([...result.relations])) + .update(stableStringify([...result.refreshKeys])) + .update(stableStringify([...parents])); + } + + const resultHash = hashBuilder.digest('hex'); + if (resultHash === previousResultHash) { + // If nothing changed in our produced outputs, we cannot have any + // significant effect on our surroundings; therefore, we just abort + // without any updates / stitching. + track.markSuccessfulWithNoChanges(); + return; + } + + // If the result was marked as not OK, it signals that some part of the + // processing pipeline threw an exception. This can happen both as part of + // non-catastrophic things such as due to validation errors, as well as if + // something fatal happens inside the processing for other reasons. In any + // case, this means we can't trust that anything in the output is okay. So + // just store the errors and trigger a stich so that they become visible to + // the outside. + if (!result.ok) { + // notify the error listener if the entity can not be processed. + Promise.resolve(undefined) + .then(() => + this.onProcessingError?.({ + unprocessedEntity, + errors: result.errors, + }), + ) + .catch(error => { + this.logger.debug( + `Processing error listener threw an exception, ${stringifyError( + error, + )}`, + ); + }); + + await this.processingDatabase.transaction(async tx => { + await this.processingDatabase.updateProcessedEntityErrors(tx, { + id, + errors: errorsString, + resultHash, + }); + }); + await this.stitcher.stitch( + new Set([stringifyEntityRef(unprocessedEntity)]), + ); + track.markSuccessfulWithErrors(); + return; + } + + result.completedEntity.metadata.uid = id; + let oldRelationSources: Map; await this.processingDatabase.transaction(async tx => { - await this.processingDatabase.updateProcessedEntityErrors(tx, { - id, - errors: errorsString, - resultHash, - }); + const { previous } = + await this.processingDatabase.updateProcessedEntity(tx, { + id, + processedEntity: result.completedEntity, + resultHash, + errors: errorsString, + relations: result.relations, + deferredEntities: result.deferredEntities, + locationKey, + refreshKeys: result.refreshKeys, + }); + oldRelationSources = new Map( + previous.relations.map(r => [ + `${r.source_entity_ref}:${r.type}`, + r.source_entity_ref, + ]), + ); }); - await this.stitcher.stitch( - new Set([stringifyEntityRef(unprocessedEntity)]), + + const newRelationSources = new Map( + result.relations.map(relation => { + const sourceEntityRef = stringifyEntityRef(relation.source); + return [`${sourceEntityRef}:${relation.type}`, sourceEntityRef]; + }), ); - track.markSuccessfulWithErrors(); - return; + + const setOfThingsToStitch = new Set([ + stringifyEntityRef(result.completedEntity), + ]); + newRelationSources.forEach((sourceEntityRef, uniqueKey) => { + if (!oldRelationSources.has(uniqueKey)) { + setOfThingsToStitch.add(sourceEntityRef); + } + }); + oldRelationSources!.forEach((sourceEntityRef, uniqueKey) => { + if (!newRelationSources.has(uniqueKey)) { + setOfThingsToStitch.add(sourceEntityRef); + } + }); + + await this.stitcher.stitch(setOfThingsToStitch); + + track.markSuccessfulWithChanges(setOfThingsToStitch.size); + } catch (error) { + assertError(error); + track.markFailed(error); } - - result.completedEntity.metadata.uid = id; - let oldRelationSources: Map; - await this.processingDatabase.transaction(async tx => { - const { previous } = - await this.processingDatabase.updateProcessedEntity(tx, { - id, - processedEntity: result.completedEntity, - resultHash, - errors: errorsString, - relations: result.relations, - deferredEntities: result.deferredEntities, - locationKey, - refreshKeys: result.refreshKeys, - }); - oldRelationSources = new Map( - previous.relations.map(r => [ - `${r.source_entity_ref}:${r.type}`, - r.source_entity_ref, - ]), - ); - }); - - const newRelationSources = new Map( - result.relations.map(relation => { - const sourceEntityRef = stringifyEntityRef(relation.source); - return [`${sourceEntityRef}:${relation.type}`, sourceEntityRef]; - }), - ); - - const setOfThingsToStitch = new Set([ - stringifyEntityRef(result.completedEntity), - ]); - newRelationSources.forEach((sourceEntityRef, uniqueKey) => { - if (!oldRelationSources.has(uniqueKey)) { - setOfThingsToStitch.add(sourceEntityRef); - } - }); - oldRelationSources!.forEach((sourceEntityRef, uniqueKey) => { - if (!newRelationSources.has(uniqueKey)) { - setOfThingsToStitch.add(sourceEntityRef); - } - }); - - await this.stitcher.stitch(setOfThingsToStitch); - - track.markSuccessfulWithChanges(setOfThingsToStitch.size); - } catch (error) { - assertError(error); - track.markFailed(error); - } + }); }, }); } diff --git a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.test.ts b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.test.ts index ceb6992d7a..fc6855f6df 100644 --- a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.test.ts +++ b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.test.ts @@ -194,10 +194,12 @@ describe('DefaultCatalogProcessingOrchestrator', () => { it('runs all processor validations when asked to', async () => { const validate = jest.fn(async () => true); - const processor1: Partial = { + const processor1: CatalogProcessor = { + getProcessorName: () => 'processor1', validateEntityKind: validate, }; - const processor2: Partial = { + const processor2: CatalogProcessor = { + getProcessorName: () => 'processor2', validateEntityKind: validate, }; diff --git a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.ts b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.ts index d177a7d4a8..c5eaacbc68 100644 --- a/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.ts +++ b/plugins/catalog-backend/src/processing/DefaultCatalogProcessingOrchestrator.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { Span, trace } from '@opentelemetry/api'; import { Entity, EntityPolicy, @@ -55,6 +56,13 @@ import { } from './util'; import { CatalogRulesEnforcer } from '../ingestion/CatalogRules'; import { ProcessorCacheManager } from './ProcessorCacheManager'; +import { + addEntityAttributes, + TRACER_ID, + withActiveSpan, +} from '../util/opentelemetry'; + +const tracer = trace.getTracer(TRACER_ID); type Context = { entityRef: string; @@ -64,6 +72,18 @@ type Context = { cache: ProcessorCacheManager; }; +function addProcessorAttributes( + span: Span, + stage: string, + processor: CatalogProcessor, +) { + span.setAttribute('backstage.catalog.processor.stage', stage); + span.setAttribute( + 'backstage.catalog.processor.name', + processor.getProcessorName(), + ); +} + /** @public */ export class DefaultCatalogProcessingOrchestrator implements CatalogProcessingOrchestrator @@ -179,54 +199,71 @@ export class DefaultCatalogProcessingOrchestrator entity: Entity, context: Context, ): Promise { - let res = entity; + return await withActiveSpan(tracer, 'ProcessingStage', async stageSpan => { + addEntityAttributes(stageSpan, entity); + stageSpan.setAttribute('backstage.catalog.processor.stage', 'preProcess'); + let res = entity; - for (const processor of this.options.processors) { - if (processor.preProcessEntity) { - try { - res = await processor.preProcessEntity( - res, - context.location, - context.collector.forProcessor(processor), - context.originLocation, - context.cache.forProcessor(processor), - ); - } catch (e) { - throw new InputError( - `Processor ${processor.constructor.name} threw an error while preprocessing`, - e, - ); + for (const processor of this.options.processors) { + if (processor.preProcessEntity) { + let innerRes = res; + res = await withActiveSpan(tracer, 'ProcessingStep', async span => { + addEntityAttributes(span, entity); + addProcessorAttributes(span, 'preProcessEntity', processor); + try { + innerRes = await processor.preProcessEntity!( + innerRes, + context.location, + context.collector.forProcessor(processor), + context.originLocation, + context.cache.forProcessor(processor), + ); + } catch (e) { + throw new InputError( + `Processor ${processor.constructor.name} threw an error while preprocessing`, + e, + ); + } + return innerRes; + }); } } - } - return res; + return res; + }); } /** * Enforce entity policies making sure that entities conform to a general schema */ private async runPolicyStep(entity: Entity): Promise { - let policyEnforcedEntity: Entity | undefined; - - try { - policyEnforcedEntity = await this.options.policy.enforce(entity); - } catch (e) { - throw new InputError( - `Policy check failed for ${stringifyEntityRef(entity)}`, - e, + return await withActiveSpan(tracer, 'ProcessingStage', async stageSpan => { + addEntityAttributes(stageSpan, entity); + stageSpan.setAttribute( + 'backstage.catalog.processor.stage', + 'enforcePolicy', ); - } + let policyEnforcedEntity: Entity | undefined; - if (!policyEnforcedEntity) { - throw new Error( - `Policy unexpectedly returned no data for ${stringifyEntityRef( - entity, - )}`, - ); - } + try { + policyEnforcedEntity = await this.options.policy.enforce(entity); + } catch (e) { + throw new InputError( + `Policy check failed for ${stringifyEntityRef(entity)}`, + e, + ); + } - return policyEnforcedEntity; + if (!policyEnforcedEntity) { + throw new Error( + `Policy unexpectedly returned no data for ${stringifyEntityRef( + entity, + )}`, + ); + } + + return policyEnforcedEntity; + }); } /** @@ -236,50 +273,62 @@ export class DefaultCatalogProcessingOrchestrator entity: Entity, context: Context, ): Promise { - // Double check that none of the previous steps tried to change something - // related to the entity ref, which would break downstream - if (stringifyEntityRef(entity) !== context.entityRef) { - throw new ConflictError( - 'Fatal: The entity kind, namespace, or name changed during processing', - ); - } + return await withActiveSpan(tracer, 'ProcessingStage', async stageSpan => { + addEntityAttributes(stageSpan, entity); + stageSpan.setAttribute('backstage.catalog.processor.stage', 'validate'); + // Double check that none of the previous steps tried to change something + // related to the entity ref, which would break downstream + if (stringifyEntityRef(entity) !== context.entityRef) { + throw new ConflictError( + 'Fatal: The entity kind, namespace, or name changed during processing', + ); + } - // Validate that the end result is a valid Entity at all - try { - validateEntity(entity); - } catch (e) { - throw new ConflictError( - `Entity envelope for ${context.entityRef} failed validation after preprocessing`, - e, - ); - } + // Validate that the end result is a valid Entity at all + try { + validateEntity(entity); + } catch (e) { + throw new ConflictError( + `Entity envelope for ${context.entityRef} failed validation after preprocessing`, + e, + ); + } - let valid = false; + let valid = false; - for (const processor of this.options.processors) { - if (processor.validateEntityKind) { - try { - const thisValid = await processor.validateEntityKind(entity); - if (thisValid) { - valid = true; - if (this.options.legacySingleProcessorValidation) { - break; + for (const processor of this.options.processors) { + if (processor.validateEntityKind) { + try { + const thisValid = await withActiveSpan( + tracer, + 'ProcessingStep', + async span => { + addEntityAttributes(span, entity); + addProcessorAttributes(span, 'validateEntityKind', processor); + return await processor.validateEntityKind!(entity); + }, + ); + if (thisValid) { + valid = true; + if (this.options.legacySingleProcessorValidation) { + break; + } } + } catch (e) { + throw new InputError( + `Processor ${processor.constructor.name} threw an error while validating the entity ${context.entityRef}`, + e, + ); } - } catch (e) { - throw new InputError( - `Processor ${processor.constructor.name} threw an error while validating the entity ${context.entityRef}`, - e, - ); } } - } - if (!valid) { - throw new InputError( - `No processor recognized the entity ${context.entityRef} as valid, possibly caused by a foreign kind or apiVersion`, - ); - } + if (!valid) { + throw new InputError( + `No processor recognized the entity ${context.entityRef} as valid, possibly caused by a foreign kind or apiVersion`, + ); + } + }); } /** @@ -289,65 +338,81 @@ export class DefaultCatalogProcessingOrchestrator entity: LocationEntity, context: Context, ): Promise { - const { type = context.location.type, presence = 'required' } = entity.spec; - const targets = new Array(); - if (entity.spec.target) { - targets.push(entity.spec.target); - } - if (entity.spec.targets) { - targets.push(...entity.spec.targets); - } - - for (const maybeRelativeTarget of targets) { - if (type === 'file' && maybeRelativeTarget.endsWith(path.sep)) { - context.collector.generic()( - processingResult.inputError( - context.location, - `LocationEntityProcessor cannot handle ${type} type location with target ${context.location.target} that ends with a path separator`, - ), - ); - continue; - } - const target = toAbsoluteUrl( - this.options.integrations, - context.location, - type, - maybeRelativeTarget, + return await withActiveSpan(tracer, 'ProcessingStage', async stageSpan => { + addEntityAttributes(stageSpan, entity); + stageSpan.setAttribute( + 'backstage.catalog.processor.stage', + 'readLocation', ); + const { type = context.location.type, presence = 'required' } = + entity.spec; + const targets = new Array(); + if (entity.spec.target) { + targets.push(entity.spec.target); + } + if (entity.spec.targets) { + targets.push(...entity.spec.targets); + } - let didRead = false; - for (const processor of this.options.processors) { - if (processor.readLocation) { - try { - const read = await processor.readLocation( - { - type, - target, - presence, - }, - presence === 'optional', - context.collector.forProcessor(processor), - this.options.parser, - context.cache.forProcessor(processor, target), - ); - if (read) { - didRead = true; - break; + for (const maybeRelativeTarget of targets) { + if (type === 'file' && maybeRelativeTarget.endsWith(path.sep)) { + context.collector.generic()( + processingResult.inputError( + context.location, + `LocationEntityProcessor cannot handle ${type} type location with target ${context.location.target} that ends with a path separator`, + ), + ); + continue; + } + const target = toAbsoluteUrl( + this.options.integrations, + context.location, + type, + maybeRelativeTarget, + ); + + let didRead = false; + for (const processor of this.options.processors) { + if (processor.readLocation) { + try { + const read = await withActiveSpan( + tracer, + 'ProcessingStep', + async span => { + addEntityAttributes(span, entity); + addProcessorAttributes(span, 'readLocation', processor); + return await processor.readLocation!( + { + type, + target, + presence, + }, + presence === 'optional', + context.collector.forProcessor(processor), + this.options.parser, + context.cache.forProcessor(processor, target), + ); + }, + ); + if (read) { + didRead = true; + break; + } + } catch (e) { + throw new InputError( + `Processor ${processor.constructor.name} threw an error while reading ${type}:${target}`, + e, + ); } - } catch (e) { - throw new InputError( - `Processor ${processor.constructor.name} threw an error while reading ${type}:${target}`, - e, - ); } } + if (!didRead) { + throw new InputError( + `No processor was able to handle reading of ${type}:${target}`, + ); + } } - if (!didRead) { - throw new InputError( - `No processor was able to handle reading of ${type}:${target}`, - ); - } - } + }); } /** @@ -357,26 +422,39 @@ export class DefaultCatalogProcessingOrchestrator entity: Entity, context: Context, ): Promise { - let res = entity; + return await withActiveSpan(tracer, 'ProcessingStage', async stageSpan => { + addEntityAttributes(stageSpan, entity); + stageSpan.setAttribute( + 'backstage.catalog.processor.stage', + 'postProcessEntity', + ); + let res = entity; - for (const processor of this.options.processors) { - if (processor.postProcessEntity) { - try { - res = await processor.postProcessEntity( - res, - context.location, - context.collector.forProcessor(processor), - context.cache.forProcessor(processor), - ); - } catch (e) { - throw new InputError( - `Processor ${processor.constructor.name} threw an error while postprocessing`, - e, - ); + for (const processor of this.options.processors) { + if (processor.postProcessEntity) { + let innerRes = res; + res = await withActiveSpan(tracer, 'ProcessingStep', async span => { + addEntityAttributes(span, entity); + addProcessorAttributes(span, 'postProcessEntity', processor); + try { + innerRes = await processor.postProcessEntity!( + innerRes, + context.location, + context.collector.forProcessor(processor), + context.cache.forProcessor(processor), + ); + } catch (e) { + throw new InputError( + `Processor ${processor.constructor.name} threw an error while postprocessing`, + e, + ); + } + return innerRes; + }); } } - } - return res; + return res; + }); } } diff --git a/plugins/catalog-backend/src/util/opentelemetry.ts b/plugins/catalog-backend/src/util/opentelemetry.ts new file mode 100644 index 0000000000..3fb83d7909 --- /dev/null +++ b/plugins/catalog-backend/src/util/opentelemetry.ts @@ -0,0 +1,101 @@ +/* + * Copyright 2023 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. + */ + +import { Span, SpanOptions, SpanStatusCode, Tracer } from '@opentelemetry/api'; +import { Entity } from '@backstage/catalog-model'; + +export const TRACER_ID = 'backstage-plugin-catalog-backend'; + +function setAttributeIfDefined(span: Span, attribute: string, value?: string) { + if (value !== null && value !== undefined) { + span.setAttribute(attribute, value); + } +} + +export function addEntityAttributes(span: Span, entity: Entity) { + setAttributeIfDefined(span, 'backstage.entity.apiVersion', entity.apiVersion); + setAttributeIfDefined(span, 'backstage.entity.kind', entity.kind); + setAttributeIfDefined( + span, + 'backstage.entity.metadata.namespace', + entity.metadata?.namespace, + ); + setAttributeIfDefined( + span, + 'backstage.entity.metadata.name', + entity.metadata?.name, + ); +} + +// Adapted from https://github.com/open-telemetry/opentelemetry-js/blob/359fbcc40a859057a02b14e84599eac399b8dba7/api/src/trace/SugaredTracer.ts +// While waiting for something like https://github.com/open-telemetry/opentelemetry-js/pull/3317 to land upstream + +const onException = (e: Error, span: Span) => { + span.recordException(e); + span.setStatus({ + code: SpanStatusCode.ERROR, + }); +}; + +function isPromiseLike(obj: PromiseLike | S): obj is PromiseLike { + return ( + !!obj && + (typeof obj === 'object' || typeof obj === 'function') && + 'then' in obj && + typeof obj.then === 'function' + ); +} + +function handleFn ReturnType>( + span: Span, + fn: F, +): ReturnType { + try { + const ret = fn(span); + + // if fn is an async function attach a recordException and spanEnd callback to the promise + if (isPromiseLike(ret)) { + ret.then( + () => { + span.end(); + }, + e => { + onException(e, span); + span.end(); + }, + ); + } else { + span.end(); + } + + return ret; + } catch (e) { + onException(e, span); + span.end(); + throw e; + } +} + +export function withActiveSpan ReturnType>( + tracer: Tracer, + name: string, + fn: F, + spanOptions: SpanOptions = {}, +): ReturnType { + return tracer.startActiveSpan(name, spanOptions, (span: Span) => { + return handleFn(span, fn); + }); +} diff --git a/plugins/catalog-graph/package.json b/plugins/catalog-graph/package.json index 73cdb47d07..2e2b3c2402 100644 --- a/plugins/catalog-graph/package.json +++ b/plugins/catalog-graph/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-graph" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/catalog-node/package.json b/plugins/catalog-node/package.json index 426f8e3297..8aef496418 100644 --- a/plugins/catalog-node/package.json +++ b/plugins/catalog-node/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/catalog-node" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/cicd-statistics-module-gitlab/package.json b/plugins/cicd-statistics-module-gitlab/package.json index 89da579bf4..2f9064b580 100644 --- a/plugins/cicd-statistics-module-gitlab/package.json +++ b/plugins/cicd-statistics-module-gitlab/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/cicd-statistics-module-gitlab" + }, "keywords": [ "backstage", "cicd statistics", diff --git a/plugins/code-climate/package.json b/plugins/code-climate/package.json index 1c0576bbdc..935e56e355 100644 --- a/plugins/code-climate/package.json +++ b/plugins/code-climate/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/code-climate" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/code-coverage-backend/package.json b/plugins/code-coverage-backend/package.json index a4910c6093..9174122f38 100644 --- a/plugins/code-coverage-backend/package.json +++ b/plugins/code-coverage-backend/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/code-coverage-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/code-coverage/package.json b/plugins/code-coverage/package.json index 8fbda2ff48..936db59fb4 100644 --- a/plugins/code-coverage/package.json +++ b/plugins/code-coverage/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/code-coverage" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/codescene/package.json b/plugins/codescene/package.json index 1bf5dedf87..aef649c213 100644 --- a/plugins/codescene/package.json +++ b/plugins/codescene/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/codescene" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/config-schema/package.json b/plugins/config-schema/package.json index f8a83aa177..ea4f55ef3c 100644 --- a/plugins/config-schema/package.json +++ b/plugins/config-schema/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/config-schema" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/devtools-backend/config.d.ts b/plugins/devtools-backend/config.d.ts index 15e70afcf8..9fc7cf1762 100644 --- a/plugins/devtools-backend/config.d.ts +++ b/plugins/devtools-backend/config.d.ts @@ -40,5 +40,15 @@ export interface Config { target: string; }>; }; + /** + * Info configuration + */ + info?: { + /** + * A list of package prefixes that DevTools will use for filtering all available dependencies + * (default is ["@backstage"]) + */ + packagePrefixes?: string[]; + }; }; } diff --git a/plugins/devtools-backend/package.json b/plugins/devtools-backend/package.json index 239f7f5328..158bc00a8d 100644 --- a/plugins/devtools-backend/package.json +++ b/plugins/devtools-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/devtools-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/devtools-backend/src/api/DevToolsBackendApi.ts b/plugins/devtools-backend/src/api/DevToolsBackendApi.ts index efd0407b31..c1b1a1fa9a 100644 --- a/plugins/devtools-backend/src/api/DevToolsBackendApi.ts +++ b/plugins/devtools-backend/src/api/DevToolsBackendApi.ts @@ -219,7 +219,12 @@ export class DevToolsBackendApi { const lockfilePath = paths.resolveTargetRoot('yarn.lock'); const lockfile = await Lockfile.load(lockfilePath); - const deps = [...lockfile.keys()].filter(n => n.startsWith('@backstage/')); + const prefixes = ['@backstage', '@internal'].concat( + this.config.getOptionalStringArray('devTools.info.packagePrefixes') ?? [], + ); + const deps = [...lockfile.keys()].filter(n => + prefixes.some(prefix => n.startsWith(prefix)), + ); const infoDependencies: PackageDependency[] = []; for (const dep of deps) { diff --git a/plugins/devtools-common/package.json b/plugins/devtools-common/package.json index e3424e1b68..2c8b382727 100644 --- a/plugins/devtools-common/package.json +++ b/plugins/devtools-common/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/devtools-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/devtools/README.md b/plugins/devtools/README.md index 3fbe8df4ac..cb6fbb95fd 100644 --- a/plugins/devtools/README.md +++ b/plugins/devtools/README.md @@ -408,11 +408,23 @@ export const customDevToolsPage = ; ## Configuration -The following sections outline the configuration for the DevTools plugin +The following sections outline the configuration for the DevTools plugin. + +### Package Dependencies + +By default, only packages with names starting with `@backstage` and `@internal` will be listed on the main "Info" tab. If you would like additional packages to be listed, you can specify the package prefixes (not regular expressions) in your `app-config.yaml`. For example, to not only provide version information about backstage plugins provided by the core application (`@backstage/*` modules) but also `@roadiehq` and `@spotify` plugins, you can specify this configuration: + +```yaml +devTools: + info: + packagePrefixes: + - @roadiehq/backstage- + - @spotify/backstage- +``` ### External Dependencies Configuration -If you decide to use the External Dependencies tab then you'll need to setup the configuration for it in your `app-config.yaml`, if there is no config setup then the tab will be empty. Here's an example: +If you decide to use the External Dependencies tab then you'll need to setup the configuration for it in your `app-config.yaml`. If there is no endpoints configured, then the tab will be empty. Here's an example: ```yaml devTools: diff --git a/plugins/dynatrace/package.json b/plugins/dynatrace/package.json index 6d4b10418c..852ce144b5 100644 --- a/plugins/dynatrace/package.json +++ b/plugins/dynatrace/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/entity-feedback-backend/package.json b/plugins/entity-feedback-backend/package.json index 36c0f85be7..1d9aae90a8 100644 --- a/plugins/entity-feedback-backend/package.json +++ b/plugins/entity-feedback-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/entity-feedback-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/entity-feedback-common/package.json b/plugins/entity-feedback-common/package.json index 6abb002aa4..642988730e 100644 --- a/plugins/entity-feedback-common/package.json +++ b/plugins/entity-feedback-common/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/entity-feedback-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/entity-feedback/package.json b/plugins/entity-feedback/package.json index de9eff5420..1ba7a035b7 100644 --- a/plugins/entity-feedback/package.json +++ b/plugins/entity-feedback/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/entity-validation/package.json b/plugins/entity-validation/package.json index 46455d3a4c..e9221c6695 100644 --- a/plugins/entity-validation/package.json +++ b/plugins/entity-validation/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/events-backend-module-aws-sqs/config.d.ts b/plugins/events-backend-module-aws-sqs/config.d.ts index dfef35bf22..c2edfeae8e 100644 --- a/plugins/events-backend-module-aws-sqs/config.d.ts +++ b/plugins/events-backend-module-aws-sqs/config.d.ts @@ -31,9 +31,8 @@ export interface Config { * Contains a record per topic for which an AWS SQS queue * should be used as source of events. */ - topics: Record< - string, - { + topics: { + [name: string]: { /** * (Required) Queue-related configuration. */ @@ -69,8 +68,8 @@ export interface Config { * Default: 1 minute. */ waitTimeAfterEmptyReceive: HumanDuration; - } - >; + }; + }; }; }; }; diff --git a/plugins/events-backend-module-aws-sqs/package.json b/plugins/events-backend-module-aws-sqs/package.json index e509058b69..77edb71673 100644 --- a/plugins/events-backend-module-aws-sqs/package.json +++ b/plugins/events-backend-module-aws-sqs/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-aws-sqs" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-module-azure/package.json b/plugins/events-backend-module-azure/package.json index 59d397352b..573d3368c4 100644 --- a/plugins/events-backend-module-azure/package.json +++ b/plugins/events-backend-module-azure/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-azure" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-module-bitbucket-cloud/package.json b/plugins/events-backend-module-bitbucket-cloud/package.json index f867348a3c..e4c1508a34 100644 --- a/plugins/events-backend-module-bitbucket-cloud/package.json +++ b/plugins/events-backend-module-bitbucket-cloud/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-bitbucket-cloud" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-module-gerrit/package.json b/plugins/events-backend-module-gerrit/package.json index f7f9471dfd..55676bce46 100644 --- a/plugins/events-backend-module-gerrit/package.json +++ b/plugins/events-backend-module-gerrit/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-gerrit" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-module-github/package.json b/plugins/events-backend-module-github/package.json index 5fd37cf134..71a4d33d42 100644 --- a/plugins/events-backend-module-github/package.json +++ b/plugins/events-backend-module-github/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-github" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-module-gitlab/package.json b/plugins/events-backend-module-gitlab/package.json index 1734ecf5b0..087e1efd55 100644 --- a/plugins/events-backend-module-gitlab/package.json +++ b/plugins/events-backend-module-gitlab/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-module-gitlab" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend-test-utils/package.json b/plugins/events-backend-test-utils/package.json index 342bbf6483..bc54d17858 100644 --- a/plugins/events-backend-test-utils/package.json +++ b/plugins/events-backend-test-utils/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend-test-utils" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-backend/package.json b/plugins/events-backend/package.json index 591c0c2381..cbf1dc8af5 100644 --- a/plugins/events-backend/package.json +++ b/plugins/events-backend/package.json @@ -25,6 +25,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/events-node/package.json b/plugins/events-node/package.json index 906d2681fc..4d2169ac20 100644 --- a/plugins/events-node/package.json +++ b/plugins/events-node/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/events-node" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/example-todo-list-backend/package.json b/plugins/example-todo-list-backend/package.json index 8b75149cae..9747356461 100644 --- a/plugins/example-todo-list-backend/package.json +++ b/plugins/example-todo-list-backend/package.json @@ -8,6 +8,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/plugins/example-todo-list-backend" + }, "publishConfig": { "access": "public", "main": "dist/index.cjs.js", diff --git a/plugins/example-todo-list-common/package.json b/plugins/example-todo-list-common/package.json index 902ea03c9a..03d39bb49f 100644 --- a/plugins/example-todo-list-common/package.json +++ b/plugins/example-todo-list-common/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/plugins/example-todo-list-common" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/example-todo-list/package.json b/plugins/example-todo-list/package.json index e1cc5178fa..da11b3cf24 100644 --- a/plugins/example-todo-list/package.json +++ b/plugins/example-todo-list/package.json @@ -8,6 +8,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/example-todo-list" + }, "publishConfig": { "access": "public", "main": "dist/index.esm.js", diff --git a/plugins/explore-backend/package.json b/plugins/explore-backend/package.json index fedc9b2600..16174f7a51 100644 --- a/plugins/explore-backend/package.json +++ b/plugins/explore-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/explore-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/firehydrant/package.json b/plugins/firehydrant/package.json index 0bde3e81ed..960cf01fba 100644 --- a/plugins/firehydrant/package.json +++ b/plugins/firehydrant/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/firehydrant" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/gcalendar/package.json b/plugins/gcalendar/package.json index c44f6d30c6..8a2311065d 100644 --- a/plugins/gcalendar/package.json +++ b/plugins/gcalendar/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/gcalendar" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/git-release-manager/package.json b/plugins/git-release-manager/package.json index a407737cde..d7214d86da 100644 --- a/plugins/git-release-manager/package.json +++ b/plugins/git-release-manager/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/git-release-manager" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/github-deployments/package.json b/plugins/github-deployments/package.json index 7147f0e53c..7fe0efd865 100644 --- a/plugins/github-deployments/package.json +++ b/plugins/github-deployments/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/github-deployments" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/github-issues/package.json b/plugins/github-issues/package.json index c975f3687f..89c5d19ba0 100644 --- a/plugins/github-issues/package.json +++ b/plugins/github-issues/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/github-issues" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/graphql-voyager/package.json b/plugins/graphql-voyager/package.json index 5bb3c253c0..5bcf02d73e 100644 --- a/plugins/graphql-voyager/package.json +++ b/plugins/graphql-voyager/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/graphql-voyager" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/ilert/package.json b/plugins/ilert/package.json index 39674cbb19..e283ffa24a 100644 --- a/plugins/ilert/package.json +++ b/plugins/ilert/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/ilert" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/jenkins-backend/config.d.ts b/plugins/jenkins-backend/config.d.ts index 5b725dd801..1773ea7e75 100644 --- a/plugins/jenkins-backend/config.d.ts +++ b/plugins/jenkins-backend/config.d.ts @@ -42,13 +42,13 @@ export interface Config { username: string; /** @visibility secret */ apiKey: string; - extraRequestHeaders?: Partial<{ + extraRequestHeaders?: { /** @visibility secret */ - Authorization: string; + Authorization?: string; /** @visibility secret */ - authorization: string; - [key: string]: string; - }>; + authorization?: string; + [key: string]: string | undefined; + }; }[]; }; } diff --git a/plugins/jenkins-backend/package.json b/plugins/jenkins-backend/package.json index 7998932341..4ab3a59853 100644 --- a/plugins/jenkins-backend/package.json +++ b/plugins/jenkins-backend/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/jenkins-backend" + }, "configSchema": "config.d.ts", "scripts": { "start": "backstage-cli package start", diff --git a/plugins/jenkins-common/package.json b/plugins/jenkins-common/package.json index 4a3eff8e81..dd00527cee 100644 --- a/plugins/jenkins-common/package.json +++ b/plugins/jenkins-common/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/jenkins-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/kafka/package.json b/plugins/kafka/package.json index 68fc955734..617290f5b8 100644 --- a/plugins/kafka/package.json +++ b/plugins/kafka/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/kafka" + }, "configSchema": "config.d.ts", "scripts": { "build": "backstage-cli package build", diff --git a/plugins/linguist-backend/package.json b/plugins/linguist-backend/package.json index ae92da2492..5110021ab2 100644 --- a/plugins/linguist-backend/package.json +++ b/plugins/linguist-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/linguist-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/linguist-common/package.json b/plugins/linguist-common/package.json index c13f40dee2..f28a721021 100644 --- a/plugins/linguist-common/package.json +++ b/plugins/linguist-common/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/linguist-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/microsoft-calendar/README.md b/plugins/microsoft-calendar/README.md index 92421046e2..3dcf58c418 100644 --- a/plugins/microsoft-calendar/README.md +++ b/plugins/microsoft-calendar/README.md @@ -32,15 +32,38 @@ yarn add --cwd packages/app @backstage/plugin-microsoft-calendar 3. You can then use the provided React component `MicrosoftCalendar` in the backstage frontend where ever you want ```tsx -import { MicrosoftCalendar } from '@backstage/plugin-microsoft-calendar'; +import { MicrosoftCalendarCard } from '@backstage/plugin-microsoft-calendar'; // ... - + ; // ... ``` +If your homepage is not static JSX add `microsoftCalendarApiRef` to the App's `apis.ts`: + +```ts +import { + MicrosoftCalendarApiClient, + microsoftCalendarApiRef, +} from '@backstage/plugin-microsoft-calendar'; +import { + // ... + fetchApiRef, + // ... +} from '@backstage/core-plugin-api'; + +export const apis = [ + // ... + createApiFactory({ + api: microsoftCalendarApiRef, + deps: { authApi: microsoftAuthApiRef, fetchApi: fetchApiRef }, + factory: deps => new MicrosoftCalendarApiClient(deps), + }), +]; +``` + ![Microsoft Calendar plugin demo](https://user-images.githubusercontent.com/23618736/215717491-25db5fa6-b237-487f-8c00-28f572e8da05.mp4) ![Sample](./docs/microsoft-calendar-plugin.png) diff --git a/plugins/microsoft-calendar/package.json b/plugins/microsoft-calendar/package.json index 09bed7ec07..1cdb50898a 100644 --- a/plugins/microsoft-calendar/package.json +++ b/plugins/microsoft-calendar/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/microsoft-calendar" + }, "author": { "name": "Statusneo", "email": "reach@statusneo.com", diff --git a/plugins/newrelic-dashboard/package.json b/plugins/newrelic-dashboard/package.json index b134d94dbb..fd18e44217 100644 --- a/plugins/newrelic-dashboard/package.json +++ b/plugins/newrelic-dashboard/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/newrelic-dashboard" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/nomad-backend/package.json b/plugins/nomad-backend/package.json index 27ee1325f1..03d0b137ee 100644 --- a/plugins/nomad-backend/package.json +++ b/plugins/nomad-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/nomad-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/nomad/package.json b/plugins/nomad/package.json index c34db7374d..8db5ed7690 100644 --- a/plugins/nomad/package.json +++ b/plugins/nomad/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/nomad" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/octopus-deploy/package.json b/plugins/octopus-deploy/package.json index 8f8bf98a56..46ec2cff08 100644 --- a/plugins/octopus-deploy/package.json +++ b/plugins/octopus-deploy/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/octopus-deploy" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/org-react/package.json b/plugins/org-react/package.json index 220c237345..49765ba6d5 100644 --- a/plugins/org-react/package.json +++ b/plugins/org-react/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "web-library" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/org/package.json b/plugins/org/package.json index 6f09955e7d..23af90d2b8 100644 --- a/plugins/org/package.json +++ b/plugins/org/package.json @@ -13,6 +13,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/periskop-backend/package.json b/plugins/periskop-backend/package.json index 4567470c5a..f515fd4088 100644 --- a/plugins/periskop-backend/package.json +++ b/plugins/periskop-backend/package.json @@ -8,6 +8,11 @@ "backstage": { "role": "backend-plugin" }, + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/periskop-backend" + }, "publishConfig": { "access": "public", "main": "dist/index.cjs.js", diff --git a/plugins/periskop/package.json b/plugins/periskop/package.json index 1ed2e39707..2f9f23d592 100644 --- a/plugins/periskop/package.json +++ b/plugins/periskop/package.json @@ -8,6 +8,11 @@ "backstage": { "role": "frontend-plugin" }, + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/periskop" + }, "publishConfig": { "access": "public", "main": "dist/index.esm.js", diff --git a/plugins/permission-backend/package.json b/plugins/permission-backend/package.json index 8c77dbba97..964a7ed5ac 100644 --- a/plugins/permission-backend/package.json +++ b/plugins/permission-backend/package.json @@ -27,6 +27,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/permission-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/playlist-backend/package.json b/plugins/playlist-backend/package.json index 9ca2c3acfe..24686f93e6 100644 --- a/plugins/playlist-backend/package.json +++ b/plugins/playlist-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/playlist-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/playlist-common/package.json b/plugins/playlist-common/package.json index bea2af8660..4303113910 100644 --- a/plugins/playlist-common/package.json +++ b/plugins/playlist-common/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "common-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/playlist-common" + }, "scripts": { "build": "backstage-cli package build", "lint": "backstage-cli package lint", diff --git a/plugins/playlist/package.json b/plugins/playlist/package.json index a4fb704fa2..33f1a94a3c 100644 --- a/plugins/playlist/package.json +++ b/plugins/playlist/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/proxy-backend/config.d.ts b/plugins/proxy-backend/config.d.ts index 410ff86a2e..bc9cf7765a 100644 --- a/plugins/proxy-backend/config.d.ts +++ b/plugins/proxy-backend/config.d.ts @@ -31,17 +31,17 @@ export interface Config { /** * Object with extra headers to be added to target requests. */ - headers?: Partial<{ + headers?: { /** @visibility secret */ - Authorization: string; + Authorization?: string; /** @visibility secret */ - authorization: string; + authorization?: string; /** @visibility secret */ - 'X-Api-Key': string; + 'X-Api-Key'?: string; /** @visibility secret */ - 'x-api-key': string; - [key: string]: string; - }>; + 'x-api-key'?: string; + [key: string]: string | undefined; + }; /** * Changes the origin of the host header to the target URL. Default: true. */ diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json index 9d9efdb5e1..b8ce9ea8d9 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/package.json +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-confluence-to-markdown" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.test.ts b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.test.ts index b3e2925265..4e4f3091f1 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.test.ts +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.test.ts @@ -157,7 +157,7 @@ describe('confluence:transform:markdown', () => { expect(logger.info).toHaveBeenCalledWith( `Fetching the mkdocs.yml catalog from https://notreal.github.com/space/backstage/mkdocs.yml`, ); - expect(logger.info).toHaveBeenCalledTimes(6); + expect(logger.info).toHaveBeenCalledTimes(5); expect(createWriteStream).toHaveBeenCalledTimes(1); expect(readFile).toHaveBeenCalledTimes(1); expect(writeFile).toHaveBeenCalledTimes(1); @@ -204,7 +204,7 @@ describe('confluence:transform:markdown', () => { expect(logger.info).toHaveBeenCalledWith( `Fetching the mkdocs.yml catalog from https://notreal.github.com/space/backstage/mkdocs.yml`, ); - expect(logger.info).toHaveBeenCalledTimes(6); + expect(logger.info).toHaveBeenCalledTimes(5); expect(createWriteStream).not.toHaveBeenCalled(); expect(readFile).toHaveBeenCalledTimes(1); diff --git a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts index 9b666fd99e..428f392555 100644 --- a/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts +++ b/plugins/scaffolder-backend-module-confluence-to-markdown/src/actions/confluence/confluenceToMarkdown.ts @@ -16,7 +16,7 @@ import { Config } from '@backstage/config'; import { UrlReader } from '@backstage/backend-common'; import { ScmIntegrations } from '@backstage/integration'; -import { createFetchPlainAction } from '@backstage/plugin-scaffolder-backend'; +import { fetchContents } from '@backstage/plugin-scaffolder-backend'; import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; import { InputError, ConflictError } from '@backstage/errors'; import { NodeHtmlMarkdown } from 'node-html-markdown'; @@ -41,7 +41,6 @@ export const createConfluenceToMarkdownAction = (options: { config: Config; }) => { const { config, reader, integrations } = options; - const fetchPlainAction = createFetchPlainAction({ reader, integrations }); type Obj = { [key: string]: string; }; @@ -82,18 +81,18 @@ export const createConfluenceToMarkdownAction = (options: { parsedRepoUrl.filepath.lastIndexOf('/') + 1, ); const dirPath = ctx.workspacePath; + const repoFileDir = `${dirPath}/${parsedRepoUrl.filepath}`; let productArray: string[][] = []; ctx.logger.info(`Fetching the mkdocs.yml catalog from ${repoUrl}`); // This grabs the files from Github - const repoFileDir = `${dirPath}/${parsedRepoUrl.filepath}`; - await fetchPlainAction.handler({ - ...ctx, - input: { - url: `https://${parsedRepoUrl.resource}/${parsedRepoUrl.owner}/${parsedRepoUrl.name}`, - targetPath: dirPath, - }, + await fetchContents({ + reader, + integrations, + baseUrl: ctx.templateInfo?.baseUrl, + fetchUrl: `https://${parsedRepoUrl.resource}/${parsedRepoUrl.owner}/${parsedRepoUrl.name}`, + outputPath: ctx.workspacePath, }); for (const url of confluenceUrls) { diff --git a/plugins/scaffolder-backend-module-cookiecutter/package.json b/plugins/scaffolder-backend-module-cookiecutter/package.json index 22cb5b66a6..f95771822b 100644 --- a/plugins/scaffolder-backend-module-cookiecutter/package.json +++ b/plugins/scaffolder-backend-module-cookiecutter/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-cookiecutter" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/scaffolder-backend-module-rails/package.json b/plugins/scaffolder-backend-module-rails/package.json index d19c0a7f91..9bc7bbf06f 100644 --- a/plugins/scaffolder-backend-module-rails/package.json +++ b/plugins/scaffolder-backend-module-rails/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-rails" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/scaffolder-backend-module-sentry/package.json b/plugins/scaffolder-backend-module-sentry/package.json index db02c35513..0193427ec1 100644 --- a/plugins/scaffolder-backend-module-sentry/package.json +++ b/plugins/scaffolder-backend-module-sentry/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-sentry" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/scaffolder-backend-module-yeoman/package.json b/plugins/scaffolder-backend-module-yeoman/package.json index 4e812f801d..12e05629db 100644 --- a/plugins/scaffolder-backend-module-yeoman/package.json +++ b/plugins/scaffolder-backend-module-yeoman/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-backend-module-yeoman" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/scaffolder-node/package.json b/plugins/scaffolder-node/package.json index 856bac50b2..59e80f1c1c 100644 --- a/plugins/scaffolder-node/package.json +++ b/plugins/scaffolder-node/package.json @@ -14,6 +14,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/scaffolder-node" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build --experimental-type-build", diff --git a/plugins/search-backend-module-catalog/package.json b/plugins/search-backend-module-catalog/package.json index a552ba7600..c1f46b7a3a 100644 --- a/plugins/search-backend-module-catalog/package.json +++ b/plugins/search-backend-module-catalog/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-module-catalog" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json index d7831f70de..47abe5e3b2 100644 --- a/plugins/search-backend-module-elasticsearch/package.json +++ b/plugins/search-backend-module-elasticsearch/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-module-elasticsearch" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend-module-explore/package.json b/plugins/search-backend-module-explore/package.json index abf7d1a49f..46c11a2e62 100644 --- a/plugins/search-backend-module-explore/package.json +++ b/plugins/search-backend-module-explore/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-module-explore" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend-module-pg/package.json b/plugins/search-backend-module-pg/package.json index 5a1d5de17b..2f37f90681 100644 --- a/plugins/search-backend-module-pg/package.json +++ b/plugins/search-backend-module-pg/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-module-pg" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend-module-techdocs/package.json b/plugins/search-backend-module-techdocs/package.json index 44115b5cf1..5a5e933523 100644 --- a/plugins/search-backend-module-techdocs/package.json +++ b/plugins/search-backend-module-techdocs/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin-module" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-module-techdocs" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json index 445ba72f0d..b799d07d62 100644 --- a/plugins/search-backend-node/package.json +++ b/plugins/search-backend-node/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "node-library" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend-node" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json index 9ad4f55f40..f2d4d0a74c 100644 --- a/plugins/search-backend/package.json +++ b/plugins/search-backend/package.json @@ -26,6 +26,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/search-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index 5572036823..1c1699c67c 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/shortcuts" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/sonarqube-backend/package.json b/plugins/sonarqube-backend/package.json index 79762943fd..41aec6ecc9 100644 --- a/plugins/sonarqube-backend/package.json +++ b/plugins/sonarqube-backend/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "backend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/sonarqube-backend" + }, "scripts": { "start": "backstage-cli package start", "build": "backstage-cli package build", diff --git a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx index 7ad4717bd2..46a22b9284 100644 --- a/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx +++ b/plugins/sonarqube/src/components/SonarQubeCard/SonarQubeCard.tsx @@ -68,9 +68,6 @@ const useStyles = makeStyles(theme => ({ lastAnalyzed: { color: theme.palette.text.secondary, }, - disabled: { - backgroundColor: theme.palette.background.default, - }, })); /** @public */ @@ -163,9 +160,6 @@ export const SonarQubeCard = (props: { action: classes.action, }, }} - className={ - !loading && (!projectTitle || !value) ? classes.disabled : undefined - } > {loading && } diff --git a/plugins/stack-overflow/package.json b/plugins/stack-overflow/package.json index 768e8f2b54..030255ec62 100644 --- a/plugins/stack-overflow/package.json +++ b/plugins/stack-overflow/package.json @@ -12,6 +12,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/stack-overflow" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/plugins/tech-insights/package.json b/plugins/tech-insights/package.json index 4721e0dd30..67df31cf47 100644 --- a/plugins/tech-insights/package.json +++ b/plugins/tech-insights/package.json @@ -12,6 +12,7 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/user-settings-backend/package.json b/plugins/user-settings-backend/package.json index 8b93f7f723..caaa31faa8 100644 --- a/plugins/user-settings-backend/package.json +++ b/plugins/user-settings-backend/package.json @@ -14,6 +14,7 @@ "types": "dist/index.d.ts", "alphaTypes": "dist/index.alpha.d.ts" }, + "homepage": "https://backstage.io", "repository": { "type": "git", "url": "https://github.com/backstage/backstage", diff --git a/plugins/xcmetrics/package.json b/plugins/xcmetrics/package.json index 57ab0ad3f2..0a3ca50ca8 100644 --- a/plugins/xcmetrics/package.json +++ b/plugins/xcmetrics/package.json @@ -13,6 +13,12 @@ "backstage": { "role": "frontend-plugin" }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "plugins/xcmetrics" + }, "scripts": { "build": "backstage-cli package build", "start": "backstage-cli package start", diff --git a/yarn.lock b/yarn.lock index 3f9b0ee1bc..f2cb969632 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5160,6 +5160,23 @@ __metadata: languageName: unknown linkType: soft +"@backstage/plugin-catalog-backend-module-gcp@workspace:plugins/catalog-backend-module-gcp": + version: 0.0.0-use.local + resolution: "@backstage/plugin-catalog-backend-module-gcp@workspace:plugins/catalog-backend-module-gcp" + dependencies: + "@backstage/backend-common": "workspace:^" + "@backstage/backend-plugin-api": "workspace:^" + "@backstage/backend-tasks": "workspace:^" + "@backstage/backend-test-utils": "workspace:^" + "@backstage/cli": "workspace:^" + "@backstage/config": "workspace:^" + "@backstage/plugin-catalog-node": "workspace:^" + "@backstage/plugin-kubernetes-common": "workspace:^" + "@google-cloud/container": ^4.15.0 + winston: ^3.2.1 + languageName: unknown + linkType: soft + "@backstage/plugin-catalog-backend-module-gerrit@workspace:plugins/catalog-backend-module-gerrit": version: 0.0.0-use.local resolution: "@backstage/plugin-catalog-backend-module-gerrit@workspace:plugins/catalog-backend-module-gerrit" @@ -9661,7 +9678,7 @@ __metadata: languageName: unknown linkType: soft -"@backstage/theme@^0.4.0, @backstage/theme@^0.4.1, @backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": +"@backstage/theme@^0.4.1, @backstage/theme@workspace:^, @backstage/theme@workspace:packages/theme": version: 0.0.0-use.local resolution: "@backstage/theme@workspace:packages/theme" dependencies: @@ -10415,9 +10432,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/android-arm64@npm:0.18.16" +"@esbuild/android-arm64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/android-arm64@npm:0.18.17" conditions: os=android & cpu=arm64 languageName: node linkType: hard @@ -10436,9 +10453,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/android-arm@npm:0.18.16" +"@esbuild/android-arm@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/android-arm@npm:0.18.17" conditions: os=android & cpu=arm languageName: node linkType: hard @@ -10450,9 +10467,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/android-x64@npm:0.18.16" +"@esbuild/android-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/android-x64@npm:0.18.17" conditions: os=android & cpu=x64 languageName: node linkType: hard @@ -10464,9 +10481,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/darwin-arm64@npm:0.18.16" +"@esbuild/darwin-arm64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/darwin-arm64@npm:0.18.17" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard @@ -10478,9 +10495,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/darwin-x64@npm:0.18.16" +"@esbuild/darwin-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/darwin-x64@npm:0.18.17" conditions: os=darwin & cpu=x64 languageName: node linkType: hard @@ -10492,9 +10509,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/freebsd-arm64@npm:0.18.16" +"@esbuild/freebsd-arm64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/freebsd-arm64@npm:0.18.17" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard @@ -10506,9 +10523,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/freebsd-x64@npm:0.18.16" +"@esbuild/freebsd-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/freebsd-x64@npm:0.18.17" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard @@ -10520,9 +10537,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-arm64@npm:0.18.16" +"@esbuild/linux-arm64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-arm64@npm:0.18.17" conditions: os=linux & cpu=arm64 languageName: node linkType: hard @@ -10534,9 +10551,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-arm@npm:0.18.16" +"@esbuild/linux-arm@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-arm@npm:0.18.17" conditions: os=linux & cpu=arm languageName: node linkType: hard @@ -10548,9 +10565,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-ia32@npm:0.18.16" +"@esbuild/linux-ia32@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-ia32@npm:0.18.17" conditions: os=linux & cpu=ia32 languageName: node linkType: hard @@ -10569,9 +10586,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-loong64@npm:0.18.16" +"@esbuild/linux-loong64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-loong64@npm:0.18.17" conditions: os=linux & cpu=loong64 languageName: node linkType: hard @@ -10583,9 +10600,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-mips64el@npm:0.18.16" +"@esbuild/linux-mips64el@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-mips64el@npm:0.18.17" conditions: os=linux & cpu=mips64el languageName: node linkType: hard @@ -10597,9 +10614,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-ppc64@npm:0.18.16" +"@esbuild/linux-ppc64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-ppc64@npm:0.18.17" conditions: os=linux & cpu=ppc64 languageName: node linkType: hard @@ -10611,9 +10628,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-riscv64@npm:0.18.16" +"@esbuild/linux-riscv64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-riscv64@npm:0.18.17" conditions: os=linux & cpu=riscv64 languageName: node linkType: hard @@ -10625,9 +10642,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-s390x@npm:0.18.16" +"@esbuild/linux-s390x@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-s390x@npm:0.18.17" conditions: os=linux & cpu=s390x languageName: node linkType: hard @@ -10639,9 +10656,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/linux-x64@npm:0.18.16" +"@esbuild/linux-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/linux-x64@npm:0.18.17" conditions: os=linux & cpu=x64 languageName: node linkType: hard @@ -10653,9 +10670,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/netbsd-x64@npm:0.18.16" +"@esbuild/netbsd-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/netbsd-x64@npm:0.18.17" conditions: os=netbsd & cpu=x64 languageName: node linkType: hard @@ -10667,9 +10684,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/openbsd-x64@npm:0.18.16" +"@esbuild/openbsd-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/openbsd-x64@npm:0.18.17" conditions: os=openbsd & cpu=x64 languageName: node linkType: hard @@ -10681,9 +10698,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/sunos-x64@npm:0.18.16" +"@esbuild/sunos-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/sunos-x64@npm:0.18.17" conditions: os=sunos & cpu=x64 languageName: node linkType: hard @@ -10695,9 +10712,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/win32-arm64@npm:0.18.16" +"@esbuild/win32-arm64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/win32-arm64@npm:0.18.17" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard @@ -10709,9 +10726,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/win32-ia32@npm:0.18.16" +"@esbuild/win32-ia32@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/win32-ia32@npm:0.18.17" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard @@ -10723,9 +10740,9 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.18.16": - version: 0.18.16 - resolution: "@esbuild/win32-x64@npm:0.18.16" +"@esbuild/win32-x64@npm:0.18.17": + version: 0.18.17 + resolution: "@esbuild/win32-x64@npm:0.18.17" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -10912,12 +10929,12 @@ __metadata: languageName: node linkType: hard -"@google-cloud/container@npm:^4.0.0": - version: 4.13.0 - resolution: "@google-cloud/container@npm:4.13.0" +"@google-cloud/container@npm:^4.0.0, @google-cloud/container@npm:^4.15.0": + version: 4.15.0 + resolution: "@google-cloud/container@npm:4.15.0" dependencies: google-gax: ^3.5.8 - checksum: 21e57e8c69e2df8cf6899541dc405f9a6c05d999289cf211c2bb8dc6e33bf7ef36ff255cfde75c6448dd335fb5b707e77f5df49bee561decbd5ed398c58db6f6 + checksum: e81f1b708ab44c55b8e998d34c442baed10a113828ef51b4a84b806a2b04a10a0dc40ee0aa202386ac6158b34b9d3f03467d7008da9e4f709fdb1f021e725b8c languageName: node linkType: hard @@ -14393,14 +14410,14 @@ __metadata: linkType: hard "@roadiehq/backstage-plugin-travis-ci@npm:^2.0.5": - version: 2.1.12 - resolution: "@roadiehq/backstage-plugin-travis-ci@npm:2.1.12" + version: 2.1.13 + resolution: "@roadiehq/backstage-plugin-travis-ci@npm:2.1.13" dependencies: - "@backstage/catalog-model": ^1.4.0 - "@backstage/core-components": ^0.13.2 - "@backstage/core-plugin-api": ^1.5.2 - "@backstage/plugin-catalog-react": ^1.7.0 - "@backstage/theme": ^0.4.0 + "@backstage/catalog-model": ^1.4.1 + "@backstage/core-components": ^0.13.3 + "@backstage/core-plugin-api": ^1.5.3 + "@backstage/plugin-catalog-react": ^1.8.0 + "@backstage/theme": ^0.4.1 "@material-ui/core": ^4.11.3 "@material-ui/icons": ^4.11.2 "@material-ui/lab": 4.0.0-alpha.57 @@ -14414,7 +14431,7 @@ __metadata: react-dom: ^16.13.1 || ^17.0.0 react-router: 6.0.0-beta.0 || ^6.3.0 react-router-dom: 6.0.0-beta.0 || ^6.3.0 - checksum: e4e5b91323104ea7fe6608333960d92f7670fc1f6372c5942ca35cbaeb48f542dc7162f7e7a81f859a353124e6b94e0be776f43e690c8f9fa66f66986dca97f6 + checksum: c8ddeadcc5edec0b25276b65ddf7971943939eb2c82d363919c748b8a740ed53c2642bda6cb509d7fc8c02f002166abf8fc4cb7a2cfa83577e1139c5ba31841b languageName: node linkType: hard @@ -15276,7 +15293,7 @@ __metadata: languageName: node linkType: hard -"@stoplight/json@npm:^3.17.0, @stoplight/json@npm:^3.17.1": +"@stoplight/json@npm:^3.17.0, @stoplight/json@npm:^3.17.1, @stoplight/json@npm:~3.21.0": version: 3.21.0 resolution: "@stoplight/json@npm:3.21.0" dependencies: @@ -15290,20 +15307,6 @@ __metadata: languageName: node linkType: hard -"@stoplight/json@npm:~3.20.1": - version: 3.20.3 - resolution: "@stoplight/json@npm:3.20.3" - dependencies: - "@stoplight/ordered-object-literal": ^1.0.3 - "@stoplight/path": ^1.3.2 - "@stoplight/types": ^13.6.0 - jsonc-parser: ~2.2.1 - lodash: ^4.17.21 - safe-stable-stringify: ^1.1 - checksum: 52a4251deca0be91c98172287def5cb004ff2ab801c3b7bb24f02abe14ad0890ee453588f235401fa048c5fefe1a750d7f68857f681d57afb62dd5310f50d71a - languageName: node - linkType: hard - "@stoplight/ordered-object-literal@npm:^1.0.1, @stoplight/ordered-object-literal@npm:^1.0.3": version: 1.0.4 resolution: "@stoplight/ordered-object-literal@npm:1.0.4" @@ -15319,11 +15322,11 @@ __metadata: linkType: hard "@stoplight/spectral-core@npm:^1.15.1, @stoplight/spectral-core@npm:^1.18.0, @stoplight/spectral-core@npm:^1.7.0, @stoplight/spectral-core@npm:^1.8.0, @stoplight/spectral-core@npm:^1.8.1": - version: 1.18.0 - resolution: "@stoplight/spectral-core@npm:1.18.0" + version: 1.18.3 + resolution: "@stoplight/spectral-core@npm:1.18.3" dependencies: "@stoplight/better-ajv-errors": 1.0.3 - "@stoplight/json": ~3.20.1 + "@stoplight/json": ~3.21.0 "@stoplight/path": 1.3.2 "@stoplight/spectral-parsers": ^1.0.0 "@stoplight/spectral-ref-resolver": ^1.0.0 @@ -15343,7 +15346,7 @@ __metadata: pony-cause: ^1.0.0 simple-eval: 1.0.0 tslib: ^2.3.0 - checksum: 76ff9e2349c035fa2b98556c8bd67bb531f2b9c29e19e33484270d62f30900d36ceb51ef0075255479cc5071b45bcb7249088f568fff9d44cd159b5ee8f07cec + checksum: 321d868a6c1e3d5f009d87d02651b423b5b6f5ef75a2ad1937b52b8ddc6e83dc3fe9618b00d7d92407e2eb3380b8409dc6ce98a8628d50ebd60d15dc8c15a7b8 languageName: node linkType: hard @@ -15397,14 +15400,14 @@ __metadata: linkType: hard "@stoplight/spectral-parsers@npm:^1.0.0, @stoplight/spectral-parsers@npm:^1.0.2": - version: 1.0.2 - resolution: "@stoplight/spectral-parsers@npm:1.0.2" + version: 1.0.3 + resolution: "@stoplight/spectral-parsers@npm:1.0.3" dependencies: - "@stoplight/json": ~3.20.1 + "@stoplight/json": ~3.21.0 "@stoplight/types": ^13.6.0 "@stoplight/yaml": ~4.2.3 tslib: ^2.3.1 - checksum: 89bc5c77ebeedca0abf9ffa9e074beed57d47b71814f23a1d65c03469aa6ea923007b42e7cb18ca7bcc4ff9fd399d604d32a41aa4c4c57a9cc3bebb4b24c3e34 + checksum: e1120e9ffc3db7f50573db08768c1206f5adc5fc503e77d3696e86e0765ce247c3c513ed12e53318b6aef0de33fc730aa78ccd542142d17d6bae01e23cba5879 languageName: node linkType: hard @@ -16846,9 +16849,9 @@ __metadata: linkType: hard "@types/dagre@npm:^0.7.44": - version: 0.7.48 - resolution: "@types/dagre@npm:0.7.48" - checksum: 9d06fc08219056db7c55041bf2099cea24fe824d8c8741ae11c365c7464502d8c65273153446a5546b4a92bc0833802ac1c6bddb708bfcaa75af3963e7fc84aa + version: 0.7.49 + resolution: "@types/dagre@npm:0.7.49" + checksum: cb27683074f8c89c073d0b7b549692b67ddae7225a2b6f9586d75c11598f7bd32d9246ecb184017a55592e7daaf63e4d33dcbc56ca4c3999cf34352460ddf772 languageName: node linkType: hard @@ -17362,9 +17365,9 @@ __metadata: linkType: hard "@types/lodash@npm:^4.14.151, @types/lodash@npm:^4.14.173, @types/lodash@npm:^4.14.175": - version: 4.14.195 - resolution: "@types/lodash@npm:4.14.195" - checksum: 39b75ca635b3fa943d17d3d3aabc750babe4c8212485a4df166fe0516e39288e14b0c60afc6e21913cc0e5a84734633c71e617e2bd14eaa1cf51b8d7799c432e + version: 4.14.196 + resolution: "@types/lodash@npm:4.14.196" + checksum: 201d17c3e62ae02a93c99ec78e024b2be9bd75564dd8fd8c26f6ac51a985ab280d28ce2688c3bcdfe785b0991cd9814edff19ee000234c7b45d9a697f09feb6a languageName: node linkType: hard @@ -17512,18 +17515,18 @@ __metadata: linkType: hard "@types/node-forge@npm:^1.3.0": - version: 1.3.3 - resolution: "@types/node-forge@npm:1.3.3" + version: 1.3.4 + resolution: "@types/node-forge@npm:1.3.4" dependencies: "@types/node": "*" - checksum: 36e3b597517ad9007822b0a0c4d44a8bcbdc4e8d8c388839d17bfeb8ff005efc1f8d3e997a1921bc54edf530000675d555f3ccb9aac8ab273285a8677a9dcb0b + checksum: c3c53ee5039a10d724bfc64fe859106baf0e39c4cac90a5d0ddd3480bf044de6ce145f104d4fa0184c365dff59df7ab4b754172c9d87800f751d10ccd7dcd1ad languageName: node linkType: hard "@types/node@npm:*, @types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0": - version: 20.4.4 - resolution: "@types/node@npm:20.4.4" - checksum: 43f3c4a8acc38ae753e15a0e79bae0447d255b3742fa87f8e065d7b9d20ecb0e03d6c5b46c00d5d26f4552160381a00255f49205595a8ee48c2423e00263c930 + version: 20.4.5 + resolution: "@types/node@npm:20.4.5" + checksum: 36a0304a8dc346a1b2d2edac4c4633eecf70875793d61a5274d0df052d7a7af7a8e34f29884eac4fbd094c4f0201477dcb39c0ecd3307ca141688806538d1138 languageName: node linkType: hard @@ -17563,9 +17566,9 @@ __metadata: linkType: hard "@types/node@npm:^18.11.17": - version: 18.17.0 - resolution: "@types/node@npm:18.17.0" - checksum: 3a43c5c5541342751b514485144818a515fac5427f663066068eaacbe8a108cbe1207aae75ec89d34c3b32414c334aad84e9083cf7fcf3ebfd970adc871314a4 + version: 18.17.1 + resolution: "@types/node@npm:18.17.1" + checksum: 56201bda9a2d05d68602df63b4e67b0545ac8c6d0280bd5fb31701350a978a577a027501fbf49db99bf177f2242ebd1244896bfd35e89042d5bd7dfebff28d4e languageName: node linkType: hard @@ -18200,11 +18203,11 @@ __metadata: linkType: hard "@types/testing-library__jest-dom@npm:^5.9.1": - version: 5.14.8 - resolution: "@types/testing-library__jest-dom@npm:5.14.8" + version: 5.14.9 + resolution: "@types/testing-library__jest-dom@npm:5.14.9" dependencies: "@types/jest": "*" - checksum: 18f5ba7d0db8ebd91667b544537762ce63f11c4fd02b3d57afa92f9457a384d3ecf9bc7b50b6b445af1b3ea38b69862b4f95130720d4dd23621d598ac074d93a + checksum: d364494fc2545316292e88861146146af1e3818792ca63b62a63758b2f737669b687f4aaddfcfbcb7d0e1ed7890a9bd05de23ff97f277d5e68de574497a9ee72 languageName: node linkType: hard @@ -18567,9 +18570,9 @@ __metadata: languageName: node linkType: hard -"@uiw/codemirror-extensions-basic-setup@npm:4.21.7": - version: 4.21.7 - resolution: "@uiw/codemirror-extensions-basic-setup@npm:4.21.7" +"@uiw/codemirror-extensions-basic-setup@npm:4.21.9": + version: 4.21.9 + resolution: "@uiw/codemirror-extensions-basic-setup@npm:4.21.9" dependencies: "@codemirror/autocomplete": ^6.0.0 "@codemirror/commands": ^6.0.0 @@ -18586,19 +18589,19 @@ __metadata: "@codemirror/search": ">=6.0.0" "@codemirror/state": ">=6.0.0" "@codemirror/view": ">=6.0.0" - checksum: c81ccef43396c92049a7bd05fecf6e4f7e1adfaed330892ca472b0d65e1ab919dbdd28475baea833a387547fedbe9c7dcc19b92577e1e8bba42084ee86ab3944 + checksum: e7f2a78dd26a919b00247ad85211a09b8242d57585c7689cc44ea9de99e02e8fd8dd281ebf48e61c4126704b031babb5a596307299015bb0aa8e561a0ad2d9b1 languageName: node linkType: hard "@uiw/react-codemirror@npm:^4.9.3": - version: 4.21.7 - resolution: "@uiw/react-codemirror@npm:4.21.7" + version: 4.21.9 + resolution: "@uiw/react-codemirror@npm:4.21.9" dependencies: "@babel/runtime": ^7.18.6 "@codemirror/commands": ^6.1.0 "@codemirror/state": ^6.1.1 "@codemirror/theme-one-dark": ^6.0.0 - "@uiw/codemirror-extensions-basic-setup": 4.21.7 + "@uiw/codemirror-extensions-basic-setup": 4.21.9 codemirror: ^6.0.0 peerDependencies: "@babel/runtime": ">=7.11.0" @@ -18608,7 +18611,7 @@ __metadata: codemirror: ">=6.0.0" react: ">=16.8.0" react-dom: ">=16.8.0" - checksum: c4650957d77556f8c2c5b1b072d7b381c7cbec068ff2c744d2891a88d6fb425d520b7b70addc6c82e809326467dcfa913171d62977009faf41be733b079d3e1e + checksum: c09a121e0c37f0dfb720e05f080b5f420eaec9bf1502cad38a100f2cefc731f50e854d682898163ad23aaefefcb505b57f4621b9724eca39d334258e0f25fddb languageName: node linkType: hard @@ -23589,9 +23592,9 @@ __metadata: linkType: hard "dompurify@npm:^2.2.7, dompurify@npm:^2.2.9, dompurify@npm:^2.3.6": - version: 2.4.5 - resolution: "dompurify@npm:2.4.5" - checksum: d6d3c3b320f15cdb5b26aa1902c3275a3ab2c3705a9df4420bb94691d7c4df67959ec7b91e486c308320791b0ee000456f042734c45d76721e61c2768eac706e + version: 2.4.7 + resolution: "dompurify@npm:2.4.7" + checksum: 13c047e772a1998348191554dda403950d45ef2ec75fa0b9915cc179ccea0a39ef780d283109bd72cf83a2a085af6c77664281d4d0106a737bc5f39906364efe languageName: node linkType: hard @@ -24310,31 +24313,31 @@ __metadata: linkType: hard "esbuild@npm:^0.18.0": - version: 0.18.16 - resolution: "esbuild@npm:0.18.16" + version: 0.18.17 + resolution: "esbuild@npm:0.18.17" dependencies: - "@esbuild/android-arm": 0.18.16 - "@esbuild/android-arm64": 0.18.16 - "@esbuild/android-x64": 0.18.16 - "@esbuild/darwin-arm64": 0.18.16 - "@esbuild/darwin-x64": 0.18.16 - "@esbuild/freebsd-arm64": 0.18.16 - "@esbuild/freebsd-x64": 0.18.16 - "@esbuild/linux-arm": 0.18.16 - "@esbuild/linux-arm64": 0.18.16 - "@esbuild/linux-ia32": 0.18.16 - "@esbuild/linux-loong64": 0.18.16 - "@esbuild/linux-mips64el": 0.18.16 - "@esbuild/linux-ppc64": 0.18.16 - "@esbuild/linux-riscv64": 0.18.16 - "@esbuild/linux-s390x": 0.18.16 - "@esbuild/linux-x64": 0.18.16 - "@esbuild/netbsd-x64": 0.18.16 - "@esbuild/openbsd-x64": 0.18.16 - "@esbuild/sunos-x64": 0.18.16 - "@esbuild/win32-arm64": 0.18.16 - "@esbuild/win32-ia32": 0.18.16 - "@esbuild/win32-x64": 0.18.16 + "@esbuild/android-arm": 0.18.17 + "@esbuild/android-arm64": 0.18.17 + "@esbuild/android-x64": 0.18.17 + "@esbuild/darwin-arm64": 0.18.17 + "@esbuild/darwin-x64": 0.18.17 + "@esbuild/freebsd-arm64": 0.18.17 + "@esbuild/freebsd-x64": 0.18.17 + "@esbuild/linux-arm": 0.18.17 + "@esbuild/linux-arm64": 0.18.17 + "@esbuild/linux-ia32": 0.18.17 + "@esbuild/linux-loong64": 0.18.17 + "@esbuild/linux-mips64el": 0.18.17 + "@esbuild/linux-ppc64": 0.18.17 + "@esbuild/linux-riscv64": 0.18.17 + "@esbuild/linux-s390x": 0.18.17 + "@esbuild/linux-x64": 0.18.17 + "@esbuild/netbsd-x64": 0.18.17 + "@esbuild/openbsd-x64": 0.18.17 + "@esbuild/sunos-x64": 0.18.17 + "@esbuild/win32-arm64": 0.18.17 + "@esbuild/win32-ia32": 0.18.17 + "@esbuild/win32-x64": 0.18.17 dependenciesMeta: "@esbuild/android-arm": optional: true @@ -24382,7 +24385,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: 8b04f7087d4e95cffd43c37663c57a9f42e183cd3d02fe3cefee7e1534a84d5cec181f42187715471b4b3f5478e2e110530df7d3a8b12053cbc8cc35145363ab + checksum: c6e1ffa776978a45697763a07ec9b16411db3d3b3997b2c4a0165a211727fce8b63b87165a28d8ef60d3a28b98197bbbc2833e51b89888a4437e0a483dffc8ff languageName: node linkType: hard @@ -24641,12 +24644,12 @@ __metadata: linkType: hard "eslint-plugin-jest@npm:^27.0.0": - version: 27.2.2 - resolution: "eslint-plugin-jest@npm:27.2.2" + version: 27.2.3 + resolution: "eslint-plugin-jest@npm:27.2.3" dependencies: "@typescript-eslint/utils": ^5.10.0 peerDependencies: - "@typescript-eslint/eslint-plugin": ^5.0.0 + "@typescript-eslint/eslint-plugin": ^5.0.0 || ^6.0.0 eslint: ^7.0.0 || ^8.0.0 jest: "*" peerDependenciesMeta: @@ -24654,7 +24657,7 @@ __metadata: optional: true jest: optional: true - checksum: 98b63252d985f5dedf36ce9587dd4a0d24daf71ca8a997258343402c0d33ddd5070502378dafd9ac7fc0ef2e0d557b5c77f18e09ad73c71a52de8061db88293f + checksum: 4c7e07f52f17749ac6fd0ff5fcd5ce30b88983ba31eeee322e4d48859f55eaa112f06172e586ad2031c00ff28bb2dfdc3d35c83895251b9c0e860fa47dfc5ff4 languageName: node linkType: hard @@ -28917,8 +28920,8 @@ __metadata: linkType: hard "isomorphic-git@npm:^1.23.0": - version: 1.24.2 - resolution: "isomorphic-git@npm:1.24.2" + version: 1.24.5 + resolution: "isomorphic-git@npm:1.24.5" dependencies: async-lock: ^1.1.0 clean-git-ref: ^2.0.1 @@ -28933,7 +28936,7 @@ __metadata: simple-get: ^4.0.1 bin: isogit: cli.cjs - checksum: 5c69ebf32624ac175fda11b49970e235dd380f18d5ebb80580e1c1b9649bb95aa5f02dc9d2967acf99f485e40f558659c0d14f1ee87bbcc06330a1fcfa5ffb93 + checksum: d9d13d76ec3a7d7cc8afd70d07ea920f07806b74810fe414559d460cbef8d49c7e0f6dfba0e1773c7856b1d3dd1bf98e17a09ae6aa4a8fd2d759a2f54989491a languageName: node linkType: hard @@ -29665,10 +29668,10 @@ __metadata: languageName: node linkType: hard -"jose@npm:^4.14.1, jose@npm:^4.6.0": - version: 4.14.3 - resolution: "jose@npm:4.14.3" - checksum: b766d65a60c0407f891003aae053fb500be0edb7e0745e6702bce39199d9f06fda5eb74a90df10611cb7bd7daf2636cbe3726341fef388b51cb4e43b64200f4f +"jose@npm:^4.14.4, jose@npm:^4.6.0": + version: 4.14.4 + resolution: "jose@npm:4.14.4" + checksum: 2d820a91a8fd97c05d8bc8eedc373b944a0cd7f5fe41063086da233d0473c73fb523912a9f026ea870782bd221f4a515f441a2d3af4de48c6f2c76dac5082377 languageName: node linkType: hard @@ -30536,11 +30539,11 @@ __metadata: linkType: hard "keyv@npm:^4.0.0, keyv@npm:^4.5.2": - version: 4.5.2 - resolution: "keyv@npm:4.5.2" + version: 4.5.3 + resolution: "keyv@npm:4.5.3" dependencies: json-buffer: 3.0.1 - checksum: 13ad58303acd2261c0d4831b4658451603fd159e61daea2121fcb15feb623e75ee328cded0572da9ca76b7b3ceaf8e614f1806c6b3af5db73c9c35a345259651 + checksum: 3ffb4d5b72b6b4b4af443bbb75ca2526b23c750fccb5ac4c267c6116888b4b65681015c2833cb20d26cf3e6e32dac6b988c77f7f022e1a571b7d90f1442257da languageName: node linkType: hard @@ -33918,14 +33921,14 @@ __metadata: linkType: hard "openid-client@npm:^5.2.1, openid-client@npm:^5.3.0": - version: 5.4.2 - resolution: "openid-client@npm:5.4.2" + version: 5.4.3 + resolution: "openid-client@npm:5.4.3" dependencies: - jose: ^4.14.1 + jose: ^4.14.4 lru-cache: ^6.0.0 object-hash: ^2.2.0 oidc-token-hash: ^5.0.3 - checksum: 0f3570990a4979aff8581de35078c82d21d45baed9805e0e385dfc62c24fa295ee82d86386846a33bc33ed3b524a5406d8564f9f927420027719f84bf1d8b741 + checksum: 0e5a126b77dad0320e8f7023ac7ad7f5f1f82ad5f985f7ab0b42a7cf36700dfb78f0bef9b59c1fae915dce0148ef191b49921cd0a01443b64c04f862d9dc03e0 languageName: node linkType: hard @@ -35541,13 +35544,13 @@ __metadata: linkType: hard "postcss@npm:^8.1.0, postcss@npm:^8.4.21": - version: 8.4.24 - resolution: "postcss@npm:8.4.24" + version: 8.4.27 + resolution: "postcss@npm:8.4.27" dependencies: nanoid: ^3.3.6 picocolors: ^1.0.0 source-map-js: ^1.0.2 - checksum: 814e2126dacfea313588eda09cc99a9b4c26ec55c059188aa7a916d20d26d483483106dc5ff9e560731b59f45c5bb91b945dfadc670aed875cc90ddbbf4e787d + checksum: 1cdd0c298849df6cd65f7e646a3ba36870a37b65f55fd59d1a165539c263e9b4872a402bf4ed1ca1bc31f58b68b2835545e33ea1a23b161a1f8aa6d5ded81e78 languageName: node linkType: hard @@ -38453,11 +38456,11 @@ __metadata: linkType: hard "semver@npm:2 || 3 || 4 || 5, semver@npm:^5.4.1, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.1": - version: 5.7.1 - resolution: "semver@npm:5.7.1" + version: 5.7.2 + resolution: "semver@npm:5.7.2" bin: - semver: ./bin/semver - checksum: 57fd0acfd0bac382ee87cd52cd0aaa5af086a7dc8d60379dfe65fea491fb2489b6016400813930ecd61fd0952dae75c115287a1b16c234b1550887117744dfaf + semver: bin/semver + checksum: fb4ab5e0dd1c22ce0c937ea390b4a822147a9c53dbd2a9a0132f12fe382902beef4fbf12cf51bb955248d8d15874ce8cd89532569756384f994309825f10b686 languageName: node linkType: hard @@ -38471,22 +38474,22 @@ __metadata: linkType: hard "semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": - version: 6.3.0 - resolution: "semver@npm:6.3.0" + version: 6.3.1 + resolution: "semver@npm:6.3.1" bin: - semver: ./bin/semver.js - checksum: 1b26ecf6db9e8292dd90df4e781d91875c0dcc1b1909e70f5d12959a23c7eebb8f01ea581c00783bbee72ceeaad9505797c381756326073850dc36ed284b21b9 + semver: bin/semver.js + checksum: ae47d06de28836adb9d3e25f22a92943477371292d9b665fb023fae278d345d508ca1958232af086d85e0155aee22e313e100971898bbb8d5d89b8b1d4054ca2 languageName: node linkType: hard "semver@npm:^7.1.1, semver@npm:^7.1.2, semver@npm:^7.1.3, semver@npm:^7.3.2, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.0, semver@npm:^7.5.3": - version: 7.5.3 - resolution: "semver@npm:7.5.3" + version: 7.5.4 + resolution: "semver@npm:7.5.4" dependencies: lru-cache: ^6.0.0 bin: semver: bin/semver.js - checksum: 9d58db16525e9f749ad0a696a1f27deabaa51f66e91d2fa2b0db3de3e9644e8677de3b7d7a03f4c15bc81521e0c3916d7369e0572dbde250d9bedf5194e2a8a7 + checksum: 12d8ad952fa353b0995bf180cdac205a4068b759a140e5d3c608317098b3575ac2f1e09182206bf2eb26120e1c0ed8fb92c48c592f6099680de56bb071423ca3 languageName: node linkType: hard @@ -42694,12 +42697,12 @@ __metadata: linkType: hard "xml2js@npm:^0.6.0": - version: 0.6.0 - resolution: "xml2js@npm:0.6.0" + version: 0.6.2 + resolution: "xml2js@npm:0.6.2" dependencies: sax: ">=0.6.0" xmlbuilder: ~11.0.0 - checksum: 437f353fd66d367bf158e9555a0625df9965d944e499728a5c6bc92a54a2763179b144f14b7e1c725040f56bbd22b0fa6cfcb09ec4faf39c45ce01efe631f40b + checksum: 458a83806193008edff44562c0bdb982801d61ee7867ae58fd35fab781e69e17f40dfeb8fc05391a4648c9c54012066d3955fe5d993ffbe4dc63399023f32ac2 languageName: node linkType: hard