@backstage/plugin-scaffolder-backend 0.0.0-nightly-20220302023312 → 0.0.0-nightly-20220303023541

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,17 +1,24 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
- ## 0.0.0-nightly-20220302023312
3
+ ## 0.0.0-nightly-20220303023541
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 5c7f2343ea: Applied fix from version 0.17.2 of this package, which is part of the v0.69.2 release of Backstage.
8
+ - 34af86517c: ensure `apiBaseUrl` being set for Bitbucket integrations, replace hardcoded defaults
8
9
  - d6deb5e440: Set timeout for scaffolder octokit client
10
+ - 83a83381b0: Use the new `processingResult` export from the catalog backend
9
11
  - 7372f29473: Cleanup API report
10
12
  - c7f6424a26: Applied fix from `v0.17.1` of this package which is part of the `v0.69.1` release of Backstage.
11
13
  - 8119a9e011: Fix the support for custom defaultBranch values for Bitbucket Cloud at the `publish:bitbucket` scaffolder action.
12
14
  - Updated dependencies
13
- - @backstage/plugin-catalog-backend@0.0.0-nightly-20220302023312
14
- - @backstage/integration@0.0.0-nightly-20220302023312
15
+ - @backstage/plugin-catalog-backend@0.0.0-nightly-20220303023541
16
+ - @backstage/backend-common@0.0.0-nightly-20220303023541
17
+ - @backstage/integration@0.0.0-nightly-20220303023541
18
+ - @backstage/catalog-model@0.0.0-nightly-20220303023541
19
+ - @backstage/plugin-scaffolder-backend-module-cookiecutter@0.0.0-nightly-20220303023541
20
+ - @backstage/catalog-client@0.0.0-nightly-20220303023541
21
+ - @backstage/plugin-scaffolder-common@0.0.0-nightly-20220303023541
15
22
 
16
23
  ## 0.17.2
17
24
 
package/dist/index.cjs.js CHANGED
@@ -939,7 +939,8 @@ const createBitbucketCloudRepository = async (opts) => {
939
939
  description,
940
940
  repoVisibility,
941
941
  mainBranch,
942
- authorization
942
+ authorization,
943
+ apiBaseUrl
943
944
  } = opts;
944
945
  const options = {
945
946
  method: "POST",
@@ -956,7 +957,7 @@ const createBitbucketCloudRepository = async (opts) => {
956
957
  };
957
958
  let response;
958
959
  try {
959
- response = await fetch__default["default"](`https://api.bitbucket.org/2.0/repositories/${workspace}/${repo}`, options);
960
+ response = await fetch__default["default"](`${apiBaseUrl}/repositories/${workspace}/${repo}`, options);
960
961
  } catch (e) {
961
962
  throw new Error(`Unable to create repository, ${e}`);
962
963
  }
@@ -975,7 +976,6 @@ const createBitbucketCloudRepository = async (opts) => {
975
976
  };
976
977
  const createBitbucketServerRepository = async (opts) => {
977
978
  const {
978
- host,
979
979
  project,
980
980
  repo,
981
981
  description,
@@ -997,8 +997,7 @@ const createBitbucketServerRepository = async (opts) => {
997
997
  }
998
998
  };
999
999
  try {
1000
- const baseUrl = apiBaseUrl ? apiBaseUrl : `https://${host}/rest/api/1.0`;
1001
- response = await fetch__default["default"](`${baseUrl}/projects/${project}/repos`, options);
1000
+ response = await fetch__default["default"](`${apiBaseUrl}/projects/${project}/repos`, options);
1002
1001
  } catch (e) {
1003
1002
  throw new Error(`Unable to create repository, ${e}`);
1004
1003
  }
@@ -1118,12 +1117,15 @@ function createPublishBitbucketAction(options) {
1118
1117
  if (!integrationConfig) {
1119
1118
  throw new errors.InputError(`No matching integration configuration for host ${host}, please check your integrations config`);
1120
1119
  }
1121
- const authorization = getAuthorizationHeader(ctx.input.token ? { host: integrationConfig.config.host, token: ctx.input.token } : integrationConfig.config);
1120
+ const authorization = getAuthorizationHeader(ctx.input.token ? {
1121
+ host: integrationConfig.config.host,
1122
+ apiBaseUrl: integrationConfig.config.apiBaseUrl,
1123
+ token: ctx.input.token
1124
+ } : integrationConfig.config);
1122
1125
  const apiBaseUrl = integrationConfig.config.apiBaseUrl;
1123
1126
  const createMethod = host === "bitbucket.org" ? createBitbucketCloudRepository : createBitbucketServerRepository;
1124
1127
  const { remoteUrl, repoContentsUrl } = await createMethod({
1125
1128
  authorization,
1126
- host,
1127
1129
  workspace: workspace || "",
1128
1130
  project,
1129
1131
  repo,
@@ -3128,7 +3130,7 @@ class ScaffolderEntitiesProcessor {
3128
3130
  defaultKind: "Group",
3129
3131
  defaultNamespace: selfRef.namespace
3130
3132
  });
3131
- emit(pluginCatalogBackend.results.relation({
3133
+ emit(pluginCatalogBackend.processingResult.relation({
3132
3134
  source: selfRef,
3133
3135
  type: catalogModel.RELATION_OWNED_BY,
3134
3136
  target: {
@@ -3137,7 +3139,7 @@ class ScaffolderEntitiesProcessor {
3137
3139
  name: targetRef.name
3138
3140
  }
3139
3141
  }));
3140
- emit(pluginCatalogBackend.results.relation({
3142
+ emit(pluginCatalogBackend.processingResult.relation({
3141
3143
  source: {
3142
3144
  kind: targetRef.kind,
3143
3145
  namespace: targetRef.namespace,