@backstage/plugin-scaffolder-node 0.6.1-next.0 → 0.6.2-next.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,5 +1,18 @@
1
1
  # @backstage/plugin-scaffolder-node
2
2
 
3
+ ## 0.6.2-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a23421: Make sure that isomorphic git push commands are not proxied.
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@1.1.0-next.1
10
+ - @backstage/catalog-model@1.7.1
11
+ - @backstage/errors@1.2.5
12
+ - @backstage/integration@1.16.0-next.0
13
+ - @backstage/types@1.2.0
14
+ - @backstage/plugin-scaffolder-common@1.5.8-next.0
15
+
3
16
  ## 0.6.1-next.0
4
17
 
5
18
  ### Patch Changes
@@ -31,14 +31,10 @@ async function initRepoAndPush(input) {
31
31
  author: authorInfo,
32
32
  committer: authorInfo
33
33
  });
34
- await git$1.addRemote({
35
- dir,
36
- url: remoteUrl,
37
- remote: "origin"
38
- });
39
34
  await git$1.push({
40
35
  dir,
41
- remote: "origin"
36
+ remote: "origin",
37
+ url: remoteUrl
42
38
  });
43
39
  return { commitHash };
44
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gitHelpers.cjs.js","sources":["../../src/actions/gitHelpers.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 { Logger } from 'winston';\nimport { Git } from '../scm';\n\n/**\n * @public\n */\nexport async function initRepoAndPush(input: {\n dir: string;\n remoteUrl: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger: Logger;\n defaultBranch?: string;\n commitMessage?: string;\n gitAuthorInfo?: { name?: string; email?: string };\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n remoteUrl,\n auth,\n logger,\n defaultBranch = 'master',\n commitMessage = 'Initial commit',\n gitAuthorInfo,\n } = input;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.init({\n dir,\n defaultBranch,\n });\n\n await git.add({ dir, filepath: '.' });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n await git.addRemote({\n dir,\n url: remoteUrl,\n remote: 'origin',\n });\n\n await git.push({\n dir,\n remote: 'origin',\n });\n\n return { commitHash };\n}\n\n/**\n * @public\n */\nexport async function commitAndPushRepo(input: {\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger: Logger;\n commitMessage: string;\n gitAuthorInfo?: { name?: string; email?: string };\n branch?: string;\n remoteRef?: string;\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n auth,\n logger,\n commitMessage,\n gitAuthorInfo,\n branch = 'master',\n remoteRef,\n } = input;\n\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.fetch({ dir });\n await git.checkout({ dir, ref: branch });\n await git.add({ dir, filepath: '.' });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n\n await git.push({\n dir,\n remote: 'origin',\n remoteRef: remoteRef ?? `refs/heads/${branch}`,\n });\n\n return { commitHash };\n}\n\n/**\n * @public\n */\nexport async function cloneRepo(options: {\n url: string;\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n ref?: string | undefined;\n depth?: number | undefined;\n noCheckout?: boolean | undefined;\n}): Promise<void> {\n const { url, dir, auth, logger, ref, depth, noCheckout } = options;\n\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.clone({ url, dir, ref, depth, noCheckout });\n}\n\n/**\n * @public\n */\nexport async function createBranch(options: {\n dir: string;\n ref: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n}): Promise<void> {\n const { dir, ref, auth, logger } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.branch({ dir, ref });\n}\n\n/**\n * @public\n */\nexport async function addFiles(options: {\n dir: string;\n filepath: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n}): Promise<void> {\n const { dir, filepath, auth, logger } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.add({ dir, filepath });\n}\n\n/**\n * @public\n */\nexport async function commitAndPushBranch(options: {\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n commitMessage: string;\n gitAuthorInfo?: { name?: string; email?: string };\n branch?: string;\n remoteRef?: string;\n remote?: string;\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n auth,\n logger,\n commitMessage,\n gitAuthorInfo,\n branch = 'master',\n remoteRef,\n remote = 'origin',\n } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n\n await git.push({\n dir,\n remote,\n remoteRef: remoteRef ?? `refs/heads/${branch}`,\n });\n\n return { commitHash };\n}\n"],"names":["git","Git"],"mappings":";;;;AAsBA,eAAsB,gBAAgB,KAWF,EAAA;AAClC,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,IACA,MAAA;AAAA,IACA,aAAgB,GAAA,QAAA;AAAA,IAChB,aAAgB,GAAA,gBAAA;AAAA,IAChB;AAAA,GACE,GAAA,KAAA;AACJ,EAAM,MAAAA,KAAA,GAAMC,QAAI,QAAS,CAAA;AAAA,IACvB,GAAG,IAAA;AAAA,IACH;AAAA,GACD,CAAA;AAED,EAAA,MAAMD,MAAI,IAAK,CAAA;AAAA,IACb,GAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAMA,MAAI,GAAI,CAAA,EAAE,GAAK,EAAA,QAAA,EAAU,KAAK,CAAA;AAGpC,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,IAAA,EAAM,eAAe,IAAQ,IAAA,YAAA;AAAA,IAC7B,KAAA,EAAO,eAAe,KAAS,IAAA;AAAA,GACjC;AAEA,EAAM,MAAA,UAAA,GAAa,MAAMA,KAAA,CAAI,MAAO,CAAA;AAAA,IAClC,GAAA;AAAA,IACA,OAAS,EAAA,aAAA;AAAA,IACT,MAAQ,EAAA,UAAA;AAAA,IACR,SAAW,EAAA;AAAA,GACZ,CAAA;AACD,EAAA,MAAMA,MAAI,SAAU,CAAA;AAAA,IAClB,GAAA;AAAA,IACA,GAAK,EAAA,SAAA;AAAA,IACL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ACD,CAAA;AAGD,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,IAAA,EAAM,eAAe,IAAQ,IAAA,YAAA;AAAA,IAC7B,KAAA,EAAO,eAAe,KAAS,IAAA;AAAA,GACjC;AAEA,EAAM,MAAA,UAAA,GAAa,MAAMD,KAAA,CAAI,MAAO,CAAA;AAAA,IAClC,GAAA;AAAA,IACA,OAAS,EAAA,aAAA;AAAA,IACT,MAAQ,EAAA,UAAA;AAAA,IACR,SAAW,EAAA;AAAA,GACZ,CAAA;AAED,EAAA,MAAMA,MAAI,IAAK,CAAA;AAAA,IACb,GAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA,EAAW,SAAa,IAAA,CAAA,WAAA,EAAc,MAAM,CAAA;AAAA,GAC7C,CAAA;AAED,EAAA,OAAO,EAAE,UAAW,EAAA;AACtB;;;;;;;;;"}
1
+ {"version":3,"file":"gitHelpers.cjs.js","sources":["../../src/actions/gitHelpers.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 { Logger } from 'winston';\nimport { Git } from '../scm';\n\n/**\n * @public\n */\nexport async function initRepoAndPush(input: {\n dir: string;\n remoteUrl: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger: Logger;\n defaultBranch?: string;\n commitMessage?: string;\n gitAuthorInfo?: { name?: string; email?: string };\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n remoteUrl,\n auth,\n logger,\n defaultBranch = 'master',\n commitMessage = 'Initial commit',\n gitAuthorInfo,\n } = input;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.init({\n dir,\n defaultBranch,\n });\n\n await git.add({ dir, filepath: '.' });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n\n await git.push({\n dir,\n remote: 'origin',\n url: remoteUrl,\n });\n\n return { commitHash };\n}\n\n/**\n * @public\n */\nexport async function commitAndPushRepo(input: {\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger: Logger;\n commitMessage: string;\n gitAuthorInfo?: { name?: string; email?: string };\n branch?: string;\n remoteRef?: string;\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n auth,\n logger,\n commitMessage,\n gitAuthorInfo,\n branch = 'master',\n remoteRef,\n } = input;\n\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.fetch({ dir });\n await git.checkout({ dir, ref: branch });\n await git.add({ dir, filepath: '.' });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n\n await git.push({\n dir,\n remote: 'origin',\n remoteRef: remoteRef ?? `refs/heads/${branch}`,\n });\n\n return { commitHash };\n}\n\n/**\n * @public\n */\nexport async function cloneRepo(options: {\n url: string;\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n ref?: string | undefined;\n depth?: number | undefined;\n noCheckout?: boolean | undefined;\n}): Promise<void> {\n const { url, dir, auth, logger, ref, depth, noCheckout } = options;\n\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.clone({ url, dir, ref, depth, noCheckout });\n}\n\n/**\n * @public\n */\nexport async function createBranch(options: {\n dir: string;\n ref: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n}): Promise<void> {\n const { dir, ref, auth, logger } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.branch({ dir, ref });\n}\n\n/**\n * @public\n */\nexport async function addFiles(options: {\n dir: string;\n filepath: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n}): Promise<void> {\n const { dir, filepath, auth, logger } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n await git.add({ dir, filepath });\n}\n\n/**\n * @public\n */\nexport async function commitAndPushBranch(options: {\n dir: string;\n // For use cases where token has to be used with Basic Auth\n // it has to be provided as password together with a username\n // which may be a fixed value defined by the provider.\n auth: { username: string; password: string } | { token: string };\n logger?: Logger | undefined;\n commitMessage: string;\n gitAuthorInfo?: { name?: string; email?: string };\n branch?: string;\n remoteRef?: string;\n remote?: string;\n}): Promise<{ commitHash: string }> {\n const {\n dir,\n auth,\n logger,\n commitMessage,\n gitAuthorInfo,\n branch = 'master',\n remoteRef,\n remote = 'origin',\n } = options;\n const git = Git.fromAuth({\n ...auth,\n logger,\n });\n\n // use provided info if possible, otherwise use fallbacks\n const authorInfo = {\n name: gitAuthorInfo?.name ?? 'Scaffolder',\n email: gitAuthorInfo?.email ?? 'scaffolder@backstage.io',\n };\n\n const commitHash = await git.commit({\n dir,\n message: commitMessage,\n author: authorInfo,\n committer: authorInfo,\n });\n\n await git.push({\n dir,\n remote,\n remoteRef: remoteRef ?? `refs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AA,IACA,MAAA;AAAA,IACA,SAAA,EAAW,SAAa,IAAA,CAAA,WAAA,EAAc,MAAM,CAAA;AAAA,GAC7C,CAAA;AAED,EAAA,OAAO,EAAE,UAAW,EAAA;AACtB;;;;;;;;;"}
@@ -140,7 +140,7 @@ class Git {
140
140
  });
141
141
  }
142
142
  async push(options) {
143
- const { dir, remote, remoteRef, force } = options;
143
+ const { dir, remote, url, remoteRef, force } = options;
144
144
  this.config.logger?.info(
145
145
  `Pushing directory to remote {dir=${dir},remote=${remote}}`
146
146
  );
@@ -154,7 +154,9 @@ class Git {
154
154
  force,
155
155
  headers: this.headers,
156
156
  remote,
157
- onAuth: this.onAuth
157
+ url,
158
+ onAuth: this.onAuth,
159
+ corsProxy: ""
158
160
  });
159
161
  } catch (ex) {
160
162
  this.config.logger?.error(
@@ -1 +1 @@
1
- {"version":3,"file":"git.cjs.js","sources":["../../src/scm/git.ts"],"sourcesContent":["/*\n * Copyright 2020 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 git, {\n ProgressCallback,\n MergeResult,\n ReadCommitResult,\n AuthCallback,\n} from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\nimport fs from 'fs-extra';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nfunction isAuthCallbackOptions(\n options: StaticAuthOptions | AuthCallbackOptions,\n): options is AuthCallbackOptions {\n return 'onAuth' in options;\n}\n\n/**\n * Configure static credential for authentication\n *\n * @public\n */\nexport type StaticAuthOptions = {\n username?: string;\n password?: string;\n token?: string;\n logger?: LoggerService;\n};\n\n/**\n * Configure an authentication callback that can provide credentials on demand\n *\n * @public\n */\nexport type AuthCallbackOptions = {\n onAuth: AuthCallback;\n logger?: LoggerService;\n};\n\n/*\nprovider username password\nAzure 'notempty' token\nBitbucket Cloud 'x-token-auth' token\nBitbucket Server username password or token\nGitHub 'x-access-token' token\nGitLab 'oauth2' token\n\nFrom : https://isomorphic-git.org/docs/en/onAuth with fix for GitHub\n\nOr token provided as `token` for Bearer auth header\ninstead of Basic Auth (e.g., Bitbucket Server).\n*/\n\n/**\n * A convenience wrapper around the `isomorphic-git` library.\n *\n * @public\n */\n\nexport class Git {\n private readonly headers: {\n [x: string]: string;\n };\n\n private constructor(\n private readonly config: {\n onAuth: AuthCallback;\n token?: string;\n logger?: LoggerService;\n },\n ) {\n this.onAuth = config.onAuth;\n\n this.headers = {\n 'user-agent': 'git/@isomorphic-git',\n ...(config.token ? { Authorization: `Bearer ${config.token}` } : {}),\n };\n }\n\n async add(options: { dir: string; filepath: string }): Promise<void> {\n const { dir, filepath } = options;\n this.config.logger?.info(`Adding file {dir=${dir},filepath=${filepath}}`);\n\n return git.add({ fs, dir, filepath });\n }\n\n async addRemote(options: {\n dir: string;\n remote: string;\n url: string;\n force?: boolean;\n }): Promise<void> {\n const { dir, url, remote, force } = options;\n this.config.logger?.info(\n `Creating new remote {dir=${dir},remote=${remote},url=${url}}`,\n );\n return git.addRemote({ fs, dir, remote, url, force });\n }\n\n async deleteRemote(options: { dir: string; remote: string }): Promise<void> {\n const { dir, remote } = options;\n this.config.logger?.info(`Deleting remote {dir=${dir},remote=${remote}}`);\n return git.deleteRemote({ fs, dir, remote });\n }\n\n async checkout(options: { dir: string; ref: string }): Promise<void> {\n const { dir, ref } = options;\n this.config.logger?.info(`Checking out branch {dir=${dir},ref=${ref}}`);\n\n return git.checkout({ fs, dir, ref });\n }\n\n async branch(options: { dir: string; ref: string }): Promise<void> {\n const { dir, ref } = options;\n this.config.logger?.info(`Creating branch {dir=${dir},ref=${ref}`);\n\n return git.branch({ fs, dir, ref });\n }\n\n async commit(options: {\n dir: string;\n message: string;\n author: { name: string; email: string };\n committer: { name: string; email: string };\n }): Promise<string> {\n const { dir, message, author, committer } = options;\n this.config.logger?.info(\n `Committing file to repo {dir=${dir},message=${message}}`,\n );\n return git.commit({ fs, dir, message, author, committer });\n }\n\n /** https://isomorphic-git.org/docs/en/clone */\n async clone(options: {\n url: string;\n dir: string;\n ref?: string;\n depth?: number;\n noCheckout?: boolean;\n }): Promise<void> {\n const { url, dir, ref, depth, noCheckout } = options;\n this.config.logger?.info(`Cloning repo {dir=${dir},url=${url}}`);\n\n try {\n return await git.clone({\n fs,\n http,\n url,\n dir,\n ref,\n singleBranch: true,\n depth: depth ?? 1,\n noCheckout,\n onProgress: this.onProgressHandler(),\n headers: this.headers,\n onAuth: this.onAuth,\n });\n } catch (ex) {\n this.config.logger?.error(`Failed to clone repo {dir=${dir},url=${url}}`);\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n /** https://isomorphic-git.org/docs/en/currentBranch */\n async currentBranch(options: {\n dir: string;\n fullName?: boolean;\n }): Promise<string | undefined> {\n const { dir, fullName = false } = options;\n return git.currentBranch({ fs, dir, fullname: fullName }) as Promise<\n string | undefined\n >;\n }\n\n /** https://isomorphic-git.org/docs/en/fetch */\n async fetch(options: {\n dir: string;\n remote?: string;\n tags?: boolean;\n }): Promise<void> {\n const { dir, remote = 'origin', tags = false } = options;\n this.config.logger?.info(\n `Fetching remote=${remote} for repository {dir=${dir}}`,\n );\n\n try {\n await git.fetch({\n fs,\n http,\n dir,\n remote,\n tags,\n onProgress: this.onProgressHandler(),\n headers: this.headers,\n onAuth: this.onAuth,\n });\n } catch (ex) {\n this.config.logger?.error(\n `Failed to fetch repo {dir=${dir},remote=${remote}}`,\n );\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n async init(options: { dir: string; defaultBranch?: string }): Promise<void> {\n const { dir, defaultBranch = 'master' } = options;\n this.config.logger?.info(`Init git repository {dir=${dir}}`);\n\n return git.init({\n fs,\n dir,\n defaultBranch,\n });\n }\n\n /** https://isomorphic-git.org/docs/en/merge */\n async merge(options: {\n dir: string;\n theirs: string;\n ours?: string;\n author: { name: string; email: string };\n committer: { name: string; email: string };\n }): Promise<MergeResult> {\n const { dir, theirs, ours, author, committer } = options;\n this.config.logger?.info(\n `Merging branch '${theirs}' into '${ours}' for repository {dir=${dir}}`,\n );\n\n // If ours is undefined, current branch is used.\n return git.merge({\n fs,\n dir,\n ours,\n theirs,\n author,\n committer,\n });\n }\n\n async push(options: {\n dir: string;\n remote: string;\n remoteRef?: string;\n force?: boolean;\n }) {\n const { dir, remote, remoteRef, force } = options;\n this.config.logger?.info(\n `Pushing directory to remote {dir=${dir},remote=${remote}}`,\n );\n try {\n return await git.push({\n fs,\n dir,\n http,\n onProgress: this.onProgressHandler(),\n remoteRef,\n force,\n headers: this.headers,\n remote,\n onAuth: this.onAuth,\n });\n } catch (ex) {\n this.config.logger?.error(\n `Failed to push to repo {dir=${dir}, remote=${remote}}`,\n );\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n /** https://isomorphic-git.org/docs/en/readCommit */\n async readCommit(options: {\n dir: string;\n sha: string;\n }): Promise<ReadCommitResult> {\n const { dir, sha } = options;\n return git.readCommit({ fs, dir, oid: sha });\n }\n\n /** https://isomorphic-git.org/docs/en/remove */\n async remove(options: { dir: string; filepath: string }): Promise<void> {\n const { dir, filepath } = options;\n this.config.logger?.info(\n `Removing file from git index {dir=${dir},filepath=${filepath}}`,\n );\n return git.remove({ fs, dir, filepath });\n }\n\n /** https://isomorphic-git.org/docs/en/resolveRef */\n async resolveRef(options: { dir: string; ref: string }): Promise<string> {\n const { dir, ref } = options;\n return git.resolveRef({ fs, dir, ref });\n }\n\n /** https://isomorphic-git.org/docs/en/log */\n async log(options: {\n dir: string;\n ref?: string;\n }): Promise<ReadCommitResult[]> {\n const { dir, ref } = options;\n return git.log({\n fs,\n dir,\n ref: ref ?? 'HEAD',\n });\n }\n\n private onAuth: AuthCallback;\n\n private onProgressHandler = (): ProgressCallback => {\n let currentPhase = '';\n\n return event => {\n if (currentPhase !== event.phase) {\n currentPhase = event.phase;\n this.config.logger?.info(event.phase);\n }\n const total = event.total\n ? `${Math.round((event.loaded / event.total) * 100)}%`\n : event.loaded;\n this.config.logger?.debug(`status={${event.phase},total={${total}}}`);\n };\n };\n\n static fromAuth = (options: StaticAuthOptions | AuthCallbackOptions) => {\n if (isAuthCallbackOptions(options)) {\n const { onAuth, logger } = options;\n return new Git({ onAuth, logger });\n }\n\n const { username, password, token, logger } = options;\n return new Git({ onAuth: () => ({ username, password }), token, logger });\n };\n}\n"],"names":["git","fs","http","logger"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,sBACP,OACgC,EAAA;AAChC,EAAA,OAAO,QAAY,IAAA,OAAA;AACrB;AA4CO,MAAM,GAAI,CAAA;AAAA,EAKP,YACW,MAKjB,EAAA;AALiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAMjB,IAAA,IAAA,CAAK,SAAS,MAAO,CAAA,MAAA;AAErB,IAAA,IAAA,CAAK,OAAU,GAAA;AAAA,MACb,YAAc,EAAA,qBAAA;AAAA,MACd,GAAI,MAAO,CAAA,KAAA,GAAQ,EAAE,aAAA,EAAe,UAAU,MAAO,CAAA,KAAK,CAAG,CAAA,EAAA,GAAI;AAAC,KACpE;AAAA;AACF,EAjBiB,OAAA;AAAA,EAmBjB,MAAM,IAAI,OAA2D,EAAA;AACnE,IAAM,MAAA,EAAE,GAAK,EAAA,QAAA,EAAa,GAAA,OAAA;AAC1B,IAAA,IAAA,CAAK,OAAO,MAAQ,EAAA,IAAA,CAAK,oBAAoB,GAAG,CAAA,UAAA,EAAa,QAAQ,CAAG,CAAA,CAAA,CAAA;AAExE,IAAA,OAAOA,qBAAI,GAAI,CAAA,MAAEC,mBAAI,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AAA,MAAM,EAAE,QAAA,EAAU,QAAU,EAAA,KAAA,EAAO,QAAW,GAAA,OAAA;AAC9C,IAAO,OAAA,IAAI,GAAI,CAAA,EAAE,MAAQ,EAAA,OAAO,EAAE,QAAA,EAAU,QAAS,EAAA,CAAA,EAAI,KAAO,EAAA,MAAA,EAAQ,CAAA;AAAA,GAC1E;AACF;;;;"}
1
+ {"version":3,"file":"git.cjs.js","sources":["../../src/scm/git.ts"],"sourcesContent":["/*\n * Copyright 2020 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 git, {\n ProgressCallback,\n MergeResult,\n ReadCommitResult,\n AuthCallback,\n} from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\nimport fs from 'fs-extra';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nfunction isAuthCallbackOptions(\n options: StaticAuthOptions | AuthCallbackOptions,\n): options is AuthCallbackOptions {\n return 'onAuth' in options;\n}\n\n/**\n * Configure static credential for authentication\n *\n * @public\n */\nexport type StaticAuthOptions = {\n username?: string;\n password?: string;\n token?: string;\n logger?: LoggerService;\n};\n\n/**\n * Configure an authentication callback that can provide credentials on demand\n *\n * @public\n */\nexport type AuthCallbackOptions = {\n onAuth: AuthCallback;\n logger?: LoggerService;\n};\n\n/*\nprovider username password\nAzure 'notempty' token\nBitbucket Cloud 'x-token-auth' token\nBitbucket Server username password or token\nGitHub 'x-access-token' token\nGitLab 'oauth2' token\n\nFrom : https://isomorphic-git.org/docs/en/onAuth with fix for GitHub\n\nOr token provided as `token` for Bearer auth header\ninstead of Basic Auth (e.g., Bitbucket Server).\n*/\n\n/**\n * A convenience wrapper around the `isomorphic-git` library.\n *\n * @public\n */\n\nexport class Git {\n private readonly headers: {\n [x: string]: string;\n };\n\n private constructor(\n private readonly config: {\n onAuth: AuthCallback;\n token?: string;\n logger?: LoggerService;\n },\n ) {\n this.onAuth = config.onAuth;\n\n this.headers = {\n 'user-agent': 'git/@isomorphic-git',\n ...(config.token ? { Authorization: `Bearer ${config.token}` } : {}),\n };\n }\n\n async add(options: { dir: string; filepath: string }): Promise<void> {\n const { dir, filepath } = options;\n this.config.logger?.info(`Adding file {dir=${dir},filepath=${filepath}}`);\n\n return git.add({ fs, dir, filepath });\n }\n\n async addRemote(options: {\n dir: string;\n remote: string;\n url: string;\n force?: boolean;\n }): Promise<void> {\n const { dir, url, remote, force } = options;\n this.config.logger?.info(\n `Creating new remote {dir=${dir},remote=${remote},url=${url}}`,\n );\n return git.addRemote({ fs, dir, remote, url, force });\n }\n\n async deleteRemote(options: { dir: string; remote: string }): Promise<void> {\n const { dir, remote } = options;\n this.config.logger?.info(`Deleting remote {dir=${dir},remote=${remote}}`);\n return git.deleteRemote({ fs, dir, remote });\n }\n\n async checkout(options: { dir: string; ref: string }): Promise<void> {\n const { dir, ref } = options;\n this.config.logger?.info(`Checking out branch {dir=${dir},ref=${ref}}`);\n\n return git.checkout({ fs, dir, ref });\n }\n\n async branch(options: { dir: string; ref: string }): Promise<void> {\n const { dir, ref } = options;\n this.config.logger?.info(`Creating branch {dir=${dir},ref=${ref}`);\n\n return git.branch({ fs, dir, ref });\n }\n\n async commit(options: {\n dir: string;\n message: string;\n author: { name: string; email: string };\n committer: { name: string; email: string };\n }): Promise<string> {\n const { dir, message, author, committer } = options;\n this.config.logger?.info(\n `Committing file to repo {dir=${dir},message=${message}}`,\n );\n return git.commit({ fs, dir, message, author, committer });\n }\n\n /** https://isomorphic-git.org/docs/en/clone */\n async clone(options: {\n url: string;\n dir: string;\n ref?: string;\n depth?: number;\n noCheckout?: boolean;\n }): Promise<void> {\n const { url, dir, ref, depth, noCheckout } = options;\n this.config.logger?.info(`Cloning repo {dir=${dir},url=${url}}`);\n\n try {\n return await git.clone({\n fs,\n http,\n url,\n dir,\n ref,\n singleBranch: true,\n depth: depth ?? 1,\n noCheckout,\n onProgress: this.onProgressHandler(),\n headers: this.headers,\n onAuth: this.onAuth,\n });\n } catch (ex) {\n this.config.logger?.error(`Failed to clone repo {dir=${dir},url=${url}}`);\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n /** https://isomorphic-git.org/docs/en/currentBranch */\n async currentBranch(options: {\n dir: string;\n fullName?: boolean;\n }): Promise<string | undefined> {\n const { dir, fullName = false } = options;\n return git.currentBranch({ fs, dir, fullname: fullName }) as Promise<\n string | undefined\n >;\n }\n\n /** https://isomorphic-git.org/docs/en/fetch */\n async fetch(options: {\n dir: string;\n remote?: string;\n tags?: boolean;\n }): Promise<void> {\n const { dir, remote = 'origin', tags = false } = options;\n this.config.logger?.info(\n `Fetching remote=${remote} for repository {dir=${dir}}`,\n );\n\n try {\n await git.fetch({\n fs,\n http,\n dir,\n remote,\n tags,\n onProgress: this.onProgressHandler(),\n headers: this.headers,\n onAuth: this.onAuth,\n });\n } catch (ex) {\n this.config.logger?.error(\n `Failed to fetch repo {dir=${dir},remote=${remote}}`,\n );\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n async init(options: { dir: string; defaultBranch?: string }): Promise<void> {\n const { dir, defaultBranch = 'master' } = options;\n this.config.logger?.info(`Init git repository {dir=${dir}}`);\n\n return git.init({\n fs,\n dir,\n defaultBranch,\n });\n }\n\n /** https://isomorphic-git.org/docs/en/merge */\n async merge(options: {\n dir: string;\n theirs: string;\n ours?: string;\n author: { name: string; email: string };\n committer: { name: string; email: string };\n }): Promise<MergeResult> {\n const { dir, theirs, ours, author, committer } = options;\n this.config.logger?.info(\n `Merging branch '${theirs}' into '${ours}' for repository {dir=${dir}}`,\n );\n\n // If ours is undefined, current branch is used.\n return git.merge({\n fs,\n dir,\n ours,\n theirs,\n author,\n committer,\n });\n }\n\n async push(options: {\n dir: string;\n remote: string;\n remoteRef?: string;\n url?: string;\n force?: boolean;\n }) {\n const { dir, remote, url, remoteRef, force } = options;\n this.config.logger?.info(\n `Pushing directory to remote {dir=${dir},remote=${remote}}`,\n );\n try {\n return await git.push({\n fs,\n dir,\n http,\n onProgress: this.onProgressHandler(),\n remoteRef,\n force,\n headers: this.headers,\n remote,\n url,\n onAuth: this.onAuth,\n corsProxy: '',\n });\n } catch (ex) {\n this.config.logger?.error(\n `Failed to push to repo {dir=${dir}, remote=${remote}}`,\n );\n if (ex.data) {\n throw new Error(`${ex.message} {data=${JSON.stringify(ex.data)}}`);\n }\n throw ex;\n }\n }\n\n /** https://isomorphic-git.org/docs/en/readCommit */\n async readCommit(options: {\n dir: string;\n sha: string;\n }): Promise<ReadCommitResult> {\n const { dir, sha } = options;\n return git.readCommit({ fs, dir, oid: sha });\n }\n\n /** https://isomorphic-git.org/docs/en/remove */\n async remove(options: { dir: string; filepath: string }): Promise<void> {\n const { dir, filepath } = options;\n this.config.logger?.info(\n `Removing file from git index {dir=${dir},filepath=${filepath}}`,\n );\n return git.remove({ fs, dir, filepath });\n }\n\n /** https://isomorphic-git.org/docs/en/resolveRef */\n async resolveRef(options: { dir: string; ref: string }): Promise<string> {\n const { dir, ref } = options;\n return git.resolveRef({ fs, dir, ref });\n }\n\n /** https://isomorphic-git.org/docs/en/log */\n async log(options: {\n dir: string;\n ref?: string;\n }): Promise<ReadCommitResult[]> {\n const { dir, ref } = options;\n return git.log({\n fs,\n dir,\n ref: ref ?? 'HEAD',\n });\n }\n\n private onAuth: AuthCallback;\n\n private onProgressHandler = (): ProgressCallback => {\n let currentPhase = '';\n\n return event => {\n if (currentPhase !== event.phase) {\n currentPhase = event.phase;\n this.config.logger?.info(event.phase);\n }\n const total = event.total\n ? `${Math.round((event.loaded / event.total) * 100)}%`\n : event.loaded;\n this.config.logger?.debug(`status={${event.phase},total={${total}}}`);\n };\n };\n\n static fromAuth = (options: StaticAuthOptions | AuthCallbackOptions) => {\n if (isAuthCallbackOptions(options)) {\n const { onAuth, logger } = options;\n return new Git({ onAuth, logger });\n }\n\n const { username, password, token, logger } = options;\n return new Git({ onAuth: () => ({ username, password }), token, logger });\n };\n}\n"],"names":["git","fs","http","logger"],"mappings":";;;;;;;;;;;;AA0BA,SAAS,sBACP,OACgC,EAAA;AAChC,EAAA,OAAO,QAAY,IAAA,OAAA;AACrB;AA4CO,MAAM,GAAI,CAAA;AAAA,EAKP,YACW,MAKjB,EAAA;AALiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAMjB,IAAA,IAAA,CAAK,SAAS,MAAO,CAAA,MAAA;AAErB,IAAA,IAAA,CAAK,OAAU,GAAA;AAAA,MACb,YAAc,EAAA,qBAAA;AAAA,MACd,GAAI,MAAO,CAAA,KAAA,GAAQ,EAAE,aAAA,EAAe,UAAU,MAAO,CAAA,KAAK,CAAG,CAAA,EAAA,GAAI;AAAC,KACpE;AAAA;AACF,EAjBiB,OAAA;AAAA,EAmBjB,MAAM,IAAI,OAA2D,EAAA;AACnE,IAAM,MAAA,EAAE,GAAK,EAAA,QAAA,EAAa,GAAA,OAAA;AAC1B,IAAA,IAAA,CAAK,OAAO,MAAQ,EAAA,IAAA,CAAK,oBAAoB,GAAG,CAAA,UAAA,EAAa,QAAQ,CAAG,CAAA,CAAA,CAAA;AAExE,IAAA,OAAOA,qBAAI,GAAI,CAAA,MAAEC,mBAAI,EAAA,GAAA,EAAK,UAAU,CAAA;AAAA;AACtC,EAEA,MAAM,UAAU,OAKE,EAAA;AAChB,IAAA,MAAM,EAAE,GAAA,EAAK,GAAK,EAAA,MAAA,EAAQ,OAAU,GAAA,OAAA;AACpC,IAAA,IAAA,CAAK,OAAO,MAAQ,EAAA,IAAA;AAAA,MAClB,CAA4B,yBAAA,EAAA,GAAG,CAAW,QAAA,EAAA,M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,CAAA;AAAA,GAC1E;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-node",
3
- "version": "0.6.1-next.0",
3
+ "version": "0.6.2-next.1",
4
4
  "description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@backstage/backend-common": "^0.25.0",
66
- "@backstage/backend-plugin-api": "1.0.3-next.0",
66
+ "@backstage/backend-plugin-api": "1.1.0-next.1",
67
67
  "@backstage/catalog-model": "1.7.1",
68
68
  "@backstage/errors": "1.2.5",
69
69
  "@backstage/integration": "1.16.0-next.0",
@@ -81,8 +81,8 @@
81
81
  "zod-to-json-schema": "^3.20.4"
82
82
  },
83
83
  "devDependencies": {
84
- "@backstage/backend-test-utils": "1.2.0-next.0",
85
- "@backstage/cli": "0.29.3-next.0",
84
+ "@backstage/backend-test-utils": "1.2.0-next.1",
85
+ "@backstage/cli": "0.29.3-next.1",
86
86
  "@backstage/config": "1.3.0"
87
87
  }
88
88
  }