@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor
2
2
 
3
+ ## 2.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 495ad08: Backstage version bump to v1.48.4
8
+
9
+ ### Patch Changes
10
+
11
+ - 9e7b674: Updated dependency `@gitbeaker/rest` to `^43.0.0`.
12
+
13
+ ## 2.12.0
14
+
15
+ ### Minor Changes
16
+
17
+ - b901dce: Backstage version bump to v1.47.3
18
+
3
19
  ## 2.11.0
4
20
 
5
21
  ### Minor Changes
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var backendPluginApi = require('@backstage/backend-plugin-api');
4
- var alpha = require('@backstage/plugin-catalog-node/alpha');
4
+ var pluginCatalogNode = require('@backstage/plugin-catalog-node');
5
5
  var pluginEventsNode = require('@backstage/plugin-events-node');
6
6
  var pluginNotificationsNode = require('@backstage/plugin-notifications-node');
7
7
  var catalogClient = require('@backstage/catalog-client');
@@ -18,7 +18,7 @@ const catalogModuleScaffolderRelationProcessor = backendPluginApi.createBackendM
18
18
  register(env) {
19
19
  env.registerInit({
20
20
  deps: {
21
- catalog: alpha.catalogProcessingExtensionPoint,
21
+ catalog: pluginCatalogNode.catalogProcessingExtensionPoint,
22
22
  logger: backendPluginApi.coreServices.logger,
23
23
  config: backendPluginApi.coreServices.rootConfig,
24
24
  events: pluginEventsNode.eventsServiceRef,
@@ -1 +1 @@
1
- {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { notificationService } from '@backstage/plugin-notifications-node';\nimport { CatalogClient } from '@backstage/catalog-client';\n\nimport { ScaffolderRelationEntityProcessor } from './ScaffolderRelationEntityProcessor';\nimport { handleTemplateUpdateNotifications } from './templateVersionUtils';\nimport { readScaffolderRelationProcessorConfig } from './templateVersionUtils';\nimport { TEMPLATE_VERSION_UPDATED_TOPIC } from './constants';\nimport { VcsProviderRegistry } from './pullRequests/vcs/VcsProviderRegistry';\nimport { GitHubProvider } from './pullRequests/vcs/providers/github/GitHubProvider';\nimport { GitLabProvider } from './pullRequests/vcs/providers/gitlab/GitLabProvider';\n\n/**\n * Catalog processor that adds link relation between scaffolder templates and their generated entities\n *\n * @public\n */\nexport const catalogModuleScaffolderRelationProcessor = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-relation-processor',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n events: eventsServiceRef,\n notifications: notificationService,\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n urlReader: coreServices.urlReader,\n },\n async init({\n catalog,\n logger,\n config,\n events,\n notifications,\n auth,\n discovery,\n urlReader,\n }) {\n logger.debug(\n 'Registering the scaffolder-relation-processor catalog module',\n );\n\n const processorConfig = readScaffolderRelationProcessorConfig(config);\n\n const catalogClient = new CatalogClient({ discoveryApi: discovery });\n\n // Initialize VCS provider registry\n const vcsRegistry = new VcsProviderRegistry();\n\n // Register GitHub provider\n const githubProvider = new GitHubProvider(\n logger,\n config,\n catalogClient,\n );\n vcsRegistry.registerProvider(githubProvider);\n\n // Register GitLab provider\n const gitlabProvider = new GitLabProvider(\n logger,\n config,\n catalogClient,\n );\n vcsRegistry.registerProvider(gitlabProvider);\n\n logger.debug('Registered VCS providers: github, gitlab');\n\n const notificationsEnabled =\n processorConfig.notifications?.templateUpdate?.enabled;\n const pullRequestsEnabled =\n processorConfig.pullRequests?.templateUpdate?.enabled;\n\n // Subscribe to events if either notifications or pull requests are enabled\n if (notificationsEnabled || pullRequestsEnabled) {\n await events.subscribe({\n id: 'scaffolder-relation-processor',\n topics: [TEMPLATE_VERSION_UPDATED_TOPIC],\n async onEvent(params) {\n const payload = params.eventPayload as {\n entityRef: string;\n previousVersion: string;\n currentVersion: string;\n };\n\n logger.info(\n `Received template update event for ${payload.entityRef}: ` +\n `${payload.previousVersion} -> ${payload.currentVersion}`,\n );\n\n handleTemplateUpdateNotifications(\n catalogClient,\n notifications,\n auth,\n processorConfig,\n payload,\n logger,\n urlReader,\n vcsRegistry,\n config,\n );\n },\n });\n }\n\n catalog.addProcessor(new ScaffolderRelationEntityProcessor(events));\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","eventsServiceRef","notificationService","readScaffolderRelationProcessorConfig","catalogClient","CatalogClient","VcsProviderRegistry","GitHubProvider","GitLabProvider","TEMPLATE_VERSION_UPDATED_TOPIC","handleTemplateUpdateNotifications","ScaffolderRelationEntityProcessor"],"mappings":";;;;;;;;;;;;;;AAqCO,MAAM,2CAA2CA,oCAAoB,CAAA;AAAA,EAC1E,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,+BAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,MAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,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YACvC,MAAM,QAAQ,MAAQ,EAAA;AACpB,cAAA,MAAM,UAAU,MAAO,CAAA,YAAA;AAMvB,cAAO,MAAA,CAAA,IAAA;AAAA,gBACL,CAAA,mCAAA,EAAsC,QAAQ,SAAS,CAAA,EAAA,EAClD,QAAQ,eAAe,CAAA,IAAA,EAAO,QAAQ,cAAc,CAAA;AAAA,eAC3D;AAEA,cAAAC,sDAAA;AAAA,gBACEN,eAAA;AAAA,gBACA,aAAA;AAAA,gBACA,IAAA;AAAA,gBACA,eAAA;AAAA,gBACA,OAAA;AAAA,gBACA,MAAA;AAAA,gBACA,SAAA;AAAA,gBACA,WAAA;AAAA,gBACA;AAAA,eACF;AAAA;AACF,WACD,CAAA;AAAA;AAGH,QAAA,OAAA,CAAQ,YAAa,CAAA,IAAIO,mEAAkC,CAAA,MAAM,CAAC,CAAA;AAAA;AACpE,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { notificationService } from '@backstage/plugin-notifications-node';\nimport { CatalogClient } from '@backstage/catalog-client';\n\nimport { ScaffolderRelationEntityProcessor } from './ScaffolderRelationEntityProcessor';\nimport { handleTemplateUpdateNotifications } from './templateVersionUtils';\nimport { readScaffolderRelationProcessorConfig } from './templateVersionUtils';\nimport { TEMPLATE_VERSION_UPDATED_TOPIC } from './constants';\nimport { VcsProviderRegistry } from './pullRequests/vcs/VcsProviderRegistry';\nimport { GitHubProvider } from './pullRequests/vcs/providers/github/GitHubProvider';\nimport { GitLabProvider } from './pullRequests/vcs/providers/gitlab/GitLabProvider';\n\n/**\n * Catalog processor that adds link relation between scaffolder templates and their generated entities\n *\n * @public\n */\nexport const catalogModuleScaffolderRelationProcessor = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'scaffolder-relation-processor',\n register(env) {\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n config: coreServices.rootConfig,\n events: eventsServiceRef,\n notifications: notificationService,\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n urlReader: coreServices.urlReader,\n },\n async init({\n catalog,\n logger,\n config,\n events,\n notifications,\n auth,\n discovery,\n urlReader,\n }) {\n logger.debug(\n 'Registering the scaffolder-relation-processor catalog module',\n );\n\n const processorConfig = readScaffolderRelationProcessorConfig(config);\n\n const catalogClient = new CatalogClient({ discoveryApi: discovery });\n\n // Initialize VCS provider registry\n const vcsRegistry = new VcsProviderRegistry();\n\n // Register GitHub provider\n const githubProvider = new GitHubProvider(\n logger,\n config,\n catalogClient,\n );\n vcsRegistry.registerProvider(githubProvider);\n\n // Register GitLab provider\n const gitlabProvider = new GitLabProvider(\n logger,\n config,\n catalogClient,\n );\n vcsRegistry.registerProvider(gitlabProvider);\n\n logger.debug('Registered VCS providers: github, gitlab');\n\n const notificationsEnabled =\n processorConfig.notifications?.templateUpdate?.enabled;\n const pullRequestsEnabled =\n processorConfig.pullRequests?.templateUpdate?.enabled;\n\n // Subscribe to events if either notifications or pull requests are enabled\n if (notificationsEnabled || pullRequestsEnabled) {\n await events.subscribe({\n id: 'scaffolder-relation-processor',\n topics: [TEMPLATE_VERSION_UPDATED_TOPIC],\n async onEvent(params) {\n const payload = params.eventPayload as {\n entityRef: string;\n previousVersion: string;\n currentVersion: string;\n };\n\n logger.info(\n `Received template update event for ${payload.entityRef}: ` +\n `${payload.previousVersion} -> ${payload.currentVersion}`,\n );\n\n handleTemplateUpdateNotifications(\n catalogClient,\n notifications,\n auth,\n processorConfig,\n payload,\n logger,\n urlReader,\n vcsRegistry,\n config,\n );\n },\n });\n }\n\n catalog.addProcessor(new ScaffolderRelationEntityProcessor(events));\n },\n });\n },\n});\n"],"names":["createBackendModule","catalogProcessingExtensionPoint","coreServices","eventsServiceRef","notificationService","readScaffolderRelationProcessorConfig","catalogClient","CatalogClient","VcsProviderRegistry","GitHubProvider","GitLabProvider","TEMPLATE_VERSION_UPDATED_TOPIC","handleTemplateUpdateNotifications","ScaffolderRelationEntityProcessor"],"mappings":";;;;;;;;;;;;;;AAqCO,MAAM,2CAA2CA,oCAAoB,CAAA;AAAA,EAC1E,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,+BAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,OAAS,EAAAC,iDAAA;AAAA,QACT,QAAQC,6BAAa,CAAA,MAAA;AAAA,QACrB,QAAQA,6BAAa,CAAA,UAAA;AAAA,QACrB,MAAQ,EAAAC,iCAAA;AAAA,QACR,aAAe,EAAAC,2CAAA;AAAA,QACf,MAAMF,6BAAa,CAAA,IAAA;AAAA,QACnB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,WAAWA,6BAAa,CAAA;AAAA,OAC1B;AAAA,MACA,MAAM,IAAK,CAAA;AAAA,QACT,OAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,MAAA;AAAA,QACA,aAAA;AAAA,QACA,IAAA;AAAA,QACA,SAAA;AAAA,QACA;AAAA,OACC,EAAA;AACD,QAAO,MAAA,CAAA,KAAA;AAAA,UACL;AAAA,SACF;AAEA,QAAM,MAAA,eAAA,GAAkBG,2DAAsC,MAAM,CAAA;AAEpE,QAAA,MAAMC,k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,YAAa,CAAA,IAAIO,mEAAkC,CAAA,MAAM,CAAC,CAAA;AAAA;AACpE,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-catalog-backend-module-scaffolder-relation-processor",
3
3
  "description": "The scaffolder-relation-processor backend module for the catalog plugin.",
4
- "version": "2.11.0",
4
+ "version": "2.13.0",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -48,24 +48,24 @@
48
48
  "tsc": "tsc"
49
49
  },
50
50
  "dependencies": {
51
- "@backstage/backend-plugin-api": "^1.5.0",
52
- "@backstage/catalog-client": "^1.12.1",
51
+ "@backstage/backend-plugin-api": "^1.7.0",
52
+ "@backstage/catalog-client": "^1.13.0",
53
53
  "@backstage/catalog-model": "^1.7.6",
54
- "@backstage/integration": "^1.18.1",
55
- "@backstage/plugin-catalog-node": "^1.20.0",
56
- "@backstage/plugin-events-node": "^0.4.17",
57
- "@backstage/plugin-notifications-common": "^0.2.0",
58
- "@backstage/plugin-notifications-node": "^0.2.21",
59
- "@gitbeaker/rest": "^42.0.0",
54
+ "@backstage/integration": "^1.20.1",
55
+ "@backstage/plugin-catalog-node": "^2.0.0",
56
+ "@backstage/plugin-events-node": "^0.4.19",
57
+ "@backstage/plugin-notifications-common": "^0.2.1",
58
+ "@backstage/plugin-notifications-node": "^0.2.23",
59
+ "@gitbeaker/rest": "^43.0.0",
60
60
  "@octokit/core": "^6.0.0",
61
61
  "git-url-parse": "^16.1.0",
62
62
  "octokit-plugin-create-pull-request": "^6.0.1"
63
63
  },
64
64
  "devDependencies": {
65
- "@backstage/backend-test-utils": "^1.10.1",
66
- "@backstage/cli": "^0.34.5",
65
+ "@backstage/backend-test-utils": "^1.11.0",
66
+ "@backstage/cli": "^0.35.4",
67
67
  "@backstage/config": "^1.3.6",
68
- "@backstage/plugin-catalog-common": "^1.1.7"
68
+ "@backstage/plugin-catalog-common": "^1.1.8"
69
69
  },
70
70
  "files": [
71
71
  "config.d.ts",