chore: move catalogModuleGithubOrgEntityProvider to its own backend module

Signed-off-by: djamaile <rdjamaile@gmail.com>
This commit is contained in:
djamaile
2023-10-04 13:49:19 +02:00
parent 39d92689c4
commit c101e683d5
12 changed files with 190 additions and 27 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-github-org': minor
---
Added `catalogModuleGithubOrgEntityProvider` to ingest users and teams from multiple Github organizations.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-github': patch
---
Removed `catalogModuleGithubOrgEntityProvider`. Import from `@backstage/plugin-catalog-backend-module-github-org` instead.
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -0,0 +1,5 @@
# @backstage/plugin-catalog-backend-module-github-org
The github-org backend module for the catalog plugin.
_This plugin was created through the Backstage CLI_
@@ -0,0 +1,11 @@
## API Report File for "@backstage/plugin-catalog-backend-module-github-org"
> 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';
// @public
const catalogModuleGithubOrgEntityProvider: () => BackendFeature;
export default catalogModuleGithubOrgEntityProvider;
```
@@ -0,0 +1,48 @@
{
"name": "@backstage/plugin-catalog-backend-module-github-org",
"description": "The github-org backend module for the catalog plugin.",
"version": "0.0.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin-module"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/backend-tasks": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/integration": "workspace:^",
"@backstage/plugin-catalog-backend-module-github": "workspace:^",
"@backstage/plugin-catalog-node": "workspace:^",
"@backstage/plugin-events-node": "workspace:^",
"@octokit/graphql": "^7.0.2",
"lodash": "^4.17.21",
"uuid": "^9.0.1",
"winston": "^3.10.0"
},
"devDependencies": {
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"luxon": "^3.0.0"
},
"files": [
"dist"
]
}
@@ -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.
*/
/**
* The github-org backend module for the catalog plugin.
*
* @packageDocumentation
*/
export { catalogModuleGithubOrgEntityProvider as default } from './module';
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Backstage Authors
* 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.
@@ -19,7 +19,7 @@ import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { EntityProvider } from '@backstage/plugin-catalog-node';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
import { catalogModuleGithubOrgEntityProvider } from './catalogModuleGithubOrgEntityProvider';
import { catalogModuleGithubOrgEntityProvider } from './module';
describe('catalogModuleGithubOrgEntityProvider', () => {
it('should register provider at the catalog extension point', async () => {
@@ -1,5 +1,5 @@
/*
* Copyright 2022 The Backstage Authors
* 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.
@@ -64,7 +64,7 @@ export const githubOrgEntityProviderTransformsExtensionPoint =
/**
* Registers the `GithubMultiOrgEntityProvider` with the catalog processing extension point.
*
* @alpha
* @public
*/
export const catalogModuleGithubOrgEntityProvider = createBackendModule({
pluginId: 'catalog',
@@ -4,25 +4,10 @@
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { TeamTransformer } from '@backstage/plugin-catalog-backend-module-github';
import { UserTransformer } from '@backstage/plugin-catalog-backend-module-github';
// @alpha
const catalogModuleGithubEntityProvider: () => BackendFeature;
export default catalogModuleGithubEntityProvider;
// @alpha
export const catalogModuleGithubOrgEntityProvider: () => BackendFeature;
// @alpha
export interface GithubOrgEntityProviderTransformsExtensionPoint {
setTeamTransformer(transformer: TeamTransformer): void;
setUserTransformer(transformer: UserTransformer): void;
}
// @alpha
export const githubOrgEntityProviderTransformsExtensionPoint: ExtensionPoint<GithubOrgEntityProviderTransformsExtensionPoint>;
// (No @packageDocumentation comment for this package)
```
@@ -15,8 +15,3 @@
*/
export { catalogModuleGithubEntityProvider as default } from './catalogModuleGithubEntityProvider';
export {
catalogModuleGithubOrgEntityProvider,
githubOrgEntityProviderTransformsExtensionPoint,
type GithubOrgEntityProviderTransformsExtensionPoint,
} from './catalogModuleGithubOrgEntityProvider';
+88 -3
View File
@@ -5497,7 +5497,30 @@ __metadata:
languageName: unknown
linkType: soft
"@backstage/plugin-catalog-backend-module-github@workspace:plugins/catalog-backend-module-github":
"@backstage/plugin-catalog-backend-module-github-org@workspace:plugins/catalog-backend-module-github-org":
version: 0.0.0-use.local
resolution: "@backstage/plugin-catalog-backend-module-github-org@workspace:plugins/catalog-backend-module-github-org"
dependencies:
"@backstage/backend-common": "workspace:^"
"@backstage/backend-plugin-api": "workspace:^"
"@backstage/backend-tasks": "workspace:^"
"@backstage/backend-test-utils": "workspace:^"
"@backstage/catalog-model": "workspace:^"
"@backstage/cli": "workspace:^"
"@backstage/config": "workspace:^"
"@backstage/integration": "workspace:^"
"@backstage/plugin-catalog-backend-module-github": "workspace:^"
"@backstage/plugin-catalog-node": "workspace:^"
"@backstage/plugin-events-node": "workspace:^"
"@octokit/graphql": ^7.0.2
lodash: ^4.17.21
luxon: ^3.0.0
uuid: ^9.0.1
winston: ^3.10.0
languageName: unknown
linkType: soft
"@backstage/plugin-catalog-backend-module-github@workspace:^, @backstage/plugin-catalog-backend-module-github@workspace:plugins/catalog-backend-module-github":
version: 0.0.0-use.local
resolution: "@backstage/plugin-catalog-backend-module-github@workspace:plugins/catalog-backend-module-github"
dependencies:
@@ -14024,6 +14047,17 @@ __metadata:
languageName: node
linkType: hard
"@octokit/endpoint@npm:^9.0.0":
version: 9.0.1
resolution: "@octokit/endpoint@npm:9.0.1"
dependencies:
"@octokit/types": ^12.0.0
is-plain-object: ^5.0.0
universal-user-agent: ^6.0.0
checksum: 4f700c66829ed0b5ced3c0d018d63de1ecf1a267064095e450b6cfeb6abddecc704947d3f04e4921ac0d4d73595d81d52802d3306945ba7a642f1386fd8db68b
languageName: node
linkType: hard
"@octokit/graphql-schema@npm:^13.7.0":
version: 13.10.0
resolution: "@octokit/graphql-schema@npm:13.10.0"
@@ -14045,6 +14079,17 @@ __metadata:
languageName: node
linkType: hard
"@octokit/graphql@npm:^7.0.2":
version: 7.0.2
resolution: "@octokit/graphql@npm:7.0.2"
dependencies:
"@octokit/request": ^8.0.1
"@octokit/types": ^12.0.0
universal-user-agent: ^6.0.0
checksum: 05a752c4c2d84fc2900d8e32e1c2d1ee98a5a14349e651cb1109d0741e821e7417a048b1bb40918534ed90a472314aabbda35688868016f248098925f82a3bfa
languageName: node
linkType: hard
"@octokit/oauth-app@npm:^4.0.7, @octokit/oauth-app@npm:^4.2.0, @octokit/oauth-app@npm:^4.2.1":
version: 4.2.4
resolution: "@octokit/oauth-app@npm:4.2.4"
@@ -14123,6 +14168,13 @@ __metadata:
languageName: node
linkType: hard
"@octokit/openapi-types@npm:^19.0.0":
version: 19.0.0
resolution: "@octokit/openapi-types@npm:19.0.0"
checksum: 9a8125ab4e1651ca4b2f734cfa15ca52fe9fa0edd87696e4f57dfa2bcd472767f0f8a99b9324be21f863e6cd91afee423982189f97ac018f3c78a83560e616f5
languageName: node
linkType: hard
"@octokit/plugin-paginate-rest@npm:^6.0.0, @octokit/plugin-paginate-rest@npm:^6.1.0, @octokit/plugin-paginate-rest@npm:^6.1.2":
version: 6.1.2
resolution: "@octokit/plugin-paginate-rest@npm:6.1.2"
@@ -14202,6 +14254,17 @@ __metadata:
languageName: node
linkType: hard
"@octokit/request-error@npm:^5.0.0":
version: 5.0.1
resolution: "@octokit/request-error@npm:5.0.1"
dependencies:
"@octokit/types": ^12.0.0
deprecation: ^2.0.0
once: ^1.4.0
checksum: a681341e43b4da7a8acb19e1a6ba0355b1af146fa0191f2554a98950cf85f898af6ae3ab0b0287d6c871f5465ec57cb38363b96b5019f9f77ba6f30eca39ede5
languageName: node
linkType: hard
"@octokit/request@npm:^5.4.14, @octokit/request@npm:^5.6.3":
version: 5.6.3
resolution: "@octokit/request@npm:5.6.3"
@@ -14230,6 +14293,19 @@ __metadata:
languageName: node
linkType: hard
"@octokit/request@npm:^8.0.1":
version: 8.1.2
resolution: "@octokit/request@npm:8.1.2"
dependencies:
"@octokit/endpoint": ^9.0.0
"@octokit/request-error": ^5.0.0
"@octokit/types": ^12.0.0
is-plain-object: ^5.0.0
universal-user-agent: ^6.0.0
checksum: 77b9221916f557bba633293ee0d1418766ae59fdfd7ccd626bbcbf0748c6d5dec80fead29f62d8eb427b32e4d8fc4de61c3f9d23999563580890b80b52ccc8e6
languageName: node
linkType: hard
"@octokit/rest@npm:^19.0.3":
version: 19.0.13
resolution: "@octokit/rest@npm:19.0.13"
@@ -14249,6 +14325,15 @@ __metadata:
languageName: node
linkType: hard
"@octokit/types@npm:^12.0.0":
version: 12.0.0
resolution: "@octokit/types@npm:12.0.0"
dependencies:
"@octokit/openapi-types": ^19.0.0
checksum: ad55e13cbeef96a63d0088df2ed0a8f3ca764db3f877aa2ecb1693de40b03c1f8e392603bd7fddaaaa74138970ea39f46e4b830d15eeeba74be1671f36440129
languageName: node
linkType: hard
"@octokit/types@npm:^6.0.3, @octokit/types@npm:^6.10.0, @octokit/types@npm:^6.12.2, @octokit/types@npm:^6.16.1, @octokit/types@npm:^6.8.2":
version: 6.41.0
resolution: "@octokit/types@npm:6.41.0"
@@ -41842,7 +41927,7 @@ __metadata:
languageName: node
linkType: hard
"uuid@npm:^9.0.0":
"uuid@npm:^9.0.0, uuid@npm:^9.0.1":
version: 9.0.1
resolution: "uuid@npm:9.0.1"
bin:
@@ -42602,7 +42687,7 @@ __metadata:
languageName: node
linkType: hard
"winston@npm:^3.2.1":
"winston@npm:^3.10.0, winston@npm:^3.2.1":
version: 3.10.0
resolution: "winston@npm:3.10.0"
dependencies: