Merge branch 'backstage:master' into master

This commit is contained in:
Ciprianna Engel
2023-07-06 11:23:49 -05:00
committed by GitHub
636 changed files with 11891 additions and 1862 deletions
+14
View File
@@ -1,5 +1,19 @@
# @backstage/plugin-adr-backend
## 0.3.5-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/plugin-adr-common@0.2.11-next.0
- @backstage/plugin-search-common@1.2.5-next.0
## 0.3.4
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-adr-backend",
"version": "0.3.4",
"version": "0.3.5-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-adr-common
## 0.2.11-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.4.1-next.0
- @backstage/integration@1.5.1-next.0
- @backstage/plugin-search-common@1.2.5-next.0
## 0.2.10
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-adr-common",
"description": "Common functionalities for the adr plugin",
"version": "0.2.10",
"version": "0.2.11-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+27
View File
@@ -1,5 +1,32 @@
# @backstage/plugin-adr
## 0.6.3-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/integration-react@1.1.15-next.1
- @backstage/plugin-catalog-react@1.7.1-next.1
- @backstage/plugin-search-react@1.6.3-next.1
## 0.6.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/integration-react@1.1.15-next.0
- @backstage/theme@0.4.0
- @backstage/plugin-adr-common@0.2.11-next.0
- @backstage/plugin-catalog-react@1.7.1-next.0
- @backstage/plugin-search-common@1.2.5-next.0
- @backstage/plugin-search-react@1.6.3-next.0
## 0.6.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-adr",
"version": "0.6.2",
"version": "0.6.3-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/plugin-airbrake-backend
## 0.2.20-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/config@1.0.8
## 0.2.19
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-airbrake-backend",
"version": "0.2.19",
"version": "0.2.20-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+25
View File
@@ -1,5 +1,30 @@
# @backstage/plugin-airbrake
## 0.3.20-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/dev-utils@1.0.17-next.1
- @backstage/test-utils@1.4.1-next.1
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.3.20-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/dev-utils@1.0.17-next.0
- @backstage/test-utils@1.4.1-next.0
- @backstage/theme@0.4.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.3.19
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-airbrake",
"version": "0.3.19",
"version": "0.3.20-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+21
View File
@@ -1,5 +1,26 @@
# @backstage/plugin-allure
## 0.1.36-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.1.36-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.1.35
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-allure",
"description": "A Backstage plugin that integrates with Allure",
"version": "0.1.35",
"version": "0.1.36-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+20
View File
@@ -1,5 +1,25 @@
# @backstage/plugin-analytics-module-ga
## 0.1.31-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/config@1.0.8
## 0.1.31-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/config@1.0.8
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
## 0.1.30
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-analytics-module-ga",
"version": "0.1.30",
"version": "0.1.31-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+20
View File
@@ -1,5 +1,25 @@
# @backstage/plugin-analytics-module-ga4
## 0.1.2-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/config@1.0.8
## 0.1.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/config@1.0.8
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
## 0.1.1
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-analytics-module-ga4",
"version": "0.1.1",
"version": "0.1.2-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+16
View File
@@ -1,5 +1,21 @@
# @backstage/plugin-apache-airflow
## 0.2.13-next.1
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
## 0.2.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/core-plugin-api@1.5.2
## 0.2.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-apache-airflow",
"version": "0.2.12",
"version": "0.2.13-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+23
View File
@@ -1,5 +1,28 @@
# @backstage/plugin-api-docs
## 0.9.6-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/plugin-catalog@1.11.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.9.6-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-catalog@1.11.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.9.5
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-api-docs",
"description": "A Backstage plugin that helps represent API entities in the frontend",
"version": "0.9.5",
"version": "0.9.6-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+18
View File
@@ -1,5 +1,23 @@
# @backstage/plugin-apollo-explorer
## 0.1.13-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
## 0.1.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
## 0.1.12
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-apollo-explorer",
"version": "0.1.12",
"version": "0.1.13-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/plugin-app-backend
## 0.3.47-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/config@1.0.8
- @backstage/config-loader@1.3.2-next.0
- @backstage/types@1.1.0
## 0.3.46
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-app-backend",
"description": "A Backstage backend plugin that serves the Backstage frontend app",
"version": "0.3.46",
"version": "0.3.47-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+21
View File
@@ -1,5 +1,26 @@
# @backstage/plugin-auth-backend
## 0.18.5-next.1
### Patch Changes
- c27ae5004fc2: Support for Token Endpoint Auth Method for OIDC Provider
- Updated dependencies
- @backstage/config@1.0.8
## 0.18.5-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/types@1.1.0
- @backstage/plugin-auth-node@0.2.16-next.0
## 0.18.4
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-auth-backend",
"description": "A Backstage backend plugin that handles authentication",
"version": "0.18.4",
"version": "0.18.5-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -53,6 +53,7 @@ const clientMetadata: Options = {
clientId: 'testclientid',
clientSecret: 'testclientsecret',
metadataUrl: 'https://oidc.test/.well-known/openid-configuration',
tokenEndpointAuthMethod: 'none',
tokenSignedResponseAlg: 'none',
};
@@ -17,6 +17,7 @@
import express from 'express';
import {
Client,
ClientAuthMethod,
Issuer,
Strategy as OidcStrategy,
TokenSet,
@@ -72,6 +73,7 @@ export type Options = OAuthProviderOptions & {
metadataUrl: string;
scope?: string;
prompt?: string;
tokenEndpointAuthMethod?: ClientAuthMethod;
tokenSignedResponseAlg?: string;
signInResolver?: SignInResolver<OidcAuthResult>;
authHandler: AuthHandler<OidcAuthResult>;
@@ -144,6 +146,8 @@ export class OidcAuthProvider implements OAuthHandlers {
client_secret: options.clientSecret,
redirect_uris: [options.callbackUrl],
response_types: ['code'],
token_endpoint_auth_method:
options.tokenEndpointAuthMethod || 'client_secret_basic',
id_token_signed_response_alg: options.tokenSignedResponseAlg || 'RS256',
scope: options.scope || '',
});
@@ -232,6 +236,9 @@ export const oidc = createAuthProviderIntegration({
customCallbackUrl ||
`${globalConfig.baseUrl}/${providerId}/handler/frame`;
const metadataUrl = envConfig.getString('metadataUrl');
const tokenEndpointAuthMethod = envConfig.getOptionalString(
'tokenEndpointAuthMethod',
) as ClientAuthMethod;
const tokenSignedResponseAlg = envConfig.getOptionalString(
'tokenSignedResponseAlg',
);
@@ -252,6 +259,7 @@ export const oidc = createAuthProviderIntegration({
clientId,
clientSecret,
callbackUrl,
tokenEndpointAuthMethod,
tokenSignedResponseAlg,
metadataUrl,
scope,
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-auth-node
## 0.2.16-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/config@1.0.8
## 0.2.15
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-auth-node",
"version": "0.2.15",
"version": "0.2.16-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+17
View File
@@ -1,5 +1,22 @@
# @backstage/plugin-azure-devops-backend
## 0.3.26-next.1
### Patch Changes
- ae261e79d256: Added alpha support for the [new backend system](https://backstage.io/docs/backend-system/)
- Updated dependencies
- @backstage/config@1.0.8
## 0.3.26-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/config@1.0.8
- @backstage/plugin-azure-devops-common@0.3.0
## 0.3.25
### Patch Changes
+19
View File
@@ -70,6 +70,25 @@ Here's how to get the backend up and running:
4. Now run `yarn start-backend` from the repo root
5. Finally open `http://localhost:7007/api/azure-devops/health` in a browser and it should return `{"status":"ok"}`
#### New Backend System
The Azure DevOps backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up:
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
+ import { azureDevOpsPlugin } from '@backstage/plugin-azure-devops-backend';
const backend = createBackend();
// ... other feature additions
+ backend.add(azureDevOpsPlugin());
backend.start();
```
## Links
- [Frontend part of the plugin](https://github.com/backstage/backstage/tree/master/plugins/azure-devops)
+4 -2
View File
@@ -3,6 +3,7 @@
> 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 { Build } from 'azure-devops-node-api/interfaces/BuildInterfaces';
import { BuildDefinitionReference } from 'azure-devops-node-api/interfaces/BuildInterfaces';
import { BuildRun } from '@backstage/plugin-azure-devops-common';
@@ -94,6 +95,9 @@ export class AzureDevOpsApi {
}): Promise<TeamMember[] | undefined>;
}
// @public
export const azureDevOpsPlugin: () => BackendFeature;
// @public (undocumented)
export function createRouter(options: RouterOptions): Promise<express.Router>;
@@ -108,6 +112,4 @@ export interface RouterOptions {
// (undocumented)
reader: UrlReader;
}
// (No @packageDocumentation comment for this package)
```
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops-backend",
"version": "0.3.25",
"version": "0.3.26-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -23,6 +23,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/plugin-azure-devops-common": "workspace:^",
"@types/express": "^4.17.6",
@@ -13,5 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Azure DevOps backend plugin that contains the API for retrieving builds, pull requests, etc. which is used by the Azure DevOps frontend plugin.
*
* @packageDocumentation
*/
export { AzureDevOpsApi } from './api';
export * from './service/router';
export { azureDevOpsPlugin } from './plugin';
@@ -0,0 +1,50 @@
/*
* 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 { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { createRouter } from './service/router';
/**
* Azure DevOps backend plugin
*
* @public
*/
export const azureDevOpsPlugin = createBackendPlugin({
pluginId: 'azure-devops',
register(env) {
env.registerInit({
deps: {
config: coreServices.config,
logger: coreServices.logger,
reader: coreServices.urlReader,
httpRouter: coreServices.httpRouter,
},
async init({ config, logger, reader, httpRouter }) {
httpRouter.use(
await createRouter({
config,
logger: loggerToWinstonLogger(logger),
reader,
}),
);
},
});
},
});
+23
View File
@@ -1,5 +1,28 @@
# @backstage/plugin-azure-devops
## 0.3.2-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.3.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-azure-devops-common@0.3.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.3.1
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-devops",
"version": "0.3.1",
"version": "0.3.2-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-azure-sites-backend
## 0.1.9-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/config@1.0.8
- @backstage/plugin-azure-sites-common@0.1.0
## 0.1.8
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-sites-backend",
"version": "0.1.8",
"version": "0.1.9-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+22
View File
@@ -1,5 +1,27 @@
# @backstage/plugin-azure-sites
## 0.1.9-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.1.9-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-azure-sites-common@0.1.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.1.8
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-azure-sites",
"version": "0.1.8",
"version": "0.1.9-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+20
View File
@@ -1,5 +1,25 @@
# @backstage/plugin-badges-backend
## 0.2.2-next.1
### Patch Changes
- 2bbdcb4154c3: Added support for the [new backend system](https://backstage.io/docs/backend-system/)
- Updated dependencies
- @backstage/config@1.0.8
## 0.2.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/plugin-auth-node@0.2.16-next.0
## 0.2.1
### Patch Changes
+18
View File
@@ -76,6 +76,24 @@ const createEnv = makeCreateEnv(config);
apiRouter.use(notFoundHandler());
```
### New Backend System
The Badges backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/), here's how you can set that up:
In your `packages/backend/src/index.ts` make the following changes:
```diff
import { createBackend } from '@backstage/backend-defaults';
+ import { badgesPlugin } from '@backstage/plugin-badges-backend';
const backend = createBackend();
// ... other feature additions
+ backend.add(badgesPlugin());
backend.start();
```
## Badge builder
Badges are created by classes implementing the `BadgeBuilder` type. The default
+4
View File
@@ -3,6 +3,7 @@
> 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 { CatalogApi } from '@backstage/catalog-client';
import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
@@ -81,6 +82,9 @@ export type BadgeSpec = {
markdown: string;
};
// @public
export const badgesPlugin: () => BackendFeature;
// @public
export interface BadgesStore {
// (undocumented)
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-badges-backend",
"description": "A Backstage backend plugin that generates README badges for your entities",
"version": "0.2.1",
"version": "0.2.2-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -34,6 +34,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/catalog-client": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/config": "workspace:^",
+1
View File
@@ -25,3 +25,4 @@ export * from './lib';
export * from './service/router';
export * from './types';
export * from './database/badgesStore';
export { badgesPlugin } from './plugin';
+61
View File
@@ -0,0 +1,61 @@
/*
* 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 { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { createRouter } from './service/router';
/**
* Badges backend plugin
*
* @public
*/
export const badgesPlugin = createBackendPlugin({
pluginId: 'badges',
register(env) {
env.registerInit({
deps: {
config: coreServices.config,
logger: coreServices.logger,
discovery: coreServices.discovery,
tokenManager: coreServices.tokenManager,
identity: coreServices.identity,
httpRouter: coreServices.httpRouter,
},
async init({
config,
logger,
discovery,
tokenManager,
identity,
httpRouter,
}) {
httpRouter.use(
await createRouter({
config,
logger: loggerToWinstonLogger(logger),
discovery,
tokenManager,
identity,
}),
);
},
});
},
});
+22
View File
@@ -1,5 +1,27 @@
# @backstage/plugin-badges
## 0.2.44-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.2.44-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.2.43
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-badges",
"description": "A Backstage plugin that generates README badges for your entities",
"version": "0.2.43",
"version": "0.2.44-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/plugin-bazaar-backend
## 0.2.10-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/config@1.0.8
- @backstage/plugin-auth-node@0.2.16-next.0
## 0.2.9
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar-backend",
"version": "0.2.9",
"version": "0.2.10-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+27
View File
@@ -1,5 +1,32 @@
# @backstage/plugin-bazaar
## 0.2.11-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/plugin-catalog@1.11.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/cli@0.22.9-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.2.11-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli@0.22.9-next.0
- @backstage/errors@1.2.1-next.0
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-catalog@1.11.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.2.10
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-bazaar",
"version": "0.2.10",
"version": "0.2.11-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,12 @@
# @backstage/plugin-bitbucket-cloud-common
## 0.2.8-next.0
### Patch Changes
- Updated dependencies
- @backstage/integration@1.5.1-next.0
## 0.2.7
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-bitbucket-cloud-common",
"description": "Common functionalities for bitbucket-cloud plugins",
"version": "0.2.7",
"version": "0.2.8-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+21
View File
@@ -1,5 +1,26 @@
# @backstage/plugin-bitrise
## 0.1.47-next.1
### Patch Changes
- Updated dependencies
- @backstage/theme@0.4.1-next.0
- @backstage/core-components@0.13.3-next.1
- @backstage/core-plugin-api@1.5.3-next.0
- @backstage/plugin-catalog-react@1.7.1-next.1
## 0.1.47-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.13.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/core-plugin-api@1.5.2
- @backstage/theme@0.4.0
- @backstage/plugin-catalog-react@1.7.1-next.0
## 0.1.46
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-bitrise",
"description": "A Backstage plugin that integrates towards Bitrise",
"version": "0.1.46",
"version": "0.1.47-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,23 @@
# @backstage/plugin-catalog-backend-module-aws
## 0.2.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/integration-aws-node@0.1.5-next.0
- @backstage/types@1.1.0
- @backstage/plugin-catalog-common@1.0.15-next.0
- @backstage/plugin-kubernetes-common@0.6.5-next.0
## 0.2.1
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-aws",
"description": "A Backstage catalog backend module that helps integrate towards AWS",
"version": "0.2.1",
"version": "0.2.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,21 @@
# @backstage/plugin-catalog-backend-module-azure
## 0.1.18-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
- @backstage/plugin-catalog-common@1.0.15-next.0
## 0.1.17
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-azure",
"description": "A Backstage catalog backend module that helps integrate towards Azure",
"version": "0.1.17",
"version": "0.1.18-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,22 @@
# @backstage/plugin-catalog-backend-module-bitbucket-cloud
## 0.1.14-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/plugin-bitbucket-cloud-common@0.2.8-next.0
- @backstage/plugin-catalog-common@1.0.15-next.0
- @backstage/plugin-events-node@0.2.8-next.0
## 0.1.13
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-bitbucket-cloud",
"description": "A Backstage catalog backend module that helps integrate towards Bitbucket Cloud",
"version": "0.1.13",
"version": "0.1.14-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,19 @@
# @backstage/plugin-catalog-backend-module-bitbucket-server
## 0.1.12-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
## 0.1.11
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-backend-module-bitbucket-server",
"version": "0.1.11",
"version": "0.1.12-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,19 @@
# @backstage/plugin-catalog-backend-module-bitbucket
## 0.2.14-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
- @backstage/plugin-bitbucket-cloud-common@0.2.8-next.0
## 0.2.13
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-bitbucket",
"description": "A Backstage catalog backend module that helps integrate towards Bitbucket",
"version": "0.2.13",
"version": "0.2.14-next.0",
"deprecated": true,
"main": "src/index.ts",
"types": "src/index.ts",
@@ -1,5 +1,19 @@
# @backstage/plugin-catalog-backend-module-gerrit
## 0.1.15-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
## 0.1.14
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-catalog-backend-module-gerrit",
"version": "0.1.14",
"version": "0.1.15-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,33 @@
# @backstage/plugin-catalog-backend-module-github
## 0.3.2-next.1
### Patch Changes
- b01b869d7158: fixed event handler to respect configured organization
- Updated dependencies
- @backstage/config@1.0.8
## 0.3.2-next.0
### Patch Changes
- 68531cc70e1f: Break some internal circular import chains
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-backend@1.11.0-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
- @backstage/plugin-catalog-common@1.0.15-next.0
- @backstage/plugin-events-node@0.2.8-next.0
## 0.3.1
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-github",
"description": "A Backstage catalog backend module that helps integrate towards GitHub",
"version": "0.3.1",
"version": "0.3.2-next.1",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1212,4 +1212,73 @@ describe('GithubEntityProvider', () => {
expect(entityProviderConnection.refresh).toHaveBeenCalledTimes(0);
expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(0);
});
it("should skip process when didn't match org from push event", async () => {
const schedule = new PersistingTaskRunner();
const config = new ConfigReader({
catalog: {
providers: {
github: {
organization: 'test-org',
filters: {
branch: 'my-special-branch',
repository: 'test-repo',
},
},
},
},
});
const provider = GithubEntityProvider.fromConfig(config, {
logger,
schedule,
})[0];
const entityProviderConnection: EntityProviderConnection = {
applyMutation: jest.fn(),
refresh: jest.fn(),
};
await provider.connect(entityProviderConnection);
const event: EventParams = {
topic: 'github.push',
metadata: {
'x-github-event': 'push',
},
eventPayload: {
ref: 'refs/heads/my-special-branch',
repository: {
name: 'test-repo',
url: 'https://github.com/test-org/test-repo',
default_branch: 'main',
stargazers: 0,
master_branch: 'main',
organization: 'other-org',
topics: [],
},
created: true,
deleted: false,
forced: false,
commits: [
{
added: ['new-file.yaml'],
removed: [],
modified: [],
},
{
added: [],
removed: [],
modified: ['catalog-info.yaml'],
},
],
},
};
await provider.onEvent(event);
await provider.onEvent(event);
expect(entityProviderConnection.refresh).toHaveBeenCalledTimes(0);
expect(entityProviderConnection.applyMutation).toHaveBeenCalledTimes(0);
});
});
@@ -296,6 +296,13 @@ export class GithubEntityProvider implements EntityProvider, EventSubscriber {
throw new Error('Not initialized');
}
if (this.config.organization !== event.repository.organization) {
this.logger.debug(
`skipping push event from organization ${event.repository.organization}`,
);
return;
}
const repoName = event.repository.name;
const repoUrl = event.repository.url;
this.logger.debug(`handle github:push event for ${repoName} - ${repoUrl}`);
@@ -28,48 +28,46 @@ import {
ScmIntegrations,
SingleInstanceGithubCredentialsProvider,
} from '@backstage/integration';
import { EventParams } from '@backstage/plugin-events-node';
import { EventSubscriber } from '@backstage/plugin-events-node';
import {
EntityProvider,
EntityProviderConnection,
} from '@backstage/plugin-catalog-node';
import { EventParams, EventSubscriber } from '@backstage/plugin-events-node';
import { graphql } from '@octokit/graphql';
import {
MembershipEvent,
OrganizationEvent,
OrganizationMemberAddedEvent,
OrganizationMemberRemovedEvent,
TeamEvent,
TeamEditedEvent,
MembershipEvent,
TeamEvent,
} from '@octokit/webhooks-types';
import { merge } from 'lodash';
import * as uuid from 'uuid';
import { Logger } from 'winston';
import {
assignGroupsToUsers,
buildOrgHierarchy,
defaultOrganizationTeamTransformer,
defaultUserTransformer,
getOrganizationTeams,
getOrganizationUsers,
GithubTeam,
parseGithubOrgUrl,
} from '../lib';
import { TeamTransformer, UserTransformer } from '../lib';
import {
createAddEntitiesOperation,
createRemoveEntitiesOperation,
createReplaceEntitiesOperation,
DeferredEntitiesBuilder,
getOrganizationTeam,
getOrganizationTeamsFromUsers,
} from '../lib/github';
import {
ANNOTATION_GITHUB_TEAM_SLUG,
ANNOTATION_GITHUB_USER_LOGIN,
} from '../lib/annotation';
import { splitTeamSlug } from '../lib/util';
import {
TeamTransformer,
UserTransformer,
defaultOrganizationTeamTransformer,
defaultUserTransformer,
} from '../lib/defaultTransformers';
import {
DeferredEntitiesBuilder,
GithubTeam,
createAddEntitiesOperation,
createRemoveEntitiesOperation,
createReplaceEntitiesOperation,
getOrganizationTeam,
getOrganizationTeams,
getOrganizationTeamsFromUsers,
getOrganizationUsers,
} from '../lib/github';
import { assignGroupsToUsers, buildOrgHierarchy } from '../lib/org';
import { parseGithubOrgUrl, splitTeamSlug } from '../lib/util';
/**
* Options for {@link GithubOrgEntityProvider}.
@@ -1,5 +1,20 @@
# @backstage/plugin-catalog-backend-module-gitlab
## 0.2.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
## 0.2.2
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-gitlab",
"description": "A Backstage catalog backend module that helps integrate towards GitLab",
"version": "0.2.2",
"version": "0.2.3-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,21 @@
# @backstage/plugin-catalog-backend-module-incremental-ingestion
## 0.3.4-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-backend@1.11.0-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/plugin-events-node@0.2.8-next.0
- @backstage/plugin-permission-common@0.7.7-next.0
## 0.3.3
### Patch Changes
@@ -99,18 +99,18 @@ export default async function createPlugin(
If you want to manage your incremental entity providers via REST endpoints, the following endpoints are available:
| Method | Path | Description |
| ------ | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| GET | `/incremental/health` | Checks the health of all incremental providers. Returns array of any unhealthy ones. |
| GET | `/incremental/providers` | Get a list of all known incremental entity providers |
| GET | `/incremental/providers/:provider` | Checks the status of an incremental provider (resting, interstitial, etc). |
| POST | `/incremental/providers/:provider/trigger` | Triggers a provider's next action immediately. E.g., if it's currently interstitial, it will trigger the next burst. |
| POST | `/incremental/providers/:provider/start` | Stop the current ingestion cycle and start a new one immediately. |
| POST | `/incremental/providers/:provider/cancel` | Stop the current ingestion cycle and start a new one in 24 hours. |
| DELETE | `/incremental/providers/:provider` | Completely remove all records for the provider and schedule it to start again in 24 hours. |
| GET | `/incremental/providers/:provider/marks` | Retrieve a list of all ingestion marks for the current ingestion cycle. |
| DELETE | `/incremental/providers/:provider/marks` | Remove all ingestion marks for the current ingestion cycle. |
| POST | `/incremental/cleanup` | Completely remove all records for ALL providers and schedule them to start again in 24 hours. (CAUTION! Can cause orphans!) |
| Method | Path | Description |
| ------ | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| GET | `/api/catalog/incremental/health` | Checks the health of all incremental providers. Returns array of any unhealthy ones. |
| GET | `/api/catalog/incremental/providers` | Get a list of all known incremental entity providers |
| GET | `/api/catalog/incremental/providers/:provider` | Checks the status of an incremental provider (resting, interstitial, etc). |
| POST | `/api/catalog/incremental/providers/:provider/trigger` | Triggers a provider's next action immediately. E.g., if it's currently interstitial, it will trigger the next burst. |
| POST | `/api/catalog/incremental/providers/:provider/start` | Stop the current ingestion cycle and start a new one immediately. |
| POST | `/api/catalog/incremental/providers/:provider/cancel` | Stop the current ingestion cycle and start a new one in 24 hours. |
| DELETE | `/api/catalog/incremental/providers/:provider` | Completely remove all records for the provider and schedule it to start again in 24 hours. |
| GET | `/api/catalog/incremental/providers/:provider/marks` | Retrieve a list of all ingestion marks for the current ingestion cycle. |
| DELETE | `/api/catalog/incremental/providers/:provider/marks` | Remove all ingestion marks for the current ingestion cycle. |
| POST | `/api/catalog/incremental/cleanup` | Completely remove all records for ALL providers and schedule them to start again in 24 hours. (CAUTION! Can cause orphans!) |
In all cases, `:provider` is the name of the incremental entity provider.
@@ -323,22 +323,17 @@ incrementalBuilder.addIncrementalEntityProvider(myEntityProvider, {
// How long should it attempt to read pages from the API in a
// single burst? Keep this short. The Incremental Entity Provider
// will attempt to read as many pages as it can in this time
burstLength: Duration.fromObject({ seconds: 3 }),
burstLength: { seconds: 3 },
// How long should it wait between bursts?
burstInterval: Duration.fromObject({ seconds: 3 }),
burstInterval: { seconds: 3 },
// How long should it rest before re-ingesting again?
restLength: Duration.fromObject({ day: 1 }),
restLength: { day: 1 },
// Optional back-off configuration - how long should it wait to retry
// in the event of an error?
backoff: [
Duration.fromObject({ seconds: 5 }),
Duration.fromObject({ seconds: 30 }),
Duration.fromObject({ minutes: 10 }),
Duration.fromObject({ hours: 3 }),
],
backoff: [{ seconds: 5 }, { seconds: 30 }, { minutes: 10 }, { hours: 3 }],
// Optional. Use this to prevent removal of entities above a given
// percentage. This can be helpful if a data source is flaky and
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-incremental-ingestion",
"description": "An entity provider for streaming large asset sources into the catalog",
"version": "0.3.3",
"version": "0.3.4-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,18 @@
# @backstage/plugin-catalog-backend-module-ldap
## 0.5.14-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/types@1.1.0
- @backstage/plugin-catalog-common@1.0.15-next.0
## 0.5.13
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-ldap",
"description": "A Backstage catalog backend module that helps integrate towards LDAP",
"version": "0.5.13",
"version": "0.5.14-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,18 @@
# @backstage/plugin-catalog-backend-module-msgraph
## 0.5.6-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/plugin-catalog-common@1.0.15-next.0
## 0.5.5
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-msgraph",
"description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph",
"version": "0.5.5",
"version": "0.5.6-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,19 @@
# @backstage/plugin-catalog-backend-module-openapi
## 0.1.13-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-backend@1.11.0-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
- @backstage/plugin-catalog-common@1.0.15-next.0
## 0.1.12
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-openapi",
"description": "A Backstage catalog backend module that helps with OpenAPI specifications",
"version": "0.1.12",
"version": "0.1.13-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,19 @@
# @backstage/plugin-catalog-backend-module-puppetdb
## 0.1.4-next.0
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/types@1.1.0
## 0.1.3
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-puppetdb",
"description": "A Backstage catalog backend module that helps integrate towards PuppetDB",
"version": "0.1.3",
"version": "0.1.4-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,15 @@
# @backstage/plugin-catalog-backend-module-unprocessed
## 0.1.1-next.0
### Patch Changes
- a8fa79ccc105: Fix and improve documentation for the unprocessed entities modules.
- Updated dependencies
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/plugin-auth-node@0.2.16-next.0
## 0.1.0
### Minor Changes
@@ -1,4 +1,4 @@
# @backstage/plugin-catalog-backend-module-unprocessed-node
# @backstage/plugin-catalog-backend-module-unprocessed
This catalog-backend module adds support for viewing unprocessed entities. An unprocessed entity is one that doesn't show up in the catalog.
@@ -10,11 +10,15 @@ A `pending` entity has not been processed yet.
## Installation
```shell
yarn add --cwd packages/backend @backstage/plugin-catalog-backend-module-unprocessed
```
### backend
In `packages/backend/src/plugins/catalog.ts` import the module and initialize it after invoking `CatalogBuilder.build()`:
```ts
```ts title="packages/backend/src/plugins/catalog.ts"
import { UnprocessedEntitesModule } from '@backstage/plugin-catalog-backend-module-unprocessed';
//...
@@ -22,7 +26,6 @@ import { UnprocessedEntitesModule } from '@backstage/plugin-catalog-backend-modu
const unprocessed = new UnprocessedEntitesModule(
await env.database.getClient(),
router,
env.logger,
);
unprocessed.registerRoutes();
```
@@ -31,7 +34,7 @@ unprocessed.registerRoutes();
In `packages/backend-next/src/index.ts` add the module:
```ts
```ts title="packages/backend-next/src/index.ts"
backend.add(catalogModuleUnprocessedEntities());
```
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend-module-unprocessed",
"description": "Backstage Catalog module to view unprocessed entities",
"version": "0.1.0",
"version": "0.1.1-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+28
View File
@@ -1,5 +1,33 @@
# @backstage/plugin-catalog-backend
## 1.11.0-next.0
### Minor Changes
- f06f0e46ba88: Support placeholder resolvers in the CatalogPlugin, also moves `PlaceholderResolver` and related types from `@backstage/plugin-catalog-backend` to `@backstage/plugin-catalog-node`.
### Patch Changes
- Updated dependencies
- @backstage/errors@1.2.1-next.0
- @backstage/backend-common@0.19.1-next.0
- @backstage/plugin-catalog-node@1.4.0-next.0
- @backstage/backend-plugin-api@0.5.4-next.0
- @backstage/backend-tasks@0.5.4-next.0
- @backstage/catalog-client@1.4.3-next.0
- @backstage/catalog-model@1.4.1-next.0
- @backstage/config@1.0.8
- @backstage/integration@1.5.1-next.0
- @backstage/types@1.1.0
- @backstage/plugin-auth-node@0.2.16-next.0
- @backstage/plugin-catalog-common@1.0.15-next.0
- @backstage/plugin-events-node@0.2.8-next.0
- @backstage/plugin-permission-common@0.7.7-next.0
- @backstage/plugin-permission-node@0.7.10-next.0
- @backstage/plugin-scaffolder-common@1.3.2-next.0
- @backstage/plugin-search-backend-module-catalog@0.1.3-next.0
- @backstage/plugin-search-common@1.2.5-next.0
## 1.10.0
### Minor Changes
+4 -4
View File
@@ -410,12 +410,12 @@ export type PlaceholderProcessorOptions = {
integrations: ScmIntegrationRegistry;
};
// @public (undocumented)
// @public @deprecated (undocumented)
export type PlaceholderResolver = (
params: PlaceholderResolverParams,
) => Promise<JsonValue>;
// @public (undocumented)
// @public @deprecated (undocumented)
export type PlaceholderResolverParams = {
key: string;
value: JsonValue;
@@ -425,10 +425,10 @@ export type PlaceholderResolverParams = {
emit: CatalogProcessorEmit_2;
};
// @public (undocumented)
// @public @deprecated (undocumented)
export type PlaceholderResolverRead = (url: string) => Promise<Buffer>;
// @public (undocumented)
// @public @deprecated (undocumented)
export type PlaceholderResolverResolveUrl = (
url: string,
base: string,
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-catalog-backend",
"description": "The Backstage backend plugin that provides the Backstage catalog",
"version": "1.10.0",
"version": "1.11.0-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -81,7 +81,7 @@ export class DefaultProviderDatabase implements ProviderDatabase {
if (toRemove.length) {
const removedCount = await deleteWithEagerPruningOfChildren({
tx,
knex: tx,
entityRefs: toRemove,
sourceKey: options.sourceKey,
});
@@ -34,26 +34,6 @@ describe('deleteWithEagerPruningOfChildren', () => {
return knex;
}
async function run(
knex: Knex,
options: { entityRefs: string[]; sourceKey: string },
): Promise<number> {
let result: number;
await knex.transaction(
async tx => {
// We can't return here, as knex swallows the return type in case the
// transaction is rolled back:
// https://github.com/knex/knex/blob/e37aeaa31c8ef9c1b07d2e4d3ec6607e557d800d/lib/transaction.js#L136
result = await deleteWithEagerPruningOfChildren({ tx, ...options });
},
{
// If we explicitly trigger a rollback, don't fail.
doNotRejectOnRollback: true,
},
);
return result!;
}
async function insertReference(
knex: Knex,
...refs: DbRefreshStateReferencesRow[]
@@ -110,7 +90,11 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_key: 'P1', target_entity_ref: 'E4' },
{ source_key: 'P2', target_entity_ref: 'E5' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E1', 'E3'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E1', 'E3'],
});
await expect(remainingEntities(knex)).resolves.toEqual(['E4', 'E5']);
},
);
@@ -139,7 +123,11 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_key: 'P1', target_entity_ref: 'E1' },
{ source_key: 'P1', target_entity_ref: 'E2' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E1'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E1'],
});
await expect(remainingEntities(knex)).resolves.toEqual(['E2']);
},
);
@@ -167,7 +155,11 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_key: 'P2', target_entity_ref: 'E3' },
{ source_entity_ref: 'E3', target_entity_ref: 'E2' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E1'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E1'],
});
await expect(remainingEntities(knex)).resolves.toEqual(['E2', 'E3']);
},
);
@@ -195,7 +187,11 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_key: 'P1', target_entity_ref: 'E3' },
{ source_entity_ref: 'E3', target_entity_ref: 'E2' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E1'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E1'],
});
await expect(remainingEntities(knex)).resolves.toEqual(['E2', 'E3']);
},
);
@@ -228,14 +224,22 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_entity_ref: 'E3', target_entity_ref: 'E5' },
{ source_entity_ref: 'E5', target_entity_ref: 'E6' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E1'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E1'],
});
await expect(remainingEntities(knex)).resolves.toEqual([
'E3',
'E4',
'E5',
'E6',
]);
await run(knex, { sourceKey: 'P1', entityRefs: ['E3'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E3'],
});
await expect(remainingEntities(knex)).resolves.toEqual([]);
},
);
@@ -263,7 +267,11 @@ describe('deleteWithEagerPruningOfChildren', () => {
{ source_key: 'P1', target_entity_ref: 'E3' },
{ source_key: 'P2', target_entity_ref: 'E4' },
);
await run(knex, { sourceKey: 'P1', entityRefs: ['E2', 'E3', 'E4'] });
await deleteWithEagerPruningOfChildren({
knex,
sourceKey: 'P1',
entityRefs: ['E2', 'E3', 'E4'],
});
await expect(remainingEntities(knex)).resolves.toEqual([
'E1',
'E2',
@@ -26,17 +26,17 @@ import { DbRefreshStateReferencesRow } from '../../tables';
* the removal of their parents.
*/
export async function deleteWithEagerPruningOfChildren(options: {
tx: Knex.Transaction;
knex: Knex | Knex.Transaction;
entityRefs: string[];
sourceKey: string;
}): Promise<number> {
const { tx, entityRefs, sourceKey } = options;
const { knex, entityRefs, sourceKey } = options;
// Split up the operation by (large) chunks, so that we do not hit database
// limits for the number of permitted bindings on a precompiled statement
let removedCount = 0;
for (const refs of lodash.chunk(entityRefs, 1000)) {
removedCount += await tx
removedCount += await knex
.delete()
.from('refresh_state')
.whereIn('entity_ref', orphans =>
@@ -186,7 +186,7 @@ export async function deleteWithEagerPruningOfChildren(options: {
// Delete the references that originate only from this entity provider. Note
// that there may be more than one entity provider making a "claim" for a
// given root entity, if they emit with the same location key.
await tx<DbRefreshStateReferencesRow>('refresh_state_references')
await knex<DbRefreshStateReferencesRow>('refresh_state_references')
.where('source_key', '=', sourceKey)
.whereIn('target_entity_ref', refs)
.delete();
@@ -26,16 +26,25 @@ import {
processingResult,
} from '@backstage/plugin-catalog-node';
/** @public */
/**
* @public
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
*/
export type PlaceholderResolverRead = (url: string) => Promise<Buffer>;
/** @public */
/**
* @public
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
*/
export type PlaceholderResolverResolveUrl = (
url: string,
base: string,
) => string;
/** @public */
/**
* @public
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
*/
export type PlaceholderResolverParams = {
key: string;
value: JsonValue;
@@ -45,7 +54,10 @@ export type PlaceholderResolverParams = {
emit: CatalogProcessorEmit;
};
/** @public */
/**
* @public
* @deprecated Use the exported value from `@backstage/plugin-catalog-node` instead.
*/
export type PlaceholderResolver = (
params: PlaceholderResolverParams,
) => Promise<JsonValue>;
@@ -27,10 +27,12 @@ import {
EntityProvider,
} from '@backstage/plugin-catalog-node';
import { loggerToWinstonLogger } from '@backstage/backend-common';
import { PlaceholderResolver } from '../modules';
class CatalogExtensionPointImpl implements CatalogProcessingExtensionPoint {
#processors = new Array<CatalogProcessor>();
#entityProviders = new Array<EntityProvider>();
#placeholderResolvers: Record<string, PlaceholderResolver> = {};
addProcessor(
...processors: Array<CatalogProcessor | Array<CatalogProcessor>>
@@ -44,6 +46,14 @@ class CatalogExtensionPointImpl implements CatalogProcessingExtensionPoint {
this.#entityProviders.push(...providers.flat());
}
addPlaceholderResolver(key: string, resolver: PlaceholderResolver) {
if (key in this.#placeholderResolvers)
throw new Error(
`A placeholder resolver for '${key}' has already been set up, please check your config.`,
);
this.#placeholderResolvers[key] = resolver;
}
get processors() {
return this.#processors;
}
@@ -51,6 +61,10 @@ class CatalogExtensionPointImpl implements CatalogProcessingExtensionPoint {
get entityProviders() {
return this.#entityProviders;
}
get placeholderResolvers() {
return this.#placeholderResolvers;
}
}
/**
@@ -99,6 +113,10 @@ export const catalogPlugin = createBackendPlugin({
});
builder.addProcessor(...processingExtensions.processors);
builder.addEntityProvider(...processingExtensions.entityProviders);
Object.entries(processingExtensions.placeholderResolvers).forEach(
([key, resolver]) => builder.setPlaceholderResolver(key, resolver),
);
const { processingEngine, router } = await builder.build();
await processingEngine.start();
+9
View File
@@ -1,5 +1,14 @@
# @backstage/plugin-catalog-common
## 1.0.15-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.4.1-next.0
- @backstage/plugin-permission-common@0.7.7-next.0
- @backstage/plugin-search-common@1.2.5-next.0
## 1.0.14
### Patch Changes

Some files were not shown because too many files have changed in this diff Show More