backport 8.3.0-beta.1 → 8.4.0
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/dist/backportRun.js +1 -1
- package/dist/entrypoint.module.d.ts +2 -2
- package/dist/entrypoint.module.js +2 -0
- package/dist/entrypoint.module.private.test.js +11 -10
- package/dist/lib/child-process-promisified.js +2 -2
- package/dist/lib/getCommits.js +1 -1
- package/dist/lib/git.js +3 -1
- package/dist/lib/git.test.js +26 -0
- package/dist/lib/github/v3/createStatusComment.js +3 -2
- package/dist/lib/github/v3/createStatusComment.test.js +61 -0
- package/dist/lib/github/v4/apiRequestV4.js +1 -1
- package/dist/lib/github/v4/enablePullRequestAutoMerge.js +2 -1
- package/dist/{entrypoint.cli.private.test.d.ts → lib/github/v4/enablePullRequestAutoMerge.mutation.test.d.ts} +0 -0
- package/dist/lib/github/v4/{enablePullRequestAutoMerge.private.test.js → enablePullRequestAutoMerge.mutation.test.js} +34 -8
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.js +5 -3
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.js +0 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.js +0 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.js +5 -6
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +7 -3
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.d.ts +2 -0
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.js +23 -7
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +2 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +1 -0
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +2 -0
- package/dist/lib/github/v4/getOptionsFromGithub/query.d.ts +1 -0
- package/dist/lib/github/v4/getOptionsFromGithub/query.js +1 -0
- package/dist/lib/remoteConfig.d.ts +1 -1
- package/dist/lib/remoteConfig.js +4 -0
- package/dist/options/ConfigOptions.d.ts +1 -0
- package/dist/options/cliArgs.d.ts +3 -2
- package/dist/options/cliArgs.js +21 -6
- package/dist/options/config/config.d.ts +1 -0
- package/dist/options/config/readConfigFile.d.ts +1 -0
- package/dist/options/options.d.ts +5 -2
- package/dist/options/options.js +1 -1
- package/dist/options/options.test.js +3 -0
- package/dist/{lib/github/v4/enablePullRequestAutoMerge.private.test.d.ts → test/e2e/cli/date-filters.private.test.d.ts} +0 -0
- package/dist/test/e2e/cli/date-filters.private.test.js +47 -0
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +4 -18
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +14 -15
- package/yarn.lock +165 -171
- package/dist/entrypoint.cli.private.test.js +0 -47
- package/dist/errors/BackportError.d.ts +0 -19
- package/dist/errors/BackportError.js +0 -29
- package/dist/runSequentially.test.d.ts +0 -1
- package/dist/runSequentially.test.js +0 -243
- package/dist/services/BackportError.d.ts +0 -19
- package/dist/services/BackportError.js +0 -29
- package/dist/services/HandledBackportError.d.ts +0 -19
- package/dist/services/HandledBackportError.js +0 -29
- package/dist/services/HandledError.d.ts +0 -19
- package/dist/services/HandledError.js +0 -29
- package/dist/services/child-process-promisified.d.ts +0 -25
- package/dist/services/child-process-promisified.js +0 -58
- package/dist/services/env.d.ts +0 -7
- package/dist/services/env.js +0 -30
- package/dist/services/env.test.d.ts +0 -1
- package/dist/services/env.test.js +0 -21
- package/dist/services/git.d.ts +0 -77
- package/dist/services/git.integration.test.d.ts +0 -1
- package/dist/services/git.integration.test.js +0 -616
- package/dist/services/git.js +0 -439
- package/dist/services/git.private.test.d.ts +0 -1
- package/dist/services/git.private.test.js +0 -618
- package/dist/services/git.test.d.ts +0 -1
- package/dist/services/git.test.js +0 -580
- package/dist/services/github/commitFormatters.d.ts +0 -3
- package/dist/services/github/commitFormatters.js +0 -17
- package/dist/services/github/commitFormatters.test.d.ts +0 -1
- package/dist/services/github/commitFormatters.test.js +0 -11
- package/dist/services/github/v3/addAssigneesToPullRequest.d.ts +0 -2
- package/dist/services/github/v3/addAssigneesToPullRequest.js +0 -32
- package/dist/services/github/v3/addAssigneesToPullRequest.test.d.ts +0 -1
- package/dist/services/github/v3/addAssigneesToPullRequest.test.js +0 -27
- package/dist/services/github/v3/addLabelsToPullRequest.d.ts +0 -2
- package/dist/services/github/v3/addLabelsToPullRequest.js +0 -30
- package/dist/services/github/v3/addReviewersToPullRequest.d.ts +0 -2
- package/dist/services/github/v3/addReviewersToPullRequest.js +0 -32
- package/dist/services/github/v3/createPullRequest.d.ts +0 -29
- package/dist/services/github/v3/createPullRequest.js +0 -91
- package/dist/services/github/v3/createPullRequest.test.d.ts +0 -1
- package/dist/services/github/v3/createPullRequest.test.js +0 -377
- package/dist/services/github/v3/createStatusComment.d.ts +0 -11
- package/dist/services/github/v3/createStatusComment.js +0 -131
- package/dist/services/github/v3/createStatusComment.test.d.ts +0 -1
- package/dist/services/github/v3/createStatusComment.test.js +0 -409
- package/dist/services/github/v3/getGithubV3ErrorMessage.d.ts +0 -14
- package/dist/services/github/v3/getGithubV3ErrorMessage.js +0 -16
- package/dist/services/github/v4/FetchPullRequestId.d.ts +0 -2
- package/dist/services/github/v4/FetchPullRequestId.js +0 -36
- package/dist/services/github/v4/apiRequestV4.d.ts +0 -31
- package/dist/services/github/v4/apiRequestV4.js +0 -71
- package/dist/services/github/v4/apiRequestV4.test.d.ts +0 -1
- package/dist/services/github/v4/apiRequestV4.test.js +0 -109
- package/dist/services/github/v4/disablePullRequestAutoMerge.d.ts +0 -2
- package/dist/services/github/v4/disablePullRequestAutoMerge.js +0 -32
- package/dist/services/github/v4/enablePullRequestAutoMerge.d.ts +0 -2
- package/dist/services/github/v4/enablePullRequestAutoMerge.js +0 -50
- package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.d.ts +0 -1
- package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.js +0 -112
- package/dist/services/github/v4/fetchAuthorId.d.ts +0 -10
- package/dist/services/github/v4/fetchAuthorId.js +0 -28
- package/dist/services/github/v4/fetchAuthorId.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchAuthorId.private.test.js +0 -25
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +0 -93
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.d.ts +0 -11
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +0 -58
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +0 -136
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.d.ts +0 -11
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +0 -48
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +0 -118
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +0 -29
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +0 -110
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +0 -196
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +0 -157
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.d.ts +0 -3
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.js +0 -61
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +0 -107
- package/dist/services/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.d.ts +0 -12
- package/dist/services/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.js +0 -69
- package/dist/services/github/v4/fetchExistingPullRequest.d.ts +0 -9
- package/dist/services/github/v4/fetchExistingPullRequest.js +0 -64
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +0 -44
- package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.d.ts +0 -2
- package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.js +0 -39
- package/dist/services/github/v4/fetchRemoteProjectConfig.d.ts +0 -8
- package/dist/services/github/v4/fetchRemoteProjectConfig.js +0 -49
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.js +0 -49
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +0 -69
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +0 -73
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.d.ts +0 -1
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +0 -116
- package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +0 -16
- package/dist/services/github/v4/getOptionsFromGithub/query.js +0 -29
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.d.ts +0 -29
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.js +0 -61
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.d.ts +0 -1
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +0 -72
- package/dist/services/github/v4/mocks/commitsByAuthorMock.d.ts +0 -2
- package/dist/services/github/v4/mocks/commitsByAuthorMock.js +0 -176
- package/dist/services/github/v4/throwOnInvalidAccessToken.d.ts +0 -6
- package/dist/services/github/v4/throwOnInvalidAccessToken.js +0 -45
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.d.ts +0 -1
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +0 -87
- package/dist/services/logger.d.ts +0 -9
- package/dist/services/logger.js +0 -74
- package/dist/services/prompt.test.d.ts +0 -1
- package/dist/services/prompt.test.js +0 -139
- package/dist/services/prompts.d.ts +0 -17
- package/dist/services/prompts.js +0 -132
- package/dist/services/remoteConfig.d.ts +0 -20
- package/dist/services/remoteConfig.js +0 -52
- package/dist/services/sequentially.d.ts +0 -1
- package/dist/services/sequentially.js +0 -10
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.d.ts +0 -16
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +0 -102
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.d.ts +0 -1
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.js +0 -467
- package/dist/services/sourceCommit/getMockSourceCommit.d.ts +0 -26
- package/dist/services/sourceCommit/getMockSourceCommit.js +0 -103
- package/dist/services/sourceCommit/parseSourceCommit.d.ts +0 -108
- package/dist/services/sourceCommit/parseSourceCommit.js +0 -123
- package/dist/services/sourceCommit/parseSourceCommit.test.d.ts +0 -1
- package/dist/services/sourceCommit/parseSourceCommit.test.js +0 -226
- package/dist/services/test.d.ts +0 -1
- package/dist/services/test.js +0 -23
- package/dist/state.d.ts +0 -0
- package/dist/state.js +0 -1
- package/dist/test/ExecError.d.ts +0 -16
- package/dist/test/ExecError.js +0 -15
- package/dist/test/e2e/cli/cli.private.test.d.ts +0 -1
- package/dist/test/e2e/cli/cli.private.test.js +0 -222
- package/dist/test/e2e/cli/interactive-error-handling.private.test.d.ts +0 -1
- package/dist/test/e2e/cli/interactive-error-handling.private.test.js +0 -80
- package/dist/test/e2e/cli/non-interactive-error-handling.private.test.d.ts +0 -1
- package/dist/test/e2e/cli/non-interactive-error-handling.private.test.js +0 -198
- package/dist/test/e2e/cli.e2e.private.test.d.ts +0 -1
- package/dist/test/e2e/cli.e2e.private.test.js +0 -433
- package/dist/test/e2e/module/module.mutation.test.d.ts +0 -1
- package/dist/test/e2e/module/module.mutation.test.js +0 -369
- package/dist/test/e2e/module.e2e.mutation.test.d.ts +0 -1
- package/dist/test/e2e/module.e2e.mutation.test.js +0 -369
- package/dist/test/e2e/module.e2e.private.test.d.ts +0 -1
- package/dist/test/e2e/module.e2e.private.test.js +0 -369
- package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +0 -13
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +0 -243
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.d.ts +0 -1
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +0 -320
- package/dist/ui/getCommits.d.ts +0 -2
- package/dist/ui/getCommits.js +0 -75
- package/dist/ui/getCommitsWithoutBackports.d.ts +0 -11
- package/dist/ui/getCommitsWithoutBackports.js +0 -68
- package/dist/ui/getCommitsWithoutBackports.test.d.ts +0 -1
- package/dist/ui/getCommitsWithoutBackports.test.js +0 -335
- package/dist/ui/getGitConfigAuthor.d.ts +0 -6
- package/dist/ui/getGitConfigAuthor.js +0 -15
- package/dist/ui/getTargetBranches.d.ts +0 -5
- package/dist/ui/getTargetBranches.js +0 -67
- package/dist/ui/getTargetBranches.test.d.ts +0 -1
- package/dist/ui/getTargetBranches.test.js +0 -204
- package/dist/ui/maybeSetupRepo.d.ts +0 -2
- package/dist/ui/maybeSetupRepo.js +0 -53
- package/dist/ui/maybeSetupRepo.test.d.ts +0 -1
- package/dist/ui/maybeSetupRepo.test.js +0 -238
- package/dist/ui/ora.d.ts +0 -2
- package/dist/ui/ora.js +0 -21
- package/dist/ui/setupRepo.d.ts +0 -2
- package/dist/ui/setupRepo.js +0 -56
- package/dist/ui/setupRepo.test.d.ts +0 -1
- package/dist/ui/setupRepo.test.js +0 -273
- package/dist/utils/filterMissingCommits.d.ts +0 -2
- package/dist/utils/filterMissingCommits.js +0 -7
- package/dist/utils/redact.d.ts +0 -1
- package/dist/utils/redact.js +0 -7
package/dist/options/cliArgs.js
CHANGED
|
@@ -76,13 +76,25 @@ function getOptionsFromCliArgs(processArgs) {
|
|
|
76
76
|
description: 'Path to global config',
|
|
77
77
|
type: 'string',
|
|
78
78
|
})
|
|
79
|
-
.option('
|
|
79
|
+
.option('dateSince', {
|
|
80
|
+
alias: 'since',
|
|
80
81
|
description: 'ISO-8601 date for filtering commits',
|
|
81
82
|
type: 'string',
|
|
83
|
+
coerce: (since) => {
|
|
84
|
+
if (since) {
|
|
85
|
+
return new Date(since).toISOString();
|
|
86
|
+
}
|
|
87
|
+
},
|
|
82
88
|
})
|
|
83
|
-
.option('
|
|
89
|
+
.option('dateUntil', {
|
|
90
|
+
alias: 'until',
|
|
84
91
|
description: 'ISO-8601 date for filtering commits',
|
|
85
92
|
type: 'string',
|
|
93
|
+
coerce: (until) => {
|
|
94
|
+
if (until) {
|
|
95
|
+
return new Date(until).toISOString();
|
|
96
|
+
}
|
|
97
|
+
},
|
|
86
98
|
})
|
|
87
99
|
.option('dir', {
|
|
88
100
|
description: 'Path to temporary backport repo',
|
|
@@ -164,6 +176,11 @@ function getOptionsFromCliArgs(processArgs) {
|
|
|
164
176
|
// Invalid value provided
|
|
165
177
|
throw new Error(`--mainline must be an integer. Received: ${mainline}`);
|
|
166
178
|
},
|
|
179
|
+
})
|
|
180
|
+
.option('signoff', {
|
|
181
|
+
description: 'Pass the --signoff option to the cherry-pick command',
|
|
182
|
+
type: 'boolean',
|
|
183
|
+
alias: ['s'],
|
|
167
184
|
})
|
|
168
185
|
// display 10 commits to pick from
|
|
169
186
|
.option('maxNumber', {
|
|
@@ -230,7 +247,7 @@ function getOptionsFromCliArgs(processArgs) {
|
|
|
230
247
|
type: 'string',
|
|
231
248
|
})
|
|
232
249
|
.option('prFilter', {
|
|
233
|
-
conflicts: ['pullNumber', 'sha'],
|
|
250
|
+
conflicts: ['pullNumber', 'sha', 'path'],
|
|
234
251
|
description: `Filter source pull requests by a query`,
|
|
235
252
|
type: 'string',
|
|
236
253
|
})
|
|
@@ -329,7 +346,7 @@ function getOptionsFromCliArgs(processArgs) {
|
|
|
329
346
|
// shorthands
|
|
330
347
|
repo,
|
|
331
348
|
// filters
|
|
332
|
-
author,
|
|
349
|
+
author,
|
|
333
350
|
// negations
|
|
334
351
|
noCherrypickRef, noFork, noStatusComment, noVerify, verify, nonInteractive,
|
|
335
352
|
// array types (should be renamed to plural form)
|
|
@@ -345,8 +362,6 @@ function getOptionsFromCliArgs(processArgs) {
|
|
|
345
362
|
repoName,
|
|
346
363
|
// filters
|
|
347
364
|
author: all ? null : author,
|
|
348
|
-
dateSince: since ? new Date(since).toISOString() : undefined,
|
|
349
|
-
dateUntil: until ? new Date(until).toISOString() : undefined,
|
|
350
365
|
// `multiple` is a cli-only flag to override `multipleBranches` and `multipleCommits`
|
|
351
366
|
multipleBranches: multiple ?? multipleBranches,
|
|
352
367
|
multipleCommits: multiple ?? multipleCommits,
|
|
@@ -58,6 +58,7 @@ export declare function getOptionsFromConfigFiles({ optionsFromCliArgs, optionsF
|
|
|
58
58
|
targetBranchChoices?: import("../ConfigOptions").TargetBranchChoiceOrString[] | undefined;
|
|
59
59
|
targetBranches?: string[] | undefined;
|
|
60
60
|
targetPRLabels?: string[] | undefined;
|
|
61
|
+
signoff?: boolean | undefined;
|
|
61
62
|
help?: boolean | undefined;
|
|
62
63
|
version?: boolean | undefined;
|
|
63
64
|
v?: boolean | undefined;
|
|
@@ -24,6 +24,7 @@ export declare function withConfigMigrations({ upstream, labels, branches, ...co
|
|
|
24
24
|
gitAuthorName?: string | undefined;
|
|
25
25
|
gitAuthorEmail?: string | undefined;
|
|
26
26
|
ls?: boolean | undefined;
|
|
27
|
+
signoff?: boolean | undefined;
|
|
27
28
|
maxNumber?: number | undefined;
|
|
28
29
|
multiple?: boolean | undefined;
|
|
29
30
|
multipleBranches?: boolean | undefined;
|
|
@@ -29,6 +29,7 @@ export declare const defaultConfigOptions: {
|
|
|
29
29
|
targetBranchChoices: TargetBranchChoiceOrString[];
|
|
30
30
|
targetBranches: string[];
|
|
31
31
|
targetPRLabels: string[];
|
|
32
|
+
signoff: boolean;
|
|
32
33
|
};
|
|
33
34
|
export declare function getOptions({ optionsFromCliArgs, optionsFromModule, }: {
|
|
34
35
|
optionsFromCliArgs: OptionsFromCliArgs;
|
|
@@ -50,6 +51,8 @@ export declare function getOptions({ optionsFromCliArgs, optionsFromModule, }: {
|
|
|
50
51
|
cherrypickRef: boolean;
|
|
51
52
|
projectConfigFile?: string | undefined;
|
|
52
53
|
globalConfigFile?: string | undefined;
|
|
54
|
+
dateSince: string | null;
|
|
55
|
+
dateUntil: string | null;
|
|
53
56
|
details: boolean;
|
|
54
57
|
dryRun?: boolean | undefined;
|
|
55
58
|
editor?: string | undefined;
|
|
@@ -61,6 +64,7 @@ export declare function getOptions({ optionsFromCliArgs, optionsFromModule, }: {
|
|
|
61
64
|
gitAuthorEmail?: string | undefined;
|
|
62
65
|
ls?: boolean | undefined;
|
|
63
66
|
mainline?: number | undefined;
|
|
67
|
+
signoff: boolean;
|
|
64
68
|
maxNumber: number;
|
|
65
69
|
multipleBranches: boolean;
|
|
66
70
|
multipleCommits: boolean;
|
|
@@ -74,8 +78,6 @@ export declare function getOptions({ optionsFromCliArgs, optionsFromModule, }: {
|
|
|
74
78
|
sha?: string | string[] | undefined;
|
|
75
79
|
resetAuthor: boolean;
|
|
76
80
|
sourceBranch: string;
|
|
77
|
-
dateSince: string | null;
|
|
78
|
-
dateUntil: string | null;
|
|
79
81
|
commitPaths: string[];
|
|
80
82
|
reviewers: string[];
|
|
81
83
|
sourcePRLabels: string[];
|
|
@@ -101,4 +103,5 @@ export declare function getOptions({ optionsFromCliArgs, optionsFromModule, }: {
|
|
|
101
103
|
branches?: TargetBranchChoiceOrString[] | undefined;
|
|
102
104
|
labels?: string[] | undefined;
|
|
103
105
|
authenticatedUsername: string;
|
|
106
|
+
isRepoPrivate: boolean;
|
|
104
107
|
}>;
|
package/dist/options/options.js
CHANGED
|
@@ -38,6 +38,7 @@ exports.defaultConfigOptions = {
|
|
|
38
38
|
targetBranchChoices: [],
|
|
39
39
|
targetBranches: [],
|
|
40
40
|
targetPRLabels: [],
|
|
41
|
+
signoff: false,
|
|
41
42
|
};
|
|
42
43
|
async function getOptions({ optionsFromCliArgs, optionsFromModule, }) {
|
|
43
44
|
const optionsFromConfigFiles = await (0, config_1.getOptionsFromConfigFiles)({
|
|
@@ -126,7 +127,6 @@ function throwForRequiredOptions(options) {
|
|
|
126
127
|
'githubApiBaseUrlV4',
|
|
127
128
|
'logFilePath',
|
|
128
129
|
'prDescription',
|
|
129
|
-
'prFilter',
|
|
130
130
|
'projectConfigFile',
|
|
131
131
|
'prTitle',
|
|
132
132
|
'repoForkOwner',
|
|
@@ -199,6 +199,7 @@ describe('getOptions', () => {
|
|
|
199
199
|
gitHostname: 'github.com',
|
|
200
200
|
githubApiBaseUrlV4: 'http://localhost/graphql',
|
|
201
201
|
interactive: true,
|
|
202
|
+
isRepoPrivate: false,
|
|
202
203
|
maxNumber: 10,
|
|
203
204
|
multipleBranches: true,
|
|
204
205
|
multipleCommits: false,
|
|
@@ -211,6 +212,7 @@ describe('getOptions', () => {
|
|
|
211
212
|
repoOwner: 'elastic',
|
|
212
213
|
resetAuthor: false,
|
|
213
214
|
reviewers: [],
|
|
215
|
+
signoff: false,
|
|
214
216
|
sourceBranch: 'default-branch-from-github',
|
|
215
217
|
sourcePRLabels: [],
|
|
216
218
|
targetBranchChoices: ['7.9', '8.0'],
|
|
@@ -397,6 +399,7 @@ function mockGithubConfigOptions({ viewerLogin = 'DO_NOT_USE-sqren', defaultBran
|
|
|
397
399
|
login: viewerLogin,
|
|
398
400
|
},
|
|
399
401
|
repository: {
|
|
402
|
+
isPrivate: false,
|
|
400
403
|
illegalBackportBranch: hasBackportBranch ? { id: 'foo' } : null,
|
|
401
404
|
defaultBranchRef: {
|
|
402
405
|
name: defaultBranchRef,
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getDevAccessToken_1 = require("../../private/getDevAccessToken");
|
|
4
|
+
const runBackportViaCli_1 = require("./runBackportViaCli");
|
|
5
|
+
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
6
|
+
describe('date filters (dateSince, dateUntil)', () => {
|
|
7
|
+
it(`filters commits by "since" and "until"`, async () => {
|
|
8
|
+
const { output } = await (0, runBackportViaCli_1.runBackportViaCli)([
|
|
9
|
+
'--branch=7.x',
|
|
10
|
+
'--repo=backport-org/backport-e2e',
|
|
11
|
+
`--accessToken=${accessToken}`,
|
|
12
|
+
'--since=2020-08-15T10:00:00.000Z',
|
|
13
|
+
'--until=2020-08-15T10:30:00.000Z',
|
|
14
|
+
], { waitForString: 'Select commit' });
|
|
15
|
+
expect(output).toMatchInlineSnapshot(`
|
|
16
|
+
"? Select commit (Use arrow keys)
|
|
17
|
+
❯ 1. Bump to 8.0.0
|
|
18
|
+
2. Add package.json
|
|
19
|
+
3. Update .backportrc.json
|
|
20
|
+
4. Create .backportrc.json"
|
|
21
|
+
`);
|
|
22
|
+
});
|
|
23
|
+
it('combined with --pr-filter', async () => {
|
|
24
|
+
const { output } = await (0, runBackportViaCli_1.runBackportViaCli)([
|
|
25
|
+
'--branch=7.x',
|
|
26
|
+
'--repo=elastic/kibana',
|
|
27
|
+
`--accessToken=${accessToken}`,
|
|
28
|
+
`--author=sqren`,
|
|
29
|
+
'--since=2021-09-20',
|
|
30
|
+
'--until=2021-10-01',
|
|
31
|
+
], { waitForString: 'Select commit' });
|
|
32
|
+
const { output: outputFromPrFilter } = await (0, runBackportViaCli_1.runBackportViaCli)([
|
|
33
|
+
'--branch=7.x',
|
|
34
|
+
'--repo=elastic/kibana',
|
|
35
|
+
`--accessToken=${accessToken}`,
|
|
36
|
+
`--pr-filter="author:sqren"`,
|
|
37
|
+
'--since=2021-09-20',
|
|
38
|
+
'--until=2021-10-01',
|
|
39
|
+
'--source-branch=master',
|
|
40
|
+
], { waitForString: 'Select commit' });
|
|
41
|
+
expect(output).toMatchInlineSnapshot(`
|
|
42
|
+
"? Select commit (Use arrow keys)
|
|
43
|
+
❯ 1. [APM] Add link to officials docs for APM UI settings (#113396) 7.x"
|
|
44
|
+
`);
|
|
45
|
+
expect(output).toEqual(outputFromPrFilter);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -65,8 +65,8 @@ describe('entrypoint cli', () => {
|
|
|
65
65
|
[boolean]
|
|
66
66
|
--projectConfigFile, --config Path to project config [string]
|
|
67
67
|
--globalConfigFile Path to global config [string]
|
|
68
|
-
--since
|
|
69
|
-
--until
|
|
68
|
+
--dateSince, --since ISO-8601 date for filtering commits [string]
|
|
69
|
+
--dateUntil, --until ISO-8601 date for filtering commits [string]
|
|
70
70
|
--dir Path to temporary backport repo [string]
|
|
71
71
|
--details Show details about each commit [boolean]
|
|
72
72
|
--dryRun Run backport locally without pushing to Github [boolean]
|
|
@@ -82,6 +82,8 @@ describe('entrypoint cli', () => {
|
|
|
82
82
|
--ls List commits instead of backporting them [boolean]
|
|
83
83
|
--mainline Parent id of merge commit. Defaults to 1 when supplied
|
|
84
84
|
without arguments [number]
|
|
85
|
+
-s, --signoff Pass the --signoff option to the cherry-pick command
|
|
86
|
+
[boolean]
|
|
85
87
|
-n, --maxNumber, --number Number of commits to choose from [number]
|
|
86
88
|
--multiple Select multiple branches/commits [boolean]
|
|
87
89
|
--multipleBranches Backport to multiple branches [boolean]
|
|
@@ -159,22 +161,6 @@ describe('entrypoint cli', () => {
|
|
|
159
161
|
6. Merge pull request #1 from backport-org/add-heart-emoji"
|
|
160
162
|
`);
|
|
161
163
|
});
|
|
162
|
-
it(`filters commits by "since" and "until"`, async () => {
|
|
163
|
-
const { output } = await (0, runBackportViaCli_1.runBackportViaCli)([
|
|
164
|
-
'--branch=7.x',
|
|
165
|
-
'--repo=backport-org/backport-e2e',
|
|
166
|
-
`--accessToken=${accessToken}`,
|
|
167
|
-
'--since=2020-08-15T10:00:00.000Z',
|
|
168
|
-
'--until=2020-08-15T10:30:00.000Z',
|
|
169
|
-
], { waitForString: 'Select commit' });
|
|
170
|
-
expect(output).toMatchInlineSnapshot(`
|
|
171
|
-
"? Select commit (Use arrow keys)
|
|
172
|
-
❯ 1. Bump to 8.0.0
|
|
173
|
-
2. Add package.json
|
|
174
|
-
3. Update .backportrc.json
|
|
175
|
-
4. Create .backportrc.json"
|
|
176
|
-
`);
|
|
177
|
-
});
|
|
178
164
|
it(`lists commits from 7.x`, async () => {
|
|
179
165
|
const { output } = await (0, runBackportViaCli_1.runBackportViaCli)([
|
|
180
166
|
'--branch=7.x',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "8.
|
|
1
|
+
export declare const PACKAGE_VERSION = "8.4.0";
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"branches",
|
|
15
15
|
"branching"
|
|
16
16
|
],
|
|
17
|
-
"version": "8.
|
|
17
|
+
"version": "8.4.0",
|
|
18
18
|
"main": "./dist/entrypoint.module.js",
|
|
19
19
|
"types": "dist/entrypoint.module.d.ts",
|
|
20
20
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"postinstall": "test -f ./dist/scripts/runPostinstall.js && node ./dist/scripts/runPostinstall.js || echo 'Dist folder missing'",
|
|
26
26
|
"version": "echo \"Bumping version\" && yarn extractPackageVersion && git add src/utils/packageVersion.ts && yarn tsc",
|
|
27
27
|
"prepare": "husky install",
|
|
28
|
-
"prepublishOnly": "yarn lint && yarn tsc",
|
|
28
|
+
"prepublishOnly": "rm -rf ./dist/ && yarn lint && yarn tsc",
|
|
29
29
|
"extractPackageVersion": "node -p \"'export const PACKAGE_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" | prettier --parser typescript > src/utils/packageVersion.ts",
|
|
30
30
|
"lint-and-test": "yarn tsc && yarn lint && yarn test-all",
|
|
31
31
|
"lint": "echo \"Running lint\" && eslint './**/*.{ts,js}'",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
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
|
-
"test": "jest"
|
|
37
|
-
"docker-run": "./docker/backport.sh"
|
|
36
|
+
"test": "jest"
|
|
38
37
|
},
|
|
39
38
|
"lint-staged": {
|
|
40
39
|
"*.ts": [
|
|
@@ -72,7 +71,7 @@
|
|
|
72
71
|
"find-up": "^5.0.0",
|
|
73
72
|
"graphql": "^16.3.0",
|
|
74
73
|
"graphql-tag": "^2.12.6",
|
|
75
|
-
"inquirer": "^8.2.
|
|
74
|
+
"inquirer": "^8.2.2",
|
|
76
75
|
"lodash": "^4.17.21",
|
|
77
76
|
"make-dir": "^3.1.0",
|
|
78
77
|
"ora": "^5.4.1",
|
|
@@ -87,30 +86,30 @@
|
|
|
87
86
|
"devDependencies": {
|
|
88
87
|
"@types/core-js": "^2.5.5",
|
|
89
88
|
"@types/dedent": "^0.7.0",
|
|
90
|
-
"@types/inquirer": "^8.2.
|
|
89
|
+
"@types/inquirer": "^8.2.1",
|
|
91
90
|
"@types/jest": "^27.4.1",
|
|
92
|
-
"@types/lodash": "^4.14.
|
|
91
|
+
"@types/lodash": "^4.14.181",
|
|
93
92
|
"@types/node": "^17.0.23",
|
|
94
93
|
"@types/safe-json-stringify": "^1.1.2",
|
|
95
94
|
"@types/yargs": "^17.0.10",
|
|
96
95
|
"@types/yargs-parser": "^21.0.0",
|
|
97
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
98
|
-
"@typescript-eslint/parser": "^5.
|
|
99
|
-
"eslint": "^8.
|
|
96
|
+
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
|
97
|
+
"@typescript-eslint/parser": "^5.17.0",
|
|
98
|
+
"eslint": "^8.12.0",
|
|
100
99
|
"eslint-config-prettier": "^8.5.0",
|
|
101
100
|
"eslint-plugin-import": "^2.25.4",
|
|
102
|
-
"eslint-plugin-jest": "^26.1.
|
|
101
|
+
"eslint-plugin-jest": "^26.1.3",
|
|
103
102
|
"eslint-plugin-prettier": "^4.0.0",
|
|
104
|
-
"graphql-config": "^4.
|
|
103
|
+
"graphql-config": "^4.2.0",
|
|
105
104
|
"husky": "^7.0.4",
|
|
106
105
|
"jest": "^27.5.1",
|
|
107
106
|
"jest-snapshot-serializer-ansi": "^1.0.0",
|
|
108
107
|
"lint-staged": "^12.3.7",
|
|
109
108
|
"nock": "^13.2.4",
|
|
110
|
-
"prettier": "^2.6.
|
|
109
|
+
"prettier": "^2.6.2",
|
|
111
110
|
"strip-ansi": "^6.0.1",
|
|
112
|
-
"ts-jest": "^27.1.
|
|
111
|
+
"ts-jest": "^27.1.4",
|
|
113
112
|
"ts-node": "^10.7.0",
|
|
114
|
-
"typescript": "^4.6.
|
|
113
|
+
"typescript": "^4.6.3"
|
|
115
114
|
}
|
|
116
115
|
}
|