backport 6.1.5 → 6.3.0-beta-2
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 +15 -6
- package/dist/{main.d.ts → backportRun.d.ts} +3 -3
- package/dist/{main.js → backportRun.js} +21 -10
- package/dist/{entrypoint.module.private.test.d.ts → entrypoint.cli.e2e.private.test.d.ts} +0 -0
- package/dist/entrypoint.cli.e2e.private.test.js +277 -0
- package/dist/entrypoint.cli.js +3 -5
- package/dist/{options/getValidatedOptions.test.d.ts → entrypoint.cli.private.test.d.ts} +0 -0
- package/dist/{entrypoint.module.private.test.js → entrypoint.cli.private.test.js} +17 -8
- package/dist/entrypoint.module.d.ts +2 -2
- package/dist/entrypoint.module.js +4 -4
- package/dist/options/ConfigOptions.d.ts +5 -1
- package/dist/options/cliArgs.d.ts +16 -14
- package/dist/options/cliArgs.js +15 -5
- package/dist/options/cliArgs.test.js +28 -10
- package/dist/options/config/config.d.ts +10 -4
- package/dist/options/config/config.js +7 -6
- package/dist/options/config/config.test.js +11 -1
- package/dist/options/config/globalConfig.d.ts +1 -1
- package/dist/options/config/globalConfig.js +15 -9
- package/dist/options/config/globalConfig.test.js +19 -32
- package/dist/options/config/projectConfig.d.ts +3 -1
- package/dist/options/config/projectConfig.js +5 -2
- package/dist/options/config/projectConfig.test.js +41 -31
- package/dist/options/config/readConfigFile.d.ts +27 -23
- package/dist/options/config/readConfigFile.js +2 -2
- package/dist/options/options.d.ts +18 -39
- package/dist/options/options.js +40 -32
- package/dist/options/options.test.js +83 -47
- package/dist/runSequentially.d.ts +0 -1
- package/dist/runSequentially.js +0 -1
- package/dist/runSequentially.test.js +39 -20
- package/dist/scripts/postinstall.js +3 -3
- package/dist/services/HandledError.d.ts +6 -4
- package/dist/services/HandledError.js +18 -3
- package/dist/services/child-process-promisified.d.ts +3 -1
- package/dist/services/env.d.ts +3 -1
- package/dist/services/env.js +4 -1
- package/dist/services/env.test.js +2 -2
- package/dist/services/git.d.ts +22 -9
- package/dist/services/git.integration.test.js +123 -24
- package/dist/services/git.js +66 -54
- package/dist/services/git.test.js +35 -20
- package/dist/services/github/commitFormatters.d.ts +0 -1
- package/dist/services/github/commitFormatters.js +1 -8
- package/dist/services/github/v3/createPullRequest.js +16 -10
- package/dist/services/github/v3/createPullRequest.test.js +248 -33
- package/dist/services/github/v3/createStatusComment.d.ts +1 -1
- package/dist/services/github/v3/createStatusComment.js +26 -15
- package/dist/services/github/v3/createStatusComment.test.js +165 -70
- package/dist/services/github/v3/getGithubV3ErrorMessage.d.ts +2 -1
- package/dist/services/github/v4/FetchPullRequestId.d.ts +0 -7
- package/dist/services/github/v4/apiRequestV4.d.ts +21 -17
- package/dist/services/github/v4/apiRequestV4.js +38 -28
- package/dist/services/github/v4/apiRequestV4.test.js +4 -4
- package/dist/services/github/v4/disablePullRequestAutoMerge.d.ts +0 -7
- package/dist/services/github/v4/enablePullRequestAutoMerge.d.ts +0 -7
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +37 -19
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +17 -8
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +3 -3
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +23 -14
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +2 -2
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +4 -4
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +41 -19
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.d.ts +1 -8
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +31 -14
- package/dist/services/github/v4/fetchExistingPullRequest.d.ts +0 -4
- package/dist/services/github/v4/fetchExistingPullRequest.js +1 -2
- package/dist/services/github/v4/fetchPullRequestAutoMergeMethod.d.ts +0 -9
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +6 -2
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.js +41 -34
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +6 -0
- package/dist/services/github/v4/getOptionsFromGithub/query.d.ts +2 -1
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.d.ts +29 -0
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.js +56 -0
- package/dist/{options/parseRequiredOptions.test.d.ts → services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.d.ts} +0 -0
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +71 -0
- package/dist/services/github/v4/mocks/commitsByAuthorMock.js +11 -11
- package/dist/services/github/v4/throwOnInvalidAccessToken.d.ts +4 -5
- package/dist/services/github/v4/throwOnInvalidAccessToken.js +10 -7
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +5 -5
- package/dist/services/logger.d.ts +9 -3
- package/dist/services/logger.js +38 -35
- package/dist/services/prompt.test.js +66 -19
- package/dist/services/prompts.js +12 -10
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +1 -1
- package/dist/services/sourceCommit/getMockSourceCommit.js +6 -6
- package/dist/services/sourceCommit/parseSourceCommit.d.ts +18 -10
- package/dist/services/sourceCommit/parseSourceCommit.js +20 -14
- package/dist/services/sourceCommit/parseSourceCommit.test.js +18 -20
- package/dist/{runWithOptions.test.d.ts → test/backport-e2e.mutation.test.d.ts} +0 -0
- package/dist/test/{integration/integration.private.test.js → backport-e2e.mutation.test.js} +143 -123
- package/dist/{scripts/generate-gql.d.ts → test/handleUnbackportedPullRequests.private.test.d.ts} +0 -0
- package/dist/test/handleUnbackportedPullRequests.private.test.js +57 -0
- package/dist/test/mockConfigFiles.js +4 -20
- package/dist/test/mocks.d.ts +10 -0
- package/dist/test/mocks.js +23 -0
- package/dist/test/private/getDevAccessToken.js +5 -4
- package/dist/test/sandbox.d.ts +5 -0
- package/dist/test/sandbox.js +43 -0
- package/dist/test/setupFiles/automatic-mocks.d.ts +1 -0
- package/dist/test/setupFiles/automatic-mocks.js +27 -11
- package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +0 -1
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +12 -13
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +50 -27
- package/dist/ui/getCommits.js +8 -14
- package/dist/ui/getCommitsWithoutBackports.js +6 -6
- package/dist/ui/getCommitsWithoutBackports.test.js +91 -39
- package/dist/ui/getTargetBranches.js +1 -1
- package/dist/ui/getTargetBranches.test.js +26 -8
- package/dist/ui/maybeSetupRepo.js +25 -5
- package/dist/ui/maybeSetupRepo.test.js +144 -14
- package/dist/utils/maybe.d.ts +1 -0
- package/dist/utils/maybe.js +7 -0
- package/dist/utils/packageVersion.d.ts +1 -0
- package/dist/{types/PromiseReturnType.js → utils/packageVersion.js} +2 -0
- package/package.json +24 -20
- package/yarn.lock +160 -237
- package/dist/index.d.ts +0 -783
- package/dist/index.js +0 -8001
- package/dist/ink.d.ts +0 -1
- package/dist/ink.js +0 -49
- package/dist/options/config/getOptionsFromGit.d.ts +0 -4
- package/dist/options/config/getOptionsFromGit.js +0 -8
- package/dist/options/getValidatedOptions.d.ts +0 -49
- package/dist/options/getValidatedOptions.js +0 -45
- package/dist/options/getValidatedOptions.test.js +0 -97
- package/dist/options/parseRequiredOptions.d.ts +0 -71
- package/dist/options/parseRequiredOptions.js +0 -68
- package/dist/options/parseRequiredOptions.test.js +0 -122
- package/dist/runWithOptions.d.ts +0 -9
- package/dist/runWithOptions.js +0 -43
- package/dist/runWithOptions.test.js +0 -304
- package/dist/scripts/generate-gql.js +0 -15
- package/dist/services/fs-promisified.d.ts +0 -6
- package/dist/services/fs-promisified.js +0 -12
- package/dist/services/getExpectedTarget.d.ts +0 -9
- package/dist/services/getExpectedTarget.js +0 -77
- package/dist/services/getExpectedTargetPullRequests.d.ts +0 -9
- package/dist/services/getExpectedTargetPullRequests.js +0 -77
- package/dist/services/github/v4/fetchCommitByPullNumber.d.ts +0 -5
- package/dist/services/github/v4/fetchCommitByPullNumber.js +0 -86
- package/dist/services/github/v4/fetchCommitByPullNumber.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommitByPullNumber.private.test.js +0 -57
- package/dist/services/github/v4/fetchCommitBySha.d.ts +0 -5
- package/dist/services/github/v4/fetchCommitBySha.js +0 -95
- package/dist/services/github/v4/fetchCommitBySha.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommitBySha.private.test.js +0 -50
- package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.d.ts +0 -28
- package/dist/services/github/v4/fetchCommits/fetchCommitsInDateRange.js +0 -52
- package/dist/services/github/v4/fetchCommits/fetchProjectConfig.d.ts +0 -3
- package/dist/services/github/v4/fetchCommits/fetchProjectConfig.js +0 -55
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.test.js +0 -252
- package/dist/services/github/v4/fetchCommitsByAuthor.d.ts +0 -28
- package/dist/services/github/v4/fetchCommitsByAuthor.js +0 -161
- package/dist/services/github/v4/fetchCommitsByAuthor.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommitsByAuthor.private.test.js +0 -115
- package/dist/services/github/v4/fetchCommitsByAuthor.test.d.ts +0 -1
- package/dist/services/github/v4/fetchCommitsByAuthor.test.js +0 -272
- package/dist/services/github/v4/fetchDefaultBranch.d.ts +0 -9
- package/dist/services/github/v4/fetchDefaultBranch.js +0 -24
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.d.ts +0 -4
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.js +0 -52
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.js +0 -32
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.d.ts +0 -4
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.js +0 -72
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/index.private.test.js +0 -34
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/query.d.ts +0 -40
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks/query.js +0 -72
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.d.ts +0 -17
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.js +0 -69
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.private.test.js +0 -32
- package/dist/services/github/v4/fetchMergedPullRequests.d.ts +0 -37
- package/dist/services/github/v4/fetchMergedPullRequests.js +0 -37
- package/dist/services/github/v4/fetchMergedPullRequests.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchMergedPullRequests.private.test.js +0 -59
- package/dist/services/github/v4/fetchMergedPullRequests.test.d.ts +0 -1
- package/dist/services/github/v4/fetchMergedPullRequests.test.js +0 -22
- package/dist/services/github/v4/fetchProjectConfig.d.ts +0 -8
- package/dist/services/github/v4/fetchProjectConfig.js +0 -56
- package/dist/services/github/v4/fetchProjectConfig.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchProjectConfig.private.test.js +0 -52
- package/dist/services/github/v4/fetchProjectConfig.test.d.ts +0 -1
- package/dist/services/github/v4/fetchProjectConfig.test.js +0 -37
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.d.ts +0 -9
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.js +0 -92
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.d.ts +0 -1
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.private.test.js +0 -66
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.d.ts +0 -1
- package/dist/services/github/v4/fetchPullRequestBySearchQuery.test.js +0 -242
- package/dist/services/github/v4/getExistingTargetPullRequests.d.ts +0 -7
- package/dist/services/github/v4/getExistingTargetPullRequests.js +0 -45
- package/dist/services/github/v4/getOptionsFromGithub/index.d.ts +0 -63
- package/dist/services/github/v4/getOptionsFromGithub/index.js +0 -139
- package/dist/services/github/v4/getOptionsFromGithub/index.private.test.d.ts +0 -1
- package/dist/services/github/v4/getOptionsFromGithub/index.private.test.js +0 -147
- package/dist/services/github/v4/getTargetBranchesFromLabels.d.ts +0 -5
- package/dist/services/github/v4/getTargetBranchesFromLabels.js +0 -20
- package/dist/services/github/v4/getTargetBranchesFromLabels.test.d.ts +0 -1
- package/dist/services/github/v4/getTargetBranchesFromLabels.test.js +0 -201
- package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.d.ts +0 -2
- package/dist/services/github/v4/mocks/fetchPullRequestBySearchQueryMock.js +0 -843
- package/dist/services/github/v4/mocks/getCommitsByAuthorMock.d.ts +0 -2
- package/dist/services/github/v4/mocks/getCommitsByAuthorMock.js +0 -73
- package/dist/services/github/v4/mocks/getPullRequestNodeMock.d.ts +0 -12
- package/dist/services/github/v4/mocks/getPullRequestNodeMock.js +0 -44
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.d.ts +0 -5
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.js +0 -20
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.d.ts +0 -1
- package/dist/services/sourceCommit/getTargetBranchesFromLabels.test.js +0 -201
- package/dist/services/sourceCommit/sourceCommit.d.ts +0 -78
- package/dist/services/sourceCommit/sourceCommit.js +0 -86
- package/dist/services/sourceCommit/sourceCommit.test.d.ts +0 -1
- package/dist/services/sourceCommit/sourceCommit.test.js +0 -287
- package/dist/services/sourceCommit.d.ts +0 -78
- package/dist/services/sourceCommit.js +0 -86
- package/dist/services/sourceCommit.test.d.ts +0 -1
- package/dist/services/sourceCommit.test.js +0 -280
- package/dist/test/inquirer.private.test.d.ts +0 -1
- package/dist/test/inquirer.private.test.js +0 -168
- package/dist/test/integration/createSpies.d.ts +0 -17
- package/dist/test/integration/createSpies.js +0 -85
- package/dist/test/integration/envConstants.d.ts +0 -5
- package/dist/test/integration/envConstants.js +0 -9
- package/dist/test/integration/helpers.d.ts +0 -7
- package/dist/test/integration/helpers.js +0 -31
- package/dist/test/integration/integration.private.test.d.ts +0 -1
- package/dist/test/integration/integration.test.d.ts +0 -1
- package/dist/test/integration/integration.test.js +0 -214
- package/dist/todo-delete.d.ts +0 -1
- package/dist/todo-delete.js +0 -17
- package/dist/types/Commit.d.ts +0 -85
- package/dist/types/Commit.js +0 -139
- package/dist/types/PromiseReturnType.d.ts +0 -1
- package/dist/types/commitNode.d.ts +0 -89
- package/dist/types/commitNode.js +0 -139
- package/dist/types/commitNode.test.d.ts +0 -1
- package/dist/types/commitNode.test.js +0 -255
- package/dist/types/commitWithAssociatedPullRequests.d.ts +0 -86
- package/dist/types/commitWithAssociatedPullRequests.js +0 -145
- package/dist/ui/cherrypickAndCreatePullRequest.test.d.ts +0 -1
- package/dist/ui/cherrypickAndCreatePullRequest.test.js +0 -617
- package/dist/ui/getTargetBranchesFromLabels.d.ts +0 -6
- package/dist/ui/getTargetBranchesFromLabels.js +0 -40
- package/dist/ui/getTargetBranchesFromLabels.test.d.ts +0 -1
- package/dist/ui/getTargetBranchesFromLabels.test.js +0 -288
package/dist/index.d.ts
DELETED
|
@@ -1,783 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="graceful-fs" />
|
|
4
|
-
declare module "options/cliArgs" {
|
|
5
|
-
import { ConfigOptions, BranchChoice } from "options/ConfigOptions";
|
|
6
|
-
export type OptionsFromCliArgs = ReturnType<typeof getOptionsFromCliArgs>;
|
|
7
|
-
export function getOptionsFromCliArgs(configOptions: ConfigOptions, argv: readonly string[]): {
|
|
8
|
-
autoFixConflicts: (({ files, directory, logger, targetBranch, }: {
|
|
9
|
-
files: string[];
|
|
10
|
-
directory: string;
|
|
11
|
-
logger: {
|
|
12
|
-
error: (message: string, meta?: unknown) => void;
|
|
13
|
-
warn: (message: string, meta?: unknown) => void;
|
|
14
|
-
info: (message: string, meta?: unknown) => void;
|
|
15
|
-
verbose: (message: string, meta?: unknown) => void;
|
|
16
|
-
debug: (message: string, meta?: unknown) => void;
|
|
17
|
-
};
|
|
18
|
-
targetBranch: string;
|
|
19
|
-
}) => boolean | Promise<boolean>) | undefined;
|
|
20
|
-
assignees: string[];
|
|
21
|
-
branchLabelMapping: Record<string, string> | undefined;
|
|
22
|
-
multipleBranches: boolean;
|
|
23
|
-
multipleCommits: boolean;
|
|
24
|
-
noVerify: boolean;
|
|
25
|
-
targetBranchChoices: BranchChoice[];
|
|
26
|
-
accessToken: string | undefined;
|
|
27
|
-
all: boolean;
|
|
28
|
-
author: string | undefined;
|
|
29
|
-
ci: boolean;
|
|
30
|
-
dryRun: boolean;
|
|
31
|
-
editor: string | undefined;
|
|
32
|
-
fork: boolean;
|
|
33
|
-
gitHostname: string;
|
|
34
|
-
githubApiBaseUrlV3: string;
|
|
35
|
-
githubApiBaseUrlV4: string;
|
|
36
|
-
mainline: number | undefined;
|
|
37
|
-
maxNumber: number;
|
|
38
|
-
path: string | undefined;
|
|
39
|
-
prTitle: string;
|
|
40
|
-
prDescription: string | undefined;
|
|
41
|
-
prFilter: string | undefined;
|
|
42
|
-
pullNumber: number | undefined;
|
|
43
|
-
resetAuthor: boolean;
|
|
44
|
-
sha: string | undefined;
|
|
45
|
-
sourceBranch: string | undefined;
|
|
46
|
-
sourcePRLabels: string[];
|
|
47
|
-
targetBranches: string[];
|
|
48
|
-
targetPRLabels: string[];
|
|
49
|
-
upstream: string | undefined;
|
|
50
|
-
username: string | undefined;
|
|
51
|
-
verbose: boolean;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
declare module "services/HandledError" {
|
|
55
|
-
export class HandledError extends Error {
|
|
56
|
-
constructor(message: string);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
declare module "options/getValidatedOptions" {
|
|
60
|
-
import { OptionsFromCliArgs } from "options/cliArgs";
|
|
61
|
-
export type ValidatedOptions = ReturnType<typeof getValidatedOptions>;
|
|
62
|
-
export function getValidatedOptions({ upstream, ...options }: OptionsFromCliArgs): {
|
|
63
|
-
accessToken: string;
|
|
64
|
-
username: string;
|
|
65
|
-
repoName: string;
|
|
66
|
-
repoOwner: string;
|
|
67
|
-
author: string;
|
|
68
|
-
all: boolean;
|
|
69
|
-
autoFixConflicts: (({ files, directory, logger, targetBranch, }: {
|
|
70
|
-
files: string[];
|
|
71
|
-
directory: string;
|
|
72
|
-
logger: {
|
|
73
|
-
error: (message: string, meta?: unknown) => void;
|
|
74
|
-
warn: (message: string, meta?: unknown) => void;
|
|
75
|
-
info: (message: string, meta?: unknown) => void;
|
|
76
|
-
verbose: (message: string, meta?: unknown) => void;
|
|
77
|
-
debug: (message: string, meta?: unknown) => void;
|
|
78
|
-
};
|
|
79
|
-
targetBranch: string;
|
|
80
|
-
}) => boolean | Promise<boolean>) | undefined;
|
|
81
|
-
assignees: string[];
|
|
82
|
-
branchLabelMapping: Record<string, string> | undefined;
|
|
83
|
-
multipleBranches: boolean;
|
|
84
|
-
multipleCommits: boolean;
|
|
85
|
-
noVerify: boolean;
|
|
86
|
-
targetBranchChoices: import("options/ConfigOptions").BranchChoice[];
|
|
87
|
-
ci: boolean;
|
|
88
|
-
dryRun: boolean;
|
|
89
|
-
editor: string | undefined;
|
|
90
|
-
fork: boolean;
|
|
91
|
-
gitHostname: string;
|
|
92
|
-
githubApiBaseUrlV3: string;
|
|
93
|
-
githubApiBaseUrlV4: string;
|
|
94
|
-
mainline: number | undefined;
|
|
95
|
-
maxNumber: number;
|
|
96
|
-
path: string | undefined;
|
|
97
|
-
prTitle: string;
|
|
98
|
-
prDescription: string | undefined;
|
|
99
|
-
prFilter: string | undefined;
|
|
100
|
-
pullNumber: number | undefined;
|
|
101
|
-
resetAuthor: boolean;
|
|
102
|
-
sha: string | undefined;
|
|
103
|
-
sourceBranch: string | undefined;
|
|
104
|
-
sourcePRLabels: string[];
|
|
105
|
-
targetBranches: string[];
|
|
106
|
-
targetPRLabels: string[];
|
|
107
|
-
verbose: boolean;
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
declare module "services/github/v4/apiRequestV4" {
|
|
111
|
-
import { AxiosError } from 'axios';
|
|
112
|
-
import { HandledError } from "services/HandledError";
|
|
113
|
-
export interface GithubV4Response<DataResponse> {
|
|
114
|
-
data: DataResponse;
|
|
115
|
-
errors?: {
|
|
116
|
-
type: string;
|
|
117
|
-
path: string[];
|
|
118
|
-
locations: {
|
|
119
|
-
line: number;
|
|
120
|
-
column: number;
|
|
121
|
-
}[];
|
|
122
|
-
message: string;
|
|
123
|
-
}[];
|
|
124
|
-
}
|
|
125
|
-
export function apiRequestV4<DataResponse>({ githubApiBaseUrlV4, accessToken, query, variables, handleError, }: {
|
|
126
|
-
githubApiBaseUrlV4: string;
|
|
127
|
-
accessToken: string;
|
|
128
|
-
query: string;
|
|
129
|
-
variables?: {
|
|
130
|
-
[key: string]: string | number | null;
|
|
131
|
-
};
|
|
132
|
-
handleError?: boolean;
|
|
133
|
-
}): Promise<DataResponse>;
|
|
134
|
-
export function handleGithubV4Error(e: AxiosError<GithubV4Response<null>>): HandledError;
|
|
135
|
-
}
|
|
136
|
-
declare module "services/github/v4/throwOnInvalidAccessToken" {
|
|
137
|
-
import { AxiosError } from 'axios';
|
|
138
|
-
import { GithubV4Response } from "services/github/v4/apiRequestV4";
|
|
139
|
-
export function throwOnInvalidAccessToken({ repoOwner, repoName, error, }: {
|
|
140
|
-
repoOwner: string;
|
|
141
|
-
repoName: string;
|
|
142
|
-
error: AxiosError<GithubV4Response<null>>;
|
|
143
|
-
}): void;
|
|
144
|
-
}
|
|
145
|
-
declare module "services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks" {
|
|
146
|
-
import { ValidatedOptions } from "options/getValidatedOptions";
|
|
147
|
-
export interface DataResponse {
|
|
148
|
-
viewer: {
|
|
149
|
-
login: string;
|
|
150
|
-
};
|
|
151
|
-
repository: {
|
|
152
|
-
ref?: {
|
|
153
|
-
name: string;
|
|
154
|
-
};
|
|
155
|
-
defaultBranchRef: {
|
|
156
|
-
name: string;
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
export function fetchDefaultRepoBranchAndPerformStartupChecks({ accessToken, githubApiBaseUrlV4, repoName, repoOwner, }: ValidatedOptions): Promise<{
|
|
161
|
-
defaultBranch: string;
|
|
162
|
-
}>;
|
|
163
|
-
}
|
|
164
|
-
declare module "types/PromiseReturnType" {
|
|
165
|
-
export type PromiseReturnType<Func> = Func extends (...args: any[]) => Promise<infer Value> ? Value : Func;
|
|
166
|
-
}
|
|
167
|
-
declare module "services/fs-promisified" {
|
|
168
|
-
import fs from 'fs';
|
|
169
|
-
export const writeFile: typeof fs.writeFile.__promisify__;
|
|
170
|
-
export const readFile: typeof fs.readFile.__promisify__;
|
|
171
|
-
export const stat: typeof fs.stat.__promisify__;
|
|
172
|
-
export const chmod: typeof fs.chmod.__promisify__;
|
|
173
|
-
}
|
|
174
|
-
declare module "options/config/readConfigFile" {
|
|
175
|
-
import { ConfigOptions } from "options/ConfigOptions";
|
|
176
|
-
export function readConfigFile(filepath: string): Promise<ConfigOptions>;
|
|
177
|
-
}
|
|
178
|
-
declare module "options/config/globalConfig" {
|
|
179
|
-
export function getGlobalConfig(ci?: boolean): Promise<import("entrypoint.module").ConfigOptions | undefined>;
|
|
180
|
-
export function createGlobalConfigAndFolderIfNotExist(): Promise<boolean>;
|
|
181
|
-
export function createGlobalConfigIfNotExist(globalConfigPath: string, configTemplate: string): Promise<boolean>;
|
|
182
|
-
}
|
|
183
|
-
declare module "options/config/projectConfig" {
|
|
184
|
-
export function getProjectConfig(): Promise<import("entrypoint.module").ConfigOptions>;
|
|
185
|
-
}
|
|
186
|
-
declare module "options/config/config" {
|
|
187
|
-
import { ConfigOptions } from "options/ConfigOptions";
|
|
188
|
-
export function getOptionsFromConfigFiles(ci?: boolean): Promise<ConfigOptions>;
|
|
189
|
-
}
|
|
190
|
-
declare module "options/options" {
|
|
191
|
-
import { PromiseReturnType } from "types/PromiseReturnType";
|
|
192
|
-
import { ConfigOptions } from "options/ConfigOptions";
|
|
193
|
-
export type BackportOptions = Readonly<PromiseReturnType<typeof getOptions>>;
|
|
194
|
-
export function getOptions(argv: string[], optionsFromModule?: ConfigOptions): Promise<{
|
|
195
|
-
sourceBranch: string;
|
|
196
|
-
accessToken: string;
|
|
197
|
-
username: string;
|
|
198
|
-
repoName: string;
|
|
199
|
-
repoOwner: string;
|
|
200
|
-
author: string;
|
|
201
|
-
all: boolean;
|
|
202
|
-
autoFixConflicts: (({ files, directory, logger, targetBranch, }: {
|
|
203
|
-
files: string[];
|
|
204
|
-
directory: string;
|
|
205
|
-
logger: {
|
|
206
|
-
error: (message: string, meta?: unknown) => void;
|
|
207
|
-
warn: (message: string, meta?: unknown) => void;
|
|
208
|
-
info: (message: string, meta?: unknown) => void;
|
|
209
|
-
verbose: (message: string, meta?: unknown) => void;
|
|
210
|
-
debug: (message: string, meta?: unknown) => void;
|
|
211
|
-
};
|
|
212
|
-
targetBranch: string;
|
|
213
|
-
}) => boolean | Promise<boolean>) | undefined;
|
|
214
|
-
assignees: string[];
|
|
215
|
-
branchLabelMapping: Record<string, string> | undefined;
|
|
216
|
-
multipleBranches: boolean;
|
|
217
|
-
multipleCommits: boolean;
|
|
218
|
-
noVerify: boolean;
|
|
219
|
-
targetBranchChoices: import("options/ConfigOptions").BranchChoice[];
|
|
220
|
-
ci: boolean;
|
|
221
|
-
dryRun: boolean;
|
|
222
|
-
editor: string | undefined;
|
|
223
|
-
fork: boolean;
|
|
224
|
-
gitHostname: string;
|
|
225
|
-
githubApiBaseUrlV3: string;
|
|
226
|
-
githubApiBaseUrlV4: string;
|
|
227
|
-
mainline: number | undefined;
|
|
228
|
-
maxNumber: number;
|
|
229
|
-
path: string | undefined;
|
|
230
|
-
prTitle: string;
|
|
231
|
-
prDescription: string | undefined;
|
|
232
|
-
prFilter: string | undefined;
|
|
233
|
-
pullNumber: number | undefined;
|
|
234
|
-
resetAuthor: boolean;
|
|
235
|
-
sha: string | undefined;
|
|
236
|
-
sourcePRLabels: string[];
|
|
237
|
-
targetBranches: string[];
|
|
238
|
-
targetPRLabels: string[];
|
|
239
|
-
verbose: boolean;
|
|
240
|
-
}>;
|
|
241
|
-
}
|
|
242
|
-
declare module "services/env" {
|
|
243
|
-
import { BackportOptions } from "options/options";
|
|
244
|
-
export function getLogfilePath(): string;
|
|
245
|
-
export function getGlobalConfigPath(): string;
|
|
246
|
-
export function getReposPath(): string;
|
|
247
|
-
export function getRepoOwnerPath({ repoOwner }: BackportOptions): string;
|
|
248
|
-
export function getRepoPath({ repoOwner, repoName }: BackportOptions): string;
|
|
249
|
-
}
|
|
250
|
-
declare module "services/logger" {
|
|
251
|
-
import { OptionsFromCliArgs } from "options/cliArgs";
|
|
252
|
-
export function consoleLog(message: string): void;
|
|
253
|
-
export type Logger = typeof logger;
|
|
254
|
-
export const logger: {
|
|
255
|
-
error: (message: string, meta?: unknown) => void;
|
|
256
|
-
warn: (message: string, meta?: unknown) => void;
|
|
257
|
-
info: (message: string, meta?: unknown) => void;
|
|
258
|
-
verbose: (message: string, meta?: unknown) => void;
|
|
259
|
-
debug: (message: string, meta?: unknown) => void;
|
|
260
|
-
};
|
|
261
|
-
export function updateLogger(options: OptionsFromCliArgs): void;
|
|
262
|
-
export function redact(str: string): string;
|
|
263
|
-
export function initLogger(): {
|
|
264
|
-
error: (message: string, meta?: unknown) => void;
|
|
265
|
-
warn: (message: string, meta?: unknown) => void;
|
|
266
|
-
info: (message: string, meta?: unknown) => void;
|
|
267
|
-
verbose: (message: string, meta?: unknown) => void;
|
|
268
|
-
debug: (message: string, meta?: unknown) => void;
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
declare module "options/ConfigOptions" {
|
|
272
|
-
import { Logger } from "services/logger";
|
|
273
|
-
export interface BranchChoice {
|
|
274
|
-
name: string;
|
|
275
|
-
checked?: boolean;
|
|
276
|
-
}
|
|
277
|
-
export type BranchChoiceRaw = string | BranchChoice;
|
|
278
|
-
type AutoFixConflictsHandler = ({ files, directory, logger, targetBranch, }: {
|
|
279
|
-
files: string[];
|
|
280
|
-
directory: string;
|
|
281
|
-
logger: Logger;
|
|
282
|
-
targetBranch: string;
|
|
283
|
-
}) => boolean | Promise<boolean>;
|
|
284
|
-
export interface ConfigOptions {
|
|
285
|
-
accessToken?: string;
|
|
286
|
-
all?: boolean;
|
|
287
|
-
assignees?: string[];
|
|
288
|
-
author?: string;
|
|
289
|
-
autoAssign?: boolean;
|
|
290
|
-
autoFixConflicts?: AutoFixConflictsHandler;
|
|
291
|
-
branchLabelMapping?: Record<string, string>;
|
|
292
|
-
ci?: boolean;
|
|
293
|
-
editor?: string;
|
|
294
|
-
fork?: boolean;
|
|
295
|
-
gitHostname?: string;
|
|
296
|
-
githubApiBaseUrlV3?: string;
|
|
297
|
-
githubApiBaseUrlV4?: string;
|
|
298
|
-
maxNumber?: number;
|
|
299
|
-
multiple?: boolean;
|
|
300
|
-
multipleBranches?: boolean;
|
|
301
|
-
multipleCommits?: boolean;
|
|
302
|
-
noVerify?: boolean;
|
|
303
|
-
path?: string;
|
|
304
|
-
prDescription?: string;
|
|
305
|
-
prFilter?: string;
|
|
306
|
-
prTitle?: string;
|
|
307
|
-
pullNumber?: number;
|
|
308
|
-
resetAuthor?: boolean;
|
|
309
|
-
sha?: string;
|
|
310
|
-
sourceBranch?: string;
|
|
311
|
-
sourcePRLabels?: string[];
|
|
312
|
-
targetBranchChoices?: BranchChoiceRaw[];
|
|
313
|
-
targetBranches?: string[];
|
|
314
|
-
targetPRLabels?: string[];
|
|
315
|
-
upstream?: string;
|
|
316
|
-
username?: string;
|
|
317
|
-
verbose?: boolean;
|
|
318
|
-
branches?: BranchChoiceRaw[];
|
|
319
|
-
labels?: string[];
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
declare module "services/sequentially" {
|
|
323
|
-
export function sequentially<T>(items: T[], handler: (item: T) => Promise<void>): Promise<void>;
|
|
324
|
-
}
|
|
325
|
-
declare module "services/child-process-promisified" {
|
|
326
|
-
import child_process from 'child_process';
|
|
327
|
-
export function exec(cmd: string, options: child_process.ExecOptions): Promise<{
|
|
328
|
-
stdout: string;
|
|
329
|
-
stderr: string;
|
|
330
|
-
}>;
|
|
331
|
-
export const execAsCallback: (command: string, options: (import("fs").BaseEncodingOptions & child_process.ExecOptions) | null | undefined, callback?: ((error: child_process.ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined) => child_process.ChildProcess;
|
|
332
|
-
}
|
|
333
|
-
declare module "services/github/commitFormatters" {
|
|
334
|
-
export function getShortSha(sha: string): string;
|
|
335
|
-
export function getFirstCommitMessageLine(message: string): string;
|
|
336
|
-
export function getFormattedCommitMessage({ message, pullNumber, sha, }: {
|
|
337
|
-
message: string;
|
|
338
|
-
pullNumber?: number;
|
|
339
|
-
sha: string;
|
|
340
|
-
}): string;
|
|
341
|
-
export function getPullNumberFromMessage(firstMessageLine: string): number | undefined;
|
|
342
|
-
}
|
|
343
|
-
declare module "services/git" {
|
|
344
|
-
import { BackportOptions } from "options/options";
|
|
345
|
-
import { Commit } from '../types/Commit';
|
|
346
|
-
export function repoExists(options: BackportOptions): Promise<boolean>;
|
|
347
|
-
export function deleteRepo(options: BackportOptions): Promise<string[]>;
|
|
348
|
-
export function getRemoteUrl({ repoName, accessToken, gitHostname }: BackportOptions, repoOwner: string): string;
|
|
349
|
-
export function cloneRepo(options: BackportOptions, callback: (progress: string) => void): Promise<unknown>;
|
|
350
|
-
export function deleteRemote(options: BackportOptions, remoteName: string): Promise<void>;
|
|
351
|
-
export function addRemote(options: BackportOptions, remoteName: string): Promise<void>;
|
|
352
|
-
export function cherrypick(options: BackportOptions, commit: Commit): Promise<{
|
|
353
|
-
needsResolving: boolean;
|
|
354
|
-
}>;
|
|
355
|
-
export function commitChanges(commit: Commit, options: BackportOptions): Promise<void>;
|
|
356
|
-
export function getConflictingFiles(options: BackportOptions): Promise<string[]>;
|
|
357
|
-
export function getUnstagedFiles(options: BackportOptions): Promise<string[]>;
|
|
358
|
-
export function setCommitAuthor(options: BackportOptions, username: string): Promise<{
|
|
359
|
-
stdout: string;
|
|
360
|
-
stderr: string;
|
|
361
|
-
}>;
|
|
362
|
-
export function createBackportBranch({ options, targetBranch, backportBranch, }: {
|
|
363
|
-
options: BackportOptions;
|
|
364
|
-
targetBranch: string;
|
|
365
|
-
backportBranch: string;
|
|
366
|
-
}): Promise<{
|
|
367
|
-
stdout: string;
|
|
368
|
-
stderr: string;
|
|
369
|
-
}>;
|
|
370
|
-
export function deleteBackportBranch({ options, backportBranch, }: {
|
|
371
|
-
options: BackportOptions;
|
|
372
|
-
backportBranch: string;
|
|
373
|
-
}): Promise<void>;
|
|
374
|
-
export function getRepoForkOwner(options: BackportOptions): string;
|
|
375
|
-
export function pushBackportBranch({ options, backportBranch, }: {
|
|
376
|
-
options: BackportOptions;
|
|
377
|
-
backportBranch: string;
|
|
378
|
-
}): Promise<{
|
|
379
|
-
stdout: string;
|
|
380
|
-
stderr: string;
|
|
381
|
-
} | undefined>;
|
|
382
|
-
}
|
|
383
|
-
declare module "services/github/v3/addAssigneesToPullRequest" {
|
|
384
|
-
import { BackportOptions } from "options/options";
|
|
385
|
-
export function addAssigneesToPullRequest({ githubApiBaseUrlV3, repoName, repoOwner, accessToken, username, dryRun, }: BackportOptions, pullNumber: number, assignees: string[]): Promise<void>;
|
|
386
|
-
}
|
|
387
|
-
declare module "services/github/v3/addLabelsToPullRequest" {
|
|
388
|
-
import { BackportOptions } from "options/options";
|
|
389
|
-
export function addLabelsToPullRequest({ githubApiBaseUrlV3, repoName, repoOwner, accessToken, dryRun, }: BackportOptions, pullNumber: number, labels: string[]): Promise<void>;
|
|
390
|
-
}
|
|
391
|
-
declare module "services/github/v4/fetchExistingPullRequest" {
|
|
392
|
-
import { BackportOptions } from "options/options";
|
|
393
|
-
import { PullRequestPayload } from "services/github/v3/createPullRequest";
|
|
394
|
-
export function fetchExistingPullRequest({ options, prPayload, }: {
|
|
395
|
-
options: BackportOptions;
|
|
396
|
-
prPayload: PullRequestPayload;
|
|
397
|
-
}): Promise<{
|
|
398
|
-
url: string;
|
|
399
|
-
number: number;
|
|
400
|
-
} | undefined>;
|
|
401
|
-
export function splitHead(prPayload: PullRequestPayload): {
|
|
402
|
-
repoForkOwner: string;
|
|
403
|
-
head: string;
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
declare module "services/github/v3/getGithubV3ErrorMessage" {
|
|
407
|
-
export type GithubV3Error = {
|
|
408
|
-
name: string;
|
|
409
|
-
status: number;
|
|
410
|
-
documentation_url: string;
|
|
411
|
-
message?: string;
|
|
412
|
-
errors?: Array<{
|
|
413
|
-
resource: string;
|
|
414
|
-
code: string;
|
|
415
|
-
field: string;
|
|
416
|
-
message?: string;
|
|
417
|
-
}>;
|
|
418
|
-
};
|
|
419
|
-
export function getGithubV3ErrorMessage(e: GithubV3Error): string | undefined;
|
|
420
|
-
}
|
|
421
|
-
declare module "services/github/v3/createPullRequest" {
|
|
422
|
-
import { BackportOptions } from "options/options";
|
|
423
|
-
import { Commit } from '../../../types/Commit';
|
|
424
|
-
export interface PullRequestPayload {
|
|
425
|
-
owner: string;
|
|
426
|
-
repo: string;
|
|
427
|
-
title: string;
|
|
428
|
-
body: string;
|
|
429
|
-
head: string;
|
|
430
|
-
base: string;
|
|
431
|
-
[key: string]: unknown;
|
|
432
|
-
}
|
|
433
|
-
export function createPullRequest({ options, prPayload, }: {
|
|
434
|
-
options: BackportOptions;
|
|
435
|
-
prPayload: PullRequestPayload;
|
|
436
|
-
}): Promise<{
|
|
437
|
-
url: string;
|
|
438
|
-
number: number;
|
|
439
|
-
}>;
|
|
440
|
-
export function getBody({ options, commits, targetBranch, }: {
|
|
441
|
-
options: BackportOptions;
|
|
442
|
-
commits: Commit[];
|
|
443
|
-
targetBranch: string;
|
|
444
|
-
}): string;
|
|
445
|
-
export function getTitle({ options, commits, targetBranch, }: {
|
|
446
|
-
options: BackportOptions;
|
|
447
|
-
commits: Commit[];
|
|
448
|
-
targetBranch: string;
|
|
449
|
-
}): string;
|
|
450
|
-
}
|
|
451
|
-
declare module "services/prompts" {
|
|
452
|
-
import { BranchChoice } from "options/ConfigOptions";
|
|
453
|
-
import { Commit } from '../types/Commit';
|
|
454
|
-
export function promptForCommits({ commitChoices, isMultipleChoice, }: {
|
|
455
|
-
commitChoices: Commit[];
|
|
456
|
-
isMultipleChoice: boolean;
|
|
457
|
-
}): Promise<Commit[]>;
|
|
458
|
-
export function promptForTargetBranches({ targetBranchChoices, isMultipleChoice, }: {
|
|
459
|
-
targetBranchChoices: BranchChoice[];
|
|
460
|
-
isMultipleChoice: boolean;
|
|
461
|
-
}): Promise<string[]>;
|
|
462
|
-
export function confirmPrompt(message: string): Promise<boolean>;
|
|
463
|
-
}
|
|
464
|
-
declare module "ui/cherrypickAndCreateTargetPullRequest" {
|
|
465
|
-
import { BackportOptions } from "options/options";
|
|
466
|
-
import { Commit } from '../types/Commit';
|
|
467
|
-
export function cherrypickAndCreateTargetPullRequest({ options, commits, targetBranch, }: {
|
|
468
|
-
options: BackportOptions;
|
|
469
|
-
commits: Commit[];
|
|
470
|
-
targetBranch: string;
|
|
471
|
-
}): Promise<{
|
|
472
|
-
url: string;
|
|
473
|
-
number: number;
|
|
474
|
-
}>;
|
|
475
|
-
export function getBackportBranchName(targetBranch: string, commits: Commit[]): string;
|
|
476
|
-
}
|
|
477
|
-
declare module "utils/filterEmpty" {
|
|
478
|
-
export function filterNil<TValue>(value: TValue | null | undefined): value is TValue;
|
|
479
|
-
}
|
|
480
|
-
declare module "services/github/v4/getExistingTargetPullRequests" {
|
|
481
|
-
export const pullRequestFragmentName = "ExistingTargetPullRequests";
|
|
482
|
-
export const pullRequestFragment: string;
|
|
483
|
-
export interface PullRequestNode {
|
|
484
|
-
baseRefName: string;
|
|
485
|
-
number: number;
|
|
486
|
-
mergeCommit: {
|
|
487
|
-
oid: string;
|
|
488
|
-
message: string;
|
|
489
|
-
} | null;
|
|
490
|
-
labels: {
|
|
491
|
-
nodes: {
|
|
492
|
-
name: string;
|
|
493
|
-
}[];
|
|
494
|
-
};
|
|
495
|
-
repository: {
|
|
496
|
-
owner: {
|
|
497
|
-
login: string;
|
|
498
|
-
};
|
|
499
|
-
name: string;
|
|
500
|
-
};
|
|
501
|
-
timelineItems: {
|
|
502
|
-
edges: (TimelineItemEdge | null)[];
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
interface PullRequestTimelineItem {
|
|
506
|
-
node: {
|
|
507
|
-
source: {
|
|
508
|
-
__typename: 'PullRequest';
|
|
509
|
-
title: string;
|
|
510
|
-
state: 'OPEN' | 'CLOSED' | 'MERGED';
|
|
511
|
-
baseRefName: string;
|
|
512
|
-
commits: {
|
|
513
|
-
edges: CommitEdge[];
|
|
514
|
-
};
|
|
515
|
-
};
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
interface IssueTimelineItem {
|
|
519
|
-
node: {
|
|
520
|
-
source: {
|
|
521
|
-
__typename: 'Issue';
|
|
522
|
-
};
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
type TimelineItemEdge = PullRequestTimelineItem | IssueTimelineItem;
|
|
526
|
-
interface CommitEdge {
|
|
527
|
-
node: {
|
|
528
|
-
commit: {
|
|
529
|
-
message: string;
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
export function getPullRequestLabels(pullRequestNode?: PullRequestNode): string[] | undefined;
|
|
534
|
-
export type ExistingTargetPullRequests = ReturnType<typeof getExistingTargetPullRequests>;
|
|
535
|
-
export function getExistingTargetPullRequests(commitMessage: string, sourcePullRequest?: PullRequestNode): {
|
|
536
|
-
branch: string;
|
|
537
|
-
state: "OPEN" | "CLOSED" | "MERGED";
|
|
538
|
-
}[];
|
|
539
|
-
}
|
|
540
|
-
declare module "services/github/v4/getTargetBranchesFromLabels" {
|
|
541
|
-
import { BackportOptions } from "options/options";
|
|
542
|
-
import { ExistingTargetPullRequests } from "services/github/v4/getExistingTargetPullRequests";
|
|
543
|
-
export function getTargetBranchForLabel({ branchLabelMapping, label, }: {
|
|
544
|
-
branchLabelMapping: NonNullable<BackportOptions['branchLabelMapping']>;
|
|
545
|
-
label: string;
|
|
546
|
-
}): string | undefined;
|
|
547
|
-
export function getTargetBranchesFromLabels({ existingTargetPullRequests, branchLabelMapping, labels, }: {
|
|
548
|
-
existingTargetPullRequests: ExistingTargetPullRequests;
|
|
549
|
-
branchLabelMapping: BackportOptions['branchLabelMapping'];
|
|
550
|
-
labels?: string[];
|
|
551
|
-
}): string[];
|
|
552
|
-
}
|
|
553
|
-
declare module "services/github/v4/fetchCommitByPullNumber" {
|
|
554
|
-
import { BackportOptions } from "options/options";
|
|
555
|
-
import { Commit } from '../../../types/Commit';
|
|
556
|
-
export function fetchCommitByPullNumber(options: BackportOptions & {
|
|
557
|
-
pullNumber: number;
|
|
558
|
-
}): Promise<Commit>;
|
|
559
|
-
}
|
|
560
|
-
declare module "services/github/v4/fetchCommitBySha" {
|
|
561
|
-
import { BackportOptions } from "options/options";
|
|
562
|
-
import { Commit } from '../../../types/Commit';
|
|
563
|
-
export function fetchCommitBySha(options: BackportOptions & {
|
|
564
|
-
sha: string;
|
|
565
|
-
}): Promise<Commit>;
|
|
566
|
-
}
|
|
567
|
-
declare module "services/github/v4/fetchAuthorId" {
|
|
568
|
-
import { BackportOptions } from "options/options";
|
|
569
|
-
export function fetchAuthorId(options: BackportOptions): Promise<string | null>;
|
|
570
|
-
}
|
|
571
|
-
declare module "services/github/v4/fetchCommitsByAuthor" {
|
|
572
|
-
import { BackportOptions } from "options/options";
|
|
573
|
-
import { Commit } from '../../../types/Commit';
|
|
574
|
-
import { PullRequestNode } from "services/github/v4/getExistingTargetPullRequests";
|
|
575
|
-
export function fetchCommitsByAuthor(options: BackportOptions): Promise<Commit[]>;
|
|
576
|
-
export interface DataResponse {
|
|
577
|
-
repository: {
|
|
578
|
-
ref: {
|
|
579
|
-
target: {
|
|
580
|
-
history: {
|
|
581
|
-
edges: HistoryEdge[];
|
|
582
|
-
};
|
|
583
|
-
};
|
|
584
|
-
} | null;
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
interface HistoryEdge {
|
|
588
|
-
node: {
|
|
589
|
-
oid: string;
|
|
590
|
-
message: string;
|
|
591
|
-
associatedPullRequests: {
|
|
592
|
-
edges: PullRequestEdge[];
|
|
593
|
-
};
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
export interface PullRequestEdge {
|
|
597
|
-
node: PullRequestNode;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
declare module "services/github/v4/fetchPullRequestBySearchQuery" {
|
|
601
|
-
import { BackportOptions } from "options/options";
|
|
602
|
-
import { Commit } from '../../../types/Commit';
|
|
603
|
-
import { PullRequestNode } from "services/github/v4/getExistingTargetPullRequests";
|
|
604
|
-
export function fetchPullRequestBySearchQuery(options: BackportOptions): Promise<Commit[]>;
|
|
605
|
-
export interface DataResponse {
|
|
606
|
-
search: {
|
|
607
|
-
nodes: PullRequestNode[];
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
declare module "ui/getCommits" {
|
|
612
|
-
import { BackportOptions } from "options/options";
|
|
613
|
-
export function getCommits(options: BackportOptions): Promise<import("types/Commit").Commit[]>;
|
|
614
|
-
}
|
|
615
|
-
declare module "ui/getTargetBranches" {
|
|
616
|
-
import { BackportOptions } from "options/options";
|
|
617
|
-
import { Commit } from '../types/Commit';
|
|
618
|
-
export function getTargetBranches(options: BackportOptions, commits: Commit[]): string[] | Promise<string[]>;
|
|
619
|
-
export function getTargetBranchChoices(options: BackportOptions, targetBranchesFromLabels: string[], sourceBranch: string): import("options/ConfigOptions").BranchChoice[];
|
|
620
|
-
}
|
|
621
|
-
declare module "ui/maybeSetupRepo" {
|
|
622
|
-
import { BackportOptions } from "options/options";
|
|
623
|
-
export function maybeSetupRepo(options: BackportOptions): Promise<void>;
|
|
624
|
-
}
|
|
625
|
-
declare module "runWithOptions" {
|
|
626
|
-
import { BackportOptions } from "options/options";
|
|
627
|
-
export type Result = {
|
|
628
|
-
success: boolean;
|
|
629
|
-
targetBranch: string;
|
|
630
|
-
pullRequestUrl?: string;
|
|
631
|
-
errorMessage?: string;
|
|
632
|
-
error?: Error;
|
|
633
|
-
};
|
|
634
|
-
export function runWithOptions(options: BackportOptions): Promise<Result[]>;
|
|
635
|
-
}
|
|
636
|
-
declare module "main" {
|
|
637
|
-
import { ConfigOptions } from "options/ConfigOptions";
|
|
638
|
-
import { Result } from "runWithOptions";
|
|
639
|
-
export type BackportResponse = {
|
|
640
|
-
success: boolean;
|
|
641
|
-
results: Result[];
|
|
642
|
-
errorMessage?: string;
|
|
643
|
-
error?: Error;
|
|
644
|
-
};
|
|
645
|
-
export function main(argv: string[], optionsFromModule?: ConfigOptions): Promise<BackportResponse>;
|
|
646
|
-
}
|
|
647
|
-
declare module "entrypoint.cli" { }
|
|
648
|
-
declare module "entrypoint.module" {
|
|
649
|
-
import { ConfigOptions } from "options/ConfigOptions";
|
|
650
|
-
export function run(options: ConfigOptions, args?: string[]): Promise<import("main").BackportResponse>;
|
|
651
|
-
export { BackportResponse } from "main";
|
|
652
|
-
export { ConfigOptions } from "options/ConfigOptions";
|
|
653
|
-
export { getTargetBranchForLabel } from "services/github/v4/getTargetBranchesFromLabels";
|
|
654
|
-
}
|
|
655
|
-
declare module "services/github/v4/mocks/commitsByAuthorMock" {
|
|
656
|
-
import { DataResponse } from "services/github/v4/fetchCommitsByAuthor";
|
|
657
|
-
export const commitsWithPullRequestsMock: DataResponse;
|
|
658
|
-
}
|
|
659
|
-
declare module "test/nockHelpers" {
|
|
660
|
-
import nock from 'nock';
|
|
661
|
-
export function mockGqlRequest({ name, statusCode, body, headers, apiBaseUrl, }: {
|
|
662
|
-
name: string;
|
|
663
|
-
statusCode: number;
|
|
664
|
-
body?: {
|
|
665
|
-
data: Record<any, any>;
|
|
666
|
-
} | {
|
|
667
|
-
errors: any[];
|
|
668
|
-
};
|
|
669
|
-
headers?: any;
|
|
670
|
-
apiBaseUrl?: string;
|
|
671
|
-
}): {
|
|
672
|
-
query: string;
|
|
673
|
-
variables: string;
|
|
674
|
-
}[];
|
|
675
|
-
export function getNockCallsForScope(scope: nock.Scope): unknown[];
|
|
676
|
-
}
|
|
677
|
-
declare module "runWithOptions.test" { }
|
|
678
|
-
declare module "options/cliArgs.test" { }
|
|
679
|
-
declare module "options/getValidatedOptions.test" { }
|
|
680
|
-
declare module "options/options.test" { }
|
|
681
|
-
declare module "options/config/config.test" { }
|
|
682
|
-
declare module "options/config/globalConfig.test" { }
|
|
683
|
-
declare module "options/config/projectConfig.test" { }
|
|
684
|
-
declare module "scripts/postinstall" {
|
|
685
|
-
export function postinstall(): Promise<void>;
|
|
686
|
-
}
|
|
687
|
-
declare module "scripts/postinstall.test" { }
|
|
688
|
-
declare module "scripts/runPostinstall" { }
|
|
689
|
-
declare module "services/env.test" { }
|
|
690
|
-
declare module "test/ExecError" {
|
|
691
|
-
import { SignalConstants } from 'os';
|
|
692
|
-
export class ExecError extends Error {
|
|
693
|
-
code: number | undefined;
|
|
694
|
-
cmd: string | undefined;
|
|
695
|
-
stdout: string | undefined;
|
|
696
|
-
stderr: string | undefined;
|
|
697
|
-
constructor(error: {
|
|
698
|
-
cmd?: string;
|
|
699
|
-
killed?: boolean;
|
|
700
|
-
code?: number;
|
|
701
|
-
signal?: SignalConstants | null;
|
|
702
|
-
stdout?: string;
|
|
703
|
-
stderr?: string;
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
declare module "services/git.test" { }
|
|
708
|
-
declare module "services/github/commitFormatters.test" { }
|
|
709
|
-
declare module "services/github/v3/addAssigneesToPullRequest.test" { }
|
|
710
|
-
declare module "services/github/v4/apiRequestV4.test" { }
|
|
711
|
-
declare module "test/private/getDevAccessToken" {
|
|
712
|
-
export function getDevAccessToken(): Promise<string>;
|
|
713
|
-
}
|
|
714
|
-
declare module "services/github/v4/fetchAuthorId.private.test" { }
|
|
715
|
-
declare module "services/github/v4/fetchCommitByPullNumber.private.test" { }
|
|
716
|
-
declare module "services/github/v4/fetchCommitBySha.private.test" { }
|
|
717
|
-
declare module "services/github/v4/fetchCommitsByAuthor.private.test" { }
|
|
718
|
-
declare module "services/github/v4/mocks/getCommitsByAuthorMock" {
|
|
719
|
-
import { DataResponse } from "services/github/v4/fetchCommitsByAuthor";
|
|
720
|
-
export const getCommitsByAuthorMock: (repoName: string) => DataResponse;
|
|
721
|
-
}
|
|
722
|
-
declare module "services/github/v4/mocks/getPullRequestNodeMock" {
|
|
723
|
-
import { PullRequestNode } from "services/github/v4/getExistingTargetPullRequests";
|
|
724
|
-
export function getPullRequestNodeMock({ pullRequestNumber, timelinePullRequest, }: {
|
|
725
|
-
pullRequestNumber: number;
|
|
726
|
-
timelinePullRequest: {
|
|
727
|
-
title: string;
|
|
728
|
-
commits: string[];
|
|
729
|
-
};
|
|
730
|
-
}): PullRequestNode;
|
|
731
|
-
}
|
|
732
|
-
declare module "services/github/v4/fetchCommitsByAuthor.test" { }
|
|
733
|
-
declare module "services/github/v4/fetchDefaultRepoBranchAndPerformStartupChecks.private.test" { }
|
|
734
|
-
declare module "services/github/v4/fetchExistingPullRequest.private.test" { }
|
|
735
|
-
declare module "services/github/v4/fetchPullRequestBySearchQuery.private.test" { }
|
|
736
|
-
declare module "services/github/v4/mocks/fetchPullRequestBySearchQueryMock" {
|
|
737
|
-
import { DataResponse } from "services/github/v4/fetchPullRequestBySearchQuery";
|
|
738
|
-
export const fetchPullRequestBySearchQueryMock: DataResponse;
|
|
739
|
-
}
|
|
740
|
-
declare module "services/github/v4/fetchPullRequestBySearchQuery.test" { }
|
|
741
|
-
declare module "services/github/v4/getTargetBranchesFromLabels.test" { }
|
|
742
|
-
declare module "services/github/v4/throwOnInvalidAccessToken.test" { }
|
|
743
|
-
declare module "test/inquirer.private.test" { }
|
|
744
|
-
declare module "test/integration/envConstants" {
|
|
745
|
-
export const INTEGRATION_TEST_DIR_PATH: string;
|
|
746
|
-
export const INTEGRATION_TEST_DATA_PATH: string;
|
|
747
|
-
export const HOMEDIR_PATH: string;
|
|
748
|
-
export const REMOTE_ORIGIN_REPO_PATH: string;
|
|
749
|
-
export const REMOTE_FORK_REPO_PATH: string;
|
|
750
|
-
}
|
|
751
|
-
declare module "test/integration/createSpies" {
|
|
752
|
-
export function createSpies({ commitCount }: {
|
|
753
|
-
commitCount: number;
|
|
754
|
-
}): {
|
|
755
|
-
getDefaultRepoBranchCalls: {
|
|
756
|
-
query: string;
|
|
757
|
-
variables: string;
|
|
758
|
-
}[];
|
|
759
|
-
authorIdCalls: {
|
|
760
|
-
query: string;
|
|
761
|
-
variables: string;
|
|
762
|
-
}[];
|
|
763
|
-
commitsByAuthorCalls: {
|
|
764
|
-
query: string;
|
|
765
|
-
variables: string;
|
|
766
|
-
}[];
|
|
767
|
-
createPullRequestCalls: unknown[];
|
|
768
|
-
};
|
|
769
|
-
}
|
|
770
|
-
declare module "test/integration/helpers" {
|
|
771
|
-
export function getBranches(cwd: string): Promise<string[]>;
|
|
772
|
-
export function getLatestCommit({ branch, commitCount, cwd, }: {
|
|
773
|
-
branch: string;
|
|
774
|
-
commitCount: number;
|
|
775
|
-
cwd: string;
|
|
776
|
-
}): Promise<string>;
|
|
777
|
-
export function deleteAndSetupEnvironment(): Promise<void>;
|
|
778
|
-
}
|
|
779
|
-
declare module "test/integration/integration.test" { }
|
|
780
|
-
declare module "test/setupFiles/automatic-mocks" { }
|
|
781
|
-
declare module "ui/cherrypickAndCreatePullRequest.test" { }
|
|
782
|
-
declare module "ui/getTargetBranches.test" { }
|
|
783
|
-
declare module "ui/maybeSetupRepo.test" { }
|