backport 8.0.0 → 8.3.0-beta.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/README.md +4 -4
- package/dist/backportRun.d.ts +5 -4
- package/dist/backportRun.js +42 -48
- package/dist/entrypoint.cli.js +3 -7
- package/dist/entrypoint.module.d.ts +7 -5
- package/dist/entrypoint.module.js +11 -9
- package/dist/entrypoint.module.private.test.js +25 -4
- package/dist/errors/BackportError.d.ts +19 -0
- package/dist/errors/BackportError.js +29 -0
- package/dist/lib/BackportError.d.ts +19 -0
- package/dist/lib/BackportError.js +29 -0
- package/dist/lib/cherrypickAndCreateTargetPullRequest.d.ts +11 -0
- package/dist/lib/cherrypickAndCreateTargetPullRequest.js +242 -0
- package/dist/lib/cherrypickAndCreateTargetPullRequest.test.d.ts +1 -0
- package/dist/lib/cherrypickAndCreateTargetPullRequest.test.js +321 -0
- package/dist/lib/child-process-promisified.d.ts +25 -0
- package/dist/lib/child-process-promisified.js +60 -0
- package/dist/lib/env.d.ts +9 -0
- package/dist/lib/env.js +33 -0
- package/dist/lib/env.test.d.ts +1 -0
- package/dist/lib/env.test.js +26 -0
- package/dist/lib/getCommits.d.ts +2 -0
- package/dist/lib/getCommits.js +75 -0
- package/dist/lib/getCommitsWithoutBackports.d.ts +11 -0
- package/dist/lib/getCommitsWithoutBackports.js +68 -0
- package/dist/lib/getCommitsWithoutBackports.test.d.ts +1 -0
- package/dist/lib/getCommitsWithoutBackports.test.js +335 -0
- package/dist/lib/getGitConfigAuthor.d.ts +6 -0
- package/dist/lib/getGitConfigAuthor.js +15 -0
- package/dist/lib/getTargetBranches.d.ts +5 -0
- package/dist/lib/getTargetBranches.js +67 -0
- package/dist/lib/getTargetBranches.test.d.ts +1 -0
- package/dist/lib/getTargetBranches.test.js +210 -0
- package/dist/lib/git.d.ts +77 -0
- package/dist/lib/git.js +439 -0
- package/dist/lib/git.private.test.d.ts +1 -0
- package/dist/lib/git.private.test.js +618 -0
- package/dist/lib/git.test.d.ts +1 -0
- package/dist/lib/git.test.js +580 -0
- package/dist/lib/github/commitFormatters.d.ts +3 -0
- package/dist/lib/github/commitFormatters.js +17 -0
- package/dist/lib/github/commitFormatters.test.d.ts +1 -0
- package/dist/lib/github/commitFormatters.test.js +11 -0
- package/dist/lib/github/v3/addAssigneesToPullRequest.d.ts +2 -0
- package/dist/lib/github/v3/addAssigneesToPullRequest.js +32 -0
- package/dist/lib/github/v3/addAssigneesToPullRequest.test.d.ts +1 -0
- package/dist/lib/github/v3/addAssigneesToPullRequest.test.js +27 -0
- package/dist/lib/github/v3/addLabelsToPullRequest.d.ts +2 -0
- package/dist/lib/github/v3/addLabelsToPullRequest.js +30 -0
- package/dist/lib/github/v3/addReviewersToPullRequest.d.ts +2 -0
- package/dist/lib/github/v3/addReviewersToPullRequest.js +32 -0
- package/dist/lib/github/v3/createPullRequest.d.ts +29 -0
- package/dist/lib/github/v3/createPullRequest.js +91 -0
- package/dist/lib/github/v3/createPullRequest.test.d.ts +1 -0
- package/dist/lib/github/v3/createPullRequest.test.js +377 -0
- package/dist/lib/github/v3/createStatusComment.d.ts +11 -0
- package/dist/lib/github/v3/createStatusComment.js +138 -0
- package/dist/lib/github/v3/createStatusComment.test.d.ts +1 -0
- package/dist/lib/github/v3/createStatusComment.test.js +566 -0
- package/dist/lib/github/v3/getGithubV3ErrorMessage.d.ts +14 -0
- package/dist/lib/github/v3/getGithubV3ErrorMessage.js +16 -0
- package/dist/lib/github/v4/FetchPullRequestId.d.ts +2 -0
- package/dist/lib/github/v4/FetchPullRequestId.js +36 -0
- package/dist/lib/github/v4/apiRequestV4.d.ts +31 -0
- package/dist/lib/github/v4/apiRequestV4.js +71 -0
- package/dist/lib/github/v4/apiRequestV4.test.d.ts +1 -0
- package/dist/lib/github/v4/apiRequestV4.test.js +109 -0
- package/dist/lib/github/v4/disablePullRequestAutoMerge.d.ts +2 -0
- package/dist/lib/github/v4/disablePullRequestAutoMerge.js +32 -0
- package/dist/lib/github/v4/enablePullRequestAutoMerge.d.ts +2 -0
- package/dist/lib/github/v4/enablePullRequestAutoMerge.js +50 -0
- package/dist/lib/github/v4/enablePullRequestAutoMerge.private.test.d.ts +1 -0
- package/dist/lib/github/v4/enablePullRequestAutoMerge.private.test.js +112 -0
- package/dist/lib/github/v4/fetchAuthorId.d.ts +10 -0
- package/dist/lib/github/v4/fetchAuthorId.js +28 -0
- package/dist/lib/github/v4/fetchAuthorId.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchAuthorId.private.test.js +25 -0
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.js +93 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.d.ts +11 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.js +58 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +136 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.d.ts +11 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.js +48 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.private.test.js +118 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +29 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.js +110 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +196 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +157 -0
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +107 -0
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.d.ts +12 -0
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.js +69 -0
- package/dist/lib/github/v4/fetchExistingPullRequest.d.ts +9 -0
- package/dist/lib/github/v4/fetchExistingPullRequest.js +64 -0
- package/dist/lib/github/v4/fetchExistingPullRequest.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchExistingPullRequest.private.test.js +44 -0
- package/dist/lib/github/v4/fetchPullRequestAutoMergeMethod.d.ts +2 -0
- package/dist/lib/github/v4/fetchPullRequestAutoMergeMethod.js +39 -0
- package/dist/lib/github/v4/fetchRemoteProjectConfig.d.ts +8 -0
- package/dist/lib/github/v4/fetchRemoteProjectConfig.js +49 -0
- package/dist/lib/github/v4/fetchRemoteProjectConfig.private.test.d.ts +1 -0
- package/dist/lib/github/v4/fetchRemoteProjectConfig.private.test.js +49 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +72 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +78 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.d.ts +1 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +116 -0
- package/dist/lib/github/v4/getOptionsFromGithub/query.d.ts +16 -0
- package/dist/lib/github/v4/getOptionsFromGithub/query.js +29 -0
- package/dist/lib/github/v4/getRepoOwnerAndNameFromGitRemotes.d.ts +29 -0
- package/dist/lib/github/v4/getRepoOwnerAndNameFromGitRemotes.js +61 -0
- package/dist/lib/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.d.ts +1 -0
- package/dist/lib/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +72 -0
- package/dist/lib/github/v4/mocks/commitsByAuthorMock.d.ts +2 -0
- package/dist/lib/github/v4/mocks/commitsByAuthorMock.js +176 -0
- package/dist/lib/github/v4/throwOnInvalidAccessToken.d.ts +7 -0
- package/dist/lib/github/v4/throwOnInvalidAccessToken.js +45 -0
- package/dist/lib/github/v4/throwOnInvalidAccessToken.test.d.ts +1 -0
- package/dist/lib/github/v4/throwOnInvalidAccessToken.test.js +87 -0
- package/dist/lib/github/v4/validateTargetBranches.d.ts +9 -0
- package/dist/lib/github/v4/validateTargetBranches.js +46 -0
- package/dist/lib/github/v4/validateTargetBranches.private.test.d.ts +1 -0
- package/dist/lib/github/v4/validateTargetBranches.private.test.js +51 -0
- package/dist/lib/logger.d.ts +11 -0
- package/dist/lib/logger.js +80 -0
- package/dist/lib/ora.d.ts +2 -0
- package/dist/lib/ora.js +21 -0
- package/dist/lib/prompt.test.d.ts +1 -0
- package/dist/lib/prompt.test.js +139 -0
- package/dist/lib/prompts.d.ts +17 -0
- package/dist/lib/prompts.js +132 -0
- package/dist/lib/remoteConfig.d.ts +20 -0
- package/dist/lib/remoteConfig.js +52 -0
- package/dist/lib/sequentially.d.ts +1 -0
- package/dist/lib/sequentially.js +10 -0
- package/dist/lib/setupRepo.d.ts +2 -0
- package/dist/lib/setupRepo.js +56 -0
- package/dist/lib/setupRepo.test.d.ts +1 -0
- package/dist/lib/setupRepo.test.js +278 -0
- package/dist/lib/sourceCommit/getExpectedTargetPullRequests.d.ts +16 -0
- package/dist/lib/sourceCommit/getExpectedTargetPullRequests.js +102 -0
- package/dist/lib/sourceCommit/getExpectedTargetPullRequests.test.d.ts +1 -0
- package/dist/lib/sourceCommit/getExpectedTargetPullRequests.test.js +467 -0
- package/dist/lib/sourceCommit/getMockSourceCommit.d.ts +26 -0
- package/dist/lib/sourceCommit/getMockSourceCommit.js +103 -0
- package/dist/lib/sourceCommit/parseSourceCommit.d.ts +108 -0
- package/dist/lib/sourceCommit/parseSourceCommit.js +123 -0
- package/dist/lib/sourceCommit/parseSourceCommit.test.d.ts +1 -0
- package/dist/lib/sourceCommit/parseSourceCommit.test.js +226 -0
- package/dist/options/ConfigOptions.d.ts +4 -2
- package/dist/options/cliArgs.d.ts +12 -9
- package/dist/options/cliArgs.js +34 -19
- package/dist/options/cliArgs.test.js +126 -2
- package/dist/options/config/config.d.ts +5 -4
- package/dist/options/config/config.js +3 -5
- package/dist/options/config/config.test.js +0 -1
- package/dist/options/config/globalConfig.d.ts +3 -1
- package/dist/options/config/globalConfig.js +5 -5
- package/dist/options/config/readConfigFile.d.ts +6 -4
- package/dist/options/config/readConfigFile.js +2 -2
- package/dist/options/options.d.ts +40 -4
- package/dist/options/options.js +20 -24
- package/dist/options/options.test.js +112 -54
- package/dist/runSequentially.d.ts +10 -9
- package/dist/runSequentially.js +7 -8
- package/dist/scripts/postinstall.js +3 -3
- package/dist/scripts/postinstall.test.js +1 -1
- package/dist/services/BackportError.d.ts +19 -0
- package/dist/services/BackportError.js +29 -0
- package/dist/services/HandledBackportError.d.ts +19 -0
- package/dist/services/HandledBackportError.js +29 -0
- package/dist/services/HandledError.d.ts +1 -1
- package/dist/services/HandledError.js +5 -5
- package/dist/services/git.js +7 -7
- package/dist/services/github/v3/createPullRequest.js +2 -2
- package/dist/services/github/v3/createStatusComment.js +2 -2
- package/dist/services/github/v3/createStatusComment.test.js +5 -4
- package/dist/services/github/v4/apiRequestV4.js +2 -2
- package/dist/services/github/v4/apiRequestV4.test.js +2 -2
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +3 -3
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +2 -2
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +3 -3
- package/dist/services/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.js +2 -2
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +2 -2
- package/dist/services/github/v4/throwOnInvalidAccessToken.js +5 -5
- package/dist/state.d.ts +0 -0
- package/dist/state.js +1 -0
- package/dist/test/e2e/cli/commit-author.private.test.js +4 -4
- package/dist/test/e2e/cli/different-merge-strategies.private.test.js +27 -25
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +46 -250
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.js +80 -0
- package/dist/test/e2e/cli/error-handling-non-interactive-mode.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/error-handling-non-interactive-mode.private.test.js +199 -0
- package/dist/test/e2e/cli/interactive-error-handling.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/interactive-error-handling.private.test.js +80 -0
- package/dist/test/e2e/cli/non-interactive-error-handling.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/non-interactive-error-handling.private.test.js +198 -0
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.js +13 -15
- package/dist/test/e2e/cli/runBackportViaCli.d.ts +5 -2
- package/dist/test/e2e/cli/runBackportViaCli.js +42 -29
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js +22 -14
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +2 -2
- package/dist/test/handleUnbackportedPullRequests.private.test.js +3 -2
- package/dist/test/setupFiles/automatic-mocks.js +1 -1
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +3 -3
- package/dist/ui/getCommits.js +2 -2
- package/dist/ui/getTargetBranches.js +3 -3
- package/dist/ui/setupRepo.js +2 -2
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +14 -14
- package/yarn.lock +125 -73
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const child_process_promisified_1 = require("../../../
|
|
3
|
+
const child_process_promisified_1 = require("../../../lib/child-process-promisified");
|
|
4
4
|
const getDevAccessToken_1 = require("../../private/getDevAccessToken");
|
|
5
5
|
const sandbox_1 = require("../../sandbox");
|
|
6
6
|
const runBackportViaCli_1 = require("./runBackportViaCli");
|
|
@@ -15,30 +15,42 @@ describe('test-that-repo-can-be-cloned', () => {
|
|
|
15
15
|
function run() {
|
|
16
16
|
return (0, runBackportViaCli_1.runBackportViaCli)([
|
|
17
17
|
'--repo=backport-org/test-that-repo-can-be-cloned',
|
|
18
|
-
'--branch=
|
|
18
|
+
'--branch=production',
|
|
19
19
|
'--pr=1',
|
|
20
20
|
`--dir=${sandboxPath}`,
|
|
21
21
|
'--dry-run',
|
|
22
22
|
`--accessToken=${accessToken}`,
|
|
23
|
-
], { showOra: true
|
|
23
|
+
], { showOra: true });
|
|
24
24
|
}
|
|
25
25
|
it('clones the repo remote repo', async () => {
|
|
26
|
-
const output = await run();
|
|
26
|
+
const { output } = await run();
|
|
27
27
|
expect(output).toContain('Cloning repository from github.com');
|
|
28
28
|
expect(output).toMatchInlineSnapshot(`
|
|
29
29
|
"- Initializing...
|
|
30
30
|
? Select pull request Beginning of a beautiful repo (#1)
|
|
31
31
|
✔ 100% Cloning repository from github.com (one-time operation)
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
Backporting to production:
|
|
34
|
+
- Pulling latest changes
|
|
35
|
+
✔ Pulling latest changes
|
|
36
|
+
- Cherry-picking: Beginning of a beautiful repo (#1)
|
|
37
|
+
✔ Cherry-picking: Beginning of a beautiful repo (#1)
|
|
38
|
+
✔ Dry run complete"
|
|
33
39
|
`);
|
|
34
40
|
});
|
|
35
41
|
it('does not clone again on subsequent runs', async () => {
|
|
36
|
-
const output = await run();
|
|
42
|
+
const { output } = await run();
|
|
37
43
|
expect(output).not.toContain('Cloning repository from github.com');
|
|
38
44
|
expect(output).toMatchInlineSnapshot(`
|
|
39
45
|
"- Initializing...
|
|
40
46
|
? Select pull request Beginning of a beautiful repo (#1)
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
Backporting to production:
|
|
49
|
+
- Pulling latest changes
|
|
50
|
+
✔ Pulling latest changes
|
|
51
|
+
- Cherry-picking: Beginning of a beautiful repo (#1)
|
|
52
|
+
✔ Cherry-picking: Beginning of a beautiful repo (#1)
|
|
53
|
+
✔ Dry run complete"
|
|
42
54
|
`);
|
|
43
55
|
});
|
|
44
56
|
});
|
|
@@ -54,19 +66,15 @@ describe('test-that-repo-can-be-cloned', () => {
|
|
|
54
66
|
});
|
|
55
67
|
function run() {
|
|
56
68
|
return (0, runBackportViaCli_1.runBackportViaCli)([
|
|
57
|
-
'--branch=
|
|
69
|
+
'--branch=production',
|
|
58
70
|
'--pr=1',
|
|
59
71
|
`--dir=${backportRepo}`,
|
|
60
72
|
'--dry-run',
|
|
61
73
|
`--accessToken=${accessToken}`,
|
|
62
|
-
], {
|
|
63
|
-
cwd: sourceRepo,
|
|
64
|
-
showOra: true,
|
|
65
|
-
waitForString: 'Backporting to foo:',
|
|
66
|
-
});
|
|
74
|
+
], { cwd: sourceRepo, showOra: true });
|
|
67
75
|
}
|
|
68
76
|
it('clones using the local repo', async () => {
|
|
69
|
-
const output = await run();
|
|
77
|
+
const { output } = await run();
|
|
70
78
|
expect(output).toEqual(expect.stringMatching(/100% Cloning repository from .*\/src\/test\/_tmp_sandbox_\/test-that-repo-can-be-cloned.private.test\/source \(one-time operation\)/gm));
|
|
71
79
|
});
|
|
72
80
|
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const rest_1 = require("@octokit/rest");
|
|
4
4
|
const entrypoint_module_1 = require("../../../entrypoint.module");
|
|
5
|
-
const commitFormatters_1 = require("../../../
|
|
5
|
+
const commitFormatters_1 = require("../../../lib/github/commitFormatters");
|
|
6
6
|
const getDevAccessToken_1 = require("../../private/getDevAccessToken");
|
|
7
7
|
const sandbox_1 = require("../../sandbox");
|
|
8
8
|
jest.unmock('find-up');
|
|
9
9
|
jest.unmock('del');
|
|
10
10
|
jest.unmock('make-dir');
|
|
11
|
-
jest.setTimeout(
|
|
11
|
+
jest.setTimeout(10000);
|
|
12
12
|
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
13
13
|
const octokit = new rest_1.Octokit({ auth: accessToken });
|
|
14
14
|
const sandboxPath = (0, sandbox_1.getSandboxPath)({ filename: __filename });
|
|
@@ -45,8 +45,9 @@ describe('Handle unbackported pull requests', () => {
|
|
|
45
45
|
pullNumber: 12,
|
|
46
46
|
targetBranches: ['7.x'],
|
|
47
47
|
dir: sandboxPath,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
interactive: false,
|
|
49
|
+
publishStatusCommentOnSuccess: false,
|
|
50
|
+
publishStatusCommentOnFailure: false,
|
|
50
51
|
},
|
|
51
52
|
});
|
|
52
53
|
const commit =
|
|
@@ -47,7 +47,7 @@ jest.mock('del', () => {
|
|
|
47
47
|
return jest.fn(async (path) => `Attempted to delete ${path}`);
|
|
48
48
|
});
|
|
49
49
|
(0, mocks_1.mockOra)();
|
|
50
|
-
jest.mock('../../
|
|
50
|
+
jest.mock('../../lib/logger', () => {
|
|
51
51
|
const spy = jest.fn();
|
|
52
52
|
const logger = {
|
|
53
53
|
spy: spy,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.cherrypickAndCreateTargetPullRequest = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
8
|
const lodash_1 = require("lodash");
|
|
9
|
-
const
|
|
9
|
+
const BackportError_1 = require("../services/BackportError");
|
|
10
10
|
const child_process_promisified_1 = require("../services/child-process-promisified");
|
|
11
11
|
const env_1 = require("../services/env");
|
|
12
12
|
const git_1 = require("../services/git");
|
|
@@ -150,7 +150,7 @@ async function waitForCherrypick(options, commit, targetBranch, gitConfigAuthor)
|
|
|
150
150
|
conflictingFiles: conflictingFilesRelative,
|
|
151
151
|
});
|
|
152
152
|
if (options.ci) {
|
|
153
|
-
throw new
|
|
153
|
+
throw new BackportError_1.BackportError({
|
|
154
154
|
code: 'merge-conflict-exception',
|
|
155
155
|
commitsWithoutBackports,
|
|
156
156
|
conflictingFiles: conflictingFilesRelative,
|
|
@@ -212,7 +212,7 @@ ${unstagedSection}
|
|
|
212
212
|
|
|
213
213
|
Press ENTER when the conflicts are resolved and files are staged`);
|
|
214
214
|
if (!didConfirm) {
|
|
215
|
-
throw new
|
|
215
|
+
throw new BackportError_1.BackportError({ code: 'abort-exception' });
|
|
216
216
|
}
|
|
217
217
|
const MAX_RETRIES = 100;
|
|
218
218
|
if (retries++ > MAX_RETRIES) {
|
package/dist/ui/getCommits.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getCommits = void 0;
|
|
7
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
-
const
|
|
8
|
+
const BackportError_1 = require("../services/BackportError");
|
|
9
9
|
const commitFormatters_1 = require("../services/github/commitFormatters");
|
|
10
10
|
const fetchCommitByPullNumber_1 = require("../services/github/v4/fetchCommits/fetchCommitByPullNumber");
|
|
11
11
|
const fetchCommitBySha_1 = require("../services/github/v4/fetchCommits/fetchCommitBySha");
|
|
@@ -41,7 +41,7 @@ async function getCommits(options) {
|
|
|
41
41
|
return [commit];
|
|
42
42
|
}
|
|
43
43
|
if (options.ci && !options.ls) {
|
|
44
|
-
throw new
|
|
44
|
+
throw new BackportError_1.BackportError('When "--ci" flag is enabled either `--sha` or `--pr` must be specified');
|
|
45
45
|
}
|
|
46
46
|
spinner.text = options.prFilter
|
|
47
47
|
? 'Loading pull requests...'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTargetBranchChoices = exports.getTargetBranches = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
|
-
const
|
|
5
|
+
const BackportError_1 = require("../services/BackportError");
|
|
6
6
|
const prompts_1 = require("../services/prompts");
|
|
7
7
|
function getTargetBranches(options, commits) {
|
|
8
8
|
// target branches already specified (in contrast to letting the user choose from a list)
|
|
@@ -18,7 +18,7 @@ function getTargetBranches(options, commits) {
|
|
|
18
18
|
// automatically backport to specified target branches
|
|
19
19
|
if (options.ci) {
|
|
20
20
|
if ((0, lodash_1.isEmpty)(missingTargetBranches)) {
|
|
21
|
-
throw new
|
|
21
|
+
throw new BackportError_1.BackportError({ code: 'no-branches-exception' });
|
|
22
22
|
}
|
|
23
23
|
return missingTargetBranches;
|
|
24
24
|
}
|
|
@@ -37,7 +37,7 @@ function getTargetBranchChoices(options, missingTargetBranches, sourceBranch) {
|
|
|
37
37
|
// exclude sourceBranch from targetBranchChoices
|
|
38
38
|
const targetBranchesChoices = getTargetBranchChoicesAsObject(options.targetBranchChoices).filter((choice) => choice.name !== sourceBranch);
|
|
39
39
|
if ((0, lodash_1.isEmpty)(targetBranchesChoices)) {
|
|
40
|
-
throw new
|
|
40
|
+
throw new BackportError_1.BackportError('Missing target branch choices');
|
|
41
41
|
}
|
|
42
42
|
if (!options.branchLabelMapping) {
|
|
43
43
|
return targetBranchesChoices;
|
package/dist/ui/setupRepo.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupRepo = void 0;
|
|
4
4
|
const del = require("del");
|
|
5
|
-
const
|
|
5
|
+
const BackportError_1 = require("../services/BackportError");
|
|
6
6
|
const env_1 = require("../services/env");
|
|
7
7
|
const git_1 = require("../services/git");
|
|
8
8
|
const ora_1 = require("./ora");
|
|
@@ -10,7 +10,7 @@ async function setupRepo(options) {
|
|
|
10
10
|
const repoPath = (0, env_1.getRepoPath)(options);
|
|
11
11
|
const isAlreadyCloned = await getIsRepoCloned(options);
|
|
12
12
|
if (options.cwd.includes(repoPath)) {
|
|
13
|
-
throw new
|
|
13
|
+
throw new BackportError_1.BackportError(`Refusing to clone repo into "${repoPath}" when current working directory is "${options.cwd}". Please change backport directory via \`--dir\` option or run backport from another location`);
|
|
14
14
|
}
|
|
15
15
|
// clone repo if folder does not already exists
|
|
16
16
|
if (!isAlreadyCloned) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "8.0.
|
|
1
|
+
export declare const PACKAGE_VERSION = "8.3.0-beta.1";
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"branches",
|
|
15
15
|
"branching"
|
|
16
16
|
],
|
|
17
|
-
"version": "8.0.
|
|
17
|
+
"version": "8.3.0-beta.1",
|
|
18
18
|
"main": "./dist/entrypoint.module.js",
|
|
19
19
|
"types": "dist/entrypoint.module.d.ts",
|
|
20
20
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"lint-and-test": "yarn tsc && yarn lint && yarn test-all",
|
|
31
31
|
"lint": "echo \"Running lint\" && eslint './**/*.{ts,js}'",
|
|
32
32
|
"start": "ts-node --transpile-only ./src/entrypoint.cli.ts",
|
|
33
|
-
"test-all": "jest --config ./jest.config.all.js",
|
|
33
|
+
"test-all": "rm -rf src/test/_tmp_sandbox_ && jest --config ./jest.config.all.js",
|
|
34
34
|
"test-mutation": "jest --config ./jest.config.mutation.js",
|
|
35
35
|
"test-private": "jest --config ./jest.config.private.js",
|
|
36
36
|
"test": "jest",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@octokit/rest": "^18.12.0",
|
|
68
|
-
"axios": "^0.26.
|
|
68
|
+
"axios": "^0.26.1",
|
|
69
69
|
"dedent": "^0.7.0",
|
|
70
70
|
"del": "^6.0.0",
|
|
71
71
|
"dotenv": "^16.0.0",
|
|
72
72
|
"find-up": "^5.0.0",
|
|
73
73
|
"graphql": "^16.3.0",
|
|
74
74
|
"graphql-tag": "^2.12.6",
|
|
75
|
-
"inquirer": "^8.2.
|
|
75
|
+
"inquirer": "^8.2.1",
|
|
76
76
|
"lodash": "^4.17.21",
|
|
77
77
|
"make-dir": "^3.1.0",
|
|
78
78
|
"ora": "^5.4.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"terminal-link": "^2.1.1",
|
|
82
82
|
"utility-types": "^3.10.0",
|
|
83
83
|
"winston": "^3.6.0",
|
|
84
|
-
"yargs": "^17.
|
|
84
|
+
"yargs": "^17.4.0",
|
|
85
85
|
"yargs-parser": "^21.0.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
@@ -89,25 +89,25 @@
|
|
|
89
89
|
"@types/dedent": "^0.7.0",
|
|
90
90
|
"@types/inquirer": "^8.2.0",
|
|
91
91
|
"@types/jest": "^27.4.1",
|
|
92
|
-
"@types/lodash": "^4.14.
|
|
93
|
-
"@types/node": "^17.0.
|
|
92
|
+
"@types/lodash": "^4.14.180",
|
|
93
|
+
"@types/node": "^17.0.23",
|
|
94
94
|
"@types/safe-json-stringify": "^1.1.2",
|
|
95
|
-
"@types/yargs": "^17.0.
|
|
95
|
+
"@types/yargs": "^17.0.10",
|
|
96
96
|
"@types/yargs-parser": "^21.0.0",
|
|
97
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
98
|
-
"@typescript-eslint/parser": "^5.
|
|
99
|
-
"eslint": "^8.
|
|
97
|
+
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
|
98
|
+
"@typescript-eslint/parser": "^5.16.0",
|
|
99
|
+
"eslint": "^8.11.0",
|
|
100
100
|
"eslint-config-prettier": "^8.5.0",
|
|
101
101
|
"eslint-plugin-import": "^2.25.4",
|
|
102
|
-
"eslint-plugin-jest": "^26.1.
|
|
102
|
+
"eslint-plugin-jest": "^26.1.2",
|
|
103
103
|
"eslint-plugin-prettier": "^4.0.0",
|
|
104
104
|
"graphql-config": "^4.1.0",
|
|
105
105
|
"husky": "^7.0.4",
|
|
106
106
|
"jest": "^27.5.1",
|
|
107
107
|
"jest-snapshot-serializer-ansi": "^1.0.0",
|
|
108
|
-
"lint-staged": "^12.3.
|
|
108
|
+
"lint-staged": "^12.3.7",
|
|
109
109
|
"nock": "^13.2.4",
|
|
110
|
-
"prettier": "^2.
|
|
110
|
+
"prettier": "^2.6.0",
|
|
111
111
|
"strip-ansi": "^6.0.1",
|
|
112
112
|
"ts-jest": "^27.1.3",
|
|
113
113
|
"ts-node": "^10.7.0",
|