@backstage/plugin-scaffolder-backend-module-gerrit 0.1.2-next.1 → 0.1.2-next.3
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 +24 -0
- package/dist/index.cjs.js +4 -2
- package/dist/index.cjs.js.map +1 -1
- package/package.json +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-gerrit
|
|
2
2
|
|
|
3
|
+
## 0.1.2-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8472188: Added or fixed the `repository` field in `package.json`.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/integration@1.9.0-next.1
|
|
10
|
+
- @backstage/plugin-scaffolder-node@0.3.0-next.3
|
|
11
|
+
- @backstage/backend-plugin-api@0.6.10-next.3
|
|
12
|
+
- @backstage/config@1.1.1
|
|
13
|
+
- @backstage/errors@1.2.3
|
|
14
|
+
|
|
15
|
+
## 0.1.2-next.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 8b269e1: Provide default branch when creating repositories.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @backstage/backend-plugin-api@0.6.10-next.2
|
|
22
|
+
- @backstage/plugin-scaffolder-node@0.3.0-next.2
|
|
23
|
+
- @backstage/config@1.1.1
|
|
24
|
+
- @backstage/errors@1.2.3
|
|
25
|
+
- @backstage/integration@1.9.0-next.0
|
|
26
|
+
|
|
3
27
|
## 0.1.2-next.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -153,12 +153,13 @@ const examples = [
|
|
|
153
153
|
];
|
|
154
154
|
|
|
155
155
|
const createGerritProject = async (config, options) => {
|
|
156
|
-
const { projectName, parent, owner, description } = options;
|
|
156
|
+
const { projectName, parent, owner, description, defaultBranch } = options;
|
|
157
157
|
const fetchOptions = {
|
|
158
158
|
method: "PUT",
|
|
159
159
|
body: JSON.stringify({
|
|
160
160
|
parent,
|
|
161
161
|
description,
|
|
162
|
+
branches: [defaultBranch],
|
|
162
163
|
owners: owner ? [owner] : [],
|
|
163
164
|
create_empty_commit: false
|
|
164
165
|
}),
|
|
@@ -297,7 +298,8 @@ function createPublishGerritAction(options) {
|
|
|
297
298
|
description,
|
|
298
299
|
owner,
|
|
299
300
|
projectName: repo,
|
|
300
|
-
parent: workspace
|
|
301
|
+
parent: workspace,
|
|
302
|
+
defaultBranch
|
|
301
303
|
});
|
|
302
304
|
const auth = {
|
|
303
305
|
username: integrationConfig.config.username,
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/actions/gerrit.examples.ts","../src/actions/gerrit.ts","../src/actions/gerritReview.ts","../src/module.ts"],"sourcesContent":["/*\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 'Initializes a Gerrit repository of contents in workspace and publish it to Gerrit with default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gerrit repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n description: 'Initialize a gerrit repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with a default Branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n defaultBranch: 'staging',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with an initial commit message, if not set defaults to initial commit',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitCommitMessage: 'Initial Commit Message',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with a repo Author Name, if not set defaults to Scaffolder',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitAuthorName: 'John Doe',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gerrit repository with a repo Author Email',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitAuthorEmail: 'johndoe@email.com',\n },\n },\n ],\n }),\n },\n {\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 example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with all proporties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n description: 'Initialize a gerrit repository',\n defaultBranch: 'staging',\n gitCommitMessage: 'Initial Commit Message',\n gitAuthorName: 'John Doe',\n gitAuthorEmail: 'johndoe@email.com',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\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 crypto from 'crypto';\nimport { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport {\n GerritIntegrationConfig,\n getGerritRequestOptions,\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';\nimport { examples } from './gerrit.examples';\n\nconst createGerritProject = async (\n config: GerritIntegrationConfig,\n options: {\n projectName: string;\n parent: string;\n owner?: string;\n description: string;\n },\n): Promise<void> => {\n const { projectName, parent, owner, description } = options;\n\n const fetchOptions: RequestInit = {\n method: 'PUT',\n body: JSON.stringify({\n parent,\n description,\n owners: owner ? [owner] : [],\n create_empty_commit: false,\n }),\n headers: {\n ...getGerritRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n const response: Response = await fetch(\n `${config.baseUrl}/a/projects/${encodeURIComponent(projectName)}`,\n fetchOptions,\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\nconst generateCommitMessage = (\n config: Config,\n commitSubject?: string,\n): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n const msg = `${\n config.getOptionalString('scaffolder.defaultCommitMessage') || commitSubject\n }\\n\\nChange-Id: I${changeId}`;\n return msg;\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to a Gerrit instance.\n * @public\n */\nexport function createPublishGerritAction(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 gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n sourcePath?: string;\n }>({\n id: 'publish:gerrit',\n supportsDryRun: true,\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Gerrit.',\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 defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\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: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n },\n sourcePath: {\n title: 'Source Path',\n type: 'string',\n description: `Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.`,\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 gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage = 'initial commit',\n sourcePath,\n } = ctx.input;\n const { repo, host, owner, workspace } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\n const integrationConfig = integrations.gerrit.byHost(host);\n\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n if (!workspace) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing workspace`,\n );\n }\n\n const repoContentsUrl = `${integrationConfig.config.gitilesBaseUrl}/${repo}/+/refs/heads/${defaultBranch}`;\n const remoteUrl = `${integrationConfig.config.cloneUrl}/a/${repo}`;\n const gitName = gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name');\n const gitEmail = gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email');\n const commitMessage = generateCommitMessage(config, gitCommitMessage);\n\n if (ctx.isDryRun) {\n ctx.logger.info(\n `Dry run arguments: ${{\n gitName,\n gitEmail,\n commitMessage,\n ...ctx.input,\n }}`,\n );\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', 'abcd-dry-run-1234');\n ctx.output('repoContentsUrl', repoContentsUrl);\n return;\n }\n\n await createGerritProject(integrationConfig.config, {\n description,\n owner: owner,\n projectName: repo,\n parent: workspace,\n });\n const auth = {\n username: integrationConfig.config.username!,\n password: integrationConfig.config.password!,\n };\n const gitAuthorInfo = {\n name: gitName,\n email: gitEmail,\n };\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: generateCommitMessage(config, gitCommitMessage),\n gitAuthorInfo,\n });\n\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\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 crypto from 'crypto';\nimport { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport {\n createTemplateAction,\n commitAndPushRepo,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\n\nconst generateGerritChangeId = (): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n return `I${changeId}`;\n};\n\n/**\n * Creates a new action that creates a Gerrit review\n * @public\n */\nexport function createPublishGerritReviewAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n branch?: string;\n sourcePath?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:gerrit:review',\n description: 'Creates a new Gerrit review.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'gitCommitMessage'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n branch: {\n title: 'Repository branch',\n type: 'string',\n description:\n 'Branch of the repository the review will be created on',\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory containing the repository',\n },\n gitCommitMessage: {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository.`,\n },\n gitAuthorName: {\n title: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n reviewUrl: {\n title: 'A URL to the review',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n branch = 'master',\n sourcePath,\n gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage,\n } = ctx.input;\n const { host, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!gitCommitMessage) {\n throw new InputError(`Missing gitCommitMessage input`);\n }\n\n const integrationConfig = integrations.gerrit.byHost(host);\n\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 auth = {\n username: integrationConfig.config.username!,\n password: integrationConfig.config.password!,\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 const changeId = generateGerritChangeId();\n const commitMessage = `${gitCommitMessage}\\n\\nChange-Id: ${changeId}`;\n\n await commitAndPushRepo({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n auth,\n logger: ctx.logger,\n commitMessage,\n gitAuthorInfo,\n branch,\n remoteRef: `refs/for/${branch}`,\n });\n\n const repoContentsUrl = `${integrationConfig.config.gitilesBaseUrl}/${repo}/+/refs/heads/${branch}`;\n const reviewUrl = `${integrationConfig.config.baseUrl}/#/q/${changeId}`;\n ctx.logger?.info(`Review available on ${reviewUrl}`);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('reviewUrl', reviewUrl);\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 createPublishGerritAction,\n createPublishGerritReviewAction,\n} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Gerrit Module for the Scaffolder Backend\n */\nexport const gerritModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'geritt',\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 scaffolder.addActions(\n createPublishGerritAction({ integrations, config }),\n createPublishGerritReviewAction({ integrations, config }),\n );\n },\n });\n },\n});\n"],"names":["yaml","getGerritRequestOptions","fetch","crypto","createTemplateAction","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory","commitAndPushRepo","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,+GAAA;AAAA,IACF,OAAA,EAASA,yBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,gBAAA;AAAA,UACR,IAAM,EAAA,mBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,qDAAA;AAAA,IACb,OAAA,EAASA,yBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAA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AAA,EAAQ,CAAA;AAAA,UAClD,+BAAgC,CAAA,EAAE,YAAc,EAAA,MAAA,EAAQ,CAAA;AAAA,SAC1D,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/actions/gerrit.examples.ts","../src/actions/gerrit.ts","../src/actions/gerritReview.ts","../src/module.ts"],"sourcesContent":["/*\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 'Initializes a Gerrit repository of contents in workspace and publish it to Gerrit with default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gerrit repository with a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n description: 'Initialize a gerrit repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with a default Branch, if not set defaults to master',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n defaultBranch: 'staging',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with an initial commit message, if not set defaults to initial commit',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitCommitMessage: 'Initial Commit Message',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with a repo Author Name, if not set defaults to Scaffolder',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitAuthorName: 'John Doe',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a Gerrit repository with a repo Author Email',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n gitAuthorEmail: 'johndoe@email.com',\n },\n },\n ],\n }),\n },\n {\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 example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a Gerrit repository with all proporties being set',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gerrit',\n name: 'Publish to Gerrit',\n input: {\n repoUrl: 'gerrit.com?repo=repo&owner=owner',\n description: 'Initialize a gerrit repository',\n defaultBranch: 'staging',\n gitCommitMessage: 'Initial Commit Message',\n gitAuthorName: 'John Doe',\n gitAuthorEmail: 'johndoe@email.com',\n sourcePath: 'repository/',\n },\n },\n ],\n }),\n },\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 crypto from 'crypto';\nimport { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport {\n GerritIntegrationConfig,\n getGerritRequestOptions,\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';\nimport { examples } from './gerrit.examples';\n\nconst createGerritProject = async (\n config: GerritIntegrationConfig,\n options: {\n projectName: string;\n parent: string;\n owner?: string;\n description: string;\n defaultBranch: string;\n },\n): Promise<void> => {\n const { projectName, parent, owner, description, defaultBranch } = options;\n\n const fetchOptions: RequestInit = {\n method: 'PUT',\n body: JSON.stringify({\n parent,\n description,\n branches: [defaultBranch],\n owners: owner ? [owner] : [],\n create_empty_commit: false,\n }),\n headers: {\n ...getGerritRequestOptions(config).headers,\n 'Content-Type': 'application/json',\n },\n };\n const response: Response = await fetch(\n `${config.baseUrl}/a/projects/${encodeURIComponent(projectName)}`,\n fetchOptions,\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\nconst generateCommitMessage = (\n config: Config,\n commitSubject?: string,\n): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n const msg = `${\n config.getOptionalString('scaffolder.defaultCommitMessage') || commitSubject\n }\\n\\nChange-Id: I${changeId}`;\n return msg;\n};\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to a Gerrit instance.\n * @public\n */\nexport function createPublishGerritAction(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 gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n sourcePath?: string;\n }>({\n id: 'publish:gerrit',\n supportsDryRun: true,\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to Gerrit.',\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 defaultBranch: {\n title: 'Default Branch',\n type: 'string',\n description: `Sets the default branch on the repository. The default value is 'master'`,\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: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n },\n sourcePath: {\n title: 'Source Path',\n type: 'string',\n description: `Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.`,\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 gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage = 'initial commit',\n sourcePath,\n } = ctx.input;\n const { repo, host, owner, workspace } = parseRepoUrl(\n repoUrl,\n integrations,\n );\n\n const integrationConfig = integrations.gerrit.byHost(host);\n\n if (!integrationConfig) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n if (!workspace) {\n throw new InputError(\n `Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing workspace`,\n );\n }\n\n const repoContentsUrl = `${integrationConfig.config.gitilesBaseUrl}/${repo}/+/refs/heads/${defaultBranch}`;\n const remoteUrl = `${integrationConfig.config.cloneUrl}/a/${repo}`;\n const gitName = gitAuthorName\n ? gitAuthorName\n : config.getOptionalString('scaffolder.defaultAuthor.name');\n const gitEmail = gitAuthorEmail\n ? gitAuthorEmail\n : config.getOptionalString('scaffolder.defaultAuthor.email');\n const commitMessage = generateCommitMessage(config, gitCommitMessage);\n\n if (ctx.isDryRun) {\n ctx.logger.info(\n `Dry run arguments: ${{\n gitName,\n gitEmail,\n commitMessage,\n ...ctx.input,\n }}`,\n );\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', 'abcd-dry-run-1234');\n ctx.output('repoContentsUrl', repoContentsUrl);\n return;\n }\n\n await createGerritProject(integrationConfig.config, {\n description,\n owner: owner,\n projectName: repo,\n parent: workspace,\n defaultBranch,\n });\n const auth = {\n username: integrationConfig.config.username!,\n password: integrationConfig.config.password!,\n };\n const gitAuthorInfo = {\n name: gitName,\n email: gitEmail,\n };\n\n const commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n remoteUrl,\n auth,\n defaultBranch,\n logger: ctx.logger,\n commitMessage: generateCommitMessage(config, gitCommitMessage),\n gitAuthorInfo,\n });\n\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('repoContentsUrl', repoContentsUrl);\n },\n });\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 crypto from 'crypto';\nimport { InputError } from '@backstage/errors';\nimport { Config } from '@backstage/config';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport {\n createTemplateAction,\n commitAndPushRepo,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\n\nconst generateGerritChangeId = (): string => {\n const changeId = crypto.randomBytes(20).toString('hex');\n return `I${changeId}`;\n};\n\n/**\n * Creates a new action that creates a Gerrit review\n * @public\n */\nexport function createPublishGerritReviewAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n branch?: string;\n sourcePath?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n }>({\n id: 'publish:gerrit:review',\n description: 'Creates a new Gerrit review.',\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl', 'gitCommitMessage'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n },\n branch: {\n title: 'Repository branch',\n type: 'string',\n description:\n 'Branch of the repository the review will be created on',\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory containing the repository',\n },\n gitCommitMessage: {\n title: 'Git Commit Message',\n type: 'string',\n description: `Sets the commit message on the repository.`,\n },\n gitAuthorName: {\n title: 'Default Author Name',\n type: 'string',\n description: `Sets the default author name for the commit. The default value is 'Scaffolder'`,\n },\n gitAuthorEmail: {\n title: 'Default Author Email',\n type: 'string',\n description: `Sets the default author email for the commit.`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n reviewUrl: {\n title: 'A URL to the review',\n type: 'string',\n },\n repoContentsUrl: {\n title: 'A URL to the root of the repository',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n repoUrl,\n branch = 'master',\n sourcePath,\n gitAuthorName,\n gitAuthorEmail,\n gitCommitMessage,\n } = ctx.input;\n const { host, repo } = parseRepoUrl(repoUrl, integrations);\n\n if (!gitCommitMessage) {\n throw new InputError(`Missing gitCommitMessage input`);\n }\n\n const integrationConfig = integrations.gerrit.byHost(host);\n\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 auth = {\n username: integrationConfig.config.username!,\n password: integrationConfig.config.password!,\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 const changeId = generateGerritChangeId();\n const commitMessage = `${gitCommitMessage}\\n\\nChange-Id: ${changeId}`;\n\n await commitAndPushRepo({\n dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),\n auth,\n logger: ctx.logger,\n commitMessage,\n gitAuthorInfo,\n branch,\n remoteRef: `refs/for/${branch}`,\n });\n\n const repoContentsUrl = `${integrationConfig.config.gitilesBaseUrl}/${repo}/+/refs/heads/${branch}`;\n const reviewUrl = `${integrationConfig.config.baseUrl}/#/q/${changeId}`;\n ctx.logger?.info(`Review available on ${reviewUrl}`);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('reviewUrl', reviewUrl);\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 createPublishGerritAction,\n createPublishGerritReviewAction,\n} from './actions';\nimport { ScmIntegrations } from '@backstage/integration';\n\n/**\n * @public\n * The Gerrit Module for the Scaffolder Backend\n */\nexport const gerritModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'geritt',\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 scaffolder.addActions(\n createPublishGerritAction({ integrations, config }),\n createPublishGerritReviewAction({ integrations, config }),\n );\n },\n });\n },\n});\n"],"names":["yaml","getGerritRequestOptions","fetch","crypto","createTemplateAction","parseRepoUrl","InputError","initRepoAndPush","getRepoSourceDirectory","commitAndPushRepo","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBO,MAAM,QAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,+GAAA;AAAA,IACF,OAAA,EAASA,yBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,gBAAA;AAAA,UACR,IAAM,EAAA,mBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,qDAAA;AAAA,IACb,OAAA,EAASA,yBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,gBAAA;AAAA,UACR,IAAM,EAAA,mBAAA;AAAA,UACN,KAAO,EAAA;AAAA,YACL,OAAS,EAAA,kCAAA;AAAA,YACT,WAAa,EAAA,gCAAA;AAAA,WACf;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,sFAAA;AAAA,IACF,O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1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-gerrit",
|
|
3
3
|
"description": "The gerrit module for @backstage/plugin-scaffolder-backend",
|
|
4
|
-
"version": "0.1.2-next.
|
|
4
|
+
"version": "0.1.2-next.3",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/backstage/backstage",
|
|
14
|
+
"directory": "plugins/scaffolder-backend-module-gerrit"
|
|
15
|
+
},
|
|
11
16
|
"backstage": {
|
|
12
17
|
"role": "backend-plugin-module"
|
|
13
18
|
},
|
|
@@ -29,18 +34,18 @@
|
|
|
29
34
|
"postpack": "backstage-cli package postpack"
|
|
30
35
|
},
|
|
31
36
|
"dependencies": {
|
|
32
|
-
"@backstage/backend-plugin-api": "^0.6.10-next.
|
|
37
|
+
"@backstage/backend-plugin-api": "^0.6.10-next.3",
|
|
33
38
|
"@backstage/config": "^1.1.1",
|
|
34
39
|
"@backstage/errors": "^1.2.3",
|
|
35
|
-
"@backstage/integration": "^1.9.0-next.
|
|
36
|
-
"@backstage/plugin-scaffolder-node": "^0.3.0-next.
|
|
40
|
+
"@backstage/integration": "^1.9.0-next.1",
|
|
41
|
+
"@backstage/plugin-scaffolder-node": "^0.3.0-next.3",
|
|
37
42
|
"node-fetch": "^2.6.7",
|
|
38
43
|
"yaml": "^2.0.0"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
|
-
"@backstage/backend-common": "^0.21.0-next.
|
|
42
|
-
"@backstage/backend-test-utils": "^0.3.0-next.
|
|
43
|
-
"@backstage/cli": "^0.25.2-next.
|
|
46
|
+
"@backstage/backend-common": "^0.21.0-next.3",
|
|
47
|
+
"@backstage/backend-test-utils": "^0.3.0-next.3",
|
|
48
|
+
"@backstage/cli": "^0.25.2-next.3",
|
|
44
49
|
"msw": "^1.0.0"
|
|
45
50
|
},
|
|
46
51
|
"files": [
|