@backstage/plugin-scaffolder-backend-module-bitbucket-server 0.1.7 → 0.1.8-next.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,17 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-bitbucket-server
2
2
 
3
+ ## 0.1.8-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 24dd655: Add examples for `publish:bitbucketServer:pull-request` scaffolder action & improve related tests
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@0.6.18-next.0
10
+ - @backstage/plugin-scaffolder-node@0.4.4-next.0
11
+ - @backstage/config@1.2.0
12
+ - @backstage/errors@1.2.4
13
+ - @backstage/integration@1.10.0
14
+
3
15
  ## 0.1.7
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -17,7 +17,7 @@ var fetch__default = /*#__PURE__*/_interopDefaultCompat(fetch);
17
17
  var yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
18
18
  var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
19
19
 
20
- const examples = [
20
+ const examples$1 = [
21
21
  {
22
22
  description: "Initialize git repository with required properties",
23
23
  example: yaml__default.default.stringify({
@@ -197,7 +197,7 @@ function createPublishBitbucketServerAction(options) {
197
197
  return pluginScaffolderNode.createTemplateAction({
198
198
  id: "publish:bitbucketServer",
199
199
  description: "Initializes a git repository of the content in the workspace, and publishes it to Bitbucket Server.",
200
- examples,
200
+ examples: examples$1,
201
201
  schema: {
202
202
  input: {
203
203
  type: "object",
@@ -346,6 +346,102 @@ function createPublishBitbucketServerAction(options) {
346
346
  });
347
347
  }
348
348
 
349
+ const examples = [
350
+ {
351
+ description: "Creating pull request on bitbucket server with required fields",
352
+ example: yaml__default.default.stringify({
353
+ steps: [
354
+ {
355
+ action: "publish:bitbucketServer:pull-request",
356
+ id: "publish-bitbucket-server-pull-request-minimal",
357
+ name: "Creating pull request on bitbucket server",
358
+ input: {
359
+ repoUrl: "hosted.bitbucket.com?project=project&repo=repo",
360
+ title: "My pull request",
361
+ sourceBranch: "my-feature-branch"
362
+ }
363
+ }
364
+ ]
365
+ })
366
+ },
367
+ {
368
+ description: "Creating pull request on bitbucket server with custom descriptions",
369
+ example: yaml__default.default.stringify({
370
+ steps: [
371
+ {
372
+ action: "publish:bitbucketServer:pull-request",
373
+ id: "publish-bitbucket-server-pull-request-minimal",
374
+ name: "Creating pull request on bitbucket server",
375
+ input: {
376
+ repoUrl: "hosted.bitbucket.com?project=project&repo=repo",
377
+ title: "My pull request",
378
+ sourceBranch: "my-feature-branch",
379
+ description: "This is a detailed description of my pull request"
380
+ }
381
+ }
382
+ ]
383
+ })
384
+ },
385
+ {
386
+ description: "Creating pull request on bitbucket server with different target branch",
387
+ example: yaml__default.default.stringify({
388
+ steps: [
389
+ {
390
+ action: "publish:bitbucketServer:pull-request",
391
+ id: "publish-bitbucket-server-pull-request-target-branch",
392
+ name: "Creating pull request on bitbucket server",
393
+ input: {
394
+ repoUrl: "hosted.bitbucket.com?project=project&repo=repo",
395
+ title: "My pull request",
396
+ sourceBranch: "my-feature-branch",
397
+ targetBranch: "development"
398
+ }
399
+ }
400
+ ]
401
+ })
402
+ },
403
+ {
404
+ description: "Creating pull request on bitbucket server with authorization token",
405
+ example: yaml__default.default.stringify({
406
+ steps: [
407
+ {
408
+ action: "publish:bitbucketServer:pull-request",
409
+ id: "publish-bitbucket-server-pull-request-minimal",
410
+ name: "Creating pull request on bitbucket server",
411
+ input: {
412
+ repoUrl: "no-credentials.bitbucket.com?project=project&repo=repo",
413
+ title: "My pull request",
414
+ sourceBranch: "my-feature-branch",
415
+ token: "my-auth-token"
416
+ }
417
+ }
418
+ ]
419
+ })
420
+ },
421
+ {
422
+ description: "Creating pull request on bitbucket server with all fields",
423
+ example: yaml__default.default.stringify({
424
+ steps: [
425
+ {
426
+ action: "publish:bitbucketServer:pull-request",
427
+ id: "publish-bitbucket-server-pull-request-minimal",
428
+ name: "Creating pull request on bitbucket server",
429
+ input: {
430
+ repoUrl: "no-credentials.bitbucket.com?project=project&repo=repo",
431
+ title: "My pull request",
432
+ sourceBranch: "my-feature-branch",
433
+ targetBranch: "development",
434
+ description: "This is a detailed description of my pull request",
435
+ token: "my-auth-token",
436
+ gitAuthorName: "test-user",
437
+ gitAuthorEmail: "test-user@sample.com"
438
+ }
439
+ }
440
+ ]
441
+ })
442
+ }
443
+ ];
444
+
349
445
  const createPullRequest = async (opts) => {
350
446
  const {
351
447
  project,
@@ -465,6 +561,7 @@ function createPublishBitbucketServerPullRequestAction(options) {
465
561
  const { integrations, config } = options;
466
562
  return pluginScaffolderNode.createTemplateAction({
467
563
  id: "publish:bitbucketServer:pull-request",
564
+ examples,
468
565
  schema: {
469
566
  input: {
470
567
  type: "object",
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/actions/bitbucketServer.examples.ts","../src/actions/bitbucketServer.ts","../src/actions/bitbucketServerPullRequest.ts","../src/module.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Initialize git repository with required properties',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with all properties',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'private',\n defaultBranch: 'main',\n sourcePath: 'packages/backend',\n enableLFS: false,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with public visibility',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'main',\n sourcePath: 'packages/backend',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with different default branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'develop',\n sourcePath: 'packages/backend',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with different source path',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'develop',\n sourcePath: 'packages/api',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 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 { InputError } from '@backstage/errors';\nimport {\n getBitbucketServerRequestOptions,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response, RequestInit } from 'node-fetch';\n\nimport { Config } from '@backstage/config';\nimport { examples } from './bitbucketServer.examples';\n\nconst createRepository = async (opts: {\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n defaultBranch: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n description,\n authorization,\n repoVisibility,\n defaultBranch,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: repo,\n description: description,\n defaultBranch: defaultBranch,\n public: repoVisibility === 'public',\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(`${apiBaseUrl}/projects/${project}/repos`, options);\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'http') {\n remoteUrl = link.href;\n }\n }\n\n const repoContentsUrl = `${r.links.self[0].href}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst performEnableLFS = async (opts: {\n authorization: string;\n host: string;\n project: string;\n repo: string;\n}) => {\n const { authorization, host, project, repo } = opts;\n\n const options: RequestInit = {\n method: 'PUT',\n headers: {\n Authorization: authorization,\n },\n };\n\n const { ok, status, statusText } = await fetch(\n `https://${host}/rest/git-lfs/admin/projects/${project}/repos/${repo}/enabled`,\n options,\n );\n\n if (!ok)\n throw new Error(\n `Failed to enable LFS in the repository, ${status}: ${statusText}`,\n );\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket Server.\n * @public\n */\nexport function createPublishBitbucketServerAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n repoVisibility?: 'private' | 'public';\n sourcePath?: string;\n enableLFS?: boolean;\n token?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:bitbucketServer',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket Server.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n description: {\n title: 'Repository Description',\n type: 'string',\n },\n repoVisibility: {\n title: 'Repository Visibility',\n type: 'string',\n enum: ['private', 'public'],\n },\n defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n },\n sourcePath: {\n title: 'Source Path',\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n type: 'string',\n },\n enableLFS: {\n title: 'Enable LFS?',\n description: 'Enable LFS for the repository.',\n type: 'boolean',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Server',\n },\n gitCommitMessage: {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n },\n gitAuthorName: {\n title: 'Author Name',\n type: 'string',\n description: `Sets the author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Author Email',\n type: 'string',\n description: `Sets the author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: {\n title: 'A URL to the repository with the provider',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n enableLFS = false,\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n } = ctx.input;\n\n const { project, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucketServer.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const token = ctx.input.token ?? integrationConfig.config.token;\n\n const authConfig = {\n ...integrationConfig.config,\n ...{ token },\n };\n const reqOpts = getBitbucketServerRequestOptions(authConfig);\n const authorization = reqOpts.headers.Authorization;\n if (!authorization) {\n throw new Error(\n `Authorization has not been provided for ${integrationConfig.config.host}. Please add either (a) a user login auth token, or (b) a token or (c) username + password to the integration config.`,\n );\n }\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const { remoteUrl, repoContentsUrl } = await createRepository({\n authorization,\n project,\n repo,\n repoVisibility,\n defaultBranch,\n description,\n apiBaseUrl,\n });\n\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const auth = authConfig.token\n ? {\n token: token!,\n }\n : {\n username: authConfig.username!,\n password: authConfig.password!,\n };\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n });\n\n if (enableLFS) {\n await performEnableLFS({ authorization, host, project, repo });\n }\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n","/*\n * Copyright 2021 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 { InputError } from '@backstage/errors';\nimport {\n getBitbucketServerRequestOptions,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n getRepoSourceDirectory,\n commitAndPushBranch,\n addFiles,\n createBranch as createGitBranch,\n cloneRepo,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { RequestInit, Response } from 'node-fetch';\nimport { Config } from '@backstage/config';\nimport fs from 'fs-extra';\n\nconst createPullRequest = async (opts: {\n project: string;\n repo: string;\n title: string;\n description?: string;\n toRef: {\n id: string;\n displayId: string;\n type: string;\n latestCommit: string;\n latestChangeset: string;\n isDefault: boolean;\n };\n fromRef: {\n id: string;\n displayId: string;\n type: string;\n latestCommit: string;\n latestChangeset: string;\n isDefault: boolean;\n };\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n title,\n description,\n toRef,\n fromRef,\n authorization,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const data: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n title: title,\n description: description,\n state: 'OPEN',\n open: true,\n closed: false,\n locked: true,\n toRef: toRef,\n fromRef: fromRef,\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(repo)}/pull-requests`,\n data,\n );\n } catch (e) {\n throw new Error(`Unable to create pull-reqeusts, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create pull requests, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n return `${r.links.self[0].href}`;\n};\nconst findBranches = async (opts: {\n project: string;\n repo: string;\n branchName: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const { project, repo, branchName, authorization, apiBaseUrl } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'GET',\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(\n repo,\n )}/branches?boostMatches=true&filterText=${encodeURIComponent(\n branchName,\n )}`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to get branches, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to get branches, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n for (const object of r.values) {\n if (object.displayId === branchName) {\n return object;\n }\n }\n\n return undefined;\n};\nconst createBranch = async (opts: {\n project: string;\n repo: string;\n branchName: string;\n authorization: string;\n apiBaseUrl: string;\n startPoint: string;\n}) => {\n const { project, repo, branchName, authorization, apiBaseUrl, startPoint } =\n opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: branchName,\n startPoint,\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(repo)}/branches`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to create branch, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to create branch, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n return await response.json();\n};\n/**\n * Creates a BitbucketServer Pull Request action.\n * @public\n */\nexport function createPublishBitbucketServerPullRequestAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n title: string;\n description?: string;\n targetBranch?: string;\n sourceBranch: string;\n token?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:bitbucketServer:pull-request',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'title', 'sourceBranch'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n title: {\n title: 'Pull Request title',\n type: 'string',\n description: 'The title for the pull request',\n },\n description: {\n title: 'Pull Request Description',\n type: 'string',\n description: 'The description of the pull request',\n },\n targetBranch: {\n title: 'Target Branch',\n type: 'string',\n description: `Branch of repository to apply changes to. The default value is 'master'`,\n },\n sourceBranch: {\n title: 'Source Branch',\n type: 'string',\n description: 'Branch of repository to copy changes from',\n },\n token: {\n title: 'Authorization Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Server',\n },\n gitAuthorName: {\n title: 'Author Name',\n type: 'string',\n description: `Sets the author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Author Email',\n type: 'string',\n description: `Sets the author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n pullRequestUrl: {\n title: 'A URL to the pull request with the provider',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n title,\n description,\n targetBranch = 'master',\n sourceBranch,\n gitAuthorName,\n gitAuthorEmail,\n } = ctx.input;\n\n const { project, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucketServer.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const token = ctx.input.token ?? integrationConfig.config.token;\n\n const authConfig = {\n ...integrationConfig.config,\n ...{ token },\n };\n\n const reqOpts = getBitbucketServerRequestOptions(authConfig);\n const authorization = reqOpts.headers.Authorization;\n if (!authorization) {\n throw new Error(\n `Authorization has not been provided for ${integrationConfig.config.host}. Please add either (a) a user login auth token, or (b) a token input from the template or (c) username + password to the integration config.`,\n );\n }\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const toRef = await findBranches({\n project,\n repo,\n branchName: targetBranch,\n authorization,\n apiBaseUrl,\n });\n\n let fromRef = await findBranches({\n project,\n repo,\n branchName: sourceBranch,\n authorization,\n apiBaseUrl,\n });\n\n if (!fromRef) {\n // create branch\n ctx.logger.info(\n `source branch not found -> creating branch named: ${sourceBranch} lastCommit: ${toRef.latestCommit}`,\n );\n const latestCommit = toRef.latestCommit;\n\n fromRef = await createBranch({\n project,\n repo,\n branchName: sourceBranch,\n authorization,\n apiBaseUrl,\n startPoint: latestCommit,\n });\n\n const remoteUrl = `https://${host}/scm/${project}/${repo}.git`;\n\n const auth = authConfig.token\n ? {\n token: token!,\n }\n : {\n username: authConfig.username!,\n password: authConfig.password!,\n };\n\n const gitAuthorInfo = {\n name:\n gitAuthorName ||\n config.getOptionalString('scaffolder.defaultAuthor.name'),\n email:\n gitAuthorEmail ||\n config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const tempDir = await ctx.createTemporaryDirectory();\n const sourceDir = getRepoSourceDirectory(ctx.workspacePath, undefined);\n await cloneRepo({\n url: remoteUrl,\n dir: tempDir,\n auth,\n logger: ctx.logger,\n ref: sourceBranch,\n });\n\n await createGitBranch({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n ref: sourceBranch,\n });\n\n // copy files\n fs.cpSync(sourceDir, tempDir, {\n recursive: true,\n filter: path => {\n return !(path.indexOf('.git') > -1);\n },\n });\n\n await addFiles({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n filepath: '.',\n });\n\n await commitAndPushBranch({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n commitMessage:\n description ??\n config.getOptionalString('scaffolder.defaultCommitMessage') ??\n '',\n gitAuthorInfo,\n branch: sourceBranch,\n });\n }\n\n const pullRequestUrl = await createPullRequest({\n project,\n repo,\n title,\n description,\n toRef,\n fromRef,\n authorization,\n apiBaseUrl,\n });\n\n ctx.output('pullRequestUrl', pullRequestUrl);\n },\n });\n}\n","/*\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 { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createPublishBitbucketServerAction,\n createPublishBitbucketServerPullRequestAction,\n} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Bitbucket Server Module for the Scaffolder Backend\n */\nexport const bitbucketServerModule = createBackendModule({\n moduleId: 'bitbucketServer',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createPublishBitbucketServerAction({ integrations, config }),\n createPublishBitbucketServerPullRequestAction({\n integrations,\n config,\n }),\n );\n },\n });\n },\n});\n"],"names":["yaml","fetch","createTemplateAction","parseRepoUrl","InputError","getBitbucketServerRequestOptions","initRepoAndPush","getRepoSourceDirectory","cloneRepo","createGitBranch","fs","addFiles","commitAndPushBranch","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WAAa,EAAA,oDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,yBAAA;AAAA,UACR,EAAI,EAAA,kCAAA;AAAA,UACJ,IAAM,EAAA,6BAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,gDAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,+CAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,yBAAA;AAAA,UACR,EAAI,EAAA,kCAAA;AAAA,UACJ,IAAM,EAAA,6BAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,gDAAA;AAAA,YACT,WAAa,EAAA,2BAAA;AAAA,YACb,cAAgB,EAAA,SAAA;AAAA,YAChB,aAAe,EAAA,MAAA;AAAA,YACf,UAAY,EAAA,kBAAA;AAAA,YACZ,SAAW,EAAA,KAAA;AAAA,YACX,KAAO,EAAA,YAAA;AAAA,YACP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AAA;AAAA,QACA,aAAA;AAAA,QACA,UAAA;AAAA,OACD,CAAA,CAAA;AAED,MAAI,GAAA,CAAA,MAAA,CAAO,kBAAkB,cAAc,CAAA,CAAA;AAAA,KAC7C;AAAA,GACD,CAAA,CAAA;AACH;;ACvZO,MAAM,wBAAwBC,oCAAoB,CAAA;AAAA,EACvD,QAAU,EAAA,iBAAA;AAAA,EACV,QAAU,EAAA,YAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAgB,EAAA;AACzB,IAAa,YAAA,CAAA;AAAA,MACX,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC,qCAAA;AAAA,QACZ,QAAQC,6BAAa,CAAA,UAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAY,QAAU,EAAA;AACjC,QAAM,MAAA,YAAA,GAAeC,2BAAgB,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AAEtD,QAAW,UAAA,CAAA,UAAA;AAAA,UACT,kCAAmC,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UAC3D,6CAA8C,CAAA;AAAA,YAC5C,YAAA;AAAA,YACA,MAAA;AAAA,WACD,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/actions/bitbucketServer.examples.ts","../src/actions/bitbucketServer.ts","../src/actions/bitbucketServerPullRequest.examples.ts","../src/actions/bitbucketServerPullRequest.ts","../src/module.ts"],"sourcesContent":["/*\n * Copyright 2021 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Initialize git repository with required properties',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with all properties',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'private',\n defaultBranch: 'main',\n sourcePath: 'packages/backend',\n enableLFS: false,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with public visibility',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'main',\n sourcePath: 'packages/backend',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with different default branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'develop',\n sourcePath: 'packages/backend',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n {\n description: 'Initialize git repository with different source path',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer',\n id: 'publish-bitbucket-server-minimal',\n name: 'Publish To Bitbucket Server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n description: 'This is a test repository',\n repoVisibility: 'public',\n defaultBranch: 'develop',\n sourcePath: 'packages/api',\n enableLFS: true,\n token: 'test-token',\n gitCommitMessage: 'Init check commit',\n gitAuthorName: 'Test User',\n gitAuthorEmail: 'test.user@example.com',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 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 { InputError } from '@backstage/errors';\nimport {\n getBitbucketServerRequestOptions,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { Response, RequestInit } from 'node-fetch';\n\nimport { Config } from '@backstage/config';\nimport { examples } from './bitbucketServer.examples';\n\nconst createRepository = async (opts: {\n project: string;\n repo: string;\n description?: string;\n repoVisibility: 'private' | 'public';\n defaultBranch: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n description,\n authorization,\n repoVisibility,\n defaultBranch,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: repo,\n description: description,\n defaultBranch: defaultBranch,\n public: repoVisibility === 'public',\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(`${apiBaseUrl}/projects/${project}/repos`, options);\n } catch (e) {\n throw new Error(`Unable to create repository, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create repository, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n let remoteUrl = '';\n for (const link of r.links.clone) {\n if (link.name === 'http') {\n remoteUrl = link.href;\n }\n }\n\n const repoContentsUrl = `${r.links.self[0].href}`;\n return { remoteUrl, repoContentsUrl };\n};\n\nconst performEnableLFS = async (opts: {\n authorization: string;\n host: string;\n project: string;\n repo: string;\n}) => {\n const { authorization, host, project, repo } = opts;\n\n const options: RequestInit = {\n method: 'PUT',\n headers: {\n Authorization: authorization,\n },\n };\n\n const { ok, status, statusText } = await fetch(\n `https://${host}/rest/git-lfs/admin/projects/${project}/repos/${repo}/enabled`,\n options,\n );\n\n if (!ok)\n throw new Error(\n `Failed to enable LFS in the repository, ${status}: ${statusText}`,\n );\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to Bitbucket Server.\n * @public\n */\nexport function createPublishBitbucketServerAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n description?: string;\n defaultBranch?: string;\n repoVisibility?: 'private' | 'public';\n sourcePath?: string;\n enableLFS?: boolean;\n token?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:bitbucketServer',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Bitbucket Server.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n description: {\n title: 'Repository Description',\n type: 'string',\n },\n repoVisibility: {\n title: 'Repository Visibility',\n type: 'string',\n enum: ['private', 'public'],\n },\n defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\n },\n sourcePath: {\n title: 'Source Path',\n description:\n 'Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.',\n type: 'string',\n },\n enableLFS: {\n title: 'Enable LFS?',\n description: 'Enable LFS for the repository.',\n type: 'boolean',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Server',\n },\n gitCommitMessage: {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository. The default value is 'initial commit'`,\n },\n gitAuthorName: {\n title: 'Author Name',\n type: 'string',\n description: `Sets the author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Author Email',\n type: 'string',\n description: `Sets the author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n remoteUrl: {\n title: 'A URL to the repository with the provider',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the initial commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n description,\n defaultBranch = 'master',\n repoVisibility = 'private',\n enableLFS = false,\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n } = ctx.input;\n\n const { project, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucketServer.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const token = ctx.input.token ?? integrationConfig.config.token;\n\n const authConfig = {\n ...integrationConfig.config,\n ...{ token },\n };\n const reqOpts = getBitbucketServerRequestOptions(authConfig);\n const authorization = reqOpts.headers.Authorization;\n if (!authorization) {\n throw new Error(\n `Authorization has not been provided for ${integrationConfig.config.host}. Please add either (a) a user login auth token, or (b) a token or (c) username + password to the integration config.`,\n );\n }\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const { remoteUrl, repoContentsUrl } = await createRepository({\n authorization,\n project,\n repo,\n repoVisibility,\n defaultBranch,\n description,\n apiBaseUrl,\n });\n\n const gitAuthorInfo = {\n name: gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name'),\n email: gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const auth = authConfig.token\n ? {\n token: token!,\n }\n : {\n username: authConfig.username!,\n password: authConfig.password!,\n };\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n });\n\n if (enableLFS) {\n await performEnableLFS({ authorization, host, project, repo });\n }\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\n}\n","/*\n * Copyright 2023 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description:\n 'Creating pull request on bitbucket server with required fields',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer:pull-request',\n id: 'publish-bitbucket-server-pull-request-minimal',\n name: 'Creating pull request on bitbucket server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n title: 'My pull request',\n sourceBranch: 'my-feature-branch',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Creating pull request on bitbucket server with custom descriptions',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer:pull-request',\n id: 'publish-bitbucket-server-pull-request-minimal',\n name: 'Creating pull request on bitbucket server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n title: 'My pull request',\n sourceBranch: 'my-feature-branch',\n description: 'This is a detailed description of my pull request',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Creating pull request on bitbucket server with different target branch',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer:pull-request',\n id: 'publish-bitbucket-server-pull-request-target-branch',\n name: 'Creating pull request on bitbucket server',\n input: {\n repoUrl: 'hosted.bitbucket.com?project=project&repo=repo',\n title: 'My pull request',\n sourceBranch: 'my-feature-branch',\n targetBranch: 'development',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Creating pull request on bitbucket server with authorization token',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer:pull-request',\n id: 'publish-bitbucket-server-pull-request-minimal',\n name: 'Creating pull request on bitbucket server',\n input: {\n repoUrl: 'no-credentials.bitbucket.com?project=project&repo=repo',\n title: 'My pull request',\n sourceBranch: 'my-feature-branch',\n token: 'my-auth-token',\n },\n },\n ],\n }),\n },\n {\n description: 'Creating pull request on bitbucket server with all fields',\n example: yaml.stringify({\n steps: [\n {\n action: 'publish:bitbucketServer:pull-request',\n id: 'publish-bitbucket-server-pull-request-minimal',\n name: 'Creating pull request on bitbucket server',\n input: {\n repoUrl: 'no-credentials.bitbucket.com?project=project&repo=repo',\n title: 'My pull request',\n sourceBranch: 'my-feature-branch',\n targetBranch: 'development',\n description: 'This is a detailed description of my pull request',\n token: 'my-auth-token',\n gitAuthorName: 'test-user',\n gitAuthorEmail: 'test-user@sample.com',\n },\n },\n ],\n }),\n },\n];\n","/*\n * Copyright 2021 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 { InputError } from '@backstage/errors';\nimport {\n getBitbucketServerRequestOptions,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport {\n createTemplateAction,\n getRepoSourceDirectory,\n commitAndPushBranch,\n addFiles,\n createBranch as createGitBranch,\n cloneRepo,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport fetch, { RequestInit, Response } from 'node-fetch';\nimport { Config } from '@backstage/config';\nimport fs from 'fs-extra';\nimport { examples } from './bitbucketServerPullRequest.examples';\n\nconst createPullRequest = async (opts: {\n project: string;\n repo: string;\n title: string;\n description?: string;\n toRef: {\n id: string;\n displayId: string;\n type: string;\n latestCommit: string;\n latestChangeset: string;\n isDefault: boolean;\n };\n fromRef: {\n id: string;\n displayId: string;\n type: string;\n latestCommit: string;\n latestChangeset: string;\n isDefault: boolean;\n };\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const {\n project,\n repo,\n title,\n description,\n toRef,\n fromRef,\n authorization,\n apiBaseUrl,\n } = opts;\n\n let response: Response;\n const data: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n title: title,\n description: description,\n state: 'OPEN',\n open: true,\n closed: false,\n locked: true,\n toRef: toRef,\n fromRef: fromRef,\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(repo)}/pull-requests`,\n data,\n );\n } catch (e) {\n throw new Error(`Unable to create pull-reqeusts, ${e}`);\n }\n\n if (response.status !== 201) {\n throw new Error(\n `Unable to create pull requests, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n return `${r.links.self[0].href}`;\n};\nconst findBranches = async (opts: {\n project: string;\n repo: string;\n branchName: string;\n authorization: string;\n apiBaseUrl: string;\n}) => {\n const { project, repo, branchName, authorization, apiBaseUrl } = opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'GET',\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(\n repo,\n )}/branches?boostMatches=true&filterText=${encodeURIComponent(\n branchName,\n )}`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to get branches, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to get branches, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n const r = await response.json();\n for (const object of r.values) {\n if (object.displayId === branchName) {\n return object;\n }\n }\n\n return undefined;\n};\nconst createBranch = async (opts: {\n project: string;\n repo: string;\n branchName: string;\n authorization: string;\n apiBaseUrl: string;\n startPoint: string;\n}) => {\n const { project, repo, branchName, authorization, apiBaseUrl, startPoint } =\n opts;\n\n let response: Response;\n const options: RequestInit = {\n method: 'POST',\n body: JSON.stringify({\n name: branchName,\n startPoint,\n }),\n headers: {\n Authorization: authorization,\n 'Content-Type': 'application/json',\n },\n };\n\n try {\n response = await fetch(\n `${apiBaseUrl}/projects/${encodeURIComponent(\n project,\n )}/repos/${encodeURIComponent(repo)}/branches`,\n options,\n );\n } catch (e) {\n throw new Error(`Unable to create branch, ${e}`);\n }\n\n if (response.status !== 200) {\n throw new Error(\n `Unable to create branch, ${response.status} ${\n response.statusText\n }, ${await response.text()}`,\n );\n }\n\n return await response.json();\n};\n/**\n * Creates a BitbucketServer Pull Request action.\n * @public\n */\nexport function createPublishBitbucketServerPullRequestAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n title: string;\n description?: string;\n targetBranch?: string;\n sourceBranch: string;\n token?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:bitbucketServer:pull-request',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'title', 'sourceBranch'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n title: {\n title: 'Pull Request title',\n type: 'string',\n description: 'The title for the pull request',\n },\n description: {\n title: 'Pull Request Description',\n type: 'string',\n description: 'The description of the pull request',\n },\n targetBranch: {\n title: 'Target Branch',\n type: 'string',\n description: `Branch of repository to apply changes to. The default value is 'master'`,\n },\n sourceBranch: {\n title: 'Source Branch',\n type: 'string',\n description: 'Branch of repository to copy changes from',\n },\n token: {\n title: 'Authorization Token',\n type: 'string',\n description:\n 'The token to use for authorization to BitBucket Server',\n },\n gitAuthorName: {\n title: 'Author Name',\n type: 'string',\n description: `Sets the author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Author Email',\n type: 'string',\n description: `Sets the author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n pullRequestUrl: {\n title: 'A URL to the pull request with the provider',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n title,\n description,\n targetBranch = 'master',\n sourceBranch,\n gitAuthorName,\n gitAuthorEmail,\n } = ctx.input;\n\n const { project, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!project) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing project`,\n );\n }\n\n const integrationConfig = integrations.bitbucketServer.byHost(host);\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const token = ctx.input.token ?? integrationConfig.config.token;\n\n const authConfig = {\n ...integrationConfig.config,\n ...{ token },\n };\n\n const reqOpts = getBitbucketServerRequestOptions(authConfig);\n const authorization = reqOpts.headers.Authorization;\n if (!authorization) {\n throw new Error(\n `Authorization has not been provided for ${integrationConfig.config.host}. Please add either (a) a user login auth token, or (b) a token input from the template or (c) username + password to the integration config.`,\n );\n }\n\n const apiBaseUrl = integrationConfig.config.apiBaseUrl;\n\n const toRef = await findBranches({\n project,\n repo,\n branchName: targetBranch,\n authorization,\n apiBaseUrl,\n });\n\n let fromRef = await findBranches({\n project,\n repo,\n branchName: sourceBranch,\n authorization,\n apiBaseUrl,\n });\n\n if (!fromRef) {\n // create branch\n ctx.logger.info(\n `source branch not found -> creating branch named: ${sourceBranch} lastCommit: ${toRef.latestCommit}`,\n );\n const latestCommit = toRef.latestCommit;\n\n fromRef = await createBranch({\n project,\n repo,\n branchName: sourceBranch,\n authorization,\n apiBaseUrl,\n startPoint: latestCommit,\n });\n\n const remoteUrl = `https://${host}/scm/${project}/${repo}.git`;\n\n const auth = authConfig.token\n ? {\n token: token!,\n }\n : {\n username: authConfig.username!,\n password: authConfig.password!,\n };\n\n const gitAuthorInfo = {\n name:\n gitAuthorName ||\n config.getOptionalString('scaffolder.defaultAuthor.name'),\n email:\n gitAuthorEmail ||\n config.getOptionalString('scaffolder.defaultAuthor.email'),\n };\n\n const tempDir = await ctx.createTemporaryDirectory();\n const sourceDir = getRepoSourceDirectory(ctx.workspacePath, undefined);\n await cloneRepo({\n url: remoteUrl,\n dir: tempDir,\n auth,\n logger: ctx.logger,\n ref: sourceBranch,\n });\n\n await createGitBranch({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n ref: sourceBranch,\n });\n\n // copy files\n fs.cpSync(sourceDir, tempDir, {\n recursive: true,\n filter: path => {\n return !(path.indexOf('.git') > -1);\n },\n });\n\n await addFiles({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n filepath: '.',\n });\n\n await commitAndPushBranch({\n dir: tempDir,\n auth,\n logger: ctx.logger,\n commitMessage:\n description ??\n config.getOptionalString('scaffolder.defaultCommitMessage') ??\n '',\n gitAuthorInfo,\n branch: sourceBranch,\n });\n }\n\n const pullRequestUrl = await createPullRequest({\n project,\n repo,\n title,\n description,\n toRef,\n fromRef,\n authorization,\n apiBaseUrl,\n });\n\n ctx.output('pullRequestUrl', pullRequestUrl);\n },\n });\n}\n","/*\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 { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createPublishBitbucketServerAction,\n createPublishBitbucketServerPullRequestAction,\n} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Bitbucket Server Module for the Scaffolder Backend\n */\nexport const bitbucketServerModule = createBackendModule({\n moduleId: 'bitbucketServer',\n pluginId: 'scaffolder',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createPublishBitbucketServerAction({ integrations, config }),\n createPublishBitbucketServerPullRequestAction({\n integrations,\n config,\n }),\n );\n },\n });\n },\n});\n"],"names":["examples","yaml","fetch","createTemplateAction","parseRepoUrl","InputError","getBitbucketServerRequestOptions","initRepoAndPush","getRepoSourceDirectory","cloneRepo","createGitBranch","fs","addFiles","commitAndPushBranch","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,UAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WAAa,EAAA,oDAAA;AAAA,IACb,OAAA,EAASC,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,yBAAA;AAAA,UACR,EAAI,EAAA,kCAAA;AAAA,UACJ,IAAM,EAAA,6BAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,gDAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,+CAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,yBAAA;AAAA,UACR,EAAI,EAAA,kCAAA;AAAA,UACJ,IAAM,EAAA,6BAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,gDAAA;AAAA,YACT,WAAa,EAAA,2BAAA;AAAA,YACb,cAAgB,EAAA,SAAA;AAAA,YAChB,aAAe,EAAA,MAAA;AAAA,YACf,UAAY,EAAA,kBAAA;AAAA,YACZ,SAAW,EAAA,KAAA;AAAA,YACX,KAAO,EAAA,YAAA;AAAA,YACP,gBAAkB,EAAA,mBAAA;AAAA,YAClB,aAAe,EAAA,WAAA;AAAA,YACf,cAAgB,EAAA,uBAAA;AAAA,WAClB;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,kDAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,MAAQ,EAAA,yBAAA;AAAA,UACR,EAAI,EAAA,kCAAA;AAAA,UACJ,IAA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CAAA,UAAA;AAAA,UACT,kCAAmC,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,UAC3D,6CAA8C,CAAA;AAAA,YAC5C,YAAA;AAAA,YACA,MAAA;AAAA,WACD,CAAA;AAAA,SACH,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-bitbucket-server",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-next.0",
4
4
  "description": "The Bitbucket Server module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module"
@@ -37,19 +37,19 @@
37
37
  "test": "backstage-cli package test"
38
38
  },
39
39
  "dependencies": {
40
- "@backstage/backend-plugin-api": "^0.6.17",
40
+ "@backstage/backend-plugin-api": "^0.6.18-next.0",
41
41
  "@backstage/config": "^1.2.0",
42
42
  "@backstage/errors": "^1.2.4",
43
43
  "@backstage/integration": "^1.10.0",
44
- "@backstage/plugin-scaffolder-node": "^0.4.3",
44
+ "@backstage/plugin-scaffolder-node": "^0.4.4-next.0",
45
45
  "fs-extra": "^11.2.0",
46
46
  "node-fetch": "^2.6.7",
47
47
  "yaml": "^2.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@backstage/backend-test-utils": "^0.3.7",
51
- "@backstage/cli": "^0.26.3",
52
- "@backstage/plugin-scaffolder-node-test-utils": "^0.1.3",
50
+ "@backstage/backend-test-utils": "^0.3.8-next.0",
51
+ "@backstage/cli": "^0.26.5-next.0",
52
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.4-next.0",
53
53
  "msw": "^1.0.0"
54
54
  }
55
55
  }