@backstage/plugin-scaffolder-backend-module-gitlab 0.5.1-next.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,17 +1,11 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-gitlab
2
2
 
3
- ## 0.5.1-next.0
3
+ ## 0.5.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 094eaa3: Remove references to in-repo backend-common
8
- - f2f68cf: Updated `gitlab:group:ensureExists` action to instead use oauth client.
9
7
  - Updated dependencies
10
- - @backstage/plugin-scaffolder-node@0.5.0-next.0
11
- - @backstage/backend-plugin-api@1.0.1-next.0
12
- - @backstage/config@1.2.0
13
- - @backstage/errors@1.2.4
14
- - @backstage/integration@1.15.0
8
+ - @backstage/plugin-scaffolder-node@0.4.12
15
9
 
16
10
  ## 0.5.0
17
11
 
package/dist/index.cjs.js CHANGED
@@ -758,11 +758,14 @@ const createGitlabGroupEnsureExistsAction = (options) => {
758
758
  ctx.output("groupId", 42);
759
759
  return;
760
760
  }
761
- const { token, repoUrl, path } = ctx.input;
762
- const { host } = parseRepoUrl(repoUrl, integrations);
763
- const api = getClient({ host, integrations, token });
761
+ const { path } = ctx.input;
762
+ const { token, integrationConfig } = getToken(ctx.input, integrations);
763
+ const api = new node.Gitlab({
764
+ host: integrationConfig.config.baseUrl,
765
+ token
766
+ });
764
767
  let currentPath = null;
765
- let parentId = null;
768
+ let parent = null;
766
769
  for (const pathElement of path) {
767
770
  const fullPath = currentPath ? `${currentPath}/${pathElement}` : pathElement;
768
771
  const result = await api.Groups.search(
@@ -773,20 +776,20 @@ const createGitlabGroupEnsureExistsAction = (options) => {
773
776
  );
774
777
  if (!subGroup) {
775
778
  ctx.logger.info(`creating missing group ${fullPath}`);
776
- parentId = (await api.Groups.create(
779
+ parent = await api.Groups.create(
777
780
  pathElement,
778
781
  pathElement,
779
- parentId ? {
780
- parentId
782
+ parent ? {
783
+ parent_id: parent.id
781
784
  } : {}
782
- ))?.id;
785
+ );
783
786
  } else {
784
- parentId = subGroup.id;
787
+ parent = subGroup;
785
788
  }
786
789
  currentPath = fullPath;
787
790
  }
788
- if (parentId !== null) {
789
- ctx.output("groupId", parentId);
791
+ if (parent !== null) {
792
+ ctx.output("groupId", parent?.id);
790
793
  }
791
794
  }
792
795
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/actions/gitlab.examples.ts","../src/actions/gitlab.ts","../src/commonGitlabConfig.ts","../src/util.ts","../src/actions/gitlabGroupEnsureExists.examples.ts","../src/actions/gitlabGroupEnsureExists.ts","../src/actions/gitlabIssueCreate.examples.ts","../src/actions/gitlabIssueCreate.ts","../src/actions/gitlabIssueEdit.examples.ts","../src/actions/gitlabIssueEdit.ts","../src/actions/helpers.ts","../src/actions/gitlabMergeRequest.examples.ts","../src/actions/gitlabMergeRequest.ts","../src/actions/gitlabPipelineTrigger.examples.ts","../src/actions/gitlabPipelineTrigger.ts","../src/actions/gitlabProjectAccessTokenCreate.examples.ts","../src/actions/gitlabProjectAccessTokenCreate.ts","../src/actions/gitlabProjectDeployTokenCreate.examples.ts","../src/actions/gitlabProjectDeployTokenCreate.ts","../src/actions/gitlabProjectVariableCreate.examples.ts","../src/actions/gitlabProjectVariableCreate.ts","../src/actions/gitlabRepoPush.examples.ts","../src/actions/gitlabRepoPush.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 git repository with the content in the workspace, and publishes it to GitLab with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n },\n },\n ],\n }),\n },\n {\n description: 'Add a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a GitLab 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:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n description: 'Initialize a git repository',\n gitCommitMessage: 'Started a project.',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with aditional settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n settings: {\n ci_config_path: '.gitlab-ci.yml',\n visibility: 'public',\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a GitLab repository with fast forward merge and always squash settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n settings: {\n merge_method: 'ff',\n squash_option: 'always',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with branch settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n branches: [\n {\n name: 'dev',\n create: true,\n protect: true,\n ref: 'master',\n },\n {\n name: 'master',\n protect: true,\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with environment variables.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n projectVariables: [\n {\n key: 'key1',\n value: 'value1',\n protected: true,\n masked: false,\n },\n {\n key: 'key2',\n value: 'value2',\n protected: true,\n masked: false,\n },\n ],\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { Gitlab } from '@gitbeaker/node';\nimport {\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Config } from '@backstage/config';\nimport { examples } from './gitlab.examples';\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to GitLab.\n *\n * @public\n */\nexport function createPublishGitlabAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n defaultBranch?: string;\n /** @deprecated in favour of settings.visibility field */\n repoVisibility?: 'private' | 'internal' | 'public';\n sourcePath?: string;\n token?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n setUserAsOwner?: boolean;\n /** @deprecated in favour of settings.topics field */\n topics?: string[];\n settings?: {\n path?: string;\n auto_devops_enabled?: boolean;\n ci_config_path?: string;\n description?: string;\n merge_method?: 'merge' | 'rebase_merge' | 'ff';\n squash_option?: 'default_off' | 'default_on' | 'never' | 'always';\n topics?: string[];\n visibility?: 'private' | 'internal' | 'public';\n };\n branches?: Array<{\n name: string;\n protect?: boolean;\n create?: boolean;\n ref?: string;\n }>;\n projectVariables?: Array<{\n key: string;\n value: string;\n description?: string;\n variable_type?: string;\n protected?: boolean;\n masked?: boolean;\n raw?: boolean;\n environment_scope?: string;\n }>;\n }>({\n id: 'publish:gitlab',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to GitLab.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n repoVisibility: {\n title: 'Repository Visibility',\n description: `Sets the visibility of the repository. The default value is 'private'. (deprecated, use settings.visibility instead)`,\n type: 'string',\n enum: ['private', 'public', 'internal'],\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 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 token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n setUserAsOwner: {\n title: 'Set User As Owner',\n type: 'boolean',\n description:\n 'Set the token user as owner of the newly created repository. Requires a token authorized to do the edit in the integration configuration for the matching host',\n },\n topics: {\n title: 'Topic labels',\n description:\n 'Topic labels to apply on the repository. (deprecated, use settings.topics instead)',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n settings: {\n title: 'Project settings',\n description:\n 'Additional project settings, based on https://docs.gitlab.com/ee/api/projects.html#create-project attributes',\n type: 'object',\n properties: {\n path: {\n title: 'Project path',\n description:\n 'Repository name for new project. Generated based on name if not provided (generated as lowercase with dashes).',\n type: 'string',\n },\n auto_devops_enabled: {\n title: 'Auto DevOps enabled',\n description: 'Enable Auto DevOps for this project',\n type: 'boolean',\n },\n ci_config_path: {\n title: 'CI config path',\n description: 'Custom CI config path for this project',\n type: 'string',\n },\n description: {\n title: 'Project description',\n description: 'Short project description',\n type: 'string',\n },\n merge_method: {\n title: 'Merge Method to use',\n description: 'Merge Methods (merge, rebase_merge, ff)',\n type: 'string',\n enum: ['merge', 'rebase_merge', 'ff'],\n },\n squash_option: {\n title: 'Squash option',\n description:\n 'Set squash option for the project (never, always, default_on, default_off)',\n type: 'string',\n enum: ['default_off', 'default_on', 'never', 'always'],\n },\n topics: {\n title: 'Topic labels',\n description: 'Topic labels to apply on the repository',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n visibility: {\n title: 'Project visibility',\n description:\n 'The visibility of the project. Can be private, internal, or public. The default value is private.',\n type: 'string',\n enum: ['private', 'public', 'internal'],\n },\n },\n },\n branches: {\n title: 'Project branches settings',\n type: 'array',\n items: {\n type: 'object',\n required: ['name'],\n properties: {\n name: {\n title: 'Branch name',\n type: 'string',\n },\n protect: {\n title: 'Should branch be protected',\n description: `Will mark branch as protected. The default value is 'false'`,\n type: 'boolean',\n },\n create: {\n title: 'Should branch be created',\n description: `If branch does not exist, it will be created from provided ref. The default value is 'false'`,\n type: 'boolean',\n },\n ref: {\n title: 'Branch reference',\n description: `Branch reference to create branch from. The default value is 'master'`,\n type: 'string',\n },\n },\n },\n },\n projectVariables: {\n title: 'Project variables',\n description:\n 'Project variables settings based on Gitlab Project Environments API - https://docs.gitlab.com/ee/api/project_level_variables.html#create-a-variable',\n type: 'array',\n items: {\n type: 'object',\n required: ['key', 'value'],\n properties: {\n key: {\n title: 'Variable key',\n description:\n 'The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed',\n type: 'string',\n },\n value: {\n title: 'Variable value',\n description: 'The value of a variable',\n type: 'string',\n },\n description: {\n title: 'Variable description',\n description: `The description of the variable. The default value is 'null'`,\n type: 'string',\n },\n variable_type: {\n title: 'Variable type',\n description: `The type of a variable. The default value is 'env_var'`,\n type: 'string',\n enum: ['env_var', 'file'],\n },\n protected: {\n title: 'Variable protection',\n description: `Whether the variable is protected. The default value is 'false'`,\n type: 'boolean',\n },\n raw: {\n title: 'Variable raw',\n description: `Whether the variable is in raw format. The default value is 'false'`,\n type: 'boolean',\n },\n environment_scope: {\n title: 'Variable environment scope',\n description: `The environment_scope of the variable. The default value is '*'`,\n type: 'string',\n },\n },\n },\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 projectId: {\n title: 'The ID of the project',\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 repoVisibility = 'private',\n defaultBranch = 'master',\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n setUserAsOwner = false,\n topics = [],\n settings = {},\n branches = [],\n projectVariables = [],\n } = ctx.input;\n const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(\n `No owner provided for host: ${host}, and repo ${repo}`,\n );\n }\n\n const integrationConfig = integrations.gitlab.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 (!integrationConfig.config.token && !ctx.input.token) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const token = ctx.input.token || integrationConfig.config.token!;\n const tokenType = ctx.input.token ? 'oauthToken' : 'token';\n\n const client = new Gitlab({\n host: integrationConfig.config.baseUrl,\n [tokenType]: token,\n });\n\n let targetNamespaceId;\n\n try {\n const namespaceResponse = (await client.Namespaces.show(owner)) as {\n id: number;\n };\n\n targetNamespaceId = namespaceResponse.id;\n } catch (e) {\n if (e.response && e.response.statusCode === 404) {\n throw new InputError(\n `The namespace ${owner} is not found or the user doesn't have permissions to access it`,\n );\n }\n throw e;\n }\n\n const { id: userId } = (await client.Users.current()) as {\n id: number;\n };\n\n if (!targetNamespaceId) {\n targetNamespaceId = userId;\n }\n\n const { id: projectId, http_url_to_repo } = await client.Projects.create({\n namespace_id: targetNamespaceId,\n name: repo,\n visibility: repoVisibility,\n ...(topics.length ? { topics } : {}),\n ...(Object.keys(settings).length ? { ...settings } : {}),\n });\n\n // When setUserAsOwner is true the input token is expected to come from an unprivileged user GitLab\n // OAuth flow. In this case GitLab works in a way that allows the unprivileged user to\n // create the repository, but not to push the default protected branch (e.g. master).\n // In order to set the user as owner of the newly created repository we need to check that the\n // GitLab integration configuration for the matching host contains a token and use\n // such token to bootstrap a new privileged client.\n if (setUserAsOwner && integrationConfig.config.token) {\n const adminClient = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: integrationConfig.config.token,\n });\n\n await adminClient.ProjectMembers.add(projectId, userId, 50);\n }\n\n const remoteUrl = (http_url_to_repo as string).replace(/\\.git$/, '');\n const repoContentsUrl = `${remoteUrl}/-/blob/${defaultBranch}`;\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 commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl: http_url_to_repo as string,\n defaultBranch,\n auth: {\n username: 'oauth2',\n password: token,\n },\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n });\n\n if (branches) {\n for (const branch of branches) {\n const {\n name,\n protect = false,\n create = false,\n ref = 'master',\n } = branch;\n\n if (create) {\n try {\n await client.Branches.create(projectId, name, ref);\n } catch (e) {\n throw new InputError(\n `Branch creation failed for ${name}. ${printGitlabError(e)}`,\n );\n }\n ctx.logger.info(\n `Branch ${name} created for ${projectId} with ref ${ref}`,\n );\n }\n\n if (protect) {\n try {\n await client.ProtectedBranches.protect(projectId, name);\n } catch (e) {\n throw new InputError(\n `Branch protection failed for ${name}. ${printGitlabError(e)}`,\n );\n }\n ctx.logger.info(`Branch ${name} protected for ${projectId}`);\n }\n }\n }\n\n if (projectVariables) {\n for (const variable of projectVariables) {\n const variableWithDefaults = Object.assign(variable, {\n variable_type: variable.variable_type ?? 'env_var',\n protected: variable.protected ?? false,\n masked: variable.masked ?? false,\n raw: variable.raw ?? false,\n environment_scope: variable.environment_scope ?? '*',\n });\n\n try {\n await client.ProjectVariables.create(\n projectId,\n variableWithDefaults,\n );\n } catch (e) {\n throw new InputError(\n `Environment variable creation failed for ${\n variableWithDefaults.key\n }. ${printGitlabError(e)}`,\n );\n }\n }\n }\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('projectId', projectId);\n },\n });\n}\n\nfunction printGitlabError(error: any): string {\n return JSON.stringify({ code: error.code, message: error.description });\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 { z } from 'zod';\n\nconst commonGitlabConfig = z.object({\n repoUrl: z.string({ description: 'Repository Location' }),\n token: z\n .string({ description: 'The token to use for authorization to GitLab' })\n .optional(),\n});\n\nexport default commonGitlabConfig;\n\nexport const commonGitlabConfigExample = {\n repoUrl: 'gitlab.com?owner=namespace-or-owner&repo=project-name',\n token: '${{ secrets.USER_OAUTH_TOKEN }}',\n};\n\n/**\n * Gitlab issue types as specified by gitlab api\n *\n * @public\n */\nexport enum IssueType {\n ISSUE = 'issue',\n INCIDENT = 'incident',\n TEST = 'test_case',\n TASK = 'task',\n}\n\n/**\n * Gitlab issue state events for modifications\n *\n * @public\n */\nexport enum IssueStateEvent {\n CLOSE = 'close',\n REOPEN = 'reopen',\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 GitLabIntegration,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Gitlab, GroupSchema } from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from './commonGitlabConfig';\nimport * as util from './util';\n\nexport const parseRepoHost = (repoUrl: string): string => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n return parsed.host;\n};\n\nexport const getToken = (\n config: z.infer<typeof commonGitlabConfig>,\n integrations: ScmIntegrationRegistry,\n): { token: string; integrationConfig: GitLabIntegration } => {\n const host = parseRepoHost(config.repoUrl);\n const integrationConfig = integrations.gitlab.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 token = config.token || integrationConfig.config.token!;\n\n return { token: token, integrationConfig: integrationConfig };\n};\n\nexport type RepoSpec = {\n repo: string;\n host: string;\n owner?: string;\n};\n\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): RepoSpec => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const owner = parsed.searchParams.get('owner') ?? undefined;\n const repo: string = parsed.searchParams.get('repo')!;\n\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n return { host, owner, repo };\n};\n\nexport function getClient(props: {\n host: string;\n token?: string;\n integrations: ScmIntegrationRegistry;\n}): InstanceType<typeof Gitlab> {\n const { host, token, integrations } = props;\n const integrationConfig = integrations.gitlab.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 { config } = integrationConfig;\n\n if (!config.token && !token) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const requestToken = token || config.token!;\n const tokenType = token ? 'oauthToken' : 'token';\n\n const gitlabOptions: any = {\n host: config.baseUrl,\n };\n\n gitlabOptions[tokenType] = requestToken;\n return new Gitlab(gitlabOptions);\n}\n\nexport function convertDate(\n inputDate: string | undefined,\n defaultDate: string,\n) {\n try {\n return inputDate\n ? new Date(inputDate).toISOString()\n : new Date(defaultDate).toISOString();\n } catch (error) {\n throw new InputError(`Error converting input date - ${error}`);\n }\n}\n\nexport async function getTopLevelParentGroup(\n client: InstanceType<typeof Gitlab>,\n groupId: number,\n): Promise<GroupSchema> {\n try {\n const topParentGroup = await client.Groups.show(groupId);\n if (topParentGroup.parent_id) {\n return util.getTopLevelParentGroup(\n client,\n topParentGroup.parent_id as number,\n );\n }\n return topParentGroup as GroupSchema;\n } catch (error: any) {\n throw new InputError(\n `Error finding top-level parent group ID: ${error.message}`,\n );\n }\n}\n\nexport async function checkEpicScope(\n client: InstanceType<typeof Gitlab>,\n projectId: number,\n epicId: number,\n) {\n try {\n // If project exists, get the top level group id\n const project = await client.Projects.show(projectId);\n if (!project) {\n throw new InputError(\n `Project with id ${projectId} not found. Check your GitLab instance.`,\n );\n }\n const topParentGroup = await getTopLevelParentGroup(\n client,\n project.namespace.id,\n );\n if (!topParentGroup) {\n throw new InputError(`Couldn't find a suitable top-level parent group.`);\n }\n // Get the epic\n const epic = (await client.Epics.all(topParentGroup.id)).find(\n (x: any) => x.id === epicId,\n );\n if (!epic) {\n throw new InputError(\n `Epic with id ${epicId} not found in the top-level parent group ${topParentGroup.name}.`,\n );\n }\n\n const epicGroup = await client.Groups.show(epic.group_id as number);\n const projectNamespace: string = project.path_with_namespace as string;\n return projectNamespace.startsWith(epicGroup.full_path as string);\n } catch (error: any) {\n throw new InputError(`Could not find epic scope: ${error.message}`);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Creating a group at the top level',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group nested within another group',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1', 'group2'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group nested within multiple other groups',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1', 'group2', 'group3'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group in dry run mode',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n isDryRun: true,\n input: {\n repoUrl: 'https://gitlab.com/my-repo',\n path: ['group1', 'group2', 'group3'],\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { GroupSchema } from '@gitbeaker/core/dist/types/resources/Groups';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getClient, parseRepoUrl } from '../util';\nimport { examples } from './gitlabGroupEnsureExists.examples';\n\n/**\n * Creates an `gitlab:group:ensureExists` Scaffolder action.\n *\n * @public\n */\nexport const createGitlabGroupEnsureExistsAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'gitlab:group:ensureExists',\n description: 'Ensures a Gitlab group exists',\n supportsDryRun: true,\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n path: z\n .array(z.string(), {\n description: 'A path of group names that is ensured to exist',\n })\n .min(1),\n }),\n ),\n output: z.object({\n groupId: z\n .number({ description: 'The id of the innermost sub-group' })\n .optional(),\n }),\n },\n async handler(ctx) {\n if (ctx.isDryRun) {\n ctx.output('groupId', 42);\n return;\n }\n\n const { token, repoUrl, path } = ctx.input;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n\n const api = getClient({ host, integrations, token });\n\n let currentPath: string | null = null;\n let parentId: number | null = null;\n for (const pathElement of path) {\n const fullPath: string = currentPath\n ? `${currentPath}/${pathElement}`\n : pathElement;\n const result = (await api.Groups.search(\n fullPath,\n )) as unknown as Array<GroupSchema>; // recast since the return type for search is wrong in the gitbeaker typings\n const subGroup = result.find(\n searchPathElem => searchPathElem.full_path === fullPath,\n );\n if (!subGroup) {\n ctx.logger.info(`creating missing group ${fullPath}`);\n parentId = (\n await api.Groups.create(\n pathElement,\n pathElement,\n parentId\n ? {\n parentId: parentId,\n }\n : {},\n )\n )?.id;\n } else {\n parentId = subGroup.id;\n }\n currentPath = fullPath;\n }\n if (parentId !== null) {\n ctx.output('groupId', parentId);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab issue with minimal options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n description: 'This is the description of the issue',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with assignees and date options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18],\n description: 'This is the description of the issue',\n createdAt: '2022-09-27T18:00:00.000Z',\n dueDate: '2022-09-28T12:00:00.000Z',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab Issue with several options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18, 15],\n description: 'This is the description of the issue',\n confidential: false,\n createdAt: '2022-09-27T18:00:00.000Z',\n dueDate: '2022-09-28T12:00:00.000Z',\n discussionToResolve: '1',\n epicId: 1,\n labels: 'phase1:label1,phase2:label2',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with token',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n description: 'This is the description of the issue',\n token: 'sample token',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with a specific milestone and weight',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue with Milestone',\n description: 'This is the description of the issue',\n milestoneId: 5,\n weight: 3,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type INCIDENT',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'incident',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type TEST',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'test_case',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type TASK with assignees',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'task',\n assignees: [18, 22],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type ISSUE and close it',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'issue',\n stateEvent: 'close',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type INCIDENT and reopen it',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'incident',\n stateEvent: 'reopen',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab issue to resolve a discussion in a merge request',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue for MR Discussion',\n description: 'This is the description of the issue',\n mergeRequestToResolveDiscussionsOf: 42,\n discussionToResolve: 'abc123',\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport commonGitlabConfig, { IssueType } from '../commonGitlabConfig';\nimport { examples } from './gitlabIssueCreate.examples';\nimport { z } from 'zod';\nimport { checkEpicScope, convertDate, getClient, parseRepoUrl } from '../util';\nimport { CreateIssueOptions, IssueSchema } from '@gitbeaker/rest';\n\nconst issueInputProperties = z.object({\n projectId: z.number().describe('Project Id'),\n title: z.string({ description: 'Title of the issue' }),\n assignees: z\n .array(z.number(), {\n description: 'IDs of the users to assign the issue to.',\n })\n .optional(),\n confidential: z.boolean({ description: 'Issue Confidentiality' }).optional(),\n description: z.string().describe('Issue description').max(1048576).optional(),\n createdAt: z\n .string()\n .describe('Creation date/time')\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n dueDate: z\n .string()\n .describe('Due date/time')\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n discussionToResolve: z\n .string({\n description:\n 'Id of a discussion to resolve. Use in combination with \"merge_request_to_resolve_discussions_of\"',\n })\n .optional(),\n epicId: z\n .number({ description: 'Id of the linked Epic' })\n .min(0, 'Valid values should be equal or greater than zero')\n .optional(),\n labels: z.string({ description: 'Labels to apply' }).optional(),\n issueType: z\n .nativeEnum(IssueType, {\n description: 'Type of the issue',\n })\n .optional(),\n mergeRequestToResolveDiscussionsOf: z\n .number({\n description: 'IID of a merge request in which to resolve all issues',\n })\n .optional(),\n milestoneId: z\n .number({ description: 'Global ID of a milestone to assign the issue' })\n .optional(),\n weight: z\n .number({ description: 'The issue weight' })\n .min(0)\n .refine(value => {\n const isValid = value >= 0;\n if (!isValid) {\n return {\n message: 'Valid values should be equal or greater than zero',\n };\n }\n return isValid;\n })\n .optional(),\n});\n\nconst issueOutputProperties = z.object({\n issueUrl: z.string({ description: 'Issue Url' }),\n issueId: z.number({ description: 'Issue Id' }),\n issueIid: z.number({ description: 'Issue Iid' }),\n});\n\n/**\n * Creates a `gitlab:issues:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabIssueAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:issues:create',\n description: 'Creates a Gitlab issue.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(issueInputProperties),\n output: issueOutputProperties,\n },\n async handler(ctx) {\n try {\n const {\n repoUrl,\n projectId,\n title,\n description = '',\n confidential = false,\n assignees = [],\n createdAt = '',\n dueDate,\n discussionToResolve = '',\n epicId,\n labels = '',\n issueType,\n mergeRequestToResolveDiscussionsOf,\n milestoneId,\n weight,\n token,\n } = commonGitlabConfig.merge(issueInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n let isEpicScoped = false;\n\n if (epicId) {\n isEpicScoped = await checkEpicScope(api, projectId, epicId);\n\n if (isEpicScoped) {\n ctx.logger.info('Epic is within Project Scope');\n } else {\n ctx.logger.warn(\n 'Chosen epic is not within the Project Scope. The issue will be created without an associated epic.',\n );\n }\n }\n const mappedCreatedAt = convertDate(\n String(createdAt),\n new Date().toISOString(),\n );\n const mappedDueDate = dueDate\n ? convertDate(String(dueDate), new Date().toISOString())\n : undefined;\n\n const issueOptions: CreateIssueOptions = {\n description,\n assigneeIds: assignees,\n confidential,\n epicId: isEpicScoped ? epicId : undefined,\n labels,\n createdAt: mappedCreatedAt,\n dueDate: mappedDueDate,\n discussionToResolve,\n issueType,\n mergeRequestToResolveDiscussionsOf,\n milestoneId,\n weight,\n };\n\n const response = (await api.Issues.create(\n projectId,\n title,\n issueOptions,\n )) as IssueSchema;\n\n ctx.output('issueId', response.id);\n ctx.output('issueUrl', response.web_url);\n ctx.output('issueIid', response.iid);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(`Failed to create GitLab issue: ${error.message}`);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Edit a GitLab issue with minimal options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Modified Test Issue',\n description: 'This is a modified description of the issue',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a GitLab issue with assignees and date options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18],\n description: 'This is the edited description of the issue',\n updatedAt: '2024-05-10T18:00:00.000Z',\n dueDate: '2024-09-28',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab Issue with several options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Edit Issue',\n assignees: [18, 15],\n description: 'This is the description of the issue',\n confidential: false,\n updatedAt: '2024-05-10T18:00:00.000Z',\n dueDate: '2024-09-28',\n discussionLocked: true,\n epicId: 1,\n labels: 'phase1:label1,phase2:label2',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change its state to close',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n stateEvent: 'close',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change its state to reopened',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n stateEvent: 'reopen',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Edit a gitlab issue to assign it to multiple users and set milestone',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test issue with milestone',\n assignees: [18, 20],\n description: 'This issue has milestone set',\n milestoneId: 5,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to add weight and update labels',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with weight and labels',\n description: 'This issue has weight and new labels',\n weight: 3,\n labels: 'bug,urgent',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to make it confidential',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Issue',\n description: 'This issue is confidential',\n confidential: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to lock the discussion',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Locked Discussion Issue',\n description: 'This discussion on this issue is locked',\n discussionLocked: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to remove labels and update milestone',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with labels removed and milestone updated',\n description: 'This issue has labels removed and milestone updated',\n removeLabels: 'phase1:label1',\n milestoneId: 6,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to remove some labels and new ones',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with labels updated',\n description: 'This issue has labels removed and new ones added',\n removeLabels: 'bug,urgent',\n labels: 'enhancement:documentation',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change issue type and add labels',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with type and labels',\n description: 'This issue has been changes and new labels added',\n labels: 'task,high-priority',\n issueType: 'task',\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport commonGitlabConfig, {\n IssueType,\n IssueStateEvent,\n} from '../commonGitlabConfig';\nimport { examples } from './gitlabIssueEdit.examples';\nimport { z } from 'zod';\nimport { checkEpicScope, convertDate, getClient, parseRepoUrl } from '../util';\nimport { IssueSchema, EditIssueOptions } from '@gitbeaker/rest';\n\nconst editIssueInputProperties = z.object({\n projectId: z\n .number()\n .describe(\n 'The global ID or URL-encoded path of the project owned by the authenticated user.',\n ),\n issueIid: z.number().describe(\"The internal ID of a project's issue\"),\n addLabels: z\n .string({\n description:\n 'Comma-separated label names to add to an issue. If a label does not already exist, this creates a new project label and assigns it to the issue.',\n })\n .optional(),\n assignees: z\n .array(z.number(), {\n description: 'IDs of the users to assign the issue to.',\n })\n .optional(),\n confidential: z\n .boolean({ description: 'Updates an issue to be confidential.' })\n .optional(),\n description: z\n .string()\n .describe('The description of an issue. Limited to 1,048,576 characters.')\n .max(1048576)\n .optional(),\n discussionLocked: z\n .boolean({\n description:\n 'Flag indicating if the issue’s discussion is locked. If the discussion is locked only project members can add or edit comments.',\n })\n .optional(),\n dueDate: z\n .string()\n .describe(\n 'The due date. Date time string in the format YYYY-MM-DD, for example 2016-03-11.',\n )\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')\n .optional(),\n epicId: z\n .number({\n description:\n 'ID of the epic to add the issue to. Valid values are greater than or equal to 0.',\n })\n .min(0, 'Valid values should be equal or greater than zero')\n .optional(),\n issueType: z\n .nativeEnum(IssueType, {\n description:\n 'Updates the type of issue. One of issue, incident, test_case or task.',\n })\n .optional(),\n labels: z\n .string({\n description:\n 'Comma-separated label names for an issue. Set to an empty string to unassign all labels. If a label does not already exist, this creates a new project label and assigns it to the issue.',\n })\n .optional(),\n milestoneId: z\n .number({\n description:\n 'The global ID of a milestone to assign the issue to. Set to 0 or provide an empty value to unassign a milestone',\n })\n .optional(),\n removeLabels: z\n .string({\n description: 'Comma-separated label names to remove from an issue.',\n })\n .optional(),\n stateEvent: z\n .nativeEnum(IssueStateEvent, {\n description:\n 'The state event of an issue. To close the issue, use close, and to reopen it, use reopen.',\n })\n .optional(),\n title: z.string().describe('The title of an issue.').optional(),\n updatedAt: z\n .string()\n .describe(\n 'When the issue was updated. Date time string, ISO 8601 formatted',\n )\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n weight: z\n .number({ description: 'The issue weight' })\n .min(0, 'Valid values should be equal or greater than zero')\n .max(10, 'Valid values should be equal or less than 10')\n .optional(),\n});\n\nconst editIssueOutputProperties = z.object({\n issueUrl: z.string({ description: 'Issue WebUrl' }),\n projectId: z.number({\n description: 'The project id the issue belongs to WebUrl',\n }),\n issueId: z.number({ description: 'The issues Id' }),\n issueIid: z.number({\n description: \"The issues internal ID of a project's issue\",\n }),\n state: z.string({ description: 'The state event of an issue' }),\n title: z.string({ description: 'The title of an issue.' }),\n updatedAt: z.string({ description: 'The last updated time of the issue.' }),\n});\n\n/**\n * Creates a `gitlab:issue:edit` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const editGitlabIssueAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:issue:edit',\n description: 'Edit a Gitlab issue.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(editIssueInputProperties),\n output: editIssueOutputProperties,\n },\n async handler(ctx) {\n try {\n const {\n repoUrl,\n projectId,\n title,\n addLabels,\n removeLabels,\n issueIid,\n description,\n confidential = false,\n assignees = [],\n updatedAt = '',\n dueDate,\n discussionLocked = false,\n epicId,\n labels,\n issueType,\n milestoneId,\n stateEvent,\n weight,\n token,\n } = commonGitlabConfig.merge(editIssueInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n let isEpicScoped = false;\n\n if (epicId) {\n isEpicScoped = await checkEpicScope(api, projectId, epicId);\n\n if (isEpicScoped) {\n ctx.logger.info('Epic is within Project Scope');\n } else {\n ctx.logger.warn(\n 'Chosen epic is not within the Project Scope. The issue will be created without an associated epic.',\n );\n }\n }\n\n const mappedUpdatedAt = convertDate(\n String(updatedAt),\n new Date().toISOString(),\n );\n\n const editIssueOptions: EditIssueOptions = {\n addLabels,\n assigneeIds: assignees,\n confidential,\n description,\n discussionLocked,\n dueDate,\n epicId: isEpicScoped ? epicId : undefined,\n issueType,\n labels,\n milestoneId,\n removeLabels,\n stateEvent,\n title,\n updatedAt: mappedUpdatedAt,\n weight,\n };\n\n const response = (await api.Issues.edit(\n projectId,\n issueIid,\n editIssueOptions,\n )) as IssueSchema;\n\n ctx.output('issueId', response.id);\n ctx.output('projectId', response.project_id);\n ctx.output('issueUrl', response.web_url);\n ctx.output('issueIid', response.iid);\n ctx.output('title', response.title);\n ctx.output('state', response.state);\n ctx.output('updatedAt', response.updated_at);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(\n `Failed to edit/modify GitLab issue: ${error.message}`,\n );\n }\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 */\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { InputError } from '@backstage/errors';\nimport { Gitlab } from '@gitbeaker/node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { Resources } from '@gitbeaker/core';\n\nexport function createGitlabApi(options: {\n integrations: ScmIntegrationRegistry;\n token?: string;\n repoUrl: string;\n}): Resources.Gitlab {\n const { integrations, token: providedToken, repoUrl } = options;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n\n const integrationConfig = integrations.gitlab.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 (!integrationConfig.config.token && !providedToken) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const token = providedToken ?? integrationConfig.config.token!;\n const tokenType = providedToken ? 'oauthToken' : 'token';\n\n return new Gitlab({\n host: integrationConfig.config.baseUrl,\n [tokenType]: token,\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a merge request with a specific assignee',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n assignee: 'my-assignee',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a merge request with removal of source branch after merge',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n removeSourceBranch: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a target branch',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n targetBranchName: 'test',\n targetPath: 'Subdirectory',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as create',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'create',\n targetPath: 'source',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as delete',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'delete',\n targetPath: 'source',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as update',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'update',\n targetPath: 'source',\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 {\n createTemplateAction,\n parseRepoUrl,\n SerializedFile,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { Types } from '@gitbeaker/core';\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport { createGitlabApi } from './helpers';\nimport { examples } from './gitlabMergeRequest.examples';\n\nfunction getFileAction(\n fileInfo: { file: SerializedFile; targetPath: string | undefined },\n remoteFiles: Types.RepositoryTreeSchema[],\n defaultCommitAction: 'create' | 'delete' | 'update' | 'auto' | undefined,\n): 'create' | 'delete' | 'update' {\n if (!defaultCommitAction || defaultCommitAction === 'auto') {\n const filePath = path.join(fileInfo.targetPath ?? '', fileInfo.file.path);\n return remoteFiles &&\n remoteFiles.some(remoteFile => remoteFile.path === filePath)\n ? 'update'\n : 'create';\n }\n return defaultCommitAction;\n}\n\n/**\n * Create a new action that creates a gitlab merge request.\n *\n * @public\n */\nexport const createPublishGitlabMergeRequestAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n title: string;\n description: string;\n branchName: string;\n targetBranchName?: string;\n sourcePath?: string;\n targetPath?: string;\n token?: string;\n commitAction?: 'create' | 'delete' | 'update' | 'auto';\n /** @deprecated projectID passed as query parameters in the repoUrl */\n projectid?: string;\n removeSourceBranch?: boolean;\n assignee?: string;\n }>({\n id: 'publish:gitlab:merge-request',\n examples,\n schema: {\n input: {\n required: ['repoUrl', 'branchName'],\n type: 'object',\n properties: {\n repoUrl: {\n type: 'string',\n title: 'Repository Location',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n /** @deprecated projectID is passed as query parameters in the repoUrl */\n projectid: {\n type: 'string',\n title: 'projectid',\n description: 'Project ID/Name(slug) of the Gitlab Project',\n },\n title: {\n type: 'string',\n title: 'Merge Request Name',\n description: 'The name for the merge request',\n },\n description: {\n type: 'string',\n title: 'Merge Request Description',\n description: 'The description of the merge request',\n },\n branchName: {\n type: 'string',\n title: 'Source Branch Name',\n description: 'The source branch name of the merge request',\n },\n targetBranchName: {\n type: 'string',\n title: 'Target Branch Name',\n description: 'The target branch name of the merge request',\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n commitAction: {\n title: 'Commit action',\n type: 'string',\n enum: ['create', 'update', 'delete', 'auto'],\n description:\n 'The action to be used for git commit. Defaults to auto. \"auto\" is custom action provide by backstage, (automatic assign create or update action) /!\\\\ Use more api calls /!\\\\ *',\n },\n removeSourceBranch: {\n title: 'Delete source branch',\n type: 'boolean',\n description:\n 'Option to delete source branch once the MR has been merged. Default: false',\n },\n assignee: {\n title: 'Merge Request Assignee',\n type: 'string',\n description: 'User this merge request will be assigned to',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n targetBranchName: {\n title: 'Target branch name of the merge request',\n type: 'string',\n },\n projectid: {\n title: 'Gitlab Project id/Name(slug)',\n type: 'string',\n },\n projectPath: {\n title: 'Gitlab Project path',\n type: 'string',\n },\n mergeRequestUrl: {\n title: 'MergeRequest(MR) URL',\n type: 'string',\n description: 'Link to the merge request in GitLab',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n assignee,\n branchName,\n targetBranchName,\n description,\n repoUrl,\n removeSourceBranch,\n targetPath,\n sourcePath,\n title,\n token,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let assigneeId = undefined;\n\n if (assignee !== undefined) {\n try {\n const assigneeUser = await api.Users.username(assignee);\n assigneeId = assigneeUser[0].id;\n } catch (e) {\n ctx.logger.warn(\n `Failed to find gitlab user id for ${assignee}: ${e}. Proceeding with MR creation without an assignee.`,\n );\n }\n }\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else if (targetPath) {\n // for backward compatibility\n fileRoot = resolveSafeChildPath(ctx.workspacePath, targetPath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n let targetBranch = targetBranchName;\n if (!targetBranch) {\n const projects = await api.Projects.show(repoID);\n\n const { default_branch: defaultBranch } = projects;\n targetBranch = defaultBranch!;\n }\n\n let remoteFiles: Types.RepositoryTreeSchema[] = [];\n if (!ctx.input.commitAction || ctx.input.commitAction === 'auto') {\n try {\n remoteFiles = await api.Repositories.tree(repoID, {\n ref: targetBranch,\n recursive: true,\n path: targetPath ?? undefined,\n });\n } catch (e) {\n ctx.logger.warn(\n `Could not retrieve the list of files for ${repoID} (branch: ${targetBranch}) : ${e}`,\n );\n }\n }\n\n const actions: Types.CommitAction[] = fileContents.map(file => ({\n action: getFileAction(\n { file, targetPath },\n remoteFiles,\n ctx.input.commitAction,\n ),\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n try {\n await api.Branches.create(repoID, branchName, String(targetBranch));\n } catch (e) {\n throw new InputError(\n `The branch creation failed. Please check that your repo does not already contain a branch named '${branchName}'. ${e}`,\n );\n }\n\n try {\n await api.Commits.create(repoID, branchName, ctx.input.title, actions);\n } catch (e) {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`,\n );\n }\n\n try {\n const mergeRequestUrl = await api.MergeRequests.create(\n repoID,\n branchName,\n String(targetBranch),\n title,\n {\n description,\n removeSourceBranch: removeSourceBranch ? removeSourceBranch : false,\n assigneeId,\n },\n ).then((mergeRequest: { web_url: string }) => {\n return mergeRequest.web_url;\n });\n ctx.output('projectid', repoID);\n ctx.output('targetBranchName', targetBranch);\n ctx.output('projectPath', repoID);\n ctx.output('mergeRequestUrl', mergeRequestUrl);\n } catch (e) {\n throw new InputError(`Merge request creation failed${e}`);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Trigger a GitLab Project Pipeline',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one', var_two: 'two' },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with No Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: {},\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with Single Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one' },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with Multiple Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one', var_two: 'two', var_three: 'three' },\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport {\n ExpandedPipelineSchema,\n PipelineTriggerTokenSchema,\n} from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getClient, parseRepoUrl } from '../util';\nimport { examples } from './gitlabPipelineTrigger.examples';\n\nconst pipelineInputProperties = z.object({\n projectId: z.number().describe('Project Id'),\n tokenDescription: z.string().describe('Pipeline token description'),\n branch: z.string().describe('Project branch'),\n variables: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'A object/record of key-valued strings containing the pipeline variables.',\n ),\n});\n\nconst pipelineOutputProperties = z.object({\n pipelineUrl: z.string({ description: 'Pipeline Url' }),\n});\n\n/**\n * Creates a `gitlab:pipeline:trigger` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createTriggerGitlabPipelineAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:pipeline:trigger',\n description: 'Triggers a GitLab Pipeline.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(pipelineInputProperties),\n output: pipelineOutputProperties,\n },\n async handler(ctx) {\n let pipelineTokenResponse: PipelineTriggerTokenSchema | null = null;\n\n const { repoUrl, projectId, tokenDescription, token, branch, variables } =\n commonGitlabConfig.merge(pipelineInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n try {\n // Create a pipeline token\n pipelineTokenResponse = (await api.PipelineTriggerTokens.create(\n projectId,\n tokenDescription,\n )) as PipelineTriggerTokenSchema;\n\n if (!pipelineTokenResponse.token) {\n ctx.logger.error('Failed to create pipeline token.');\n return;\n }\n ctx.logger.info(\n `Pipeline token id ${pipelineTokenResponse.id} created.`,\n );\n\n // Use the pipeline token to trigger the pipeline in the project\n const pipelineTriggerResponse =\n (await api.PipelineTriggerTokens.trigger(\n projectId,\n branch,\n pipelineTokenResponse.token,\n { variables },\n )) as ExpandedPipelineSchema;\n\n if (!pipelineTriggerResponse.id) {\n ctx.logger.error('Failed to trigger pipeline.');\n return;\n }\n\n ctx.logger.info(`Pipeline id ${pipelineTriggerResponse.id} triggered.`);\n\n ctx.output('pipelineUrl', pipelineTriggerResponse.web_url);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(`Failed to trigger Pipeline: ${error.message}`);\n } finally {\n // Delete the pipeline token if it was created\n if (pipelineTokenResponse && pipelineTokenResponse.id) {\n try {\n await api.PipelineTriggerTokens.remove(\n projectId,\n pipelineTokenResponse.id,\n );\n ctx.logger.info(\n `Deleted pipeline token ${pipelineTokenResponse.id}.`,\n );\n } catch (error: any) {\n ctx.logger.error(\n `Failed to delete pipeline token id ${pipelineTokenResponse.id}.`,\n );\n }\n }\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab project access token with minimal options.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with custom scopes.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n scopes: ['read_registry', 'write_repository'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with a specified name.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'my-custom-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a numeric project ID.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a specified expired Date.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n expiresAt: '2024-06-25',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with an access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n accessLevel: 30,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with multiple options',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n accessLevel: 40,\n name: 'full-access-token',\n expiresAt: '2024-12-31',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a token for authorization',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n token: 'personal-access-token',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with read-only scopes',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n scopes: ['read_repository', 'read_api'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with guest access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 10,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with maintainer access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 40,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with owner access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 50,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a specified name and no expiration date',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'no-expiry-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token for a specific gitlab instance',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.example.com?repo=repo&owner=owner',\n projectId: '101112',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { AccessTokenScopes, Gitlab } from '@gitbeaker/rest';\nimport { DateTime } from 'luxon';\nimport { z } from 'zod';\nimport { getToken } from '../util';\nimport { examples } from './gitlabProjectAccessTokenCreate.examples';\n\n/**\n * Creates a `gitlab:projectAccessToken:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\n\nexport const createGitlabProjectAccessTokenAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectAccessToken:create',\n examples,\n schema: {\n input: z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID/Name(slug) of the Gitlab Project',\n }),\n token: z\n .string({\n description: 'The token to use for authorization to GitLab',\n })\n .optional(),\n name: z.string({ description: 'Name of Access Key' }).optional(),\n repoUrl: z.string({ description: 'URL to gitlab instance' }),\n accessLevel: z\n .number({\n description:\n 'Access Level of the Token, 10 (Guest), 20 (Reporter), 30 (Developer), 40 (Maintainer), and 50 (Owner)',\n })\n .optional(),\n scopes: z\n .string({\n description: 'Scopes for a project access token',\n })\n .array()\n .optional(),\n expiresAt: z\n .string({\n description:\n 'Expiration date of the access token in ISO format (YYYY-MM-DD). If Empty, it will set to the maximum of 365 days.',\n })\n .optional(),\n }),\n output: z.object({\n access_token: z.string({ description: 'Access Token' }),\n }),\n },\n async handler(ctx) {\n ctx.logger.info(`Creating Token for Project \"${ctx.input.projectId}\"`);\n const {\n projectId,\n name = 'tokenname',\n accessLevel = 40,\n scopes = ['read_repository'],\n expiresAt,\n } = ctx.input;\n\n const { token, integrationConfig } = getToken(ctx.input, integrations);\n\n if (!integrationConfig.config.token && token) {\n throw new InputError(\n `No token available for host ${integrationConfig.config.baseUrl}`,\n );\n }\n\n let api;\n\n if (!ctx.input.token) {\n api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: token,\n });\n } else {\n api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n oauthToken: token,\n });\n }\n\n const response = await api.ProjectAccessTokens.create(\n projectId,\n name,\n scopes as AccessTokenScopes[],\n {\n expiresAt:\n expiresAt || DateTime.now().plus({ days: 365 }).toISODate()!,\n accessLevel,\n },\n );\n\n if (!response.token) {\n throw new Error('Could not create project access token');\n }\n\n ctx.output('access_token', response.token);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab project deploy token with minimal options.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n name: 'tokenname',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project deploy token with custom scopes.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n name: 'tokenname',\n scopes: ['read_registry', 'write_repository'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project deploy token with a specified name.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'my-custom-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project deploy token with a numeric project ID.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n name: 'tokenname',\n },\n },\n ],\n }),\n },\n\n {\n description: 'Create a GitLab project deploy token with a custom username',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n name: 'tokenname',\n username: 'tokenuser',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { DeployTokenScope } from '@gitbeaker/core/dist/types/templates/ResourceDeployTokens';\nimport { Gitlab } from '@gitbeaker/node';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getToken } from '../util';\nimport { examples } from './gitlabProjectDeployTokenCreate.examples';\n\n/**\n * Creates a `gitlab:projectDeployToken:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabProjectDeployTokenAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectDeployToken:create',\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID',\n }),\n name: z.string({ description: 'Deploy Token Name' }),\n username: z\n .string({ description: 'Deploy Token Username' })\n .optional(),\n scopes: z.array(z.string(), { description: 'Scopes' }).optional(),\n }),\n ),\n output: z.object({\n deploy_token: z.string({ description: 'Deploy Token' }),\n user: z.string({ description: 'User' }),\n }),\n },\n async handler(ctx) {\n ctx.logger.info(`Creating Token for Project \"${ctx.input.projectId}\"`);\n const { projectId, name, username, scopes } = ctx.input;\n const { token, integrationConfig } = getToken(ctx.input, integrations);\n\n const api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: token,\n });\n\n const deployToken = await api.ProjectDeployTokens.add(\n projectId,\n name,\n scopes as DeployTokenScope[],\n {\n username: username,\n },\n );\n\n if (!deployToken.hasOwnProperty('token')) {\n throw new InputError(`No deploy_token given from gitlab instance`);\n }\n\n ctx.output('deploy_token', deployToken.token as string);\n ctx.output('user', deployToken.username);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Creating a GitLab project variable of type env_var',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n },\n },\n ],\n }),\n },\n {\n description: 'Creating a GitLab project variable of type file',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my-file-content',\n variableType: 'file',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable that is protected.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n variableProtected: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable with masked flag as true',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n key: 'DB_PASSWORD',\n value: 'password123',\n variableType: 'env_var',\n masked: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable that is expandable.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n raw: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project variable with a specific environment scope.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n environmentScope: 'production',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project variable with a wildcard environment scope.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n environmentScope: '*',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { VariableType } from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getClient, parseRepoUrl } from '../util';\nimport { examples } from './gitlabProjectVariableCreate.examples';\n\n/**\n * Creates a `gitlab:projectVariable:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabProjectVariableAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectVariable:create',\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID',\n }),\n key: z\n .string({\n description:\n 'The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed',\n })\n .regex(/^[A-Za-z0-9_]{1,255}$/),\n value: z.string({ description: 'The value of a variable' }),\n variableType: z.string({\n description: 'Variable Type (env_var or file)',\n }),\n variableProtected: z\n .boolean({ description: 'Whether the variable is protected' })\n .default(false)\n .optional(),\n masked: z\n .boolean({ description: 'Whether the variable is masked' })\n .default(false)\n .optional(),\n raw: z\n .boolean({ description: 'Whether the variable is expandable' })\n .default(false)\n .optional(),\n environmentScope: z\n .string({ description: 'The environment_scope of the variable' })\n .default('*')\n .optional(),\n }),\n ),\n },\n async handler(ctx) {\n const {\n repoUrl,\n projectId,\n key,\n value,\n variableType,\n variableProtected = false,\n masked = false,\n raw = false,\n environmentScope = '*',\n token,\n } = ctx.input;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n\n const api = getClient({ host, integrations, token });\n\n await api.ProjectVariables.create(projectId, key, value, {\n variableType: variableType as VariableType,\n protected: variableProtected,\n masked,\n raw,\n environmentScope,\n });\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Push changes to gitlab repository with minimal changes',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Push changes to gitlab repository with a specific source and target path',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n sourcePath: 'src',\n targetPath: 'dest',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Push changes to gitlab repository with a specific commit action',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n commitAction: 'update',\n },\n },\n ],\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 {\n createTemplateAction,\n parseRepoUrl,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { Types } from '@gitbeaker/core';\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport { createGitlabApi } from './helpers';\nimport { examples } from './gitlabRepoPush.examples';\n\n/**\n * Create a new action that commits into a gitlab repository.\n *\n * @public\n */\nexport const createGitlabRepoPushAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n branchName: string;\n commitMessage: string;\n sourcePath?: string;\n targetPath?: string;\n token?: string;\n commitAction?: 'create' | 'delete' | 'update';\n }>({\n id: 'gitlab:repo:push',\n examples,\n schema: {\n input: {\n required: ['repoUrl', 'branchName', 'commitMessage'],\n type: 'object',\n properties: {\n repoUrl: {\n type: 'string',\n title: 'Repository Location',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n branchName: {\n type: 'string',\n title: 'Source Branch Name',\n description: 'The branch name for the commit',\n },\n commitMessage: {\n type: 'string',\n title: 'Commit Message',\n description: `The commit message`,\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n commitAction: {\n title: 'Commit action',\n type: 'string',\n enum: ['create', 'update', 'delete'],\n description:\n 'The action to be used for git commit. Defaults to create.',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n projectid: {\n title: 'Gitlab Project id/Name(slug)',\n type: 'string',\n },\n projectPath: {\n title: 'Gitlab Project path',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n branchName,\n repoUrl,\n targetPath,\n sourcePath,\n token,\n commitAction,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n const actions: Types.CommitAction[] = fileContents.map(file => ({\n action: commitAction ?? 'create',\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n let branchExists = false;\n try {\n await api.Branches.show(repoID, branchName);\n branchExists = true;\n } catch (e: any) {\n if (e.response?.statusCode !== 404) {\n throw new InputError(\n `Failed to check status of branch '${branchName}'. Please make sure that branch already exists or Backstage has permissions to create one. ${e}`,\n );\n }\n }\n\n if (!branchExists) {\n // create a branch using the default branch as ref\n try {\n const projects = await api.Projects.show(repoID);\n const { default_branch: defaultBranch } = projects;\n await api.Branches.create(repoID, branchName, String(defaultBranch));\n } catch (e) {\n throw new InputError(\n `The branch '${branchName}' was not found and creation failed with error. Please make sure that branch already exists or Backstage has permissions to create one. ${e}`,\n );\n }\n }\n\n try {\n const commit = await api.Commits.create(\n repoID,\n branchName,\n ctx.input.commitMessage,\n actions,\n );\n ctx.output('projectid', repoID);\n ctx.output('projectPath', repoID);\n ctx.output('commitHash', commit.id);\n } catch (e) {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`,\n );\n }\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 { ScmIntegrations } from '@backstage/integration';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGitlabGroupEnsureExistsAction,\n createGitlabIssueAction,\n createGitlabProjectAccessTokenAction,\n createGitlabProjectDeployTokenAction,\n createGitlabProjectVariableAction,\n createGitlabRepoPushAction,\n createPublishGitlabAction,\n createPublishGitlabMergeRequestAction,\n createTriggerGitlabPipelineAction,\n editGitlabIssueAction,\n} from './actions';\n\n/**\n * @public\n * The GitLab Module for the Scaffolder Backend\n */\nexport const gitlabModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitlab',\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 createGitlabGroupEnsureExistsAction({ integrations }),\n createGitlabIssueAction({ integrations }),\n createGitlabProjectAccessTokenAction({ integrations }),\n createGitlabProjectDeployTokenAction({ integrations }),\n createGitlabProjectVariableAction({ integrations }),\n createGitlabRepoPushAction({ integrations }),\n editGitlabIssueAction({ integrations }),\n createPublishGitlabAction({ config, integrations }),\n createPublishGitlabMergeRequestAction({ integrations }),\n createTriggerGitlabPipelineAction({ integrations }),\n );\n },\n });\n },\n});\n"],"names":["examples","yaml","createTemplateAction","parseRepoUrl","InputError","Gitlab","initRepoAndPush","getRepoSourceDirectory","z","IssueType","IssueStateEvent","util.getTopLevelParentGroup","path","resolveSafeChildPath","serializeDirectoryContents","DateTime","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,UAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,4HAAA;AAAA,IACF,OAAA,EAASC,sBAAK,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,+CAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,oBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,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,+CAAA;AAAA,YACT,WAAa,EAAA,6BAAA;AAAA,WACf;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,0GAAA;AAAA,IACF,OAAA,EAASA,sBAAK,SAAU,CAAA;AAAA,MACtB,KAAO,EAAA;AAAA,QACL;AAAA,UACE,EAAI,EAAA,SAAA;AAAA,UACJ,MAAQ,EAAA,gBAAA;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CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/actions/gitlab.examples.ts","../src/actions/gitlab.ts","../src/commonGitlabConfig.ts","../src/util.ts","../src/actions/gitlabGroupEnsureExists.examples.ts","../src/actions/gitlabGroupEnsureExists.ts","../src/actions/gitlabIssueCreate.examples.ts","../src/actions/gitlabIssueCreate.ts","../src/actions/gitlabIssueEdit.examples.ts","../src/actions/gitlabIssueEdit.ts","../src/actions/helpers.ts","../src/actions/gitlabMergeRequest.examples.ts","../src/actions/gitlabMergeRequest.ts","../src/actions/gitlabPipelineTrigger.examples.ts","../src/actions/gitlabPipelineTrigger.ts","../src/actions/gitlabProjectAccessTokenCreate.examples.ts","../src/actions/gitlabProjectAccessTokenCreate.ts","../src/actions/gitlabProjectDeployTokenCreate.examples.ts","../src/actions/gitlabProjectDeployTokenCreate.ts","../src/actions/gitlabProjectVariableCreate.examples.ts","../src/actions/gitlabProjectVariableCreate.ts","../src/actions/gitlabRepoPush.examples.ts","../src/actions/gitlabRepoPush.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 git repository with the content in the workspace, and publishes it to GitLab with the default configuration.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n },\n },\n ],\n }),\n },\n {\n description: 'Add a description.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n description: 'Initialize a git repository',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a GitLab 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:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n description: 'Initialize a git repository',\n gitCommitMessage: 'Started a project.',\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with aditional settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n settings: {\n ci_config_path: '.gitlab-ci.yml',\n visibility: 'public',\n },\n },\n },\n ],\n }),\n },\n {\n description:\n 'Initializes a GitLab repository with fast forward merge and always squash settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n settings: {\n merge_method: 'ff',\n squash_option: 'always',\n },\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with branch settings.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n branches: [\n {\n name: 'dev',\n create: true,\n protect: true,\n ref: 'master',\n },\n {\n name: 'master',\n protect: true,\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Initializes a GitLab repository with environment variables.',\n example: yaml.stringify({\n steps: [\n {\n id: 'publish',\n action: 'publish:gitlab',\n name: 'Publish to GitLab',\n input: {\n repoUrl: 'gitlab.com?repo=project_name&owner=group_name',\n projectVariables: [\n {\n key: 'key1',\n value: 'value1',\n protected: true,\n masked: false,\n },\n {\n key: 'key2',\n value: 'value2',\n protected: true,\n masked: false,\n },\n ],\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { Gitlab } from '@gitbeaker/node';\nimport {\n initRepoAndPush,\n getRepoSourceDirectory,\n parseRepoUrl,\n} from '@backstage/plugin-scaffolder-node';\nimport { Config } from '@backstage/config';\nimport { examples } from './gitlab.examples';\n\n/**\n * Creates a new action that initializes a git repository of the content in the workspace\n * and publishes it to GitLab.\n *\n * @public\n */\nexport function createPublishGitlabAction(options: {\n integrations: ScmIntegrationRegistry;\n config: Config;\n}) {\n const { integrations, config } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n defaultBranch?: string;\n /** @deprecated in favour of settings.visibility field */\n repoVisibility?: 'private' | 'internal' | 'public';\n sourcePath?: string;\n token?: string;\n gitCommitMessage?: string;\n gitAuthorName?: string;\n gitAuthorEmail?: string;\n setUserAsOwner?: boolean;\n /** @deprecated in favour of settings.topics field */\n topics?: string[];\n settings?: {\n path?: string;\n auto_devops_enabled?: boolean;\n ci_config_path?: string;\n description?: string;\n merge_method?: 'merge' | 'rebase_merge' | 'ff';\n squash_option?: 'default_off' | 'default_on' | 'never' | 'always';\n topics?: string[];\n visibility?: 'private' | 'internal' | 'public';\n };\n branches?: Array<{\n name: string;\n protect?: boolean;\n create?: boolean;\n ref?: string;\n }>;\n projectVariables?: Array<{\n key: string;\n value: string;\n description?: string;\n variable_type?: string;\n protected?: boolean;\n masked?: boolean;\n raw?: boolean;\n environment_scope?: string;\n }>;\n }>({\n id: 'publish:gitlab',\n description:\n 'Initializes a git repository of the content in the workspace, and publishes it to GitLab.',\n examples,\n schema: {\n input: {\n type: 'object',\n required: ['repoUrl'],\n properties: {\n repoUrl: {\n title: 'Repository Location',\n type: 'string',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n repoVisibility: {\n title: 'Repository Visibility',\n description: `Sets the visibility of the repository. The default value is 'private'. (deprecated, use settings.visibility instead)`,\n type: 'string',\n enum: ['private', 'public', 'internal'],\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 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 token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n setUserAsOwner: {\n title: 'Set User As Owner',\n type: 'boolean',\n description:\n 'Set the token user as owner of the newly created repository. Requires a token authorized to do the edit in the integration configuration for the matching host',\n },\n topics: {\n title: 'Topic labels',\n description:\n 'Topic labels to apply on the repository. (deprecated, use settings.topics instead)',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n settings: {\n title: 'Project settings',\n description:\n 'Additional project settings, based on https://docs.gitlab.com/ee/api/projects.html#create-project attributes',\n type: 'object',\n properties: {\n path: {\n title: 'Project path',\n description:\n 'Repository name for new project. Generated based on name if not provided (generated as lowercase with dashes).',\n type: 'string',\n },\n auto_devops_enabled: {\n title: 'Auto DevOps enabled',\n description: 'Enable Auto DevOps for this project',\n type: 'boolean',\n },\n ci_config_path: {\n title: 'CI config path',\n description: 'Custom CI config path for this project',\n type: 'string',\n },\n description: {\n title: 'Project description',\n description: 'Short project description',\n type: 'string',\n },\n merge_method: {\n title: 'Merge Method to use',\n description: 'Merge Methods (merge, rebase_merge, ff)',\n type: 'string',\n enum: ['merge', 'rebase_merge', 'ff'],\n },\n squash_option: {\n title: 'Squash option',\n description:\n 'Set squash option for the project (never, always, default_on, default_off)',\n type: 'string',\n enum: ['default_off', 'default_on', 'never', 'always'],\n },\n topics: {\n title: 'Topic labels',\n description: 'Topic labels to apply on the repository',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n visibility: {\n title: 'Project visibility',\n description:\n 'The visibility of the project. Can be private, internal, or public. The default value is private.',\n type: 'string',\n enum: ['private', 'public', 'internal'],\n },\n },\n },\n branches: {\n title: 'Project branches settings',\n type: 'array',\n items: {\n type: 'object',\n required: ['name'],\n properties: {\n name: {\n title: 'Branch name',\n type: 'string',\n },\n protect: {\n title: 'Should branch be protected',\n description: `Will mark branch as protected. The default value is 'false'`,\n type: 'boolean',\n },\n create: {\n title: 'Should branch be created',\n description: `If branch does not exist, it will be created from provided ref. The default value is 'false'`,\n type: 'boolean',\n },\n ref: {\n title: 'Branch reference',\n description: `Branch reference to create branch from. The default value is 'master'`,\n type: 'string',\n },\n },\n },\n },\n projectVariables: {\n title: 'Project variables',\n description:\n 'Project variables settings based on Gitlab Project Environments API - https://docs.gitlab.com/ee/api/project_level_variables.html#create-a-variable',\n type: 'array',\n items: {\n type: 'object',\n required: ['key', 'value'],\n properties: {\n key: {\n title: 'Variable key',\n description:\n 'The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed',\n type: 'string',\n },\n value: {\n title: 'Variable value',\n description: 'The value of a variable',\n type: 'string',\n },\n description: {\n title: 'Variable description',\n description: `The description of the variable. The default value is 'null'`,\n type: 'string',\n },\n variable_type: {\n title: 'Variable type',\n description: `The type of a variable. The default value is 'env_var'`,\n type: 'string',\n enum: ['env_var', 'file'],\n },\n protected: {\n title: 'Variable protection',\n description: `Whether the variable is protected. The default value is 'false'`,\n type: 'boolean',\n },\n raw: {\n title: 'Variable raw',\n description: `Whether the variable is in raw format. The default value is 'false'`,\n type: 'boolean',\n },\n environment_scope: {\n title: 'Variable environment scope',\n description: `The environment_scope of the variable. The default value is '*'`,\n type: 'string',\n },\n },\n },\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 projectId: {\n title: 'The ID of the project',\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 repoVisibility = 'private',\n defaultBranch = 'master',\n gitCommitMessage = 'initial commit',\n gitAuthorName,\n gitAuthorEmail,\n setUserAsOwner = false,\n topics = [],\n settings = {},\n branches = [],\n projectVariables = [],\n } = ctx.input;\n const { owner, repo, host } = parseRepoUrl(repoUrl, integrations);\n\n if (!owner) {\n throw new InputError(\n `No owner provided for host: ${host}, and repo ${repo}`,\n );\n }\n\n const integrationConfig = integrations.gitlab.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 (!integrationConfig.config.token && !ctx.input.token) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const token = ctx.input.token || integrationConfig.config.token!;\n const tokenType = ctx.input.token ? 'oauthToken' : 'token';\n\n const client = new Gitlab({\n host: integrationConfig.config.baseUrl,\n [tokenType]: token,\n });\n\n let targetNamespaceId;\n\n try {\n const namespaceResponse = (await client.Namespaces.show(owner)) as {\n id: number;\n };\n\n targetNamespaceId = namespaceResponse.id;\n } catch (e) {\n if (e.response && e.response.statusCode === 404) {\n throw new InputError(\n `The namespace ${owner} is not found or the user doesn't have permissions to access it`,\n );\n }\n throw e;\n }\n\n const { id: userId } = (await client.Users.current()) as {\n id: number;\n };\n\n if (!targetNamespaceId) {\n targetNamespaceId = userId;\n }\n\n const { id: projectId, http_url_to_repo } = await client.Projects.create({\n namespace_id: targetNamespaceId,\n name: repo,\n visibility: repoVisibility,\n ...(topics.length ? { topics } : {}),\n ...(Object.keys(settings).length ? { ...settings } : {}),\n });\n\n // When setUserAsOwner is true the input token is expected to come from an unprivileged user GitLab\n // OAuth flow. In this case GitLab works in a way that allows the unprivileged user to\n // create the repository, but not to push the default protected branch (e.g. master).\n // In order to set the user as owner of the newly created repository we need to check that the\n // GitLab integration configuration for the matching host contains a token and use\n // such token to bootstrap a new privileged client.\n if (setUserAsOwner && integrationConfig.config.token) {\n const adminClient = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: integrationConfig.config.token,\n });\n\n await adminClient.ProjectMembers.add(projectId, userId, 50);\n }\n\n const remoteUrl = (http_url_to_repo as string).replace(/\\.git$/, '');\n const repoContentsUrl = `${remoteUrl}/-/blob/${defaultBranch}`;\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 commitResult = await initRepoAndPush({\n dir: getRepoSourceDirectory(ctx.workspacePath, ctx.input.sourcePath),\n remoteUrl: http_url_to_repo as string,\n defaultBranch,\n auth: {\n username: 'oauth2',\n password: token,\n },\n logger: ctx.logger,\n commitMessage: gitCommitMessage\n ? gitCommitMessage\n : config.getOptionalString('scaffolder.defaultCommitMessage'),\n gitAuthorInfo,\n });\n\n if (branches) {\n for (const branch of branches) {\n const {\n name,\n protect = false,\n create = false,\n ref = 'master',\n } = branch;\n\n if (create) {\n try {\n await client.Branches.create(projectId, name, ref);\n } catch (e) {\n throw new InputError(\n `Branch creation failed for ${name}. ${printGitlabError(e)}`,\n );\n }\n ctx.logger.info(\n `Branch ${name} created for ${projectId} with ref ${ref}`,\n );\n }\n\n if (protect) {\n try {\n await client.ProtectedBranches.protect(projectId, name);\n } catch (e) {\n throw new InputError(\n `Branch protection failed for ${name}. ${printGitlabError(e)}`,\n );\n }\n ctx.logger.info(`Branch ${name} protected for ${projectId}`);\n }\n }\n }\n\n if (projectVariables) {\n for (const variable of projectVariables) {\n const variableWithDefaults = Object.assign(variable, {\n variable_type: variable.variable_type ?? 'env_var',\n protected: variable.protected ?? false,\n masked: variable.masked ?? false,\n raw: variable.raw ?? false,\n environment_scope: variable.environment_scope ?? '*',\n });\n\n try {\n await client.ProjectVariables.create(\n projectId,\n variableWithDefaults,\n );\n } catch (e) {\n throw new InputError(\n `Environment variable creation failed for ${\n variableWithDefaults.key\n }. ${printGitlabError(e)}`,\n );\n }\n }\n }\n\n ctx.output('commitHash', commitResult?.commitHash);\n ctx.output('remoteUrl', remoteUrl);\n ctx.output('repoContentsUrl', repoContentsUrl);\n ctx.output('projectId', projectId);\n },\n });\n}\n\nfunction printGitlabError(error: any): string {\n return JSON.stringify({ code: error.code, message: error.description });\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 { z } from 'zod';\n\nconst commonGitlabConfig = z.object({\n repoUrl: z.string({ description: 'Repository Location' }),\n token: z\n .string({ description: 'The token to use for authorization to GitLab' })\n .optional(),\n});\n\nexport default commonGitlabConfig;\n\nexport const commonGitlabConfigExample = {\n repoUrl: 'gitlab.com?owner=namespace-or-owner&repo=project-name',\n token: '${{ secrets.USER_OAUTH_TOKEN }}',\n};\n\n/**\n * Gitlab issue types as specified by gitlab api\n *\n * @public\n */\nexport enum IssueType {\n ISSUE = 'issue',\n INCIDENT = 'incident',\n TEST = 'test_case',\n TASK = 'task',\n}\n\n/**\n * Gitlab issue state events for modifications\n *\n * @public\n */\nexport enum IssueStateEvent {\n CLOSE = 'close',\n REOPEN = 'reopen',\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 GitLabIntegration,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { Gitlab, GroupSchema } from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from './commonGitlabConfig';\nimport * as util from './util';\n\nexport const parseRepoHost = (repoUrl: string): string => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n return parsed.host;\n};\n\nexport const getToken = (\n config: z.infer<typeof commonGitlabConfig>,\n integrations: ScmIntegrationRegistry,\n): { token: string; integrationConfig: GitLabIntegration } => {\n const host = parseRepoHost(config.repoUrl);\n const integrationConfig = integrations.gitlab.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 token = config.token || integrationConfig.config.token!;\n\n return { token: token, integrationConfig: integrationConfig };\n};\n\nexport type RepoSpec = {\n repo: string;\n host: string;\n owner?: string;\n};\n\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): RepoSpec => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const owner = parsed.searchParams.get('owner') ?? undefined;\n const repo: string = parsed.searchParams.get('repo')!;\n\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n return { host, owner, repo };\n};\n\nexport function getClient(props: {\n host: string;\n token?: string;\n integrations: ScmIntegrationRegistry;\n}): InstanceType<typeof Gitlab> {\n const { host, token, integrations } = props;\n const integrationConfig = integrations.gitlab.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 { config } = integrationConfig;\n\n if (!config.token && !token) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const requestToken = token || config.token!;\n const tokenType = token ? 'oauthToken' : 'token';\n\n const gitlabOptions: any = {\n host: config.baseUrl,\n };\n\n gitlabOptions[tokenType] = requestToken;\n return new Gitlab(gitlabOptions);\n}\n\nexport function convertDate(\n inputDate: string | undefined,\n defaultDate: string,\n) {\n try {\n return inputDate\n ? new Date(inputDate).toISOString()\n : new Date(defaultDate).toISOString();\n } catch (error) {\n throw new InputError(`Error converting input date - ${error}`);\n }\n}\n\nexport async function getTopLevelParentGroup(\n client: InstanceType<typeof Gitlab>,\n groupId: number,\n): Promise<GroupSchema> {\n try {\n const topParentGroup = await client.Groups.show(groupId);\n if (topParentGroup.parent_id) {\n return util.getTopLevelParentGroup(\n client,\n topParentGroup.parent_id as number,\n );\n }\n return topParentGroup as GroupSchema;\n } catch (error: any) {\n throw new InputError(\n `Error finding top-level parent group ID: ${error.message}`,\n );\n }\n}\n\nexport async function checkEpicScope(\n client: InstanceType<typeof Gitlab>,\n projectId: number,\n epicId: number,\n) {\n try {\n // If project exists, get the top level group id\n const project = await client.Projects.show(projectId);\n if (!project) {\n throw new InputError(\n `Project with id ${projectId} not found. Check your GitLab instance.`,\n );\n }\n const topParentGroup = await getTopLevelParentGroup(\n client,\n project.namespace.id,\n );\n if (!topParentGroup) {\n throw new InputError(`Couldn't find a suitable top-level parent group.`);\n }\n // Get the epic\n const epic = (await client.Epics.all(topParentGroup.id)).find(\n (x: any) => x.id === epicId,\n );\n if (!epic) {\n throw new InputError(\n `Epic with id ${epicId} not found in the top-level parent group ${topParentGroup.name}.`,\n );\n }\n\n const epicGroup = await client.Groups.show(epic.group_id as number);\n const projectNamespace: string = project.path_with_namespace as string;\n return projectNamespace.startsWith(epicGroup.full_path as string);\n } catch (error: any) {\n throw new InputError(`Could not find epic scope: ${error.message}`);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Creating a group at the top level',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group nested within another group',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1', 'group2'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group nested within multiple other groups',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n input: {\n repoUrl: 'gitlab.com',\n path: ['group1', 'group2', 'group3'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a group in dry run mode',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroup',\n name: 'Group',\n action: 'gitlab:group:ensureExists',\n isDryRun: true,\n input: {\n repoUrl: 'https://gitlab.com/my-repo',\n path: ['group1', 'group2', 'group3'],\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { GroupSchema } from '@gitbeaker/core/dist/types/resources/Groups';\nimport { Gitlab } from '@gitbeaker/node';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getToken } from '../util';\nimport { examples } from './gitlabGroupEnsureExists.examples';\n\n/**\n * Creates an `gitlab:group:ensureExists` Scaffolder action.\n *\n * @public\n */\nexport const createGitlabGroupEnsureExistsAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'gitlab:group:ensureExists',\n description: 'Ensures a Gitlab group exists',\n supportsDryRun: true,\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n path: z\n .array(z.string(), {\n description: 'A path of group names that is ensured to exist',\n })\n .min(1),\n }),\n ),\n output: z.object({\n groupId: z\n .number({ description: 'The id of the innermost sub-group' })\n .optional(),\n }),\n },\n async handler(ctx) {\n if (ctx.isDryRun) {\n ctx.output('groupId', 42);\n return;\n }\n\n const { path } = ctx.input;\n const { token, integrationConfig } = getToken(ctx.input, integrations);\n\n const api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: token,\n });\n\n let currentPath: string | null = null;\n let parent: GroupSchema | null = null;\n for (const pathElement of path) {\n const fullPath: string = currentPath\n ? `${currentPath}/${pathElement}`\n : pathElement;\n const result = (await api.Groups.search(\n fullPath,\n )) as unknown as Array<GroupSchema>; // recast since the return type for search is wrong in the gitbeaker typings\n const subGroup = result.find(\n searchPathElem => searchPathElem.full_path === fullPath,\n );\n if (!subGroup) {\n ctx.logger.info(`creating missing group ${fullPath}`);\n parent = await api.Groups.create(\n pathElement,\n pathElement,\n parent\n ? {\n parent_id: parent.id,\n }\n : {},\n );\n } else {\n parent = subGroup;\n }\n currentPath = fullPath;\n }\n if (parent !== null) {\n ctx.output('groupId', parent?.id);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab issue with minimal options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n description: 'This is the description of the issue',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with assignees and date options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18],\n description: 'This is the description of the issue',\n createdAt: '2022-09-27T18:00:00.000Z',\n dueDate: '2022-09-28T12:00:00.000Z',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab Issue with several options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18, 15],\n description: 'This is the description of the issue',\n confidential: false,\n createdAt: '2022-09-27T18:00:00.000Z',\n dueDate: '2022-09-28T12:00:00.000Z',\n discussionToResolve: '1',\n epicId: 1,\n labels: 'phase1:label1,phase2:label2',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with token',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n description: 'This is the description of the issue',\n token: 'sample token',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue with a specific milestone and weight',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue with Milestone',\n description: 'This is the description of the issue',\n milestoneId: 5,\n weight: 3,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type INCIDENT',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'incident',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type TEST',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'test_case',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type TASK with assignees',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'task',\n assignees: [18, 22],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type ISSUE and close it',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'issue',\n stateEvent: 'close',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab issue of type INCIDENT and reopen it',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Test Issue',\n description: 'This is the description of the issue',\n issueType: 'incident',\n stateEvent: 'reopen',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab issue to resolve a discussion in a merge request',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'Issues',\n action: 'gitlab:issues:create',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue for MR Discussion',\n description: 'This is the description of the issue',\n mergeRequestToResolveDiscussionsOf: 42,\n discussionToResolve: 'abc123',\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport commonGitlabConfig, { IssueType } from '../commonGitlabConfig';\nimport { examples } from './gitlabIssueCreate.examples';\nimport { z } from 'zod';\nimport { checkEpicScope, convertDate, getClient, parseRepoUrl } from '../util';\nimport { CreateIssueOptions, IssueSchema } from '@gitbeaker/rest';\n\nconst issueInputProperties = z.object({\n projectId: z.number().describe('Project Id'),\n title: z.string({ description: 'Title of the issue' }),\n assignees: z\n .array(z.number(), {\n description: 'IDs of the users to assign the issue to.',\n })\n .optional(),\n confidential: z.boolean({ description: 'Issue Confidentiality' }).optional(),\n description: z.string().describe('Issue description').max(1048576).optional(),\n createdAt: z\n .string()\n .describe('Creation date/time')\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n dueDate: z\n .string()\n .describe('Due date/time')\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n discussionToResolve: z\n .string({\n description:\n 'Id of a discussion to resolve. Use in combination with \"merge_request_to_resolve_discussions_of\"',\n })\n .optional(),\n epicId: z\n .number({ description: 'Id of the linked Epic' })\n .min(0, 'Valid values should be equal or greater than zero')\n .optional(),\n labels: z.string({ description: 'Labels to apply' }).optional(),\n issueType: z\n .nativeEnum(IssueType, {\n description: 'Type of the issue',\n })\n .optional(),\n mergeRequestToResolveDiscussionsOf: z\n .number({\n description: 'IID of a merge request in which to resolve all issues',\n })\n .optional(),\n milestoneId: z\n .number({ description: 'Global ID of a milestone to assign the issue' })\n .optional(),\n weight: z\n .number({ description: 'The issue weight' })\n .min(0)\n .refine(value => {\n const isValid = value >= 0;\n if (!isValid) {\n return {\n message: 'Valid values should be equal or greater than zero',\n };\n }\n return isValid;\n })\n .optional(),\n});\n\nconst issueOutputProperties = z.object({\n issueUrl: z.string({ description: 'Issue Url' }),\n issueId: z.number({ description: 'Issue Id' }),\n issueIid: z.number({ description: 'Issue Iid' }),\n});\n\n/**\n * Creates a `gitlab:issues:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabIssueAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:issues:create',\n description: 'Creates a Gitlab issue.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(issueInputProperties),\n output: issueOutputProperties,\n },\n async handler(ctx) {\n try {\n const {\n repoUrl,\n projectId,\n title,\n description = '',\n confidential = false,\n assignees = [],\n createdAt = '',\n dueDate,\n discussionToResolve = '',\n epicId,\n labels = '',\n issueType,\n mergeRequestToResolveDiscussionsOf,\n milestoneId,\n weight,\n token,\n } = commonGitlabConfig.merge(issueInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n let isEpicScoped = false;\n\n if (epicId) {\n isEpicScoped = await checkEpicScope(api, projectId, epicId);\n\n if (isEpicScoped) {\n ctx.logger.info('Epic is within Project Scope');\n } else {\n ctx.logger.warn(\n 'Chosen epic is not within the Project Scope. The issue will be created without an associated epic.',\n );\n }\n }\n const mappedCreatedAt = convertDate(\n String(createdAt),\n new Date().toISOString(),\n );\n const mappedDueDate = dueDate\n ? convertDate(String(dueDate), new Date().toISOString())\n : undefined;\n\n const issueOptions: CreateIssueOptions = {\n description,\n assigneeIds: assignees,\n confidential,\n epicId: isEpicScoped ? epicId : undefined,\n labels,\n createdAt: mappedCreatedAt,\n dueDate: mappedDueDate,\n discussionToResolve,\n issueType,\n mergeRequestToResolveDiscussionsOf,\n milestoneId,\n weight,\n };\n\n const response = (await api.Issues.create(\n projectId,\n title,\n issueOptions,\n )) as IssueSchema;\n\n ctx.output('issueId', response.id);\n ctx.output('issueUrl', response.web_url);\n ctx.output('issueIid', response.iid);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(`Failed to create GitLab issue: ${error.message}`);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Edit a GitLab issue with minimal options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Modified Test Issue',\n description: 'This is a modified description of the issue',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a GitLab issue with assignees and date options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Issue',\n assignees: [18],\n description: 'This is the edited description of the issue',\n updatedAt: '2024-05-10T18:00:00.000Z',\n dueDate: '2024-09-28',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab Issue with several options',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test Edit Issue',\n assignees: [18, 15],\n description: 'This is the description of the issue',\n confidential: false,\n updatedAt: '2024-05-10T18:00:00.000Z',\n dueDate: '2024-09-28',\n discussionLocked: true,\n epicId: 1,\n labels: 'phase1:label1,phase2:label2',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change its state to close',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n stateEvent: 'close',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change its state to reopened',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n stateEvent: 'reopen',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Edit a gitlab issue to assign it to multiple users and set milestone',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Test issue with milestone',\n assignees: [18, 20],\n description: 'This issue has milestone set',\n milestoneId: 5,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to add weight and update labels',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with weight and labels',\n description: 'This issue has weight and new labels',\n weight: 3,\n labels: 'bug,urgent',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to make it confidential',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Confidential Issue',\n description: 'This issue is confidential',\n confidential: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to lock the discussion',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Locked Discussion Issue',\n description: 'This discussion on this issue is locked',\n discussionLocked: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to remove labels and update milestone',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with labels removed and milestone updated',\n description: 'This issue has labels removed and milestone updated',\n removeLabels: 'phase1:label1',\n milestoneId: 6,\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to remove some labels and new ones',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with labels updated',\n description: 'This issue has labels removed and new ones added',\n removeLabels: 'bug,urgent',\n labels: 'enhancement:documentation',\n },\n },\n ],\n }),\n },\n {\n description: 'Edit a gitlab issue to change issue type and add labels',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabIssue',\n name: 'EditIssues',\n action: 'gitlab:issue:edit',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n title: 'Issue with type and labels',\n description: 'This issue has been changes and new labels added',\n labels: 'task,high-priority',\n issueType: 'task',\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport commonGitlabConfig, {\n IssueType,\n IssueStateEvent,\n} from '../commonGitlabConfig';\nimport { examples } from './gitlabIssueEdit.examples';\nimport { z } from 'zod';\nimport { checkEpicScope, convertDate, getClient, parseRepoUrl } from '../util';\nimport { IssueSchema, EditIssueOptions } from '@gitbeaker/rest';\n\nconst editIssueInputProperties = z.object({\n projectId: z\n .number()\n .describe(\n 'The global ID or URL-encoded path of the project owned by the authenticated user.',\n ),\n issueIid: z.number().describe(\"The internal ID of a project's issue\"),\n addLabels: z\n .string({\n description:\n 'Comma-separated label names to add to an issue. If a label does not already exist, this creates a new project label and assigns it to the issue.',\n })\n .optional(),\n assignees: z\n .array(z.number(), {\n description: 'IDs of the users to assign the issue to.',\n })\n .optional(),\n confidential: z\n .boolean({ description: 'Updates an issue to be confidential.' })\n .optional(),\n description: z\n .string()\n .describe('The description of an issue. Limited to 1,048,576 characters.')\n .max(1048576)\n .optional(),\n discussionLocked: z\n .boolean({\n description:\n 'Flag indicating if the issue’s discussion is locked. If the discussion is locked only project members can add or edit comments.',\n })\n .optional(),\n dueDate: z\n .string()\n .describe(\n 'The due date. Date time string in the format YYYY-MM-DD, for example 2016-03-11.',\n )\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'Invalid date format. Use YYYY-MM-DD')\n .optional(),\n epicId: z\n .number({\n description:\n 'ID of the epic to add the issue to. Valid values are greater than or equal to 0.',\n })\n .min(0, 'Valid values should be equal or greater than zero')\n .optional(),\n issueType: z\n .nativeEnum(IssueType, {\n description:\n 'Updates the type of issue. One of issue, incident, test_case or task.',\n })\n .optional(),\n labels: z\n .string({\n description:\n 'Comma-separated label names for an issue. Set to an empty string to unassign all labels. If a label does not already exist, this creates a new project label and assigns it to the issue.',\n })\n .optional(),\n milestoneId: z\n .number({\n description:\n 'The global ID of a milestone to assign the issue to. Set to 0 or provide an empty value to unassign a milestone',\n })\n .optional(),\n removeLabels: z\n .string({\n description: 'Comma-separated label names to remove from an issue.',\n })\n .optional(),\n stateEvent: z\n .nativeEnum(IssueStateEvent, {\n description:\n 'The state event of an issue. To close the issue, use close, and to reopen it, use reopen.',\n })\n .optional(),\n title: z.string().describe('The title of an issue.').optional(),\n updatedAt: z\n .string()\n .describe(\n 'When the issue was updated. Date time string, ISO 8601 formatted',\n )\n .regex(\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/,\n 'Invalid date format. Use YYYY-MM-DDTHH:mm:ssZ or YYYY-MM-DDTHH:mm:ss.SSSZ',\n )\n .optional(),\n weight: z\n .number({ description: 'The issue weight' })\n .min(0, 'Valid values should be equal or greater than zero')\n .max(10, 'Valid values should be equal or less than 10')\n .optional(),\n});\n\nconst editIssueOutputProperties = z.object({\n issueUrl: z.string({ description: 'Issue WebUrl' }),\n projectId: z.number({\n description: 'The project id the issue belongs to WebUrl',\n }),\n issueId: z.number({ description: 'The issues Id' }),\n issueIid: z.number({\n description: \"The issues internal ID of a project's issue\",\n }),\n state: z.string({ description: 'The state event of an issue' }),\n title: z.string({ description: 'The title of an issue.' }),\n updatedAt: z.string({ description: 'The last updated time of the issue.' }),\n});\n\n/**\n * Creates a `gitlab:issue:edit` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const editGitlabIssueAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:issue:edit',\n description: 'Edit a Gitlab issue.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(editIssueInputProperties),\n output: editIssueOutputProperties,\n },\n async handler(ctx) {\n try {\n const {\n repoUrl,\n projectId,\n title,\n addLabels,\n removeLabels,\n issueIid,\n description,\n confidential = false,\n assignees = [],\n updatedAt = '',\n dueDate,\n discussionLocked = false,\n epicId,\n labels,\n issueType,\n milestoneId,\n stateEvent,\n weight,\n token,\n } = commonGitlabConfig.merge(editIssueInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n let isEpicScoped = false;\n\n if (epicId) {\n isEpicScoped = await checkEpicScope(api, projectId, epicId);\n\n if (isEpicScoped) {\n ctx.logger.info('Epic is within Project Scope');\n } else {\n ctx.logger.warn(\n 'Chosen epic is not within the Project Scope. The issue will be created without an associated epic.',\n );\n }\n }\n\n const mappedUpdatedAt = convertDate(\n String(updatedAt),\n new Date().toISOString(),\n );\n\n const editIssueOptions: EditIssueOptions = {\n addLabels,\n assigneeIds: assignees,\n confidential,\n description,\n discussionLocked,\n dueDate,\n epicId: isEpicScoped ? epicId : undefined,\n issueType,\n labels,\n milestoneId,\n removeLabels,\n stateEvent,\n title,\n updatedAt: mappedUpdatedAt,\n weight,\n };\n\n const response = (await api.Issues.edit(\n projectId,\n issueIid,\n editIssueOptions,\n )) as IssueSchema;\n\n ctx.output('issueId', response.id);\n ctx.output('projectId', response.project_id);\n ctx.output('issueUrl', response.web_url);\n ctx.output('issueIid', response.iid);\n ctx.output('title', response.title);\n ctx.output('state', response.state);\n ctx.output('updatedAt', response.updated_at);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(\n `Failed to edit/modify GitLab issue: ${error.message}`,\n );\n }\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 */\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { InputError } from '@backstage/errors';\nimport { Gitlab } from '@gitbeaker/node';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { Resources } from '@gitbeaker/core';\n\nexport function createGitlabApi(options: {\n integrations: ScmIntegrationRegistry;\n token?: string;\n repoUrl: string;\n}): Resources.Gitlab {\n const { integrations, token: providedToken, repoUrl } = options;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n\n const integrationConfig = integrations.gitlab.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 (!integrationConfig.config.token && !providedToken) {\n throw new InputError(`No token available for host ${host}`);\n }\n\n const token = providedToken ?? integrationConfig.config.token!;\n const tokenType = providedToken ? 'oauthToken' : 'token';\n\n return new Gitlab({\n host: integrationConfig.config.baseUrl,\n [tokenType]: token,\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a merge request with a specific assignee',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n assignee: 'my-assignee',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a merge request with removal of source branch after merge',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n removeSourceBranch: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a target branch',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n description: 'This MR is really good',\n sourcePath: './path/to/my/changes',\n branchName: 'new-mr',\n targetBranchName: 'test',\n targetPath: 'Subdirectory',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as create',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'create',\n targetPath: 'source',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as delete',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'delete',\n targetPath: 'source',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a merge request with a commit action as update',\n example: yaml.stringify({\n steps: [\n {\n id: 'createMergeRequest',\n action: 'publish:gitlab:merge-request',\n name: 'Create a Merge Request',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n title: 'Create my new MR',\n branchName: 'new-mr',\n description: 'MR description',\n commitAction: 'update',\n targetPath: 'source',\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 {\n createTemplateAction,\n parseRepoUrl,\n SerializedFile,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { Types } from '@gitbeaker/core';\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport { createGitlabApi } from './helpers';\nimport { examples } from './gitlabMergeRequest.examples';\n\nfunction getFileAction(\n fileInfo: { file: SerializedFile; targetPath: string | undefined },\n remoteFiles: Types.RepositoryTreeSchema[],\n defaultCommitAction: 'create' | 'delete' | 'update' | 'auto' | undefined,\n): 'create' | 'delete' | 'update' {\n if (!defaultCommitAction || defaultCommitAction === 'auto') {\n const filePath = path.join(fileInfo.targetPath ?? '', fileInfo.file.path);\n return remoteFiles &&\n remoteFiles.some(remoteFile => remoteFile.path === filePath)\n ? 'update'\n : 'create';\n }\n return defaultCommitAction;\n}\n\n/**\n * Create a new action that creates a gitlab merge request.\n *\n * @public\n */\nexport const createPublishGitlabMergeRequestAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n title: string;\n description: string;\n branchName: string;\n targetBranchName?: string;\n sourcePath?: string;\n targetPath?: string;\n token?: string;\n commitAction?: 'create' | 'delete' | 'update' | 'auto';\n /** @deprecated projectID passed as query parameters in the repoUrl */\n projectid?: string;\n removeSourceBranch?: boolean;\n assignee?: string;\n }>({\n id: 'publish:gitlab:merge-request',\n examples,\n schema: {\n input: {\n required: ['repoUrl', 'branchName'],\n type: 'object',\n properties: {\n repoUrl: {\n type: 'string',\n title: 'Repository Location',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n /** @deprecated projectID is passed as query parameters in the repoUrl */\n projectid: {\n type: 'string',\n title: 'projectid',\n description: 'Project ID/Name(slug) of the Gitlab Project',\n },\n title: {\n type: 'string',\n title: 'Merge Request Name',\n description: 'The name for the merge request',\n },\n description: {\n type: 'string',\n title: 'Merge Request Description',\n description: 'The description of the merge request',\n },\n branchName: {\n type: 'string',\n title: 'Source Branch Name',\n description: 'The source branch name of the merge request',\n },\n targetBranchName: {\n type: 'string',\n title: 'Target Branch Name',\n description: 'The target branch name of the merge request',\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n commitAction: {\n title: 'Commit action',\n type: 'string',\n enum: ['create', 'update', 'delete', 'auto'],\n description:\n 'The action to be used for git commit. Defaults to auto. \"auto\" is custom action provide by backstage, (automatic assign create or update action) /!\\\\ Use more api calls /!\\\\ *',\n },\n removeSourceBranch: {\n title: 'Delete source branch',\n type: 'boolean',\n description:\n 'Option to delete source branch once the MR has been merged. Default: false',\n },\n assignee: {\n title: 'Merge Request Assignee',\n type: 'string',\n description: 'User this merge request will be assigned to',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n targetBranchName: {\n title: 'Target branch name of the merge request',\n type: 'string',\n },\n projectid: {\n title: 'Gitlab Project id/Name(slug)',\n type: 'string',\n },\n projectPath: {\n title: 'Gitlab Project path',\n type: 'string',\n },\n mergeRequestUrl: {\n title: 'MergeRequest(MR) URL',\n type: 'string',\n description: 'Link to the merge request in GitLab',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n assignee,\n branchName,\n targetBranchName,\n description,\n repoUrl,\n removeSourceBranch,\n targetPath,\n sourcePath,\n title,\n token,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let assigneeId = undefined;\n\n if (assignee !== undefined) {\n try {\n const assigneeUser = await api.Users.username(assignee);\n assigneeId = assigneeUser[0].id;\n } catch (e) {\n ctx.logger.warn(\n `Failed to find gitlab user id for ${assignee}: ${e}. Proceeding with MR creation without an assignee.`,\n );\n }\n }\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else if (targetPath) {\n // for backward compatibility\n fileRoot = resolveSafeChildPath(ctx.workspacePath, targetPath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n let targetBranch = targetBranchName;\n if (!targetBranch) {\n const projects = await api.Projects.show(repoID);\n\n const { default_branch: defaultBranch } = projects;\n targetBranch = defaultBranch!;\n }\n\n let remoteFiles: Types.RepositoryTreeSchema[] = [];\n if (!ctx.input.commitAction || ctx.input.commitAction === 'auto') {\n try {\n remoteFiles = await api.Repositories.tree(repoID, {\n ref: targetBranch,\n recursive: true,\n path: targetPath ?? undefined,\n });\n } catch (e) {\n ctx.logger.warn(\n `Could not retrieve the list of files for ${repoID} (branch: ${targetBranch}) : ${e}`,\n );\n }\n }\n\n const actions: Types.CommitAction[] = fileContents.map(file => ({\n action: getFileAction(\n { file, targetPath },\n remoteFiles,\n ctx.input.commitAction,\n ),\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n try {\n await api.Branches.create(repoID, branchName, String(targetBranch));\n } catch (e) {\n throw new InputError(\n `The branch creation failed. Please check that your repo does not already contain a branch named '${branchName}'. ${e}`,\n );\n }\n\n try {\n await api.Commits.create(repoID, branchName, ctx.input.title, actions);\n } catch (e) {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`,\n );\n }\n\n try {\n const mergeRequestUrl = await api.MergeRequests.create(\n repoID,\n branchName,\n String(targetBranch),\n title,\n {\n description,\n removeSourceBranch: removeSourceBranch ? removeSourceBranch : false,\n assigneeId,\n },\n ).then((mergeRequest: { web_url: string }) => {\n return mergeRequest.web_url;\n });\n ctx.output('projectid', repoID);\n ctx.output('targetBranchName', targetBranch);\n ctx.output('projectPath', repoID);\n ctx.output('mergeRequestUrl', mergeRequestUrl);\n } catch (e) {\n throw new InputError(`Merge request creation failed${e}`);\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\nimport { commonGitlabConfigExample } from '../commonGitlabConfig';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Trigger a GitLab Project Pipeline',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one', var_two: 'two' },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with No Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: {},\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with Single Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one' },\n },\n },\n ],\n }),\n },\n {\n description: 'Trigger a GitLab Project Pipeline with Multiple Variables',\n example: yaml.stringify({\n steps: [\n {\n id: 'triggerPipeline',\n name: 'Trigger Project Pipeline',\n action: 'gitlab:pipeline:trigger',\n input: {\n ...commonGitlabConfigExample,\n projectId: 12,\n tokenDescription:\n 'This is the text that will appear in the pipeline token',\n token: 'glpt-xxxxxxxxxxxx',\n branch: 'main',\n variables: { var_one: 'one', var_two: 'two', var_three: 'three' },\n },\n },\n ],\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 { InputError } from '@backstage/errors';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport {\n ExpandedPipelineSchema,\n PipelineTriggerTokenSchema,\n} from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getClient, parseRepoUrl } from '../util';\nimport { examples } from './gitlabPipelineTrigger.examples';\n\nconst pipelineInputProperties = z.object({\n projectId: z.number().describe('Project Id'),\n tokenDescription: z.string().describe('Pipeline token description'),\n branch: z.string().describe('Project branch'),\n variables: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n 'A object/record of key-valued strings containing the pipeline variables.',\n ),\n});\n\nconst pipelineOutputProperties = z.object({\n pipelineUrl: z.string({ description: 'Pipeline Url' }),\n});\n\n/**\n * Creates a `gitlab:pipeline:trigger` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createTriggerGitlabPipelineAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:pipeline:trigger',\n description: 'Triggers a GitLab Pipeline.',\n examples,\n schema: {\n input: commonGitlabConfig.merge(pipelineInputProperties),\n output: pipelineOutputProperties,\n },\n async handler(ctx) {\n let pipelineTokenResponse: PipelineTriggerTokenSchema | null = null;\n\n const { repoUrl, projectId, tokenDescription, token, branch, variables } =\n commonGitlabConfig.merge(pipelineInputProperties).parse(ctx.input);\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n try {\n // Create a pipeline token\n pipelineTokenResponse = (await api.PipelineTriggerTokens.create(\n projectId,\n tokenDescription,\n )) as PipelineTriggerTokenSchema;\n\n if (!pipelineTokenResponse.token) {\n ctx.logger.error('Failed to create pipeline token.');\n return;\n }\n ctx.logger.info(\n `Pipeline token id ${pipelineTokenResponse.id} created.`,\n );\n\n // Use the pipeline token to trigger the pipeline in the project\n const pipelineTriggerResponse =\n (await api.PipelineTriggerTokens.trigger(\n projectId,\n branch,\n pipelineTokenResponse.token,\n { variables },\n )) as ExpandedPipelineSchema;\n\n if (!pipelineTriggerResponse.id) {\n ctx.logger.error('Failed to trigger pipeline.');\n return;\n }\n\n ctx.logger.info(`Pipeline id ${pipelineTriggerResponse.id} triggered.`);\n\n ctx.output('pipelineUrl', pipelineTriggerResponse.web_url);\n } catch (error: any) {\n if (error instanceof z.ZodError) {\n // Handling Zod validation errors\n throw new InputError(`Validation error: ${error.message}`, {\n validationErrors: error.errors,\n });\n }\n // Handling other errors\n throw new InputError(`Failed to trigger Pipeline: ${error.message}`);\n } finally {\n // Delete the pipeline token if it was created\n if (pipelineTokenResponse && pipelineTokenResponse.id) {\n try {\n await api.PipelineTriggerTokens.remove(\n projectId,\n pipelineTokenResponse.id,\n );\n ctx.logger.info(\n `Deleted pipeline token ${pipelineTokenResponse.id}.`,\n );\n } catch (error: any) {\n ctx.logger.error(\n `Failed to delete pipeline token id ${pipelineTokenResponse.id}.`,\n );\n }\n }\n }\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab project access token with minimal options.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with custom scopes.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n scopes: ['read_registry', 'write_repository'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with a specified name.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'my-custom-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a numeric project ID.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a specified expired Date.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n expiresAt: '2024-06-25',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with an access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n accessLevel: 30,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with multiple options',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n accessLevel: 40,\n name: 'full-access-token',\n expiresAt: '2024-12-31',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a token for authorization',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n token: 'personal-access-token',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with read-only scopes',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n scopes: ['read_repository', 'read_api'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with guest access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 10,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with maintainer access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 40,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project access token with owner access level',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n accessLevel: 50,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token with a specified name and no expiration date',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'no-expiry-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project access token for a specific gitlab instance',\n example: yaml.stringify({\n steps: [\n {\n id: 'createAccessToken',\n action: 'gitlab:projectAccessToken:create',\n name: 'Create GitLab Project Access Token',\n input: {\n repoUrl: 'gitlab.example.com?repo=repo&owner=owner',\n projectId: '101112',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { AccessTokenScopes, Gitlab } from '@gitbeaker/rest';\nimport { DateTime } from 'luxon';\nimport { z } from 'zod';\nimport { getToken } from '../util';\nimport { examples } from './gitlabProjectAccessTokenCreate.examples';\n\n/**\n * Creates a `gitlab:projectAccessToken:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\n\nexport const createGitlabProjectAccessTokenAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectAccessToken:create',\n examples,\n schema: {\n input: z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID/Name(slug) of the Gitlab Project',\n }),\n token: z\n .string({\n description: 'The token to use for authorization to GitLab',\n })\n .optional(),\n name: z.string({ description: 'Name of Access Key' }).optional(),\n repoUrl: z.string({ description: 'URL to gitlab instance' }),\n accessLevel: z\n .number({\n description:\n 'Access Level of the Token, 10 (Guest), 20 (Reporter), 30 (Developer), 40 (Maintainer), and 50 (Owner)',\n })\n .optional(),\n scopes: z\n .string({\n description: 'Scopes for a project access token',\n })\n .array()\n .optional(),\n expiresAt: z\n .string({\n description:\n 'Expiration date of the access token in ISO format (YYYY-MM-DD). If Empty, it will set to the maximum of 365 days.',\n })\n .optional(),\n }),\n output: z.object({\n access_token: z.string({ description: 'Access Token' }),\n }),\n },\n async handler(ctx) {\n ctx.logger.info(`Creating Token for Project \"${ctx.input.projectId}\"`);\n const {\n projectId,\n name = 'tokenname',\n accessLevel = 40,\n scopes = ['read_repository'],\n expiresAt,\n } = ctx.input;\n\n const { token, integrationConfig } = getToken(ctx.input, integrations);\n\n if (!integrationConfig.config.token && token) {\n throw new InputError(\n `No token available for host ${integrationConfig.config.baseUrl}`,\n );\n }\n\n let api;\n\n if (!ctx.input.token) {\n api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: token,\n });\n } else {\n api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n oauthToken: token,\n });\n }\n\n const response = await api.ProjectAccessTokens.create(\n projectId,\n name,\n scopes as AccessTokenScopes[],\n {\n expiresAt:\n expiresAt || DateTime.now().plus({ days: 365 }).toISODate()!,\n accessLevel,\n },\n );\n\n if (!response.token) {\n throw new Error('Could not create project access token');\n }\n\n ctx.output('access_token', response.token);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Create a GitLab project deploy token with minimal options.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n name: 'tokenname',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project deploy token with custom scopes.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n name: 'tokenname',\n scopes: ['read_registry', 'write_repository'],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project deploy token with a specified name.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '101112',\n name: 'my-custom-token',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project deploy token with a numeric project ID.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n name: 'tokenname',\n },\n },\n ],\n }),\n },\n\n {\n description: 'Create a GitLab project deploy token with a custom username',\n example: yaml.stringify({\n steps: [\n {\n id: 'createDeployToken',\n action: 'gitlab:projectDeployToken:create',\n name: 'Create GitLab Project Deploy Token',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: 42,\n name: 'tokenname',\n username: 'tokenuser',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { DeployTokenScope } from '@gitbeaker/core/dist/types/templates/ResourceDeployTokens';\nimport { Gitlab } from '@gitbeaker/node';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getToken } from '../util';\nimport { examples } from './gitlabProjectDeployTokenCreate.examples';\n\n/**\n * Creates a `gitlab:projectDeployToken:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabProjectDeployTokenAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectDeployToken:create',\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID',\n }),\n name: z.string({ description: 'Deploy Token Name' }),\n username: z\n .string({ description: 'Deploy Token Username' })\n .optional(),\n scopes: z.array(z.string(), { description: 'Scopes' }).optional(),\n }),\n ),\n output: z.object({\n deploy_token: z.string({ description: 'Deploy Token' }),\n user: z.string({ description: 'User' }),\n }),\n },\n async handler(ctx) {\n ctx.logger.info(`Creating Token for Project \"${ctx.input.projectId}\"`);\n const { projectId, name, username, scopes } = ctx.input;\n const { token, integrationConfig } = getToken(ctx.input, integrations);\n\n const api = new Gitlab({\n host: integrationConfig.config.baseUrl,\n token: token,\n });\n\n const deployToken = await api.ProjectDeployTokens.add(\n projectId,\n name,\n scopes as DeployTokenScope[],\n {\n username: username,\n },\n );\n\n if (!deployToken.hasOwnProperty('token')) {\n throw new InputError(`No deploy_token given from gitlab instance`);\n }\n\n ctx.output('deploy_token', deployToken.token as string);\n ctx.output('user', deployToken.username);\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Creating a GitLab project variable of type env_var',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n },\n },\n ],\n }),\n },\n {\n description: 'Creating a GitLab project variable of type file',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my-file-content',\n variableType: 'file',\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable that is protected.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '456',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n variableProtected: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable with masked flag as true',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:createGitlabProjectVariableAction',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '789',\n key: 'DB_PASSWORD',\n value: 'password123',\n variableType: 'env_var',\n masked: true,\n },\n },\n ],\n }),\n },\n {\n description: 'Create a GitLab project variable that is expandable.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n raw: true,\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project variable with a specific environment scope.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n environmentScope: 'production',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Create a GitLab project variable with a wildcard environment scope.',\n example: yaml.stringify({\n steps: [\n {\n id: 'createVariable',\n action: 'gitlab:projectVariable:create',\n name: 'Create GitLab Project Variable',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n projectId: '123',\n key: 'MY_VARIABLE',\n value: 'my_value',\n variableType: 'env_var',\n environmentScope: '*',\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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { VariableType } from '@gitbeaker/rest';\nimport { z } from 'zod';\nimport commonGitlabConfig from '../commonGitlabConfig';\nimport { getClient, parseRepoUrl } from '../util';\nimport { examples } from './gitlabProjectVariableCreate.examples';\n\n/**\n * Creates a `gitlab:projectVariable:create` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabProjectVariableAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n return createTemplateAction({\n id: 'gitlab:projectVariable:create',\n examples,\n schema: {\n input: commonGitlabConfig.merge(\n z.object({\n projectId: z.union([z.number(), z.string()], {\n description: 'Project ID',\n }),\n key: z\n .string({\n description:\n 'The key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed',\n })\n .regex(/^[A-Za-z0-9_]{1,255}$/),\n value: z.string({ description: 'The value of a variable' }),\n variableType: z.string({\n description: 'Variable Type (env_var or file)',\n }),\n variableProtected: z\n .boolean({ description: 'Whether the variable is protected' })\n .default(false)\n .optional(),\n masked: z\n .boolean({ description: 'Whether the variable is masked' })\n .default(false)\n .optional(),\n raw: z\n .boolean({ description: 'Whether the variable is expandable' })\n .default(false)\n .optional(),\n environmentScope: z\n .string({ description: 'The environment_scope of the variable' })\n .default('*')\n .optional(),\n }),\n ),\n },\n async handler(ctx) {\n const {\n repoUrl,\n projectId,\n key,\n value,\n variableType,\n variableProtected = false,\n masked = false,\n raw = false,\n environmentScope = '*',\n token,\n } = ctx.input;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n\n const api = getClient({ host, integrations, token });\n\n await api.ProjectVariables.create(projectId, key, value, {\n variableType: variableType as VariableType,\n protected: variableProtected,\n masked,\n raw,\n environmentScope,\n });\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 */\nimport { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Push changes to gitlab repository with minimal changes',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Push changes to gitlab repository with a specific source and target path',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n sourcePath: 'src',\n targetPath: 'dest',\n },\n },\n ],\n }),\n },\n {\n description:\n 'Push changes to gitlab repository with a specific commit action',\n example: yaml.stringify({\n steps: [\n {\n id: 'pushChanges',\n action: 'gitlab:repo:push',\n name: 'Push changes to gitlab repository',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n commitMessage: 'Initial Commit',\n branchName: 'feature-branch',\n commitAction: 'update',\n },\n },\n ],\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 {\n createTemplateAction,\n parseRepoUrl,\n serializeDirectoryContents,\n} from '@backstage/plugin-scaffolder-node';\nimport { Types } from '@gitbeaker/core';\nimport path from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport { createGitlabApi } from './helpers';\nimport { examples } from './gitlabRepoPush.examples';\n\n/**\n * Create a new action that commits into a gitlab repository.\n *\n * @public\n */\nexport const createGitlabRepoPushAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction<{\n repoUrl: string;\n branchName: string;\n commitMessage: string;\n sourcePath?: string;\n targetPath?: string;\n token?: string;\n commitAction?: 'create' | 'delete' | 'update';\n }>({\n id: 'gitlab:repo:push',\n examples,\n schema: {\n input: {\n required: ['repoUrl', 'branchName', 'commitMessage'],\n type: 'object',\n properties: {\n repoUrl: {\n type: 'string',\n title: 'Repository Location',\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n },\n branchName: {\n type: 'string',\n title: 'Source Branch Name',\n description: 'The branch name for the commit',\n },\n commitMessage: {\n type: 'string',\n title: 'Commit Message',\n description: `The commit message`,\n },\n sourcePath: {\n type: 'string',\n title: 'Working Subdirectory',\n description:\n 'Subdirectory of working directory to copy changes from',\n },\n targetPath: {\n type: 'string',\n title: 'Repository Subdirectory',\n description: 'Subdirectory of repository to apply changes to',\n },\n token: {\n title: 'Authentication Token',\n type: 'string',\n description: 'The token to use for authorization to GitLab',\n },\n commitAction: {\n title: 'Commit action',\n type: 'string',\n enum: ['create', 'update', 'delete'],\n description:\n 'The action to be used for git commit. Defaults to create.',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n projectid: {\n title: 'Gitlab Project id/Name(slug)',\n type: 'string',\n },\n projectPath: {\n title: 'Gitlab Project path',\n type: 'string',\n },\n commitHash: {\n title: 'The git commit hash of the commit',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const {\n branchName,\n repoUrl,\n targetPath,\n sourcePath,\n token,\n commitAction,\n } = ctx.input;\n\n const { owner, repo, project } = parseRepoUrl(repoUrl, integrations);\n const repoID = project ? project : `${owner}/${repo}`;\n\n const api = createGitlabApi({\n integrations,\n token,\n repoUrl,\n });\n\n let fileRoot: string;\n if (sourcePath) {\n fileRoot = resolveSafeChildPath(ctx.workspacePath, sourcePath);\n } else {\n fileRoot = ctx.workspacePath;\n }\n\n const fileContents = await serializeDirectoryContents(fileRoot, {\n gitignore: true,\n });\n\n const actions: Types.CommitAction[] = fileContents.map(file => ({\n action: commitAction ?? 'create',\n filePath: targetPath\n ? path.posix.join(targetPath, file.path)\n : file.path,\n encoding: 'base64',\n content: file.content.toString('base64'),\n execute_filemode: file.executable,\n }));\n\n let branchExists = false;\n try {\n await api.Branches.show(repoID, branchName);\n branchExists = true;\n } catch (e: any) {\n if (e.response?.statusCode !== 404) {\n throw new InputError(\n `Failed to check status of branch '${branchName}'. Please make sure that branch already exists or Backstage has permissions to create one. ${e}`,\n );\n }\n }\n\n if (!branchExists) {\n // create a branch using the default branch as ref\n try {\n const projects = await api.Projects.show(repoID);\n const { default_branch: defaultBranch } = projects;\n await api.Branches.create(repoID, branchName, String(defaultBranch));\n } catch (e) {\n throw new InputError(\n `The branch '${branchName}' was not found and creation failed with error. Please make sure that branch already exists or Backstage has permissions to create one. ${e}`,\n );\n }\n }\n\n try {\n const commit = await api.Commits.create(\n repoID,\n branchName,\n ctx.input.commitMessage,\n actions,\n );\n ctx.output('projectid', repoID);\n ctx.output('projectPath', repoID);\n ctx.output('commitHash', commit.id);\n } catch (e) {\n throw new InputError(\n `Committing the changes to ${branchName} failed. Please check that none of the files created by the template already exists. ${e}`,\n );\n }\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 { ScmIntegrations } from '@backstage/integration';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGitlabGroupEnsureExistsAction,\n createGitlabIssueAction,\n createGitlabProjectAccessTokenAction,\n createGitlabProjectDeployTokenAction,\n createGitlabProjectVariableAction,\n createGitlabRepoPushAction,\n createPublishGitlabAction,\n createPublishGitlabMergeRequestAction,\n createTriggerGitlabPipelineAction,\n editGitlabIssueAction,\n} from './actions';\n\n/**\n * @public\n * The GitLab Module for the Scaffolder Backend\n */\nexport const gitlabModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitlab',\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 createGitlabGroupEnsureExistsAction({ integrations }),\n createGitlabIssueAction({ integrations }),\n createGitlabProjectAccessTokenAction({ integrations }),\n createGitlabProjectDeployTokenAction({ integrations }),\n createGitlabProjectVariableAction({ integrations }),\n createGitlabRepoPushAction({ integrations }),\n editGitlabIssueAction({ integrations }),\n createPublishGitlabAction({ config, integrations }),\n createPublishGitlabMergeRequestAction({ integrations }),\n createTriggerGitlabPipelineAction({ integrations }),\n );\n },\n });\n },\n});\n"],"names":["examples","yaml","createTemplateAction","parseRepoUrl","InputError","Gitlab","initRepoAndPush","getRepoSourceDirectory","z","IssueType","IssueStateEvent","util.getTopLevelParentGroup","path","resolveSafeChildPath","serializeDirectoryContents","DateTime","createBackendModule","scaffolderActionsExtensionPoint","coreServices","ScmIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBO,MAAMA,UAA8B,GAAA;AAAA,EACzC;AAAA,IACE,WACE,EAAA,4HAAA;AAAA,IACF,OAAA,EAASC,sBAAK,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,+CAAA;AAAA,WACX;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAa,EAAA,oBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,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,+CAAA;AAAA,YACT,WAAa,EAAA,6BAAA;AAAA,WACf;AAAA,SACF;AAAA,OACF;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA;AAAA,IACE,WACE,EAAA,0GAAA;AAAA,IACF,OAAA,EAASA,sBAAK,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,+CAAA;AAAA,YACT,WAAa,EAAA,6BAAA;AAAA,YACb,gBAAkB,EAAA,oBAAA;AAAA,WACpB;AAAA,SACF;AAAA,O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ugin-scaffolder-backend-module-gitlab",
3
- "version": "0.5.1-next.0",
3
+ "version": "0.5.1",
4
4
  "backstage": {
5
5
  "role": "backend-plugin-module",
6
6
  "pluginId": "scaffolder",
@@ -21,7 +21,6 @@
21
21
  "license": "Apache-2.0",
22
22
  "exports": {
23
23
  ".": {
24
- "backstage": "@backstage/BackendFeature",
25
24
  "require": "./dist/index.cjs.js",
26
25
  "types": "./dist/index.d.ts",
27
26
  "default": "./dist/index.cjs.js"
@@ -44,11 +43,11 @@
44
43
  },
45
44
  "dependencies": {
46
45
  "@backstage/backend-common": "^0.25.0",
47
- "@backstage/backend-plugin-api": "^1.0.1-next.0",
46
+ "@backstage/backend-plugin-api": "^1.0.0",
48
47
  "@backstage/config": "^1.2.0",
49
48
  "@backstage/errors": "^1.2.4",
50
49
  "@backstage/integration": "^1.15.0",
51
- "@backstage/plugin-scaffolder-node": "^0.5.0-next.0",
50
+ "@backstage/plugin-scaffolder-node": "^0.4.12",
52
51
  "@gitbeaker/core": "^35.8.0",
53
52
  "@gitbeaker/node": "^35.8.0",
54
53
  "@gitbeaker/rest": "^39.25.0",
@@ -57,9 +56,9 @@
57
56
  "zod": "^3.22.4"
58
57
  },
59
58
  "devDependencies": {
60
- "@backstage/backend-test-utils": "^1.0.1-next.0",
61
- "@backstage/cli": "^0.28.0-next.0",
62
- "@backstage/core-app-api": "^1.15.1-next.0",
63
- "@backstage/plugin-scaffolder-node-test-utils": "^0.1.13-next.0"
59
+ "@backstage/backend-test-utils": "^1.0.0",
60
+ "@backstage/cli": "^0.27.1",
61
+ "@backstage/core-app-api": "^1.15.0",
62
+ "@backstage/plugin-scaffolder-node-test-utils": "^0.1.13"
64
63
  }
65
64
  }