backport 5.6.5 → 6.1.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.
Files changed (238) hide show
  1. package/README.md +166 -41
  2. package/dist/entrypoint.cli.js +3 -1
  3. package/dist/entrypoint.module.d.ts +18 -5
  4. package/dist/entrypoint.module.js +42 -12
  5. package/dist/entrypoint.module.private.test.d.ts +1 -0
  6. package/dist/entrypoint.module.private.test.js +34 -0
  7. package/dist/ink.d.ts +1 -0
  8. package/dist/ink.js +49 -0
  9. package/dist/main.d.ts +11 -6
  10. package/dist/main.js +40 -25
  11. package/dist/options/ConfigOptions.d.ts +28 -12
  12. package/dist/options/cliArgs.d.ts +36 -35
  13. package/dist/options/cliArgs.js +91 -52
  14. package/dist/options/cliArgs.test.js +41 -42
  15. package/dist/options/config/config.d.ts +34 -57
  16. package/dist/options/config/config.js +5 -39
  17. package/dist/options/config/config.test.js +11 -25
  18. package/dist/options/config/getOptionsFromGit.d.ts +3 -2
  19. package/dist/options/config/getOptionsFromGit.js +1 -3
  20. package/dist/options/config/globalConfig.d.ts +2 -49
  21. package/dist/options/config/globalConfig.js +9 -12
  22. package/dist/options/config/globalConfig.test.js +7 -5
  23. package/dist/options/config/projectConfig.d.ts +2 -49
  24. package/dist/options/config/projectConfig.js +2 -2
  25. package/dist/options/config/projectConfig.test.js +53 -16
  26. package/dist/options/config/readConfigFile.d.ts +43 -39
  27. package/dist/options/config/readConfigFile.js +30 -4
  28. package/dist/options/options.d.ts +57 -31
  29. package/dist/options/options.js +102 -10
  30. package/dist/options/options.test.js +263 -61
  31. package/dist/options/parseRequiredOptions.d.ts +19 -14
  32. package/dist/options/parseRequiredOptions.js +9 -15
  33. package/dist/options/parseRequiredOptions.test.js +30 -26
  34. package/dist/runSequentially.d.ts +20 -0
  35. package/dist/runSequentially.js +41 -0
  36. package/dist/runSequentially.test.d.ts +1 -0
  37. package/dist/runSequentially.test.js +196 -0
  38. package/dist/runWithOptions.js +7 -14
  39. package/dist/runWithOptions.test.js +140 -17
  40. package/dist/scripts/generate-gql.d.ts +1 -0
  41. package/dist/scripts/generate-gql.js +15 -0
  42. package/dist/scripts/postinstall.js +4 -4
  43. package/dist/scripts/postinstall.test.js +9 -2
  44. package/dist/scripts/runPostinstall.js +1 -1
  45. package/dist/services/HandledError.d.ts +11 -1
  46. package/dist/services/HandledError.js +2 -1
  47. package/dist/services/child-process-promisified.d.ts +1 -1
  48. package/dist/services/child-process-promisified.js +1 -1
  49. package/dist/services/env.js +5 -5
  50. package/dist/services/env.test.js +11 -4
  51. package/dist/services/fs-promisified.js +4 -4
  52. package/dist/services/getExpectedTarget.d.ts +9 -0
  53. package/dist/services/getExpectedTarget.js +77 -0
  54. package/dist/services/getExpectedTargetPullRequests.d.ts +9 -0
  55. package/dist/services/getExpectedTargetPullRequests.js +77 -0
  56. package/dist/services/git.d.ts +20 -6
  57. package/dist/services/git.integration.test.d.ts +1 -0
  58. package/dist/services/git.integration.test.js +168 -0
  59. package/dist/services/git.js +93 -67
  60. package/dist/services/git.test.js +68 -68
  61. package/dist/services/github/commitFormatters.d.ts +3 -7
  62. package/dist/services/github/commitFormatters.js +10 -19
  63. package/dist/services/github/commitFormatters.test.js +2 -24
  64. package/dist/services/github/v3/addAssigneesToPullRequest.d.ts +1 -1
  65. package/dist/services/github/v3/addAssigneesToPullRequest.js +3 -8
  66. package/dist/services/github/v3/addAssigneesToPullRequest.test.js +6 -8
  67. package/dist/services/github/v3/addLabelsToPullRequest.d.ts +1 -1
  68. package/dist/services/github/v3/addLabelsToPullRequest.js +2 -6
  69. package/dist/services/github/v3/addReviewersToPullRequest.d.ts +2 -0
  70. package/dist/services/github/v3/addReviewersToPullRequest.js +34 -0
  71. package/dist/services/github/v3/createPullRequest.d.ts +3 -2
  72. package/dist/services/github/v3/createPullRequest.js +31 -29
  73. package/dist/services/github/v3/createPullRequest.test.d.ts +1 -0
  74. package/dist/services/github/v3/createPullRequest.test.js +110 -0
  75. package/dist/services/github/v3/createStatusComment.d.ts +11 -0
  76. package/dist/services/github/v3/createStatusComment.js +97 -0
  77. package/dist/services/github/v3/createStatusComment.test.d.ts +1 -0
  78. package/dist/services/github/v3/createStatusComment.test.js +209 -0
  79. package/dist/services/github/v4/FetchPullRequestId.d.ts +9 -0
  80. package/dist/services/github/v4/FetchPullRequestId.js +32 -0
  81. package/dist/services/github/v4/apiRequestV4.d.ts +2 -2
  82. package/dist/services/github/v4/apiRequestV4.js +8 -10
  83. package/dist/services/github/v4/apiRequestV4.test.js +7 -7
  84. package/dist/services/github/v4/disablePullRequestAutoMerge.d.ts +1 -8
  85. package/dist/services/github/v4/disablePullRequestAutoMerge.js +6 -32
  86. package/dist/services/github/v4/enablePullRequestAutoMerge.d.ts +1 -8
  87. package/dist/services/github/v4/enablePullRequestAutoMerge.js +31 -40
  88. package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.d.ts +1 -0
  89. package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.js +112 -0
  90. package/dist/services/github/v4/fetchAuthorId.d.ts +5 -2
  91. package/dist/services/github/v4/fetchAuthorId.js +6 -7
  92. package/dist/services/github/v4/fetchAuthorId.private.test.js +6 -9
  93. package/dist/services/github/v4/fetchCommitByPullNumber.js +11 -9
  94. package/dist/services/github/v4/fetchCommitByPullNumber.private.test.js +4 -4
  95. package/dist/services/github/v4/fetchCommitBySha.js +14 -12
  96. package/dist/services/github/v4/fetchCommitBySha.private.test.js +4 -4
  97. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.d.ts +12 -0
  98. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +46 -0
  99. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.d.ts +1 -0
  100. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +70 -0
  101. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.d.ts +12 -0
  102. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +36 -0
  103. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.d.ts +1 -0
  104. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +55 -0
  105. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +27 -0
  106. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +88 -0
  107. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.d.ts +1 -0
  108. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +128 -0
  109. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.d.ts +1 -0
  110. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +125 -0
  111. package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.d.ts +28 -0
  112. package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.js +52 -0
  113. package/dist/services/github/v4/fetchCommits/fetchProjectConfig.d.ts +3 -0
  114. package/dist/services/github/v4/fetchCommits/fetchProjectConfig.js +55 -0
  115. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.d.ts +10 -0
  116. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.js +49 -0
  117. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.d.ts +1 -0
  118. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +77 -0
  119. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.d.ts +1 -0
  120. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.js +252 -0
  121. package/dist/services/github/v4/fetchCommitsByAuthor.d.ts +2 -1
  122. package/dist/services/github/v4/fetchCommitsByAuthor.js +81 -70
  123. package/dist/services/github/v4/fetchCommitsByAuthor.private.test.js +78 -5
  124. package/dist/services/github/v4/fetchCommitsByAuthor.test.js +29 -21
  125. package/dist/services/github/v4/fetchDefaultBranch.js +1 -1
  126. package/dist/services/github/v4/fetchExistingPullRequest.js +2 -3
  127. package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +3 -5
  128. package/dist/services/github/v4/fetchMergedPullRequests.d.ts +18 -19
  129. package/dist/services/github/v4/fetchMergedPullRequests.js +22 -69
  130. package/dist/services/github/v4/fetchMergedPullRequests.private.test.js +8 -9
  131. package/dist/services/github/v4/fetchProjectConfig.d.ts +8 -0
  132. package/dist/services/github/v4/fetchProjectConfig.js +56 -0
  133. package/dist/services/github/v4/fetchProjectConfig.private.test.d.ts +1 -0
  134. package/dist/services/github/v4/fetchProjectConfig.private.test.js +52 -0
  135. package/dist/services/github/v4/fetchProjectConfig.test.d.ts +1 -0
  136. package/dist/services/github/v4/fetchProjectConfig.test.js +37 -0
  137. package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.d.ts +11 -0
  138. package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.js +35 -0
  139. package/dist/services/github/v4/fetchPullRequestBySearchQuery.js +12 -10
  140. package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.js +3 -3
  141. package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.js +2 -2
  142. package/dist/services/github/v4/getExistingTargetPullRequests.d.ts +4 -58
  143. package/dist/services/github/v4/getExistingTargetPullRequests.js +3 -58
  144. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +66 -0
  145. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +130 -0
  146. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.d.ts +1 -0
  147. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +130 -0
  148. package/dist/services/github/v4/getOptionsFromGithub/index.d.ts +19 -9
  149. package/dist/services/github/v4/getOptionsFromGithub/index.js +59 -19
  150. package/dist/services/github/v4/getOptionsFromGithub/index.private.test.js +119 -32
  151. package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +16 -16
  152. package/dist/services/github/v4/getOptionsFromGithub/query.js +16 -15
  153. package/dist/services/github/v4/getTargetBranchesFromLabels.d.ts +0 -7
  154. package/dist/services/github/v4/getTargetBranchesFromLabels.js +1 -26
  155. package/dist/services/github/v4/getTargetBranchesFromLabels.test.js +69 -32
  156. package/dist/services/github/v4/mocks/commitsByAuthorMock.d.ts +2 -2
  157. package/dist/services/github/v4/mocks/commitsByAuthorMock.js +39 -25
  158. package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.d.ts +1 -1
  159. package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.js +10 -0
  160. package/dist/services/github/v4/mocks/getCommitsByAuthorMock.d.ts +1 -1
  161. package/dist/services/github/v4/mocks/getCommitsByAuthorMock.js +2 -0
  162. package/dist/services/github/v4/mocks/getPullRequestNodeMock.d.ts +1 -1
  163. package/dist/services/github/v4/mocks/getPullRequestNodeMock.js +1 -0
  164. package/dist/services/github/v4/throwOnInvalidAccessToken.d.ts +1 -1
  165. package/dist/services/github/v4/throwOnInvalidAccessToken.js +10 -15
  166. package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +7 -7
  167. package/dist/services/logger.d.ts +3 -3
  168. package/dist/services/logger.js +16 -15
  169. package/dist/services/prompt.test.d.ts +1 -0
  170. package/dist/services/prompt.test.js +87 -0
  171. package/dist/services/prompts.d.ts +10 -4
  172. package/dist/services/prompts.js +85 -22
  173. package/dist/services/sourceCommit/getExpectedTargetPullRequests.d.ts +9 -0
  174. package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +92 -0
  175. package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.d.ts +1 -0
  176. package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.js +413 -0
  177. package/dist/services/sourceCommit/getMockSourceCommit.d.ts +21 -0
  178. package/dist/services/sourceCommit/getMockSourceCommit.js +67 -0
  179. package/dist/services/sourceCommit/getTargetBranchesFromLabels.d.ts +5 -0
  180. package/dist/services/sourceCommit/getTargetBranchesFromLabels.js +20 -0
  181. package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.d.ts +1 -0
  182. package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.js +201 -0
  183. package/dist/services/sourceCommit/parseSourceCommit.d.ts +82 -0
  184. package/dist/services/sourceCommit/parseSourceCommit.js +96 -0
  185. package/dist/services/sourceCommit/parseSourceCommit.test.d.ts +1 -0
  186. package/dist/services/sourceCommit/parseSourceCommit.test.js +229 -0
  187. package/dist/services/sourceCommit/sourceCommit.d.ts +78 -0
  188. package/dist/services/sourceCommit/sourceCommit.js +86 -0
  189. package/dist/services/sourceCommit/sourceCommit.test.d.ts +1 -0
  190. package/dist/services/sourceCommit/sourceCommit.test.js +287 -0
  191. package/dist/services/sourceCommit.d.ts +78 -0
  192. package/dist/services/sourceCommit.js +86 -0
  193. package/dist/services/sourceCommit.test.d.ts +1 -0
  194. package/dist/services/sourceCommit.test.js +280 -0
  195. package/dist/test/inquirer.private.test.js +64 -49
  196. package/dist/test/integration/createSpies.js +6 -6
  197. package/dist/test/integration/envConstants.js +5 -6
  198. package/dist/test/integration/helpers.js +1 -1
  199. package/dist/test/integration/integration.private.test.d.ts +1 -0
  200. package/dist/test/integration/integration.private.test.js +327 -0
  201. package/dist/test/integration/integration.test.js +28 -29
  202. package/dist/test/mockConfigFiles.d.ts +5 -0
  203. package/dist/test/mockConfigFiles.js +37 -0
  204. package/dist/test/nockHelpers.d.ts +1 -1
  205. package/dist/test/nockHelpers.js +7 -11
  206. package/dist/test/private/getDevAccessToken.js +1 -1
  207. package/dist/test/setupFiles/automatic-mocks.d.ts +0 -1
  208. package/dist/test/setupFiles/automatic-mocks.js +1 -51
  209. package/dist/types/Commit.d.ts +85 -0
  210. package/dist/types/Commit.js +139 -0
  211. package/dist/types/commitNode.d.ts +89 -0
  212. package/dist/types/commitNode.js +139 -0
  213. package/dist/types/commitNode.test.d.ts +1 -0
  214. package/dist/types/commitNode.test.js +255 -0
  215. package/dist/types/commitWithAssociatedPullRequests.d.ts +86 -0
  216. package/dist/types/commitWithAssociatedPullRequests.js +145 -0
  217. package/dist/ui/cherrypickAndCreatePullRequest.test.js +346 -76
  218. package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +11 -1
  219. package/dist/ui/cherrypickAndCreateTargetPullRequest.js +138 -67
  220. package/dist/ui/cherrypickAndCreateTargetPullRequest.test.d.ts +1 -0
  221. package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +468 -0
  222. package/dist/ui/getCommits.d.ts +1 -1
  223. package/dist/ui/getCommits.js +55 -25
  224. package/dist/ui/getTargetBranches.d.ts +3 -2
  225. package/dist/ui/getTargetBranches.js +33 -18
  226. package/dist/ui/getTargetBranches.test.js +75 -99
  227. package/dist/ui/getTargetBranchesFromLabels.d.ts +6 -0
  228. package/dist/ui/getTargetBranchesFromLabels.js +40 -0
  229. package/dist/ui/getTargetBranchesFromLabels.test.d.ts +1 -0
  230. package/dist/ui/getTargetBranchesFromLabels.test.js +288 -0
  231. package/dist/ui/maybeSetupRepo.js +11 -10
  232. package/dist/ui/maybeSetupRepo.test.js +54 -4
  233. package/dist/utils/excludeUndefined.d.ts +6 -0
  234. package/dist/utils/excludeUndefined.js +7 -0
  235. package/dist/utils/excludeUndefined.test.d.ts +1 -0
  236. package/dist/utils/excludeUndefined.test.js +24 -0
  237. package/package.json +37 -51
  238. package/yarn.lock +2414 -2993
@@ -1,10 +1,9 @@
1
1
  import { OptionsFromGithub } from '../services/github/v4/getOptionsFromGithub';
2
- import { BranchChoiceRaw, BranchChoice, ConfigOptions } from './ConfigOptions';
2
+ import { TargetBranchChoiceOrString, TargetBranchChoice, ConfigFileOptions } from './ConfigOptions';
3
3
  import { OptionsFromCliArgs } from './cliArgs';
4
4
  import { OptionsFromConfigFiles } from './config/config';
5
- export declare type ValidatedOptions = ReturnType<typeof parseRequiredOptions>;
6
5
  export declare function parseRequiredOptions(optionsFromConfigFiles: OptionsFromConfigFiles, optionsFromCliArgs: OptionsFromCliArgs, optionsFromGithub: OptionsFromGithub): {
7
- targetBranchChoices: BranchChoice[];
6
+ targetBranchChoices: TargetBranchChoice[];
8
7
  accessToken: string;
9
8
  username: string;
10
9
  repoName: string;
@@ -14,32 +13,33 @@ export declare function parseRequiredOptions(optionsFromConfigFiles: OptionsFrom
14
13
  all: boolean;
15
14
  multipleBranches: boolean;
16
15
  multipleCommits: boolean;
16
+ commitPaths: string[];
17
+ reviewers: string[];
18
+ sourcePRLabels: (string[] | undefined) & (string[] | never[]);
19
+ targetBranches: (string[] | undefined) & (string[] | never[]);
20
+ targetPRLabels: (string[] | undefined) & (string[] | never[]);
21
+ cherrypickRef: boolean;
22
+ fork: boolean;
17
23
  noVerify: boolean;
18
24
  autoAssign: boolean;
19
25
  autoMerge: boolean;
20
26
  autoMergeMethod: string;
21
27
  ci: boolean;
22
- dryRun: boolean;
28
+ details: boolean;
23
29
  editor: string | undefined;
24
30
  forceLocalConfig: boolean | undefined;
25
- fork: boolean;
26
31
  gitHostname: string;
27
32
  githubApiBaseUrlV3: string;
28
33
  githubApiBaseUrlV4: string;
29
34
  mainline: number | undefined;
30
35
  maxNumber: number;
31
- path: string | undefined;
32
- prTitle: string;
33
36
  prDescription: string | undefined;
37
+ prTitle: string;
34
38
  prFilter: string | undefined;
35
39
  pullNumber: number | undefined;
36
40
  resetAuthor: boolean;
37
41
  sha: string | undefined;
38
42
  sourceBranch: string;
39
- sourcePRLabels: string[] | (string[] & never[]);
40
- targetBranches: string[] | (string[] & never[]);
41
- targetPRLabels: string[];
42
- upstream: string | undefined;
43
43
  verbose: boolean;
44
44
  autoFixConflicts?: (({ files, directory, logger, targetBranch, }: {
45
45
  files: string[];
@@ -53,12 +53,17 @@ export declare function parseRequiredOptions(optionsFromConfigFiles: OptionsFrom
53
53
  };
54
54
  targetBranch: string;
55
55
  }) => boolean | Promise<boolean>) | undefined;
56
- branchLabelMapping?: Record<string, string> | undefined;
57
56
  multiple?: boolean | undefined;
58
- branches?: BranchChoiceRaw[] | undefined;
57
+ branchLabelMapping?: Record<string, string> | undefined;
58
+ upstream?: string | undefined;
59
+ branches?: TargetBranchChoiceOrString[] | undefined;
59
60
  labels?: string[] | undefined;
61
+ historicalBranchLabelMappings: {
62
+ branchLabelMapping: Record<string, string>;
63
+ committedDate: string;
64
+ }[];
60
65
  };
61
- export declare function getRequiredOptions({ accessToken, username, upstream, }: ConfigOptions): {
66
+ export declare function getRequiredOptions({ accessToken, username, repoName, repoOwner, }: ConfigFileOptions): {
62
67
  accessToken: string;
63
68
  username: string;
64
69
  repoOwner: string;
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.getRequiredOptions = exports.parseRequiredOptions = void 0;
7
- const lodash_isempty_1 = __importDefault(require("lodash.isempty"));
8
- const lodash_isstring_1 = __importDefault(require("lodash.isstring"));
4
+ const lodash_1 = require("lodash");
9
5
  const HandledError_1 = require("../services/HandledError");
10
6
  const env_1 = require("../services/env");
11
7
  const PROJECT_CONFIG_DOCS_LINK = 'https://github.com/sqren/backport/blob/e119d71d6dc03cd061f6ad9b9a8b1cd995f98961/docs/configuration.md#project-config-backportrcjson';
@@ -20,10 +16,10 @@ function parseRequiredOptions(optionsFromConfigFiles, optionsFromCliArgs, option
20
16
  ...optionsFromCliArgs,
21
17
  };
22
18
  // ensure `targetBranches` or `targetBranchChoices` are given
23
- if (lodash_isempty_1.default(options.targetBranches) &&
24
- lodash_isempty_1.default(options.targetBranchChoices) &&
19
+ if ((0, lodash_1.isEmpty)(options.targetBranches) &&
20
+ (0, lodash_1.isEmpty)(options.targetBranchChoices) &&
25
21
  // this is primarily necessary on CI where `targetBranches` and `targetBranchChoices` and not given
26
- lodash_isempty_1.default(options.branchLabelMapping)) {
22
+ (0, lodash_1.isEmpty)(options.branchLabelMapping)) {
27
23
  throw new HandledError_1.HandledError(`You must specify a target branch\n\nYou can specify it via either:\n - Config file (recommended): ".backportrc.json". Read more: ${PROJECT_CONFIG_DOCS_LINK}\n - CLI: "--branch 6.1"`);
28
24
  }
29
25
  const { accessToken, username, repoName, repoOwner } = getRequiredOptions(options);
@@ -37,7 +33,7 @@ function parseRequiredOptions(optionsFromConfigFiles, optionsFromCliArgs, option
37
33
  repoName,
38
34
  repoOwner,
39
35
  // auto-assign the current user or default to the specified assignees
40
- assignees: options.autoAssign
36
+ assignees: options.autoAssign && options.username
41
37
  ? [options.username]
42
38
  : options.assignees,
43
39
  author: options.author || username,
@@ -49,7 +45,7 @@ exports.parseRequiredOptions = parseRequiredOptions;
49
45
  // It must be transformed so it is always treated as an object troughout the application
50
46
  function getTargetBranchChoicesAsObject(targetBranchChoices) {
51
47
  return targetBranchChoices.map((choice) => {
52
- if (lodash_isstring_1.default(choice)) {
48
+ if ((0, lodash_1.isString)(choice)) {
53
49
  return {
54
50
  name: choice,
55
51
  checked: false,
@@ -58,16 +54,14 @@ function getTargetBranchChoicesAsObject(targetBranchChoices) {
58
54
  return choice;
59
55
  });
60
56
  }
61
- function getRequiredOptions({ accessToken, username, upstream, }) {
57
+ function getRequiredOptions({ accessToken, username, repoName, repoOwner, }) {
62
58
  // accessToken and username must be supplied in config or via cli args
63
59
  if (!accessToken || !username) {
64
- const globalConfigPath = env_1.getGlobalConfigPath();
60
+ const globalConfigPath = (0, env_1.getGlobalConfigPath)();
65
61
  throw new HandledError_1.HandledError(`Please update your config file: ${globalConfigPath}.\nIt must contain a valid "username" and "accessToken".\n\nRead more: ${GLOBAL_CONFIG_DOCS_LINK}`);
66
62
  }
67
- // upstream must be specified via config or cli args
68
- const [repoOwner, repoName] = (upstream !== null && upstream !== void 0 ? upstream : '').split('/');
69
63
  if (!repoOwner || !repoName) {
70
- throw new HandledError_1.HandledError(`You must specify a valid Github repository\n\nYou can specify it via either:\n - Config file (recommended): ".backportrc.json". Read more: ${PROJECT_CONFIG_DOCS_LINK}\n - CLI: "--upstream elastic/kibana"`);
64
+ throw new HandledError_1.HandledError(`You must specify a valid Github repository\n\nYou can specify it via either:\n - Config file (recommended): ".backportrc.json". Read more: ${PROJECT_CONFIG_DOCS_LINK}\n - CLI: "--repo-owner elastic --repo-name kibana"`);
71
65
  }
72
66
  return { accessToken, username, repoOwner, repoName };
73
67
  }
@@ -1,23 +1,33 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const os_1 = __importDefault(require("os"));
3
7
  const config_1 = require("./config/config");
4
8
  const parseRequiredOptions_1 = require("./parseRequiredOptions");
5
9
  describe('parseRequiredOptions', () => {
10
+ beforeEach(() => {
11
+ jest.spyOn(os_1.default, 'homedir').mockReturnValue('/myHomeDir');
12
+ });
6
13
  const optionsFromConfigFiles = {
7
14
  ...config_1.defaultConfigOptions,
8
15
  accessToken: 'myAccessToken',
9
16
  username: 'sqren',
10
- upstream: 'elastic/kibana',
17
+ repoOwner: 'elastic',
18
+ repoName: 'kibana',
11
19
  targetBranches: ['branchA', 'branchB'],
12
20
  };
13
21
  const optionsFromCliArgs = {};
14
- const optionsFromGithub = { sourceBranch: 'main' };
22
+ const optionsFromGithub = {
23
+ sourceBranch: 'source-branch-from-github',
24
+ };
15
25
  describe('should not throw', () => {
16
26
  it('when all options are valid and `branches` is given', () => {
17
- expect(() => parseRequiredOptions_1.parseRequiredOptions(optionsFromConfigFiles, optionsFromCliArgs, optionsFromGithub)).not.toThrow();
27
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)(optionsFromConfigFiles, optionsFromCliArgs, optionsFromGithub)).not.toThrow();
18
28
  });
19
29
  it('when `targetBranchChoices` is given instead of `targetBranches`', () => {
20
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
30
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
21
31
  ...optionsFromConfigFiles,
22
32
  targetBranchChoices: [{ name: 'branchA' }],
23
33
  targetBranches: [],
@@ -25,21 +35,21 @@ describe('parseRequiredOptions', () => {
25
35
  });
26
36
  describe('autoAssign/assignees', () => {
27
37
  it('should set `assignees` to current user if `autoAssign` is true', () => {
28
- const options = parseRequiredOptions_1.parseRequiredOptions({ ...optionsFromConfigFiles, assignees: ['john'] }, { autoAssign: true }, optionsFromGithub);
38
+ const options = (0, parseRequiredOptions_1.parseRequiredOptions)({ ...optionsFromConfigFiles, assignees: ['john'] }, { autoAssign: true }, optionsFromGithub);
29
39
  expect(options.assignees).toEqual(['sqren']);
30
40
  });
31
41
  it('should set `assignees` to specified value if `autoAssign` is false', () => {
32
- const options = parseRequiredOptions_1.parseRequiredOptions({ ...optionsFromConfigFiles, assignees: ['john'] }, { autoAssign: false }, optionsFromGithub);
42
+ const options = (0, parseRequiredOptions_1.parseRequiredOptions)({ ...optionsFromConfigFiles, assignees: ['john'] }, { autoAssign: false }, optionsFromGithub);
33
43
  expect(options.assignees).toEqual(['john']);
34
44
  });
35
45
  it('should set `assignees` to empty if neither `assignees` or `autoAssign` is specified', () => {
36
- const options = parseRequiredOptions_1.parseRequiredOptions({ ...optionsFromConfigFiles, assignees: [] }, { autoAssign: false }, optionsFromGithub);
46
+ const options = (0, parseRequiredOptions_1.parseRequiredOptions)({ ...optionsFromConfigFiles, assignees: [] }, { autoAssign: false }, optionsFromGithub);
37
47
  expect(options.assignees).toEqual([]);
38
48
  });
39
49
  });
40
50
  describe('targetBranchChoices', () => {
41
51
  it('should convert primitives', () => {
42
- const options = parseRequiredOptions_1.parseRequiredOptions({
52
+ const options = (0, parseRequiredOptions_1.parseRequiredOptions)({
43
53
  ...optionsFromConfigFiles,
44
54
  targetBranchChoices: ['choice 1', 'choice 2'],
45
55
  }, optionsFromCliArgs, optionsFromGithub);
@@ -49,7 +59,7 @@ describe('parseRequiredOptions', () => {
49
59
  ]);
50
60
  });
51
61
  it('should preserve objects as-is', () => {
52
- const options = parseRequiredOptions_1.parseRequiredOptions({
62
+ const options = (0, parseRequiredOptions_1.parseRequiredOptions)({
53
63
  ...optionsFromConfigFiles,
54
64
  targetBranchChoices: [
55
65
  { name: 'choice 1', checked: false },
@@ -65,51 +75,45 @@ describe('parseRequiredOptions', () => {
65
75
  });
66
76
  describe('should throw', () => {
67
77
  it('when accessToken is missing', () => {
68
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
78
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
69
79
  ...optionsFromConfigFiles,
70
80
  accessToken: undefined,
71
81
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
72
82
  });
73
83
  it('when accessToken is empty', () => {
74
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
84
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
75
85
  ...optionsFromConfigFiles,
76
86
  accessToken: '',
77
87
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
78
88
  });
79
89
  it('when `targetBranches`, `targetBranchChoices` and `branchLabelMapping` are all empty', () => {
80
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
90
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
81
91
  ...optionsFromConfigFiles,
82
92
  targetBranchChoices: [],
83
93
  targetBranches: [],
84
94
  branchLabelMapping: {},
85
95
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
86
96
  });
87
- it('when upstream is missing', () => {
88
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
89
- ...optionsFromConfigFiles,
90
- upstream: undefined,
91
- }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
92
- });
93
- it('when upstream is empty', () => {
94
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
97
+ it('when repoName is missing', () => {
98
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
95
99
  ...optionsFromConfigFiles,
96
- upstream: '',
100
+ repoName: undefined,
97
101
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
98
102
  });
99
- it('when upstream is invalid', () => {
100
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
103
+ it('when repoOwner is missing', () => {
104
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
101
105
  ...optionsFromConfigFiles,
102
- upstream: 'foobar',
106
+ repoOwner: undefined,
103
107
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
104
108
  });
105
109
  it('when username is missing', () => {
106
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
110
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
107
111
  ...optionsFromConfigFiles,
108
112
  username: undefined,
109
113
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
110
114
  });
111
115
  it('when username is empty', () => {
112
- expect(() => parseRequiredOptions_1.parseRequiredOptions({
116
+ expect(() => (0, parseRequiredOptions_1.parseRequiredOptions)({
113
117
  ...optionsFromConfigFiles,
114
118
  username: '',
115
119
  }, optionsFromCliArgs, optionsFromGithub)).toThrowErrorMatchingSnapshot();
@@ -0,0 +1,20 @@
1
+ import { ValidConfigOptions } from './options/options';
2
+ import { HandledError } from './services/HandledError';
3
+ import { Commit } from './services/sourceCommit/parseSourceCommit';
4
+ export declare type Result = {
5
+ status: 'success';
6
+ didUpdate: boolean;
7
+ targetBranch: string;
8
+ pullRequestUrl: string;
9
+ pullRequestNumber: number;
10
+ } | {
11
+ status: 'failure';
12
+ targetBranch: string;
13
+ errorMessage: string;
14
+ error: HandledError;
15
+ };
16
+ export declare function runSequentially({ options, commits, targetBranches, }: {
17
+ options: ValidConfigOptions;
18
+ commits: Commit[];
19
+ targetBranches: string[];
20
+ }): Promise<Result[]>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runSequentially = void 0;
4
+ const logger_1 = require("./services/logger");
5
+ const sequentially_1 = require("./services/sequentially");
6
+ const cherrypickAndCreateTargetPullRequest_1 = require("./ui/cherrypickAndCreateTargetPullRequest");
7
+ const maybeSetupRepo_1 = require("./ui/maybeSetupRepo");
8
+ async function runSequentially({ options, commits, targetBranches, }) {
9
+ logger_1.logger.verbose('Backport options', options);
10
+ await (0, maybeSetupRepo_1.maybeSetupRepo)(options);
11
+ const results = [];
12
+ await (0, sequentially_1.sequentially)(targetBranches, async (targetBranch) => {
13
+ logger_1.logger.info(`Backporting ${JSON.stringify(commits)} to ${targetBranch}`);
14
+ try {
15
+ const { number, url, didUpdate } = await (0, cherrypickAndCreateTargetPullRequest_1.cherrypickAndCreateTargetPullRequest)({
16
+ options,
17
+ commits,
18
+ targetBranch,
19
+ });
20
+ results.push({
21
+ targetBranch,
22
+ status: 'success',
23
+ didUpdate,
24
+ pullRequestUrl: url,
25
+ pullRequestNumber: number,
26
+ });
27
+ }
28
+ catch (e) {
29
+ results.push({
30
+ targetBranch,
31
+ status: 'failure',
32
+ errorMessage: e.message,
33
+ error: e,
34
+ });
35
+ (0, logger_1.consoleLog)(e.message);
36
+ }
37
+ });
38
+ // return the results for consumers to programatically read
39
+ return results;
40
+ }
41
+ exports.runSequentially = runSequentially;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ const os_1 = __importDefault(require("os"));
26
+ const lodash_1 = require("lodash");
27
+ const nock_1 = __importDefault(require("nock"));
28
+ const runSequentially_1 = require("./runSequentially");
29
+ const childProcess = __importStar(require("./services/child-process-promisified"));
30
+ const nockHelpers_1 = require("./test/nockHelpers");
31
+ jest.mock('./services/child-process-promisified', () => {
32
+ return {
33
+ exec: jest.fn(async (cmd) => {
34
+ throw new Error(`Mock required for exec with cmd: "${cmd}"`);
35
+ }),
36
+ execAsCallback: jest.fn((...args) => {
37
+ (0, lodash_1.last)(args)();
38
+ return {
39
+ stderr: {
40
+ on: () => null,
41
+ },
42
+ };
43
+ }),
44
+ };
45
+ });
46
+ describe('runSequentially', () => {
47
+ let rpcExecMock;
48
+ let rpcExecOriginalMock;
49
+ let res;
50
+ let createPullRequestCalls;
51
+ afterEach(() => {
52
+ jest.clearAllMocks();
53
+ nock_1.default.cleanAll();
54
+ });
55
+ beforeEach(async () => {
56
+ jest.spyOn(os_1.default, 'homedir').mockReturnValue('/myHomeDir');
57
+ const options = {
58
+ accessToken: 'myAccessToken',
59
+ authenticatedUsername: 'sqren_authenticated',
60
+ assignees: [],
61
+ autoAssign: false,
62
+ autoFixConflicts: undefined,
63
+ autoMerge: false,
64
+ autoMergeMethod: 'merge',
65
+ branchLabelMapping: undefined,
66
+ historicalBranchLabelMappings: [],
67
+ cherrypickRef: true,
68
+ ci: false,
69
+ commitPaths: [],
70
+ details: false,
71
+ editor: 'code',
72
+ skipRemoteConfig: undefined,
73
+ fork: true,
74
+ gitHostname: 'github.com',
75
+ githubApiBaseUrlV3: 'https://api.github.com',
76
+ githubApiBaseUrlV4: 'http://localhost/graphql',
77
+ mainline: undefined,
78
+ maxNumber: 10,
79
+ multipleBranches: false,
80
+ multipleCommits: false,
81
+ noVerify: true,
82
+ prDescription: 'myPrDescription',
83
+ prFilter: undefined,
84
+ prTitle: 'myPrTitle {targetBranch} {commitMessages}',
85
+ pullNumber: undefined,
86
+ repoName: 'kibana',
87
+ repoOwner: 'elastic',
88
+ resetAuthor: false,
89
+ reviewers: [],
90
+ sha: undefined,
91
+ sourceBranch: 'my-source-branch-from-options',
92
+ sourcePRLabels: [],
93
+ targetBranches: [],
94
+ targetBranchChoices: [
95
+ { name: '6.x' },
96
+ { name: '6.0' },
97
+ { name: '5.6' },
98
+ { name: '5.5' },
99
+ { name: '5.4' },
100
+ ],
101
+ targetPRLabels: [],
102
+ author: 'sqren',
103
+ verbose: false,
104
+ };
105
+ rpcExecMock = jest
106
+ .spyOn(childProcess, 'exec')
107
+ .mockResolvedValue({ stdout: 'success', stderr: '' });
108
+ rpcExecOriginalMock = jest.spyOn(childProcess, 'execAsCallback');
109
+ const scope = (0, nock_1.default)('https://api.github.com')
110
+ .post('/repos/elastic/kibana/pulls')
111
+ .reply(200, {
112
+ number: 1337,
113
+ html_url: 'myHtmlUrl',
114
+ });
115
+ createPullRequestCalls = (0, nockHelpers_1.listenForCallsToNockScope)(scope);
116
+ const commits = [
117
+ {
118
+ sha: 'abcd',
119
+ committedDate: '1',
120
+ expectedTargetPullRequests: [],
121
+ originalMessage: 'My commit message',
122
+ sourceBranch: 'master',
123
+ pullNumber: 55,
124
+ },
125
+ ];
126
+ const targetBranches = ['7.x'];
127
+ res = await (0, runSequentially_1.runSequentially)({ options, commits, targetBranches });
128
+ scope.done();
129
+ });
130
+ it('returns pull request', () => {
131
+ expect(res).toEqual([
132
+ {
133
+ didUpdate: false,
134
+ pullRequestNumber: 1337,
135
+ pullRequestUrl: 'myHtmlUrl',
136
+ status: 'success',
137
+ targetBranch: '7.x',
138
+ },
139
+ ]);
140
+ });
141
+ it('creates pull request', () => {
142
+ expect(createPullRequestCalls).toMatchInlineSnapshot(`
143
+ Array [
144
+ Object {
145
+ "base": "7.x",
146
+ "body": "# Backport
147
+
148
+ This is an automatic backport to 7.x of:
149
+ - #55
150
+
151
+ ### Questions ?
152
+ Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
153
+
154
+ myPrDescription",
155
+ "head": "sqren_authenticated:backport/7.x/pr-55",
156
+ "title": "myPrTitle 7.x My commit message",
157
+ },
158
+ ]
159
+ `);
160
+ });
161
+ it('should run all commands in the correct directory', () => {
162
+ expect(rpcExecMock.mock.calls.every(
163
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
164
+ ([cmd, opts]) => opts.cwd === '/myHomeDir/.backport/repositories/elastic/kibana')).toBe(true);
165
+ });
166
+ it('exec should be called with correct args', () => {
167
+ expect(rpcExecMock).toHaveBeenCalledTimes(10);
168
+ expect(rpcExecMock.mock.calls.map(([cmd]) => cmd)).toEqual([
169
+ 'git remote rm origin',
170
+ 'git remote rm sqren_authenticated',
171
+ 'git remote add sqren_authenticated https://x-access-token:myAccessToken@github.com/sqren_authenticated/kibana.git',
172
+ 'git remote rm elastic',
173
+ 'git remote add elastic https://x-access-token:myAccessToken@github.com/elastic/kibana.git',
174
+ 'git reset --hard && git clean -d --force && git fetch elastic 7.x && git checkout -B backport/7.x/pr-55 elastic/7.x --no-track',
175
+ 'git fetch elastic master:master --force',
176
+ 'git cherry-pick -x abcd',
177
+ 'git push sqren_authenticated backport/7.x/pr-55:backport/7.x/pr-55 --force',
178
+ 'git reset --hard && git checkout my-source-branch-from-options && git branch -D backport/7.x/pr-55',
179
+ ]);
180
+ });
181
+ it('git clone should be called with correct args', () => {
182
+ expect(rpcExecOriginalMock).toHaveBeenCalledTimes(1);
183
+ expect(rpcExecOriginalMock.mock.calls).toMatchInlineSnapshot(`
184
+ Array [
185
+ Array [
186
+ "git clone https://x-access-token:myAccessToken@github.com/elastic/kibana.git --progress",
187
+ Object {
188
+ "cwd": "/myHomeDir/.backport/repositories/elastic",
189
+ "maxBuffer": 104857600,
190
+ },
191
+ [Function],
192
+ ],
193
+ ]
194
+ `);
195
+ });
196
+ });
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.runWithOptions = void 0;
7
- const chalk_1 = __importDefault(require("chalk"));
8
4
  const HandledError_1 = require("./services/HandledError");
9
5
  const logger_1 = require("./services/logger");
10
6
  const sequentially_1 = require("./services/sequentially");
@@ -14,17 +10,14 @@ const getTargetBranches_1 = require("./ui/getTargetBranches");
14
10
  const maybeSetupRepo_1 = require("./ui/maybeSetupRepo");
15
11
  async function runWithOptions(options) {
16
12
  logger_1.logger.verbose('Backport options', options);
17
- if (options.dryRun) {
18
- logger_1.consoleLog(chalk_1.default.red('Dry run: Nothing will be pushed to Github\n'));
19
- }
20
- const commits = await getCommits_1.getCommits(options);
21
- const targetBranches = await getTargetBranches_1.getTargetBranches(options, commits);
22
- await maybeSetupRepo_1.maybeSetupRepo(options);
13
+ const commits = await (0, getCommits_1.getCommits)(options);
14
+ const targetBranches = await (0, getTargetBranches_1.getTargetBranches)(options, commits);
15
+ await (0, maybeSetupRepo_1.maybeSetupRepo)(options);
23
16
  const results = [];
24
- await sequentially_1.sequentially(targetBranches, async (targetBranch) => {
17
+ await (0, sequentially_1.sequentially)(targetBranches, async (targetBranch) => {
25
18
  logger_1.logger.info(`Backporting ${JSON.stringify(commits)} to ${targetBranch}`);
26
19
  try {
27
- const pullRequest = await cherrypickAndCreateTargetPullRequest_1.cherrypickAndCreateTargetPullRequest({
20
+ const pullRequest = await (0, cherrypickAndCreateTargetPullRequest_1.cherrypickAndCreateTargetPullRequest)({
28
21
  options,
29
22
  commits,
30
23
  targetBranch,
@@ -38,10 +31,10 @@ async function runWithOptions(options) {
38
31
  catch (e) {
39
32
  const isHandledError = e instanceof HandledError_1.HandledError;
40
33
  const errorMessage = isHandledError
41
- ? logger_1.redact(e.message)
34
+ ? (0, logger_1.redact)(e.message)
42
35
  : 'An unhandled error occurred. Please consult the logs';
43
36
  results.push({ targetBranch, success: false, errorMessage, error: e });
44
- logger_1.consoleLog(errorMessage);
37
+ (0, logger_1.consoleLog)(errorMessage);
45
38
  }
46
39
  });
47
40
  // return the results for consumers to programatically read