backport 8.4.4 → 8.5.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/dist/backportRun.js +1 -5
- package/dist/entrypoint.module.d.ts +2 -2
- package/dist/entrypoint.module.js +9 -8
- package/dist/entrypoint.module.private.test.js +86 -32
- package/dist/lib/BackportError.d.ts +3 -0
- package/dist/lib/BackportError.js +2 -0
- package/dist/lib/cherrypickAndCreateTargetPullRequest.js +4 -3
- package/dist/lib/cherrypickAndCreateTargetPullRequest.test.js +30 -4
- package/dist/lib/getCommits.js +14 -9
- package/dist/lib/getCommitsWithoutBackports.js +3 -3
- package/dist/lib/getCommitsWithoutBackports.test.js +38 -15
- package/dist/lib/getTargetBranches.d.ts +1 -1
- package/dist/lib/getTargetBranches.js +6 -10
- package/dist/lib/getTargetBranches.test.js +9 -9
- package/dist/lib/git.d.ts +2 -2
- package/dist/lib/git.js +9 -2
- package/dist/lib/git.test.js +3 -1
- package/dist/lib/github/v3/createPullRequest.test.js +39 -13
- package/dist/lib/github/v3/createStatusComment.js +5 -2
- package/dist/lib/github/v3/createStatusComment.test.js +7 -3
- package/dist/lib/github/v4/fetchCommits/allFetchers.private.test.js +20 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +32 -10
- package/dist/lib/github/v4/fetchCommits/fetchCommitBySha.private.test.js +9 -1
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +49 -14
- package/dist/lib/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +15 -5
- package/dist/lib/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +41 -11
- package/dist/lib/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +1 -1
- package/dist/lib/github/v4/validateTargetBranch.d.ts +15 -0
- package/dist/lib/github/v4/{validateTargetBranches.js → validateTargetBranch.js} +13 -17
- package/dist/lib/github/v4/{validateTargetBranches.private.test.d.ts → validateTargetBranch.private.test.d.ts} +0 -0
- package/dist/lib/github/v4/validateTargetBranch.private.test.js +23 -0
- package/dist/lib/prompt.test.js +37 -9
- package/dist/lib/prompts.js +5 -2
- package/dist/lib/setupRepo.js +3 -3
- package/dist/lib/sourceCommit/getPullRequestStates.d.ts +27 -0
- package/dist/lib/sourceCommit/{getExpectedTargetPullRequests.js → getPullRequestStates.js} +62 -27
- package/dist/lib/sourceCommit/{getExpectedTargetPullRequests.test.d.ts → getPullRequestStates.test.d.ts} +0 -0
- package/dist/lib/sourceCommit/{getExpectedTargetPullRequests.test.js → getPullRequestStates.test.js} +283 -87
- package/dist/lib/sourceCommit/parseSourceCommit.d.ts +4 -2
- package/dist/lib/sourceCommit/parseSourceCommit.js +20 -5
- package/dist/lib/sourceCommit/parseSourceCommit.test.js +78 -25
- package/dist/options/ConfigOptions.d.ts +1 -1
- package/dist/options/config/config.d.ts +1 -1
- package/dist/options/config/readConfigFile.d.ts +1 -1
- package/dist/options/options.d.ts +1 -1
- package/dist/runSequentially.js +9 -3
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +2 -2
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.js +2 -2
- package/dist/test/e2e/cli/error-handling-non-interactive-mode.private.test.js +10 -8
- package/dist/test/e2e/cli/repo-with-changing-branchLabelMapping.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/repo-with-changing-branchLabelMapping.private.test.js +95 -0
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +11 -4
- package/dist/test/handleUnbackportedPullRequests.private.test.js +10 -1
- package/dist/test/nockHelpers.js +1 -0
- package/dist/utils/filterUnmergedCommits.js +1 -1
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +13 -13
- package/yarn.lock +512 -425
- package/dist/lib/github/v4/validateTargetBranches.d.ts +0 -9
- package/dist/lib/github/v4/validateTargetBranches.private.test.js +0 -51
- package/dist/lib/sourceCommit/getExpectedTargetPullRequests.d.ts +0 -16
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ValidConfigOptions } from '../../../options/options';
|
|
2
|
-
export interface TargetBranchResponse {
|
|
3
|
-
repository: {
|
|
4
|
-
ref: {
|
|
5
|
-
id: string;
|
|
6
|
-
} | null;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare function validateTargetBranches({ accessToken, repoName, repoOwner, githubApiBaseUrlV4 }: ValidConfigOptions, targetBranches: string[]): Promise<void>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const getDevAccessToken_1 = require("../../../test/private/getDevAccessToken");
|
|
4
|
-
const validateTargetBranches_1 = require("./validateTargetBranches");
|
|
5
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
6
|
-
describe('validateTargetBranches', () => {
|
|
7
|
-
describe('no branches', () => {
|
|
8
|
-
it('resolves', async () => {
|
|
9
|
-
const options = {
|
|
10
|
-
repoOwner: 'backport-org',
|
|
11
|
-
repoName: 'repo-with-target-branches',
|
|
12
|
-
accessToken,
|
|
13
|
-
};
|
|
14
|
-
const targetBranches = [];
|
|
15
|
-
expect(await (0, validateTargetBranches_1.validateTargetBranches)(options, targetBranches)).toEqual(undefined);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe('one invalid and one valid branch', () => {
|
|
19
|
-
it('throws', async () => {
|
|
20
|
-
const options = {
|
|
21
|
-
repoOwner: 'backport-org',
|
|
22
|
-
repoName: 'repo-with-target-branches',
|
|
23
|
-
accessToken,
|
|
24
|
-
};
|
|
25
|
-
const targetBranches = ['production', 'foo'];
|
|
26
|
-
await expect(() => (0, validateTargetBranches_1.validateTargetBranches)(options, targetBranches)).rejects.toThrowError('The branch "foo" does not exist');
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
describe('two valid branches', () => {
|
|
30
|
-
it('resolves', async () => {
|
|
31
|
-
const options = {
|
|
32
|
-
repoOwner: 'backport-org',
|
|
33
|
-
repoName: 'repo-with-target-branches',
|
|
34
|
-
accessToken,
|
|
35
|
-
};
|
|
36
|
-
const targetBranches = ['production', 'staging'];
|
|
37
|
-
expect(await (0, validateTargetBranches_1.validateTargetBranches)(options, targetBranches)).toEqual(undefined);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
describe('two invalid branches', () => {
|
|
41
|
-
it('throws', async () => {
|
|
42
|
-
const options = {
|
|
43
|
-
repoOwner: 'backport-org',
|
|
44
|
-
repoName: 'repo-with-target-branches',
|
|
45
|
-
accessToken,
|
|
46
|
-
};
|
|
47
|
-
const targetBranches = ['foo', 'bar'];
|
|
48
|
-
await expect(() => (0, validateTargetBranches_1.validateTargetBranches)(options, targetBranches)).rejects.toThrow(/The branch "(foo|bar)" does not exist/);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ValidConfigOptions } from '../../options/options';
|
|
2
|
-
import { SourceCommitWithTargetPullRequest } from './parseSourceCommit';
|
|
3
|
-
export declare type ExpectedTargetPullRequest = {
|
|
4
|
-
url?: string;
|
|
5
|
-
number?: number;
|
|
6
|
-
branch: string;
|
|
7
|
-
state: 'OPEN' | 'CLOSED' | 'MERGED' | 'NOT_CREATED';
|
|
8
|
-
mergeCommit?: {
|
|
9
|
-
sha: string;
|
|
10
|
-
message: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare function getExpectedTargetPullRequests({ sourceCommit, latestBranchLabelMapping, }: {
|
|
14
|
-
sourceCommit: SourceCommitWithTargetPullRequest;
|
|
15
|
-
latestBranchLabelMapping: ValidConfigOptions['branchLabelMapping'];
|
|
16
|
-
}): ExpectedTargetPullRequest[];
|