backport 6.2.0 → 6.3.0-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/README.md +15 -6
  2. package/dist/backportRun.d.ts +2 -2
  3. package/dist/backportRun.js +13 -8
  4. package/dist/{entrypoint.api.private.test.d.ts → entrypoint.cli.e2e.private.test.d.ts} +0 -0
  5. package/dist/entrypoint.cli.e2e.private.test.js +277 -0
  6. package/dist/entrypoint.cli.js +3 -5
  7. package/dist/{entrypoint.module.private.test.d.ts → entrypoint.cli.private.test.d.ts} +0 -0
  8. package/dist/{entrypoint.module.private.test.js → entrypoint.cli.private.test.js} +17 -8
  9. package/dist/entrypoint.module.d.ts +2 -2
  10. package/dist/entrypoint.module.js +4 -4
  11. package/dist/options/ConfigOptions.d.ts +7 -3
  12. package/dist/options/cliArgs.d.ts +16 -14
  13. package/dist/options/cliArgs.js +31 -5
  14. package/dist/options/cliArgs.test.js +28 -10
  15. package/dist/options/config/config.d.ts +11 -11
  16. package/dist/options/config/config.js +7 -6
  17. package/dist/options/config/config.test.js +11 -1
  18. package/dist/options/config/globalConfig.d.ts +1 -1
  19. package/dist/options/config/globalConfig.js +15 -9
  20. package/dist/options/config/globalConfig.test.js +17 -30
  21. package/dist/options/config/projectConfig.d.ts +3 -1
  22. package/dist/options/config/projectConfig.js +5 -2
  23. package/dist/options/config/projectConfig.test.js +41 -31
  24. package/dist/options/config/readConfigFile.d.ts +21 -23
  25. package/dist/options/config/readConfigFile.js +2 -2
  26. package/dist/options/options.d.ts +19 -46
  27. package/dist/options/options.js +40 -32
  28. package/dist/options/options.test.js +83 -50
  29. package/dist/runSequentially.d.ts +0 -1
  30. package/dist/runSequentially.js +1 -1
  31. package/dist/runSequentially.test.js +37 -18
  32. package/dist/scripts/postinstall.js +3 -3
  33. package/dist/services/HandledError.d.ts +6 -4
  34. package/dist/services/HandledError.js +18 -3
  35. package/dist/services/child-process-promisified.d.ts +3 -1
  36. package/dist/services/env.d.ts +3 -1
  37. package/dist/services/env.js +4 -1
  38. package/dist/services/env.test.js +2 -2
  39. package/dist/services/git.d.ts +22 -9
  40. package/dist/services/git.integration.test.js +123 -24
  41. package/dist/services/git.js +66 -54
  42. package/dist/services/git.test.js +35 -20
  43. package/dist/services/github/commitFormatters.d.ts +0 -1
  44. package/dist/services/github/commitFormatters.js +1 -8
  45. package/dist/services/github/v3/createPullRequest.js +16 -10
  46. package/dist/services/github/v3/createPullRequest.test.js +248 -33
  47. package/dist/services/github/v3/createStatusComment.d.ts +1 -1
  48. package/dist/services/github/v3/createStatusComment.js +26 -15
  49. package/dist/services/github/v3/createStatusComment.test.js +132 -72
  50. package/dist/services/github/v3/getGithubV3ErrorMessage.d.ts +2 -1
  51. package/dist/{options/getValidatedOptions.test.d.ts → services/github/v3/index.d.ts} +0 -0
  52. package/dist/services/github/v3/index.js +61 -0
  53. package/dist/services/github/v4/FetchPullRequestId.d.ts +0 -7
  54. package/dist/services/github/v4/apiRequestV4.d.ts +21 -17
  55. package/dist/services/github/v4/apiRequestV4.js +46 -28
  56. package/dist/services/github/v4/apiRequestV4.test.js +4 -4
  57. package/dist/services/github/v4/disablePullRequestAutoMerge.d.ts +0 -7
  58. package/dist/services/github/v4/enablePullRequestAutoMerge.d.ts +0 -7
  59. package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +37 -19
  60. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +17 -8
  61. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +3 -3
  62. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +23 -14
  63. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +2 -2
  64. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +4 -4
  65. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +41 -19
  66. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.d.ts +1 -8
  67. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +31 -14
  68. package/dist/services/github/v4/fetchExistingPullRequest.d.ts +0 -4
  69. package/dist/services/github/v4/fetchExistingPullRequest.js +1 -2
  70. package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.d.ts +0 -9
  71. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +7 -9
  72. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +48 -40
  73. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +6 -0
  74. package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +15 -23
  75. package/dist/services/github/v4/getOptionsFromGithub/query.js +17 -25
  76. package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.d.ts +29 -0
  77. package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.js +56 -0
  78. package/dist/{options/parseRequiredOptions.test.d.ts → services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.d.ts} +0 -0
  79. package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +71 -0
  80. package/dist/services/github/v4/mocks/commitsByAuthorMock.js +11 -11
  81. package/dist/services/github/v4/throwOnInvalidAccessToken.d.ts +4 -5
  82. package/dist/services/github/v4/throwOnInvalidAccessToken.js +10 -7
  83. package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +5 -5
  84. package/dist/services/logger.d.ts +11 -17
  85. package/dist/services/logger.js +29 -66
  86. package/dist/services/prompt.test.js +66 -19
  87. package/dist/services/prompts.js +12 -10
  88. package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +1 -1
  89. package/dist/services/sourceCommit/getMockSourceCommit.js +6 -6
  90. package/dist/services/sourceCommit/parseSourceCommit.d.ts +18 -10
  91. package/dist/services/sourceCommit/parseSourceCommit.js +20 -14
  92. package/dist/services/sourceCommit/parseSourceCommit.test.js +18 -20
  93. package/dist/{runWithOptions.test.d.ts → test/backport-e2e.mutation.test.d.ts} +0 -0
  94. package/dist/test/{backport-e2e.private.test.js → backport-e2e.mutation.test.js} +136 -116
  95. package/dist/test/handleUnbackportedPullRequests.private.test.js +26 -12
  96. package/dist/test/mockConfigFiles.js +4 -20
  97. package/dist/test/mocks.d.ts +10 -0
  98. package/dist/test/mocks.js +23 -0
  99. package/dist/test/private/getDevAccessToken.js +5 -4
  100. package/dist/test/sandbox.d.ts +5 -0
  101. package/dist/{react-components/0-loadOptions.js → test/sandbox.js} +18 -20
  102. package/dist/test/setupFiles/automatic-mocks.d.ts +1 -0
  103. package/dist/test/setupFiles/automatic-mocks.js +27 -11
  104. package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +0 -1
  105. package/dist/ui/cherrypickAndCreateTargetPullRequest.js +12 -13
  106. package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +50 -27
  107. package/dist/ui/getCommits.js +8 -14
  108. package/dist/ui/getCommitsWithoutBackports.js +6 -6
  109. package/dist/ui/getCommitsWithoutBackports.test.js +91 -39
  110. package/dist/ui/getTargetBranches.js +1 -1
  111. package/dist/ui/getTargetBranches.test.js +26 -8
  112. package/dist/ui/maybeSetupRepo.js +25 -5
  113. package/dist/ui/maybeSetupRepo.test.js +144 -18
  114. package/dist/utils/maybe.d.ts +1 -0
  115. package/dist/utils/maybe.js +7 -0
  116. package/dist/utils/packageVersion.d.ts +1 -0
  117. package/dist/{types/PromiseReturnType.js → utils/packageVersion.js} +2 -0
  118. package/package.json +26 -21
  119. package/yarn.lock +165 -237
  120. package/dist/entrypoint.api.d.ts +0 -22
  121. package/dist/entrypoint.api.js +0 -57
  122. package/dist/entrypoint.api.private.test.js +0 -37
  123. package/dist/index.d.ts +0 -783
  124. package/dist/index.js +0 -8001
  125. package/dist/ink.d.ts +0 -1
  126. package/dist/ink.js +0 -49
  127. package/dist/main.d.ts +0 -14
  128. package/dist/main.js +0 -68
  129. package/dist/options/config/getOptionsFromGit.d.ts +0 -4
  130. package/dist/options/config/getOptionsFromGit.js +0 -8
  131. package/dist/options/config/getProjectConfig.d.ts +0 -0
  132. package/dist/options/config/getProjectConfig.js +0 -1
  133. package/dist/options/getValidatedOptions.d.ts +0 -49
  134. package/dist/options/getValidatedOptions.js +0 -45
  135. package/dist/options/getValidatedOptions.test.js +0 -97
  136. package/dist/options/parseRequiredOptions.d.ts +0 -71
  137. package/dist/options/parseRequiredOptions.js +0 -68
  138. package/dist/options/parseRequiredOptions.test.js +0 -122
  139. package/dist/react-components/0-loadOptions.d.ts +0 -6
  140. package/dist/react-components/1-loadCommit.d.ts +0 -8
  141. package/dist/react-components/1-loadCommit.js +0 -88
  142. package/dist/react-components/1a-loadCommit.d.ts +0 -5
  143. package/dist/react-components/1a-loadCommit.js +0 -76
  144. package/dist/react-components/1b-commitChoices.d.ts +0 -5
  145. package/dist/react-components/1b-commitChoices.js +0 -98
  146. package/dist/react-components/2-commitChoices.d.ts +0 -8
  147. package/dist/react-components/2-commitChoices.js +0 -96
  148. package/dist/react-components/2-commitsPrompt.d.ts +0 -8
  149. package/dist/react-components/2-commitsPrompt.js +0 -96
  150. package/dist/react-components/2-targetBranchChoices.d.ts +0 -9
  151. package/dist/react-components/2-targetBranchChoices.js +0 -109
  152. package/dist/react-components/3-cherrypick.d.ts +0 -1
  153. package/dist/react-components/3-cherrypick.js +0 -2
  154. package/dist/react-components/App.d.ts +0 -2
  155. package/dist/react-components/App.js +0 -35
  156. package/dist/react-components/BackportStateContext.d.ts +0 -33
  157. package/dist/react-components/BackportStateContext.js +0 -42
  158. package/dist/react-components/CommitPrompt/2-commitsPrompt.d.ts +0 -8
  159. package/dist/react-components/CommitPrompt/2-commitsPrompt.js +0 -96
  160. package/dist/react-components/CommitPrompt/CommitPrompt.d.ts +0 -8
  161. package/dist/react-components/CommitPrompt/CommitPrompt.js +0 -96
  162. package/dist/react-components/CommitPrompt/getCommits.d.ts +0 -2
  163. package/dist/react-components/CommitPrompt/getCommits.js +0 -27
  164. package/dist/react-components/CommitPrompt.d.ts +0 -8
  165. package/dist/react-components/CommitPrompt.js +0 -96
  166. package/dist/react-components/CustomMultiSelect.d.ts +0 -13
  167. package/dist/react-components/CustomMultiSelect.js +0 -21
  168. package/dist/react-components/CustomMultiSelectItem.d.ts +0 -5
  169. package/dist/react-components/CustomMultiSelectItem.js +0 -12
  170. package/dist/react-components/CustomSelect.d.ts +0 -14
  171. package/dist/react-components/CustomSelect.js +0 -34
  172. package/dist/react-components/ErrorBoundary.d.ts +0 -15
  173. package/dist/react-components/ErrorBoundary.js +0 -53
  174. package/dist/react-components/MultiSelect.d.ts +0 -7
  175. package/dist/react-components/MultiSelect.js +0 -16
  176. package/dist/react-components/hooks/useAsync.d.ts +0 -12
  177. package/dist/react-components/hooks/useAsync.js +0 -73
  178. package/dist/runWithOptions.d.ts +0 -9
  179. package/dist/runWithOptions.js +0 -43
  180. package/dist/runWithOptions.test.js +0 -304
  181. package/dist/scripts/generate-gql.d.ts +0 -1
  182. package/dist/scripts/generate-gql.js +0 -15
  183. package/dist/services/backportRun/backportRun.ci.d.ts +0 -6
  184. package/dist/services/backportRun/backportRun.ci.js +0 -81
  185. package/dist/services/backportRun/backportRun.d.ts +0 -14
  186. package/dist/services/backportRun/backportRun.interactive.d.ts +0 -1
  187. package/dist/services/backportRun/backportRun.interactive.js +0 -4
  188. package/dist/services/backportRun/backportRun.js +0 -14
  189. package/dist/services/backportRun/backportState.d.ts +0 -4
  190. package/dist/services/backportRun/backportState.js +0 -28
  191. package/dist/services/backportRun/getCommits.d.ts +0 -2
  192. package/dist/services/backportRun/getCommits.js +0 -20
  193. package/dist/services/backportRun/runSequentially.d.ts +0 -20
  194. package/dist/services/backportRun/runSequentially.js +0 -41
  195. package/dist/services/backportRun/runSequentially.test.d.ts +0 -1
  196. package/dist/services/backportRun/runSequentially.test.js +0 -199
  197. package/dist/services/cherrypickAndCreateTargetPullRequest.d.ts +0 -12
  198. package/dist/services/cherrypickAndCreateTargetPullRequest.js +0 -206
  199. package/dist/services/cherrypickAndCreateTargetPullRequest.test.d.ts +0 -1
  200. package/dist/services/cherrypickAndCreateTargetPullRequest.test.js +0 -403
  201. package/dist/services/fs-promisified.d.ts +0 -6
  202. package/dist/services/fs-promisified.js +0 -12
  203. package/dist/services/getCommits.d.ts +0 -2
  204. package/dist/services/getCommits.js +0 -38
  205. package/dist/services/getCommitsWithoutBackports.d.ts +0 -11
  206. package/dist/services/getCommitsWithoutBackports.js +0 -68
  207. package/dist/services/getCommitsWithoutBackports.test.d.ts +0 -1
  208. package/dist/services/getCommitsWithoutBackports.test.js +0 -259
  209. package/dist/services/getExpectedTarget.d.ts +0 -9
  210. package/dist/services/getExpectedTarget.js +0 -77
  211. package/dist/services/getExpectedTargetPullRequests.d.ts +0 -9
  212. package/dist/services/getExpectedTargetPullRequests.js +0 -77
  213. package/dist/services/getTargetBranches.d.ts +0 -5
  214. package/dist/services/getTargetBranches.js +0 -60
  215. package/dist/services/getTargetBranches.test.d.ts +0 -1
  216. package/dist/services/getTargetBranches.test.js +0 -180
  217. package/dist/services/github/v4/fetchCommitByPullNumber.d.ts +0 -5
  218. package/dist/services/github/v4/fetchCommitByPullNumber.js +0 -86
  219. package/dist/services/github/v4/fetchCommitByPullNumber.private.test.d.ts +0 -1
  220. package/dist/services/github/v4/fetchCommitByPullNumber.private.test.js +0 -57
  221. package/dist/services/github/v4/fetchCommitBySha.d.ts +0 -5
  222. package/dist/services/github/v4/fetchCommitBySha.js +0 -95
  223. package/dist/services/github/v4/fetchCommitBySha.private.test.d.ts +0 -1
  224. package/dist/services/github/v4/fetchCommitBySha.private.test.js +0 -50
  225. package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.d.ts +0 -28
  226. package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.js +0 -52
  227. package/dist/services/github/v4/fetchCommits/fetchProjectConfig.d.ts +0 -3
  228. package/dist/services/github/v4/fetchCommits/fetchProjectConfig.js +0 -55
  229. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.d.ts +0 -1
  230. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.js +0 -252
  231. package/dist/services/github/v4/fetchCommitsByAuthor.d.ts +0 -28
  232. package/dist/services/github/v4/fetchCommitsByAuthor.js +0 -161
  233. package/dist/services/github/v4/fetchCommitsByAuthor.private.test.d.ts +0 -1
  234. package/dist/services/github/v4/fetchCommitsByAuthor.private.test.js +0 -115
  235. package/dist/services/github/v4/fetchCommitsByAuthor.test.d.ts +0 -1
  236. package/dist/services/github/v4/fetchCommitsByAuthor.test.js +0 -272
  237. package/dist/services/github/v4/fetchDefaultBranch.d.ts +0 -9
  238. package/dist/services/github/v4/fetchDefaultBranch.js +0 -24
  239. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.d.ts +0 -4
  240. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.js +0 -52
  241. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.d.ts +0 -1
  242. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.js +0 -32
  243. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.d.ts +0 -4
  244. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.js +0 -72
  245. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.private.test.d.ts +0 -1
  246. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.private.test.js +0 -34
  247. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/query.d.ts +0 -40
  248. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/query.js +0 -72
  249. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.d.ts +0 -17
  250. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.js +0 -69
  251. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.d.ts +0 -1
  252. package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.js +0 -32
  253. package/dist/services/github/v4/fetchMergedPullRequests.d.ts +0 -37
  254. package/dist/services/github/v4/fetchMergedPullRequests.js +0 -37
  255. package/dist/services/github/v4/fetchMergedPullRequests.private.test.d.ts +0 -1
  256. package/dist/services/github/v4/fetchMergedPullRequests.private.test.js +0 -59
  257. package/dist/services/github/v4/fetchMergedPullRequests.test.d.ts +0 -1
  258. package/dist/services/github/v4/fetchMergedPullRequests.test.js +0 -22
  259. package/dist/services/github/v4/fetchProjectConfig.d.ts +0 -8
  260. package/dist/services/github/v4/fetchProjectConfig.js +0 -56
  261. package/dist/services/github/v4/fetchProjectConfig.private.test.d.ts +0 -1
  262. package/dist/services/github/v4/fetchProjectConfig.private.test.js +0 -52
  263. package/dist/services/github/v4/fetchProjectConfig.test.d.ts +0 -1
  264. package/dist/services/github/v4/fetchProjectConfig.test.js +0 -37
  265. package/dist/services/github/v4/fetchPullRequestBySearchQuery.d.ts +0 -9
  266. package/dist/services/github/v4/fetchPullRequestBySearchQuery.js +0 -92
  267. package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.d.ts +0 -1
  268. package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.js +0 -66
  269. package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.d.ts +0 -1
  270. package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.js +0 -242
  271. package/dist/services/github/v4/getExistingTargetPullRequests.d.ts +0 -7
  272. package/dist/services/github/v4/getExistingTargetPullRequests.js +0 -45
  273. package/dist/services/github/v4/getOptionsFromGithub/index.d.ts +0 -63
  274. package/dist/services/github/v4/getOptionsFromGithub/index.js +0 -139
  275. package/dist/services/github/v4/getOptionsFromGithub/index.private.test.d.ts +0 -1
  276. package/dist/services/github/v4/getOptionsFromGithub/index.private.test.js +0 -147
  277. package/dist/services/github/v4/getTargetBranchesFromLabels.d.ts +0 -5
  278. package/dist/services/github/v4/getTargetBranchesFromLabels.js +0 -20
  279. package/dist/services/github/v4/getTargetBranchesFromLabels.test.d.ts +0 -1
  280. package/dist/services/github/v4/getTargetBranchesFromLabels.test.js +0 -201
  281. package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.d.ts +0 -2
  282. package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.js +0 -843
  283. package/dist/services/github/v4/mocks/getCommitsByAuthorMock.d.ts +0 -2
  284. package/dist/services/github/v4/mocks/getCommitsByAuthorMock.js +0 -73
  285. package/dist/services/github/v4/mocks/getPullRequestNodeMock.d.ts +0 -12
  286. package/dist/services/github/v4/mocks/getPullRequestNodeMock.js +0 -44
  287. package/dist/services/maybeSetupRepo.d.ts +0 -2
  288. package/dist/services/maybeSetupRepo.js +0 -33
  289. package/dist/services/maybeSetupRepo.test.d.ts +0 -1
  290. package/dist/services/maybeSetupRepo.test.js +0 -78
  291. package/dist/services/sourceCommit/getTargetBranchesFromLabels.d.ts +0 -5
  292. package/dist/services/sourceCommit/getTargetBranchesFromLabels.js +0 -20
  293. package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.d.ts +0 -1
  294. package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.js +0 -201
  295. package/dist/services/sourceCommit/sourceCommit.d.ts +0 -78
  296. package/dist/services/sourceCommit/sourceCommit.js +0 -86
  297. package/dist/services/sourceCommit/sourceCommit.test.d.ts +0 -1
  298. package/dist/services/sourceCommit/sourceCommit.test.js +0 -287
  299. package/dist/services/sourceCommit.d.ts +0 -78
  300. package/dist/services/sourceCommit.js +0 -86
  301. package/dist/services/sourceCommit.test.d.ts +0 -1
  302. package/dist/services/sourceCommit.test.js +0 -280
  303. package/dist/test/backport-e2e.private.test.d.ts +0 -1
  304. package/dist/test/inquirer.private.test.d.ts +0 -1
  305. package/dist/test/inquirer.private.test.js +0 -168
  306. package/dist/test/integration/createSpies.d.ts +0 -17
  307. package/dist/test/integration/createSpies.js +0 -85
  308. package/dist/test/integration/envConstants.d.ts +0 -5
  309. package/dist/test/integration/envConstants.js +0 -9
  310. package/dist/test/integration/helpers.d.ts +0 -7
  311. package/dist/test/integration/helpers.js +0 -31
  312. package/dist/test/integration/integration.private.test.d.ts +0 -1
  313. package/dist/test/integration/integration.private.test.js +0 -327
  314. package/dist/test/integration/integration.test.d.ts +0 -1
  315. package/dist/test/integration/integration.test.js +0 -214
  316. package/dist/todo-delete.d.ts +0 -1
  317. package/dist/todo-delete.js +0 -17
  318. package/dist/types/Commit.d.ts +0 -85
  319. package/dist/types/Commit.js +0 -139
  320. package/dist/types/PromiseReturnType.d.ts +0 -1
  321. package/dist/types/commitNode.d.ts +0 -89
  322. package/dist/types/commitNode.js +0 -139
  323. package/dist/types/commitNode.test.d.ts +0 -1
  324. package/dist/types/commitNode.test.js +0 -255
  325. package/dist/types/commitWithAssociatedPullRequests.d.ts +0 -86
  326. package/dist/types/commitWithAssociatedPullRequests.js +0 -145
  327. package/dist/ui/cherrypickAndCreatePullRequest.test.d.ts +0 -1
  328. package/dist/ui/cherrypickAndCreatePullRequest.test.js +0 -617
  329. package/dist/ui/getTargetBranchesFromLabels.d.ts +0 -6
  330. package/dist/ui/getTargetBranchesFromLabels.js +0 -40
  331. package/dist/ui/getTargetBranchesFromLabels.test.d.ts +0 -1
  332. package/dist/ui/getTargetBranchesFromLabels.test.js +0 -288
  333. package/dist/utils/sequentially.d.ts +0 -1
  334. package/dist/utils/sequentially.js +0 -10
@@ -1,327 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- /* eslint-disable jest/no-commented-out-tests */
7
- const os_1 = __importDefault(require("os"));
8
- const path_1 = require("path");
9
- const rest_1 = require("@octokit/rest");
10
- const del = require("del");
11
- const nock_1 = __importDefault(require("nock"));
12
- const options_1 = require("../../options/options");
13
- const runSequentially_1 = require("../../runSequentially");
14
- const getCommits_1 = require("../../ui/getCommits");
15
- const mockConfigFiles_1 = require("../mockConfigFiles");
16
- const nockHelpers_1 = require("../nockHelpers");
17
- const getDevAccessToken_1 = require("../private/getDevAccessToken");
18
- jest.unmock('make-dir');
19
- jest.unmock('del');
20
- jest.setTimeout(10000);
21
- const INTEGRATION_TEST_DATA_PATH = (0, path_1.resolve)('./src/test/integration/mock-environment');
22
- const HOMEDIR_PATH = (0, path_1.resolve)('./src/test/integration/mock-environment/homedir');
23
- const REPO_OWNER = 'backport-org';
24
- const REPO_NAME = 'integration-test';
25
- const BRANCH_NAME = 'backport/7.x/commit-5bf29b7d';
26
- const AUHTOR = 'sqren';
27
- describe('integration', () => {
28
- afterAll(() => {
29
- nock_1.default.cleanAll();
30
- });
31
- beforeAll(() => {
32
- // set alternative homedir
33
- jest.spyOn(os_1.default, 'homedir').mockReturnValue(HOMEDIR_PATH);
34
- (0, mockConfigFiles_1.mockConfigFiles)({
35
- globalConfig: {},
36
- projectConfig: {},
37
- });
38
- });
39
- describe('when a single commit is backported', () => {
40
- let res;
41
- let accessToken;
42
- let createPullRequestsMockCalls;
43
- beforeAll(async () => {
44
- accessToken = await (0, getDevAccessToken_1.getDevAccessToken)();
45
- await resetState(accessToken);
46
- createPullRequestsMockCalls = mockCreatePullRequest({
47
- number: 1337,
48
- html_url: 'myHtmlUrl',
49
- });
50
- const options = await (0, options_1.getOptions)([], {
51
- githubApiBaseUrlV3: 'https://api.foo.com',
52
- ci: true,
53
- sha: '5bf29b7d847ea3dbde9280448f0f62ad0f22d3ad',
54
- author: AUHTOR,
55
- accessToken,
56
- repoOwner: 'backport-org',
57
- repoName: 'integration-test',
58
- });
59
- const commits = await (0, getCommits_1.getCommits)(options);
60
- const targetBranches = ['7.x'];
61
- res = await (0, runSequentially_1.runSequentially)({ options, commits, targetBranches });
62
- });
63
- it('returns pull request', () => {
64
- expect(res).toEqual([
65
- {
66
- didUpdate: false,
67
- pullRequestUrl: 'myHtmlUrl',
68
- pullRequestNumber: 1337,
69
- status: 'success',
70
- targetBranch: '7.x',
71
- },
72
- ]);
73
- });
74
- it('sends the correct http body when creating pull request', () => {
75
- expect(createPullRequestsMockCalls).toMatchInlineSnapshot(`
76
- Array [
77
- Object {
78
- "base": "7.x",
79
- "body": "# Backport
80
-
81
- This is an automatic backport to \`7.x\` of:
82
- - Add ❤️ emoji (5bf29b7d)
83
-
84
- ### Questions ?
85
- Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
86
- ",
87
- "head": "sqren:backport/7.x/commit-5bf29b7d",
88
- "title": "[7.x] Add ❤️ emoji",
89
- },
90
- ]
91
- `);
92
- });
93
- it('should not create new branches in origin (backport-org/integration-test)', async () => {
94
- const branches = await getBranches({
95
- accessToken,
96
- repoOwner: REPO_OWNER,
97
- repoName: REPO_NAME,
98
- });
99
- expect(branches.map((b) => b.name)).toEqual(['7.x', 'master']);
100
- });
101
- it('should create branch in the fork (sqren/integration-test)', async () => {
102
- const branches = await getBranches({
103
- accessToken,
104
- repoOwner: AUHTOR,
105
- repoName: REPO_NAME,
106
- });
107
- expect(branches.map((b) => b.name)).toEqual([
108
- '7.x',
109
- BRANCH_NAME,
110
- 'master',
111
- ]);
112
- });
113
- it('should have cherry picked the correct commit', async () => {
114
- const branches = await getBranches({
115
- accessToken,
116
- repoOwner: AUHTOR,
117
- repoName: REPO_NAME,
118
- });
119
- const sha = branches.find((branch) => branch.name === '7.x')?.commit.sha;
120
- expect(sha).toEqual('b68e4fcaaf4427fe1e902c718b3bb3f07b560fb5');
121
- });
122
- });
123
- // describe.skip('when two commits are backported', () => {
124
- // let createPullRequestsMockCalls: unknown[];
125
- // let res: Awaited<ReturnType<typeof runSequentially>>;
126
- // let accessToken: string;
127
- // beforeAll(async () => {
128
- // accessToken = await getDevAccessToken();
129
- // await resetState(accessToken);
130
- // createPullRequestsMockCalls = mockCreatePullRequest({
131
- // number: 1337,
132
- // html_url: 'myHtmlUrl',
133
- // });
134
- // const options = {
135
- // githubApiBaseUrlV3: 'https://api.foo.com',
136
- // ci: true,
137
- // sha: '5bf29b7d847ea3dbde9280448f0f62ad0f22d3ad',
138
- // author: AUHTOR,
139
- // accessToken,
140
- // repoOwner: 'backport-org',
141
- // reponame: 'integration-test',
142
- // } as ValidConfigOptions;
143
- // const commits = await getCommits(options);
144
- // const targetBranches: string[] = ['7.x'];
145
- // res = await runSequentially({ options, commits, targetBranches });
146
- // });
147
- // it('sends the correct http body when creating pull request', () => {
148
- // expect(createPullRequestsMockCalls).toMatchInlineSnapshot();
149
- // });
150
- // it('returns pull request', () => {
151
- // expect(res).toEqual([
152
- // { pullRequestUrl: 'myHtmlUrl', success: true, targetBranch: '6.0' },
153
- // ]);
154
- // });
155
- // it('should not create new branches in origin (backport-org/integration-test)', async () => {
156
- // const branches = await getBranches({
157
- // accessToken,
158
- // repoOwner: REPO_OWNER,
159
- // repoName: REPO_NAME,
160
- // });
161
- // expect(branches.map((b) => b.name)).toEqual(['7.x', '* master']);
162
- // });
163
- // it('should create branch in the fork (sqren/integration-test)', async () => {
164
- // const branches = await getBranches({
165
- // accessToken,
166
- // repoOwner: AUHTOR,
167
- // repoName: REPO_NAME,
168
- // });
169
- // expect(branches.map((b) => b.name)).toEqual([
170
- // '7.x',
171
- // 'backport/6.0/pr-85_commit-2e63475c',
172
- // 'master',
173
- // ]);
174
- // });
175
- // it('should have cherry picked the correct commit', async () => {
176
- // const branches = await getBranches({
177
- // accessToken,
178
- // repoOwner: AUHTOR,
179
- // repoName: REPO_NAME,
180
- // });
181
- // const sha = branches.find((branch) => branch.name === '7.x')?.commit.sha;
182
- // expect(sha).toEqual('foo');
183
- // });
184
- // });
185
- describe('when disabling fork mode', () => {
186
- let res;
187
- let accessToken;
188
- let createPullRequestsMockCalls;
189
- beforeAll(async () => {
190
- accessToken = await (0, getDevAccessToken_1.getDevAccessToken)();
191
- await resetState(accessToken);
192
- createPullRequestsMockCalls = mockCreatePullRequest({
193
- number: 1337,
194
- html_url: 'myHtmlUrl',
195
- });
196
- const options = await (0, options_1.getOptions)([], {
197
- author: AUHTOR,
198
- githubApiBaseUrlV3: 'https://api.foo.com',
199
- ci: true,
200
- sha: '5bf29b7d847ea3dbde9280448f0f62ad0f22d3ad',
201
- accessToken,
202
- repoOwner: 'backport-org',
203
- repoName: 'integration-test',
204
- fork: false,
205
- });
206
- const commits = await (0, getCommits_1.getCommits)(options);
207
- const targetBranches = ['7.x'];
208
- res = await (0, runSequentially_1.runSequentially)({ options, commits, targetBranches });
209
- });
210
- it('sends the correct http body when creating pull request', () => {
211
- expect(createPullRequestsMockCalls).toMatchInlineSnapshot(`
212
- Array [
213
- Object {
214
- "base": "7.x",
215
- "body": "# Backport
216
-
217
- This is an automatic backport to \`7.x\` of:
218
- - Add ❤️ emoji (5bf29b7d)
219
-
220
- ### Questions ?
221
- Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
222
- ",
223
- "head": "backport-org:backport/7.x/commit-5bf29b7d",
224
- "title": "[7.x] Add ❤️ emoji",
225
- },
226
- ]
227
- `);
228
- });
229
- it('returns pull request', () => {
230
- expect(res).toEqual([
231
- {
232
- didUpdate: false,
233
- pullRequestNumber: 1337,
234
- pullRequestUrl: 'myHtmlUrl',
235
- status: 'success',
236
- targetBranch: '7.x',
237
- },
238
- ]);
239
- });
240
- it('should create new branches in origin (backport-org/integration-test)', async () => {
241
- const branches = await getBranches({
242
- accessToken,
243
- repoOwner: REPO_OWNER,
244
- repoName: REPO_NAME,
245
- });
246
- expect(branches.map((b) => b.name)).toEqual([
247
- '7.x',
248
- BRANCH_NAME,
249
- 'master',
250
- ]);
251
- });
252
- it('should NOT create branch in the fork (sqren/integration-test)', async () => {
253
- const branches = await getBranches({
254
- accessToken,
255
- repoOwner: AUHTOR,
256
- repoName: REPO_NAME,
257
- });
258
- expect(branches.map((b) => b.name)).toEqual(['7.x', 'master']);
259
- });
260
- it('should cherry pick the correct commit', async () => {
261
- const branches = await getBranches({
262
- accessToken,
263
- repoOwner: REPO_OWNER,
264
- repoName: REPO_NAME,
265
- });
266
- const sha = branches.find((branch) => branch.name === '7.x')?.commit.sha;
267
- expect(sha).toEqual('b68e4fcaaf4427fe1e902c718b3bb3f07b560fb5');
268
- });
269
- });
270
- });
271
- function mockCreatePullRequest(response) {
272
- const scope = (0, nock_1.default)('https://api.foo.com', { allowUnmocked: true })
273
- .post('/repos/backport-org/integration-test/pulls')
274
- .reply(200, response);
275
- return (0, nockHelpers_1.listenForCallsToNockScope)(scope);
276
- }
277
- async function getBranches({ accessToken, repoOwner, repoName, }) {
278
- // console.log(`fetch branches for ${repoOwner}`);
279
- const octokit = new rest_1.Octokit({
280
- auth: accessToken,
281
- });
282
- const res = await octokit.repos.listBranches({
283
- owner: repoOwner,
284
- repo: repoName,
285
- });
286
- return res.data;
287
- }
288
- async function deleteBranch({ accessToken, repoOwner, repoName, branchName, }) {
289
- try {
290
- const octokit = new rest_1.Octokit({
291
- auth: accessToken,
292
- });
293
- // console.log({ accessToken });
294
- const opts = {
295
- owner: repoOwner,
296
- repo: repoName,
297
- ref: `heads/${branchName}`,
298
- };
299
- const res = await octokit.git.deleteRef(opts);
300
- // console.log(`Deleted ${repoOwner}:heads/${branchName}`);
301
- return res.data;
302
- }
303
- catch (e) {
304
- // console.log(
305
- // `Could not delete ${repoOwner}:heads/${branchName} (${e.message})`
306
- // );
307
- if (e.message === 'Reference does not exist') {
308
- return;
309
- }
310
- throw e;
311
- }
312
- }
313
- async function resetState(accessToken) {
314
- await deleteBranch({
315
- accessToken,
316
- repoOwner: REPO_OWNER,
317
- repoName: REPO_NAME,
318
- branchName: BRANCH_NAME,
319
- });
320
- await deleteBranch({
321
- accessToken,
322
- repoOwner: AUHTOR,
323
- repoName: REPO_NAME,
324
- branchName: BRANCH_NAME,
325
- });
326
- await del(INTEGRATION_TEST_DATA_PATH);
327
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,214 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const lodash_1 = require("lodash");
7
- const nock_1 = __importDefault(require("nock"));
8
- const options_1 = require("../../options/options");
9
- const runWithOptions_1 = require("../../runWithOptions");
10
- const createSpies_1 = require("./createSpies");
11
- const envConstants_1 = require("./envConstants");
12
- const helpers_1 = require("./helpers");
13
- jest.unmock('make-dir');
14
- jest.unmock('del');
15
- describe('integration', () => {
16
- afterAll(() => {
17
- nock_1.default.cleanAll();
18
- });
19
- describe('when a single commit is backported', () => {
20
- let res;
21
- let spies;
22
- beforeEach((0, lodash_1.once)(async () => {
23
- jest.clearAllMocks();
24
- spies = (0, createSpies_1.createSpies)({ commitCount: 1 });
25
- await (0, helpers_1.deleteAndSetupEnvironment)();
26
- const options = await (0, options_1.getOptions)([], {
27
- // use localhost to avoid CORS issues
28
- githubApiBaseUrlV4: 'http://localhost/graphql',
29
- });
30
- res = await (0, runWithOptions_1.runWithOptions)(options);
31
- }));
32
- it('returns pull request', () => {
33
- expect(res).toEqual([
34
- { pullRequestUrl: 'myHtmlUrl', success: true, targetBranch: '6.0' },
35
- ]);
36
- });
37
- it('sends the correct http body when creating pull request', () => {
38
- expect(spies.createPullRequestCalls).toEqual([
39
- {
40
- base: '6.0',
41
- body: 'Backports the following commits to 6.0:\n - #85',
42
- head: 'sqren:backport/6.0/pr-85',
43
- title: '[6.0] Add witch (#85)',
44
- },
45
- ]);
46
- });
47
- it('should make correct API requests', () => {
48
- expect(spies.getGithubConfigOptionsCalls).toMatchSnapshot();
49
- expect(spies.authorIdCalls).toMatchSnapshot();
50
- expect(spies.commitsByAuthorCalls).toMatchSnapshot();
51
- });
52
- it('should not create new branches in origin (backport-org/backport-demo)', async () => {
53
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_ORIGIN_REPO_PATH);
54
- expect(branches).toEqual(['6.0', '* master']);
55
- });
56
- it('should create branch in the fork (sqren/backport-demo)', async () => {
57
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_FORK_REPO_PATH);
58
- expect(branches).toEqual(['6.0', 'backport/6.0/pr-85', '* master']);
59
- });
60
- it('should have cherry picked the correct commit', async () => {
61
- const commit = await (0, helpers_1.getLatestCommit)({
62
- branch: 'backport/6.0/pr-85',
63
- commitCount: 1,
64
- cwd: envConstants_1.REMOTE_FORK_REPO_PATH,
65
- });
66
- expect(commit).toMatchInlineSnapshot(`
67
- " romeo-and-juliet.txt | 2 +-
68
- 1 file changed, 1 insertion(+), 1 deletion(-)
69
-
70
- diff --git a/romeo-and-juliet.txt b/romeo-and-juliet.txt
71
- index 87f1ac7..51e1e4b 100644
72
- --- a/romeo-and-juliet.txt
73
- +++ b/romeo-and-juliet.txt
74
- @@ -158 +158 @@ Thereto prick'd on by a most emulate pride,
75
- -Dared to the combat; in which our valiant Hamlet--
76
- +Dared to the combat; in 🧙‍♀️ our valiant Hamlet--
77
- "
78
- `);
79
- });
80
- });
81
- describe('when two commits are backported', () => {
82
- let spies;
83
- let res;
84
- beforeEach((0, lodash_1.once)(async () => {
85
- jest.clearAllMocks();
86
- spies = (0, createSpies_1.createSpies)({ commitCount: 2 });
87
- await (0, helpers_1.deleteAndSetupEnvironment)();
88
- const options = await (0, options_1.getOptions)([], {
89
- // use localhost to avoid CORS issues
90
- githubApiBaseUrlV4: 'http://localhost/graphql',
91
- });
92
- res = await (0, runWithOptions_1.runWithOptions)(options);
93
- }));
94
- it('sends the correct http body when creating pull request', () => {
95
- expect(spies.createPullRequestCalls).toEqual([
96
- {
97
- title: '[6.0] Add witch (#85) | Add 👻',
98
- head: 'sqren:backport/6.0/pr-85_commit-2e63475c',
99
- base: '6.0',
100
- body: 'Backports the following commits to 6.0:\n - #85\n - Add 👻 (2e63475c)',
101
- },
102
- ]);
103
- });
104
- it('returns pull request', () => {
105
- expect(res).toEqual([
106
- { pullRequestUrl: 'myHtmlUrl', success: true, targetBranch: '6.0' },
107
- ]);
108
- });
109
- it('should make correct API requests', () => {
110
- expect(spies.getGithubConfigOptionsCalls).toMatchSnapshot();
111
- expect(spies.authorIdCalls).toMatchSnapshot();
112
- expect(spies.commitsByAuthorCalls).toMatchSnapshot();
113
- });
114
- it('should not create new branches in origin (backport-org/backport-demo)', async () => {
115
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_ORIGIN_REPO_PATH);
116
- expect(branches).toEqual(['6.0', '* master']);
117
- });
118
- it('should create branch in the fork (sqren/backport-demo)', async () => {
119
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_FORK_REPO_PATH);
120
- expect(branches).toEqual([
121
- '6.0',
122
- 'backport/6.0/pr-85_commit-2e63475c',
123
- '* master',
124
- ]);
125
- });
126
- it('should have cherry picked the correct commit', async () => {
127
- const commit = await (0, helpers_1.getLatestCommit)({
128
- branch: 'backport/6.0/pr-85_commit-2e63475c',
129
- commitCount: 2,
130
- cwd: envConstants_1.REMOTE_FORK_REPO_PATH,
131
- });
132
- expect(commit).toMatchInlineSnapshot(`
133
- " romeo-and-juliet.txt | 2 +-
134
- 1 file changed, 1 insertion(+), 1 deletion(-)
135
-
136
- diff --git a/romeo-and-juliet.txt b/romeo-and-juliet.txt
137
- index 51e1e4b..4814bb0 100644
138
- --- a/romeo-and-juliet.txt
139
- +++ b/romeo-and-juliet.txt
140
- @@ -203 +203 @@ But soft, behold! lo, where it comes again!
141
- -Re-enter Ghost
142
- +Re-enter 👻
143
- romeo-and-juliet.txt | 2 +-
144
- 1 file changed, 1 insertion(+), 1 deletion(-)
145
-
146
- diff --git a/romeo-and-juliet.txt b/romeo-and-juliet.txt
147
- index 87f1ac7..51e1e4b 100644
148
- --- a/romeo-and-juliet.txt
149
- +++ b/romeo-and-juliet.txt
150
- @@ -158 +158 @@ Thereto prick'd on by a most emulate pride,
151
- -Dared to the combat; in which our valiant Hamlet--
152
- +Dared to the combat; in 🧙‍♀️ our valiant Hamlet--
153
- "
154
- `);
155
- });
156
- });
157
- describe('when disabling fork mode', () => {
158
- let res;
159
- let spies;
160
- beforeEach((0, lodash_1.once)(async () => {
161
- jest.clearAllMocks();
162
- spies = (0, createSpies_1.createSpies)({ commitCount: 1 });
163
- await (0, helpers_1.deleteAndSetupEnvironment)();
164
- const options = await (0, options_1.getOptions)(['--fork=false'], {
165
- // use localhost to avoid CORS issues
166
- githubApiBaseUrlV4: 'http://localhost/graphql',
167
- });
168
- res = await (0, runWithOptions_1.runWithOptions)(options);
169
- }));
170
- it('sends the correct http body when creating pull request', () => {
171
- expect(spies.createPullRequestCalls).toEqual([
172
- {
173
- base: '6.0',
174
- body: 'Backports the following commits to 6.0:\n - #85',
175
- head: 'backport-org:backport/6.0/pr-85',
176
- title: '[6.0] Add witch (#85)',
177
- },
178
- ]);
179
- });
180
- it('returns pull request', () => {
181
- expect(res).toEqual([
182
- { pullRequestUrl: 'myHtmlUrl', success: true, targetBranch: '6.0' },
183
- ]);
184
- });
185
- it('should create new branches in origin (backport-org/backport-demo)', async () => {
186
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_ORIGIN_REPO_PATH);
187
- expect(branches).toEqual(['6.0', 'backport/6.0/pr-85', '* master']);
188
- });
189
- it('should NOT create branch in the fork (sqren/backport-demo)', async () => {
190
- const branches = await (0, helpers_1.getBranches)(envConstants_1.REMOTE_FORK_REPO_PATH);
191
- expect(branches).toEqual(['6.0', '* master']);
192
- });
193
- it('should cherry pick the correct commit', async () => {
194
- const commit = await (0, helpers_1.getLatestCommit)({
195
- branch: 'backport/6.0/pr-85',
196
- commitCount: 1,
197
- cwd: envConstants_1.REMOTE_ORIGIN_REPO_PATH,
198
- });
199
- expect(commit).toMatchInlineSnapshot(`
200
- " romeo-and-juliet.txt | 2 +-
201
- 1 file changed, 1 insertion(+), 1 deletion(-)
202
-
203
- diff --git a/romeo-and-juliet.txt b/romeo-and-juliet.txt
204
- index 87f1ac7..51e1e4b 100644
205
- --- a/romeo-and-juliet.txt
206
- +++ b/romeo-and-juliet.txt
207
- @@ -158 +158 @@ Thereto prick'd on by a most emulate pride,
208
- -Dared to the combat; in which our valiant Hamlet--
209
- +Dared to the combat; in 🧙‍♀️ our valiant Hamlet--
210
- "
211
- `);
212
- });
213
- });
214
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const entrypoint_module_1 = require("./entrypoint.module");
4
- async function init() {
5
- const { accessToken } = await (0, entrypoint_module_1.getLocalGlobalConfig)();
6
- if (!accessToken) {
7
- throw new Error('Missing access token');
8
- }
9
- const commit = await (0, entrypoint_module_1.getCommits)({
10
- accessToken: accessToken,
11
- repoOwner: 'backport-org',
12
- repoName: 'repo-with-conflicts',
13
- pullNumber: 8,
14
- });
15
- console.log({ commit });
16
- }
17
- init();
@@ -1,85 +0,0 @@
1
- import { ValidConfigOptions } from '../options/options';
2
- export interface Commit {
3
- committedDate: string;
4
- sourceBranch: string;
5
- targetBranchesFromLabels: string[];
6
- sha: string;
7
- formattedMessage: string;
8
- originalMessage: string;
9
- pullNumber?: number;
10
- existingTargetPullRequests: ExistingTargetPullRequests;
11
- }
12
- export interface PullRequestNode {
13
- baseRefName: string;
14
- number: number;
15
- mergeCommit: {
16
- committedDate: string;
17
- oid: string;
18
- message: string;
19
- } | null;
20
- labels: {
21
- nodes: {
22
- name: string;
23
- }[];
24
- };
25
- repository: {
26
- owner: {
27
- login: string;
28
- };
29
- name: string;
30
- };
31
- timelineItems: {
32
- edges: Array<TimelineEdge>;
33
- };
34
- }
35
- declare type TimelineEdge = TimelinePullRequestEdge | TimelineIssueEdge;
36
- interface TimelinePullRequestEdge {
37
- node: {
38
- source: {
39
- __typename: 'PullRequest';
40
- title: string;
41
- state: 'OPEN' | 'CLOSED' | 'MERGED';
42
- baseRefName: string;
43
- number: number;
44
- commits: {
45
- edges: CommitEdge[];
46
- };
47
- };
48
- };
49
- }
50
- interface TimelineIssueEdge {
51
- node: {
52
- source: {
53
- __typename: 'Issue';
54
- };
55
- };
56
- }
57
- interface CommitEdge {
58
- node: {
59
- commit: {
60
- message: string;
61
- };
62
- };
63
- }
64
- export declare type CommitNode = {
65
- oid: string;
66
- message: string;
67
- committedDate: string;
68
- associatedPullRequests: {
69
- edges: {
70
- node: PullRequestNode;
71
- }[] | null;
72
- };
73
- };
74
- export declare function getCommit(options: ValidConfigOptions, commitNode: CommitNode): Commit;
75
- export declare const commitNodeFragment: {
76
- name: string;
77
- source: string;
78
- };
79
- export declare type ExistingTargetPullRequests = ReturnType<typeof getExistingTargetPullRequests>;
80
- export declare function getExistingTargetPullRequests(sourcePullRequest?: PullRequestNode): {
81
- number: number;
82
- branch: string;
83
- state: "OPEN" | "CLOSED" | "MERGED";
84
- }[];
85
- export {};