@backstage/plugin-catalog-backend-module-bitbucket-cloud 0.0.0-nightly-20220531024457
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 +68 -0
- package/README.md +9 -0
- package/config.d.ts +90 -0
- package/dist/index.cjs.js +186 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @backstage/plugin-catalog-backend-module-bitbucket-cloud
|
|
2
|
+
|
|
3
|
+
## 0.0.0-nightly-20220531024457
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- dfc4efcbf0: Add new plugin `catalog-backend-module-bitbucket-cloud` with `BitbucketCloudEntityProvider`.
|
|
8
|
+
|
|
9
|
+
This entity provider is an alternative/replacement to the `BitbucketDiscoveryProcessor` **_(for Bitbucket Cloud only!)_**.
|
|
10
|
+
It replaces use cases using `search=true` and should be powerful enough as a complete replacement.
|
|
11
|
+
|
|
12
|
+
If any feature for Bitbucket Cloud is missing and preventing you from switching, please raise an issue.
|
|
13
|
+
|
|
14
|
+
**Before:**
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
// packages/backend/src/plugins/catalog.ts
|
|
18
|
+
|
|
19
|
+
builder.addProcessor(
|
|
20
|
+
BitbucketDiscoveryProcessor.fromConfig(env.config, { logger: env.logger }),
|
|
21
|
+
);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
# app-config.yaml
|
|
26
|
+
|
|
27
|
+
catalog:
|
|
28
|
+
locations:
|
|
29
|
+
- type: bitbucket-discovery
|
|
30
|
+
target: 'https://bitbucket.org/workspaces/workspace-name/projects/apis-*/repos/service-*?search=true&catalogPath=/catalog-info.yaml'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**After:**
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// packages/backend/src/plugins/catalog.ts
|
|
37
|
+
builder.addEntityProvider(
|
|
38
|
+
BitbucketCloudEntityProvider.fromConfig(env.config, {
|
|
39
|
+
logger: env.logger,
|
|
40
|
+
schedule: env.scheduler.createScheduledTaskRunner({
|
|
41
|
+
frequency: { minutes: 30 },
|
|
42
|
+
timeout: { minutes: 3 },
|
|
43
|
+
}),
|
|
44
|
+
}),
|
|
45
|
+
);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
# app-config.yaml
|
|
50
|
+
|
|
51
|
+
catalog:
|
|
52
|
+
providers:
|
|
53
|
+
bitbucketCloud:
|
|
54
|
+
yourProviderId: # identifies your ingested dataset
|
|
55
|
+
catalogPath: /catalog-info.yaml # default value
|
|
56
|
+
filters: # optional
|
|
57
|
+
projectKey: '^apis-.* # optional; RegExp
|
|
58
|
+
repoSlug: '^service-.* # optional; RegExp
|
|
59
|
+
workspace: workspace-name
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies
|
|
65
|
+
- @backstage/backend-tasks@0.0.0-nightly-20220531024457
|
|
66
|
+
- @backstage/integration@0.0.0-nightly-20220531024457
|
|
67
|
+
- @backstage/plugin-catalog-backend@0.0.0-nightly-20220531024457
|
|
68
|
+
- @backstage/plugin-bitbucket-cloud-common@0.0.0-nightly-20220531024457
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Catalog Backend Module for Bitbucket Cloud
|
|
2
|
+
|
|
3
|
+
This is an extension module to the catalog-backend plugin,
|
|
4
|
+
providing extensions targeted at Bitbucket Cloud offerings.
|
|
5
|
+
|
|
6
|
+
## Getting started
|
|
7
|
+
|
|
8
|
+
See [Backstage documentation](https://backstage.io/docs/integrations/bitbucketCloud/discovery)
|
|
9
|
+
for details on how to install and configure the plugin.
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2022 The Backstage Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export interface Config {
|
|
18
|
+
catalog?: {
|
|
19
|
+
/**
|
|
20
|
+
* List of provider-specific options and attributes
|
|
21
|
+
*/
|
|
22
|
+
providers?: {
|
|
23
|
+
/**
|
|
24
|
+
* BitbucketCloudEntityProvider configuration
|
|
25
|
+
*
|
|
26
|
+
* Uses "default" as default id for the single config variant.
|
|
27
|
+
*/
|
|
28
|
+
bitbucketCloud?:
|
|
29
|
+
| {
|
|
30
|
+
/**
|
|
31
|
+
* (Optional) Path to the catalog file. Default to "/catalog-info.yaml".
|
|
32
|
+
* @visibility frontend
|
|
33
|
+
*/
|
|
34
|
+
catalogPath?: string;
|
|
35
|
+
/**
|
|
36
|
+
* (Required) Your workspace.
|
|
37
|
+
* @visibility frontend
|
|
38
|
+
*/
|
|
39
|
+
workspace: string;
|
|
40
|
+
/**
|
|
41
|
+
* (Optional) Filters applied to discovered catalog files in repositories.
|
|
42
|
+
* @visibility frontend
|
|
43
|
+
*/
|
|
44
|
+
filters?: {
|
|
45
|
+
/**
|
|
46
|
+
* (Optional) Filter for the repository slug.
|
|
47
|
+
* @visibility frontend
|
|
48
|
+
*/
|
|
49
|
+
repoSlug?: RegExp;
|
|
50
|
+
/**
|
|
51
|
+
* (Optional) Filter for the project key.
|
|
52
|
+
* @visibility frontend
|
|
53
|
+
*/
|
|
54
|
+
projectKey?: RegExp;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
| Record<
|
|
58
|
+
string,
|
|
59
|
+
{
|
|
60
|
+
/**
|
|
61
|
+
* (Optional) Path to the catalog file. Default to "/catalog-info.yaml".
|
|
62
|
+
* @visibility frontend
|
|
63
|
+
*/
|
|
64
|
+
catalogPath?: string;
|
|
65
|
+
/**
|
|
66
|
+
* (Required) Your workspace.
|
|
67
|
+
* @visibility frontend
|
|
68
|
+
*/
|
|
69
|
+
workspace: string;
|
|
70
|
+
/**
|
|
71
|
+
* (Optional) Filters applied to discovered catalog files in repositories.
|
|
72
|
+
* @visibility frontend
|
|
73
|
+
*/
|
|
74
|
+
filters?: {
|
|
75
|
+
/**
|
|
76
|
+
* (Optional) Filter for the repository slug.
|
|
77
|
+
* @visibility frontend
|
|
78
|
+
*/
|
|
79
|
+
repoSlug?: RegExp;
|
|
80
|
+
/**
|
|
81
|
+
* (Optional) Filter for the project key.
|
|
82
|
+
* @visibility frontend
|
|
83
|
+
*/
|
|
84
|
+
projectKey?: RegExp;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
>;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var integration = require('@backstage/integration');
|
|
6
|
+
var pluginBitbucketCloudCommon = require('@backstage/plugin-bitbucket-cloud-common');
|
|
7
|
+
var pluginCatalogBackend = require('@backstage/plugin-catalog-backend');
|
|
8
|
+
var uuid = require('uuid');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n["default"] = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var uuid__namespace = /*#__PURE__*/_interopNamespace(uuid);
|
|
29
|
+
|
|
30
|
+
const DEFAULT_CATALOG_PATH = "/catalog-info.yaml";
|
|
31
|
+
const DEFAULT_PROVIDER_ID = "default";
|
|
32
|
+
function readProviderConfigs(config) {
|
|
33
|
+
const providersConfig = config.getOptionalConfig("catalog.providers.bitbucketCloud");
|
|
34
|
+
if (!providersConfig) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
if (providersConfig.has("workspace")) {
|
|
38
|
+
return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];
|
|
39
|
+
}
|
|
40
|
+
return providersConfig.keys().map((id) => {
|
|
41
|
+
const providerConfig = providersConfig.getConfig(id);
|
|
42
|
+
return readProviderConfig(id, providerConfig);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function readProviderConfig(id, config) {
|
|
46
|
+
var _a;
|
|
47
|
+
const workspace = config.getString("workspace");
|
|
48
|
+
const catalogPath = (_a = config.getOptionalString("catalogPath")) != null ? _a : DEFAULT_CATALOG_PATH;
|
|
49
|
+
const projectKeyPattern = config.getOptionalString("filters.projectKey");
|
|
50
|
+
const repoSlugPattern = config.getOptionalString("filters.repoSlug");
|
|
51
|
+
return {
|
|
52
|
+
id,
|
|
53
|
+
catalogPath,
|
|
54
|
+
workspace,
|
|
55
|
+
filters: {
|
|
56
|
+
projectKey: projectKeyPattern ? compileRegExp(projectKeyPattern) : void 0,
|
|
57
|
+
repoSlug: repoSlugPattern ? compileRegExp(repoSlugPattern) : void 0
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function compileRegExp(pattern) {
|
|
62
|
+
let fullLinePattern = pattern;
|
|
63
|
+
if (!fullLinePattern.startsWith("^")) {
|
|
64
|
+
fullLinePattern = `^${fullLinePattern}`;
|
|
65
|
+
}
|
|
66
|
+
if (!fullLinePattern.endsWith("$")) {
|
|
67
|
+
fullLinePattern = `${fullLinePattern}$`;
|
|
68
|
+
}
|
|
69
|
+
return new RegExp(fullLinePattern);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const DEFAULT_BRANCH = "master";
|
|
73
|
+
class BitbucketCloudEntityProvider {
|
|
74
|
+
static fromConfig(config, options) {
|
|
75
|
+
const integrations = integration.ScmIntegrations.fromConfig(config);
|
|
76
|
+
const integration$1 = integrations.bitbucketCloud.byHost("bitbucket.org");
|
|
77
|
+
if (!integration$1) {
|
|
78
|
+
throw new Error("No integration for bitbucket.org available");
|
|
79
|
+
}
|
|
80
|
+
return readProviderConfigs(config).map((providerConfig) => new BitbucketCloudEntityProvider(providerConfig, integration$1, options.logger, options.schedule));
|
|
81
|
+
}
|
|
82
|
+
constructor(config, integration, logger, schedule) {
|
|
83
|
+
this.client = pluginBitbucketCloudCommon.BitbucketCloudClient.fromConfig(integration.config);
|
|
84
|
+
this.config = config;
|
|
85
|
+
this.logger = logger.child({
|
|
86
|
+
target: this.getProviderName()
|
|
87
|
+
});
|
|
88
|
+
this.scheduleFn = this.createScheduleFn(schedule);
|
|
89
|
+
}
|
|
90
|
+
createScheduleFn(schedule) {
|
|
91
|
+
return async () => {
|
|
92
|
+
const taskId = this.getTaskId();
|
|
93
|
+
return schedule.run({
|
|
94
|
+
id: taskId,
|
|
95
|
+
fn: async () => {
|
|
96
|
+
const logger = this.logger.child({
|
|
97
|
+
class: BitbucketCloudEntityProvider.prototype.constructor.name,
|
|
98
|
+
taskId,
|
|
99
|
+
taskInstanceId: uuid__namespace.v4()
|
|
100
|
+
});
|
|
101
|
+
try {
|
|
102
|
+
await this.refresh(logger);
|
|
103
|
+
} catch (error) {
|
|
104
|
+
logger.error(error);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
getProviderName() {
|
|
111
|
+
return `bitbucketCloud-provider:${this.config.id}`;
|
|
112
|
+
}
|
|
113
|
+
getTaskId() {
|
|
114
|
+
return `${this.getProviderName()}:refresh`;
|
|
115
|
+
}
|
|
116
|
+
async connect(connection) {
|
|
117
|
+
this.connection = connection;
|
|
118
|
+
await this.scheduleFn();
|
|
119
|
+
}
|
|
120
|
+
async refresh(logger) {
|
|
121
|
+
if (!this.connection) {
|
|
122
|
+
throw new Error("Not initialized");
|
|
123
|
+
}
|
|
124
|
+
logger.info("Discovering catalog files in Bitbucket Cloud repositories");
|
|
125
|
+
const targets = await this.findCatalogFiles();
|
|
126
|
+
const entities = targets.map(BitbucketCloudEntityProvider.toLocationSpec).map((location) => pluginCatalogBackend.locationSpecToLocationEntity({ location })).map((entity) => {
|
|
127
|
+
return {
|
|
128
|
+
locationKey: this.getProviderName(),
|
|
129
|
+
entity
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
await this.connection.applyMutation({
|
|
133
|
+
type: "full",
|
|
134
|
+
entities
|
|
135
|
+
});
|
|
136
|
+
logger.info(`Committed ${entities.length} Locations for catalog files in Bitbucket Cloud repositories`);
|
|
137
|
+
}
|
|
138
|
+
async findCatalogFiles() {
|
|
139
|
+
const workspace = this.config.workspace;
|
|
140
|
+
const catalogPath = this.config.catalogPath;
|
|
141
|
+
const catalogFilename = catalogPath.substring(catalogPath.lastIndexOf("/") + 1);
|
|
142
|
+
const fields = [
|
|
143
|
+
"-values.content_matches",
|
|
144
|
+
"+values.file.commit.repository.mainbranch.name",
|
|
145
|
+
"+values.file.commit.repository.project.key",
|
|
146
|
+
"+values.file.commit.repository.slug",
|
|
147
|
+
"-values.*.links",
|
|
148
|
+
"-values.*.*.links",
|
|
149
|
+
"-values.*.*.*.links",
|
|
150
|
+
"+values.file.commit.repository.links.html.href"
|
|
151
|
+
].join(",");
|
|
152
|
+
const query = `"${catalogFilename}" path:${catalogPath}`;
|
|
153
|
+
const searchResults = this.client.searchCode(workspace, query, { fields }).iterateResults();
|
|
154
|
+
const result = [];
|
|
155
|
+
for await (const searchResult of searchResults) {
|
|
156
|
+
if (searchResult.path_matches.length === 0) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const repository = searchResult.file.commit.repository;
|
|
160
|
+
if (this.matchesFilters(repository)) {
|
|
161
|
+
result.push(BitbucketCloudEntityProvider.toUrl(repository, searchResult.file.path));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
matchesFilters(repository) {
|
|
167
|
+
const filters = this.config.filters;
|
|
168
|
+
return !filters || (!filters.projectKey || filters.projectKey.test(repository.project.key)) && (!filters.repoSlug || filters.repoSlug.test(repository.slug));
|
|
169
|
+
}
|
|
170
|
+
static toUrl(repository, filePath) {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
const repoUrl = repository.links.html.href;
|
|
173
|
+
const branch = (_b = (_a = repository.mainbranch) == null ? void 0 : _a.name) != null ? _b : DEFAULT_BRANCH;
|
|
174
|
+
return `${repoUrl}/src/${branch}/${filePath}`;
|
|
175
|
+
}
|
|
176
|
+
static toLocationSpec(target) {
|
|
177
|
+
return {
|
|
178
|
+
type: "url",
|
|
179
|
+
target,
|
|
180
|
+
presence: "required"
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
exports.BitbucketCloudEntityProvider = BitbucketCloudEntityProvider;
|
|
186
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/BitbucketCloudEntityProviderConfig.ts","../src/BitbucketCloudEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 */\n\nimport { Config } from '@backstage/config';\n\nconst DEFAULT_CATALOG_PATH = '/catalog-info.yaml';\nconst DEFAULT_PROVIDER_ID = 'default';\n\nexport type BitbucketCloudEntityProviderConfig = {\n id: string;\n catalogPath: string;\n workspace: string;\n filters?: {\n projectKey?: RegExp;\n repoSlug?: RegExp;\n };\n};\n\nexport function readProviderConfigs(\n config: Config,\n): BitbucketCloudEntityProviderConfig[] {\n const providersConfig = config.getOptionalConfig(\n 'catalog.providers.bitbucketCloud',\n );\n if (!providersConfig) {\n return [];\n }\n\n if (providersConfig.has('workspace')) {\n // simple/single config variant\n return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];\n }\n\n return providersConfig.keys().map(id => {\n const providerConfig = providersConfig.getConfig(id);\n\n return readProviderConfig(id, providerConfig);\n });\n}\n\nfunction readProviderConfig(\n id: string,\n config: Config,\n): BitbucketCloudEntityProviderConfig {\n const workspace = config.getString('workspace');\n const catalogPath =\n config.getOptionalString('catalogPath') ?? DEFAULT_CATALOG_PATH;\n const projectKeyPattern = config.getOptionalString('filters.projectKey');\n const repoSlugPattern = config.getOptionalString('filters.repoSlug');\n\n return {\n id,\n catalogPath,\n workspace,\n filters: {\n projectKey: projectKeyPattern\n ? compileRegExp(projectKeyPattern)\n : undefined,\n repoSlug: repoSlugPattern ? compileRegExp(repoSlugPattern) : undefined,\n },\n };\n}\n\n/**\n * Compiles a RegExp while enforcing the pattern to contain\n * the start-of-line and end-of-line anchors.\n *\n * @param pattern\n */\nfunction compileRegExp(pattern: string): RegExp {\n let fullLinePattern = pattern;\n if (!fullLinePattern.startsWith('^')) {\n fullLinePattern = `^${fullLinePattern}`;\n }\n if (!fullLinePattern.endsWith('$')) {\n fullLinePattern = `${fullLinePattern}$`;\n }\n\n return new RegExp(fullLinePattern);\n}\n","/*\n * Copyright 2022 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 */\n\nimport { TaskRunner } from '@backstage/backend-tasks';\nimport { Config } from '@backstage/config';\nimport {\n BitbucketCloudIntegration,\n ScmIntegrations,\n} from '@backstage/integration';\nimport {\n BitbucketCloudClient,\n Models,\n} from '@backstage/plugin-bitbucket-cloud-common';\nimport {\n EntityProvider,\n EntityProviderConnection,\n LocationSpec,\n locationSpecToLocationEntity,\n} from '@backstage/plugin-catalog-backend';\nimport {\n BitbucketCloudEntityProviderConfig,\n readProviderConfigs,\n} from './BitbucketCloudEntityProviderConfig';\nimport * as uuid from 'uuid';\nimport { Logger } from 'winston';\n\nconst DEFAULT_BRANCH = 'master';\n\n/**\n * Discovers catalog files located in [Bitbucket Cloud](https://bitbucket.org).\n * The provider will search your Bitbucket Cloud account and register catalog files matching the configured path\n * as Location entity and via following processing steps add all contained catalog entities.\n * This can be useful as an alternative to static locations or manually adding things to the catalog.\n *\n * @public\n */\nexport class BitbucketCloudEntityProvider implements EntityProvider {\n private readonly client: BitbucketCloudClient;\n private readonly config: BitbucketCloudEntityProviderConfig;\n private readonly logger: Logger;\n private readonly scheduleFn: () => Promise<void>;\n private connection?: EntityProviderConnection;\n\n static fromConfig(\n config: Config,\n options: {\n logger: Logger;\n schedule: TaskRunner;\n },\n ): BitbucketCloudEntityProvider[] {\n const integrations = ScmIntegrations.fromConfig(config);\n const integration = integrations.bitbucketCloud.byHost('bitbucket.org');\n if (!integration) {\n // this should never happen as we add a default integration,\n // but as a general safeguard, e.g. if this approach gets changed\n throw new Error('No integration for bitbucket.org available');\n }\n\n return readProviderConfigs(config).map(\n providerConfig =>\n new BitbucketCloudEntityProvider(\n providerConfig,\n integration,\n options.logger,\n options.schedule,\n ),\n );\n }\n\n private constructor(\n config: BitbucketCloudEntityProviderConfig,\n integration: BitbucketCloudIntegration,\n logger: Logger,\n schedule: TaskRunner,\n ) {\n this.client = BitbucketCloudClient.fromConfig(integration.config);\n this.config = config;\n this.logger = logger.child({\n target: this.getProviderName(),\n });\n this.scheduleFn = this.createScheduleFn(schedule);\n }\n\n private createScheduleFn(schedule: TaskRunner): () => Promise<void> {\n return async () => {\n const taskId = this.getTaskId();\n return schedule.run({\n id: taskId,\n fn: async () => {\n const logger = this.logger.child({\n class: BitbucketCloudEntityProvider.prototype.constructor.name,\n taskId,\n taskInstanceId: uuid.v4(),\n });\n\n try {\n await this.refresh(logger);\n } catch (error) {\n logger.error(error);\n }\n },\n });\n };\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */\n getProviderName(): string {\n return `bitbucketCloud-provider:${this.config.id}`;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getTaskId} */\n getTaskId(): string {\n return `${this.getProviderName()}:refresh`;\n }\n\n /** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */\n async connect(connection: EntityProviderConnection): Promise<void> {\n this.connection = connection;\n await this.scheduleFn();\n }\n\n async refresh(logger: Logger) {\n if (!this.connection) {\n throw new Error('Not initialized');\n }\n\n logger.info('Discovering catalog files in Bitbucket Cloud repositories');\n\n const targets = await this.findCatalogFiles();\n const entities = targets\n .map(BitbucketCloudEntityProvider.toLocationSpec)\n .map(location => locationSpecToLocationEntity({ location }))\n .map(entity => {\n return {\n locationKey: this.getProviderName(),\n entity: entity,\n };\n });\n\n await this.connection.applyMutation({\n type: 'full',\n entities: entities,\n });\n\n logger.info(\n `Committed ${entities.length} Locations for catalog files in Bitbucket Cloud repositories`,\n );\n }\n\n private async findCatalogFiles(): Promise<string[]> {\n const workspace = this.config.workspace;\n const catalogPath = this.config.catalogPath;\n\n const catalogFilename = catalogPath.substring(\n catalogPath.lastIndexOf('/') + 1,\n );\n\n // load all fields relevant for creating refs later, but not more\n const fields = [\n // exclude code/content match details\n '-values.content_matches',\n // include/add relevant repository details\n '+values.file.commit.repository.mainbranch.name',\n '+values.file.commit.repository.project.key',\n '+values.file.commit.repository.slug',\n // remove irrelevant links\n '-values.*.links',\n '-values.*.*.links',\n '-values.*.*.*.links',\n // ...except the one we need\n '+values.file.commit.repository.links.html.href',\n ].join(',');\n const query = `\"${catalogFilename}\" path:${catalogPath}`;\n const searchResults = this.client\n .searchCode(workspace, query, { fields })\n .iterateResults();\n\n const result: string[] = [];\n\n for await (const searchResult of searchResults) {\n // not a file match, but a code match\n if (searchResult.path_matches!.length === 0) {\n continue;\n }\n\n const repository = searchResult.file!.commit!.repository!;\n if (this.matchesFilters(repository)) {\n result.push(\n BitbucketCloudEntityProvider.toUrl(\n repository,\n searchResult.file!.path!,\n ),\n );\n }\n }\n\n return result;\n }\n\n private matchesFilters(repository: Models.Repository): boolean {\n const filters = this.config.filters;\n return (\n !filters ||\n ((!filters.projectKey ||\n filters.projectKey.test(repository.project!.key!)) &&\n (!filters.repoSlug || filters.repoSlug.test(repository.slug!)))\n );\n }\n\n private static toUrl(\n repository: Models.Repository,\n filePath: string,\n ): string {\n const repoUrl = repository.links!.html!.href;\n const branch = repository.mainbranch?.name ?? DEFAULT_BRANCH;\n\n return `${repoUrl}/src/${branch}/${filePath}`;\n }\n\n private static toLocationSpec(target: string): LocationSpec {\n return {\n type: 'url',\n target: target,\n presence: 'required',\n };\n }\n}\n"],"names":["ScmIntegrations","integration","BitbucketCloudClient","uuid","loc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UAAU,EAAE;AAC7B,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;AACxC,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AACjK,GAAG;AACH,EAAE,OAAO,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE;AACrC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC/C,IAAI,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,UAAU,CAAC,UAAU,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,IAAI,GAAG,EAAE,GAAG,cAAc,CAAC;AAChH,IAAI,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClD,GAAG;AACH,EAAE,OAAO,cAAc,CAAC,MAAM,EAAE;AAChC,IAAI,OAAO;AACX,MAAM,IAAI,EAAE,KAAK;AACjB,MAAM,MAAM;AACZ,MAAM,QAAQ,EAAE,UAAU;AAC1B,KAAK,CAAC;AACN,GAAG;AACH;;;;"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TaskRunner } from '@backstage/backend-tasks';
|
|
2
|
+
import { Config } from '@backstage/config';
|
|
3
|
+
import { EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-backend';
|
|
4
|
+
import { Logger } from 'winston';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Discovers catalog files located in [Bitbucket Cloud](https://bitbucket.org).
|
|
8
|
+
* The provider will search your Bitbucket Cloud account and register catalog files matching the configured path
|
|
9
|
+
* as Location entity and via following processing steps add all contained catalog entities.
|
|
10
|
+
* This can be useful as an alternative to static locations or manually adding things to the catalog.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
declare class BitbucketCloudEntityProvider implements EntityProvider {
|
|
15
|
+
private readonly client;
|
|
16
|
+
private readonly config;
|
|
17
|
+
private readonly logger;
|
|
18
|
+
private readonly scheduleFn;
|
|
19
|
+
private connection?;
|
|
20
|
+
static fromConfig(config: Config, options: {
|
|
21
|
+
logger: Logger;
|
|
22
|
+
schedule: TaskRunner;
|
|
23
|
+
}): BitbucketCloudEntityProvider[];
|
|
24
|
+
private constructor();
|
|
25
|
+
private createScheduleFn;
|
|
26
|
+
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getProviderName} */
|
|
27
|
+
getProviderName(): string;
|
|
28
|
+
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.getTaskId} */
|
|
29
|
+
getTaskId(): string;
|
|
30
|
+
/** {@inheritdoc @backstage/plugin-catalog-backend#EntityProvider.connect} */
|
|
31
|
+
connect(connection: EntityProviderConnection): Promise<void>;
|
|
32
|
+
refresh(logger: Logger): Promise<void>;
|
|
33
|
+
private findCatalogFiles;
|
|
34
|
+
private matchesFilters;
|
|
35
|
+
private static toUrl;
|
|
36
|
+
private static toLocationSpec;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { BitbucketCloudEntityProvider };
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage/plugin-catalog-backend-module-bitbucket-cloud",
|
|
3
|
+
"description": "A Backstage catalog backend module that helps integrate towards Bitbucket Cloud",
|
|
4
|
+
"version": "0.0.0-nightly-20220531024457",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"private": false,
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public",
|
|
11
|
+
"main": "dist/index.cjs.js",
|
|
12
|
+
"types": "dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"backstage": {
|
|
15
|
+
"role": "backend-plugin-module"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://backstage.io",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/backstage/backstage",
|
|
21
|
+
"directory": "plugins/catalog-backend-module-bitbucket-cloud"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"backstage"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "backstage-cli package build",
|
|
28
|
+
"lint": "backstage-cli package lint",
|
|
29
|
+
"test": "backstage-cli package test",
|
|
30
|
+
"prepack": "backstage-cli package prepack",
|
|
31
|
+
"postpack": "backstage-cli package postpack",
|
|
32
|
+
"clean": "backstage-cli package clean",
|
|
33
|
+
"start": "backstage-cli package start"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@backstage/backend-tasks": "^0.0.0-nightly-20220531024457",
|
|
37
|
+
"@backstage/config": "^1.0.1",
|
|
38
|
+
"@backstage/integration": "^0.0.0-nightly-20220531024457",
|
|
39
|
+
"@backstage/plugin-bitbucket-cloud-common": "^0.0.0-nightly-20220531024457",
|
|
40
|
+
"@backstage/plugin-catalog-backend": "^0.0.0-nightly-20220531024457",
|
|
41
|
+
"uuid": "^8.0.0",
|
|
42
|
+
"winston": "^3.2.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@backstage/backend-common": "^0.0.0-nightly-20220531024457",
|
|
46
|
+
"@backstage/backend-test-utils": "^0.0.0-nightly-20220531024457",
|
|
47
|
+
"@backstage/cli": "^0.0.0-nightly-20220531024457",
|
|
48
|
+
"msw": "^0.35.0"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"config.d.ts"
|
|
53
|
+
],
|
|
54
|
+
"configSchema": "config.d.ts"
|
|
55
|
+
}
|