backport 8.3.0 → 8.4.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 +11 -178
- 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/cherrypickAndCreateTargetPullRequest.js +30 -20
- package/dist/lib/child-process-promisified.js +2 -2
- package/dist/lib/getCommits.js +1 -1
- package/dist/lib/git.d.ts +1 -1
- package/dist/lib/git.js +8 -28
- package/dist/lib/git.private.test.js +7 -7
- package/dist/lib/git.test.js +28 -12
- 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 +6 -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/ora.d.ts +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 +3 -3
- package/dist/options/options.test.js +7 -4
- 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 +48 -0
- package/dist/test/e2e/cli/different-merge-strategies.private.test.js +120 -4
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +4 -18
- package/dist/test/e2e/cli/error-handling-interactive-mode.private.test.js +2 -1
- package/dist/test/e2e/cli/error-handling-non-interactive-mode.private.test.js +3 -2
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.js +2 -2
- package/dist/test/e2e/cli/runBackportViaCli.d.ts +8 -2
- package/dist/test/e2e/cli/runBackportViaCli.js +47 -17
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js +1 -0
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +1 -1
- package/dist/test/handleUnbackportedPullRequests.private.test.js +1 -1
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +20 -21
- package/yarn.lock +210 -220
- 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
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const nock_1 = __importDefault(require("nock"));
|
|
7
|
-
const addAssigneesToPullRequest_1 = require("./addAssigneesToPullRequest");
|
|
8
|
-
describe('addAssigneesToPullRequest', () => {
|
|
9
|
-
it('should add assignees to PR', async () => {
|
|
10
|
-
const pullNumber = 216;
|
|
11
|
-
const assignees = ['sqren'];
|
|
12
|
-
const scope = (0, nock_1.default)('https://api.github.com')
|
|
13
|
-
.post('/repos/elastic/kibana/issues/216/assignees', {
|
|
14
|
-
assignees: ['sqren'],
|
|
15
|
-
})
|
|
16
|
-
.reply(200, 'some response');
|
|
17
|
-
const res = await (0, addAssigneesToPullRequest_1.addAssigneesToPullRequest)({
|
|
18
|
-
author: 'sqren',
|
|
19
|
-
repoName: 'kibana',
|
|
20
|
-
repoOwner: 'elastic',
|
|
21
|
-
accessToken: 'my-token',
|
|
22
|
-
}, pullNumber, assignees);
|
|
23
|
-
expect(res).toBe(undefined);
|
|
24
|
-
scope.done();
|
|
25
|
-
nock_1.default.cleanAll();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addLabelsToPullRequest = void 0;
|
|
4
|
-
const rest_1 = require("@octokit/rest");
|
|
5
|
-
const ora_1 = require("../../../ui/ora");
|
|
6
|
-
const logger_1 = require("../../logger");
|
|
7
|
-
async function addLabelsToPullRequest({ githubApiBaseUrlV3, repoName, repoOwner, accessToken, ci, }, pullNumber, labels) {
|
|
8
|
-
const text = `Adding labels: ${labels.join(', ')}`;
|
|
9
|
-
logger_1.logger.info(text);
|
|
10
|
-
const spinner = (0, ora_1.ora)(ci, text).start();
|
|
11
|
-
try {
|
|
12
|
-
const octokit = new rest_1.Octokit({
|
|
13
|
-
auth: accessToken,
|
|
14
|
-
baseUrl: githubApiBaseUrlV3,
|
|
15
|
-
log: logger_1.logger,
|
|
16
|
-
});
|
|
17
|
-
await octokit.issues.addLabels({
|
|
18
|
-
owner: repoOwner,
|
|
19
|
-
repo: repoName,
|
|
20
|
-
issue_number: pullNumber,
|
|
21
|
-
labels,
|
|
22
|
-
});
|
|
23
|
-
spinner.succeed();
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
spinner.fail();
|
|
27
|
-
logger_1.logger.info(`Could not add labels to PR ${pullNumber}`, e);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.addLabelsToPullRequest = addLabelsToPullRequest;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addReviewersToPullRequest = void 0;
|
|
4
|
-
const rest_1 = require("@octokit/rest");
|
|
5
|
-
const ora_1 = require("../../../ui/ora");
|
|
6
|
-
const logger_1 = require("../../logger");
|
|
7
|
-
async function addReviewersToPullRequest({ githubApiBaseUrlV3, repoName, repoOwner, accessToken, ci, }, pullNumber, reviewers) {
|
|
8
|
-
const text = `Adding reviewers: ${reviewers}`;
|
|
9
|
-
logger_1.logger.info(text);
|
|
10
|
-
const spinner = (0, ora_1.ora)(ci, text).start();
|
|
11
|
-
try {
|
|
12
|
-
const octokit = new rest_1.Octokit({
|
|
13
|
-
auth: accessToken,
|
|
14
|
-
baseUrl: githubApiBaseUrlV3,
|
|
15
|
-
log: logger_1.logger,
|
|
16
|
-
});
|
|
17
|
-
await octokit.pulls.requestReviewers({
|
|
18
|
-
owner: repoOwner,
|
|
19
|
-
repo: repoName,
|
|
20
|
-
pull_number: pullNumber,
|
|
21
|
-
reviewers,
|
|
22
|
-
});
|
|
23
|
-
spinner.succeed();
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
//@ts-expect-error
|
|
27
|
-
const message = e.response?.data?.message;
|
|
28
|
-
spinner.fail(`Adding reviewers. ${message ? message : ''}`);
|
|
29
|
-
logger_1.logger.info(`Could not add reviewers to PR ${pullNumber}`, e);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.addReviewersToPullRequest = addReviewersToPullRequest;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ValidConfigOptions } from '../../../options/options';
|
|
2
|
-
import { Commit } from '../../sourceCommit/parseSourceCommit';
|
|
3
|
-
export interface PullRequestPayload {
|
|
4
|
-
owner: string;
|
|
5
|
-
repo: string;
|
|
6
|
-
title: string;
|
|
7
|
-
body: string;
|
|
8
|
-
head: string;
|
|
9
|
-
base: string;
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
}
|
|
12
|
-
export declare function createPullRequest({ options, prPayload, }: {
|
|
13
|
-
options: ValidConfigOptions;
|
|
14
|
-
prPayload: PullRequestPayload;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
url: string;
|
|
17
|
-
number: number;
|
|
18
|
-
didUpdate: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
export declare function getPullRequestBody({ options, commits, targetBranch, }: {
|
|
21
|
-
options: ValidConfigOptions;
|
|
22
|
-
commits: Commit[];
|
|
23
|
-
targetBranch: string;
|
|
24
|
-
}): string;
|
|
25
|
-
export declare function getTitle({ options, commits, targetBranch, }: {
|
|
26
|
-
options: ValidConfigOptions;
|
|
27
|
-
commits: Commit[];
|
|
28
|
-
targetBranch: string;
|
|
29
|
-
}): string;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTitle = exports.getPullRequestBody = exports.createPullRequest = void 0;
|
|
4
|
-
const rest_1 = require("@octokit/rest");
|
|
5
|
-
const ora_1 = require("../../../ui/ora");
|
|
6
|
-
const packageVersion_1 = require("../../../utils/packageVersion");
|
|
7
|
-
const BackportError_1 = require("../../BackportError");
|
|
8
|
-
const logger_1 = require("../../logger");
|
|
9
|
-
const commitFormatters_1 = require("../commitFormatters");
|
|
10
|
-
const fetchExistingPullRequest_1 = require("../v4/fetchExistingPullRequest");
|
|
11
|
-
const getGithubV3ErrorMessage_1 = require("./getGithubV3ErrorMessage");
|
|
12
|
-
async function createPullRequest({ options, prPayload, }) {
|
|
13
|
-
logger_1.logger.info(`Creating PR with title: "${prPayload.title}". ${prPayload.head} -> ${prPayload.base}`);
|
|
14
|
-
const { accessToken, githubApiBaseUrlV3 } = options;
|
|
15
|
-
const spinner = (0, ora_1.ora)(options.ci, `Creating pull request`).start();
|
|
16
|
-
try {
|
|
17
|
-
const octokit = new rest_1.Octokit({
|
|
18
|
-
auth: accessToken,
|
|
19
|
-
baseUrl: githubApiBaseUrlV3,
|
|
20
|
-
log: logger_1.logger,
|
|
21
|
-
});
|
|
22
|
-
const res = await octokit.pulls.create(prPayload);
|
|
23
|
-
spinner.succeed();
|
|
24
|
-
return {
|
|
25
|
-
url: res.data.html_url,
|
|
26
|
-
number: res.data.number,
|
|
27
|
-
didUpdate: false,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
// retrieve url for existing
|
|
32
|
-
try {
|
|
33
|
-
const existingPR = await (0, fetchExistingPullRequest_1.fetchExistingPullRequest)({
|
|
34
|
-
options,
|
|
35
|
-
prPayload,
|
|
36
|
-
});
|
|
37
|
-
if (existingPR) {
|
|
38
|
-
spinner.succeed('Updating existing pull request');
|
|
39
|
-
return {
|
|
40
|
-
url: existingPR.url,
|
|
41
|
-
number: existingPR.number,
|
|
42
|
-
didUpdate: true,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
logger_1.logger.info('Could not retrieve existing pull request', e);
|
|
48
|
-
// swallow error
|
|
49
|
-
}
|
|
50
|
-
spinner.fail();
|
|
51
|
-
throw new BackportError_1.BackportError(
|
|
52
|
-
//@ts-expect-error
|
|
53
|
-
`Could not create pull request: ${(0, getGithubV3ErrorMessage_1.getGithubV3ErrorMessage)(e)}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.createPullRequest = createPullRequest;
|
|
57
|
-
function getPullRequestBody({ options, commits, targetBranch, }) {
|
|
58
|
-
const commitMessages = commits
|
|
59
|
-
.map((c) => {
|
|
60
|
-
const message = c.sourcePullRequest
|
|
61
|
-
? `[${(0, commitFormatters_1.getFirstLine)(c.sourceCommit.message)}](${c.sourcePullRequest.url})`
|
|
62
|
-
: `${(0, commitFormatters_1.getFirstLine)(c.sourceCommit.message)} (${(0, commitFormatters_1.getShortSha)(c.sourceCommit.sha)})`;
|
|
63
|
-
return ` - ${message}`;
|
|
64
|
-
})
|
|
65
|
-
.join('\n');
|
|
66
|
-
const defaultPrDescription = `# Backport
|
|
67
|
-
|
|
68
|
-
This will backport the following commits from \`${commits[0].sourceBranch}\` to \`${targetBranch}\`:
|
|
69
|
-
${commitMessages}
|
|
70
|
-
|
|
71
|
-
<!--- Backport version: ${packageVersion_1.PACKAGE_VERSION} -->
|
|
72
|
-
|
|
73
|
-
### Questions ?
|
|
74
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)`;
|
|
75
|
-
return (options.prDescription ?? defaultPrDescription)
|
|
76
|
-
.replace('{targetBranch}', targetBranch)
|
|
77
|
-
.replace('{commitMessages}', commitMessages)
|
|
78
|
-
.replace('{defaultPrDescription}', defaultPrDescription);
|
|
79
|
-
}
|
|
80
|
-
exports.getPullRequestBody = getPullRequestBody;
|
|
81
|
-
function getTitle({ options, commits, targetBranch, }) {
|
|
82
|
-
const commitMessages = commits
|
|
83
|
-
.map((c) => (0, commitFormatters_1.getFirstLine)(c.sourceCommit.message))
|
|
84
|
-
.join(' | ');
|
|
85
|
-
const defaultPrTitle = '[{targetBranch}] {commitMessages}';
|
|
86
|
-
return (options.prTitle ?? defaultPrTitle)
|
|
87
|
-
.replace('{targetBranch}', targetBranch)
|
|
88
|
-
.replace('{commitMessages}', commitMessages)
|
|
89
|
-
.slice(0, 240);
|
|
90
|
-
}
|
|
91
|
-
exports.getTitle = getTitle;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const createPullRequest_1 = require("./createPullRequest");
|
|
4
|
-
describe('getPullRequestBody', () => {
|
|
5
|
-
it('when single pull request is backported', () => {
|
|
6
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
7
|
-
options: {},
|
|
8
|
-
commits: [
|
|
9
|
-
{
|
|
10
|
-
author: {
|
|
11
|
-
email: 'soren.louv@elastic.co',
|
|
12
|
-
name: 'Søren Louv-Jansen',
|
|
13
|
-
},
|
|
14
|
-
sourcePullRequest: {
|
|
15
|
-
number: 55,
|
|
16
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
17
|
-
mergeCommit: {
|
|
18
|
-
sha: 'abcdefghi',
|
|
19
|
-
message: 'My commit message (#55)',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
sourceCommit: {
|
|
23
|
-
committedDate: '2020',
|
|
24
|
-
sha: 'abcdefghi',
|
|
25
|
-
message: 'My commit message (#55)',
|
|
26
|
-
},
|
|
27
|
-
expectedTargetPullRequests: [],
|
|
28
|
-
sourceBranch: 'master',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
targetBranch: '7.x',
|
|
32
|
-
})).toMatchInlineSnapshot(`
|
|
33
|
-
"# Backport
|
|
34
|
-
|
|
35
|
-
This will backport the following commits from \`master\` to \`7.x\`:
|
|
36
|
-
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
37
|
-
|
|
38
|
-
<!--- Backport version: 1.2.3-mocked -->
|
|
39
|
-
|
|
40
|
-
### Questions ?
|
|
41
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)"
|
|
42
|
-
`);
|
|
43
|
-
});
|
|
44
|
-
it('when a single commit (non pull request) is backported', () => {
|
|
45
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
46
|
-
options: {},
|
|
47
|
-
commits: [
|
|
48
|
-
{
|
|
49
|
-
author: {
|
|
50
|
-
email: 'soren.louv@elastic.co',
|
|
51
|
-
name: 'Søren Louv-Jansen',
|
|
52
|
-
},
|
|
53
|
-
sourceCommit: {
|
|
54
|
-
committedDate: '',
|
|
55
|
-
sha: 'abcdefghijklmw',
|
|
56
|
-
message: 'My commit message',
|
|
57
|
-
},
|
|
58
|
-
sourceBranch: 'main',
|
|
59
|
-
expectedTargetPullRequests: [],
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
targetBranch: '7.x',
|
|
63
|
-
})).toMatchInlineSnapshot(`
|
|
64
|
-
"# Backport
|
|
65
|
-
|
|
66
|
-
This will backport the following commits from \`main\` to \`7.x\`:
|
|
67
|
-
- My commit message (abcdefgh)
|
|
68
|
-
|
|
69
|
-
<!--- Backport version: 1.2.3-mocked -->
|
|
70
|
-
|
|
71
|
-
### Questions ?
|
|
72
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)"
|
|
73
|
-
`);
|
|
74
|
-
});
|
|
75
|
-
it('when multiple commits are backported', () => {
|
|
76
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
77
|
-
options: {},
|
|
78
|
-
commits: [
|
|
79
|
-
{
|
|
80
|
-
author: {
|
|
81
|
-
email: 'soren.louv@elastic.co',
|
|
82
|
-
name: 'Søren Louv-Jansen',
|
|
83
|
-
},
|
|
84
|
-
sourcePullRequest: {
|
|
85
|
-
number: 55,
|
|
86
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
87
|
-
mergeCommit: {
|
|
88
|
-
sha: 'abcdefghijklm',
|
|
89
|
-
message: 'My commit message (#55)',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
sourceCommit: {
|
|
93
|
-
committedDate: '',
|
|
94
|
-
sha: 'abcdefghijklm',
|
|
95
|
-
message: 'My commit message (#55)',
|
|
96
|
-
},
|
|
97
|
-
sourceBranch: 'main',
|
|
98
|
-
expectedTargetPullRequests: [],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
author: {
|
|
102
|
-
email: 'soren.louv@elastic.co',
|
|
103
|
-
name: 'Søren Louv-Jansen',
|
|
104
|
-
},
|
|
105
|
-
sourceCommit: {
|
|
106
|
-
committedDate: '',
|
|
107
|
-
sha: 'qwertyuiop',
|
|
108
|
-
message: 'Another commit message',
|
|
109
|
-
},
|
|
110
|
-
sourceBranch: 'main',
|
|
111
|
-
expectedTargetPullRequests: [],
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
targetBranch: '7.x',
|
|
115
|
-
})).toMatchInlineSnapshot(`
|
|
116
|
-
"# Backport
|
|
117
|
-
|
|
118
|
-
This will backport the following commits from \`main\` to \`7.x\`:
|
|
119
|
-
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
120
|
-
- Another commit message (qwertyui)
|
|
121
|
-
|
|
122
|
-
<!--- Backport version: 1.2.3-mocked -->
|
|
123
|
-
|
|
124
|
-
### Questions ?
|
|
125
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)"
|
|
126
|
-
`);
|
|
127
|
-
});
|
|
128
|
-
it('when a PR is merged (instead of squashed) and the individual commits are selected', () => {
|
|
129
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
130
|
-
options: {},
|
|
131
|
-
commits: [
|
|
132
|
-
{
|
|
133
|
-
sourceCommit: {
|
|
134
|
-
committedDate: '2022-02-07T23:53:14Z',
|
|
135
|
-
message: 'Merge strategy: Second commit',
|
|
136
|
-
sha: 'e8df5eaa4db7b94474b48e2320b02d33a830d9fb',
|
|
137
|
-
},
|
|
138
|
-
author: {
|
|
139
|
-
email: 'soren.louv@elastic.co',
|
|
140
|
-
name: 'Søren Louv-Jansen',
|
|
141
|
-
},
|
|
142
|
-
sourcePullRequest: {
|
|
143
|
-
number: 1,
|
|
144
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/1',
|
|
145
|
-
mergeCommit: {
|
|
146
|
-
message: 'Merge pull request #1 from backport-org/merge-strategy\n\nMerge commits to `main`',
|
|
147
|
-
sha: '0db7f1ac1233461563d8708511d1c14adbab46da',
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
sourceBranch: 'main',
|
|
151
|
-
expectedTargetPullRequests: [],
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
sourceCommit: {
|
|
155
|
-
committedDate: '2022-02-07T23:51:59Z',
|
|
156
|
-
message: 'Merge strategy: First commit',
|
|
157
|
-
sha: '5411b1c1144093e422220008f23f2c2b909ed113',
|
|
158
|
-
},
|
|
159
|
-
author: {
|
|
160
|
-
email: 'soren.louv@elastic.co',
|
|
161
|
-
name: 'Søren Louv-Jansen',
|
|
162
|
-
},
|
|
163
|
-
sourcePullRequest: {
|
|
164
|
-
number: 1,
|
|
165
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/1',
|
|
166
|
-
mergeCommit: {
|
|
167
|
-
message: 'Merge pull request #1 from backport-org/merge-strategy\n\nMerge commits to `main`',
|
|
168
|
-
sha: '0db7f1ac1233461563d8708511d1c14adbab46da',
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
sourceBranch: 'main',
|
|
172
|
-
expectedTargetPullRequests: [],
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
targetBranch: '7.x',
|
|
176
|
-
})).toMatchInlineSnapshot(`
|
|
177
|
-
"# Backport
|
|
178
|
-
|
|
179
|
-
This will backport the following commits from \`main\` to \`7.x\`:
|
|
180
|
-
- [Merge strategy: Second commit](https://github.com/backport-org/different-merge-strategies/pull/1)
|
|
181
|
-
- [Merge strategy: First commit](https://github.com/backport-org/different-merge-strategies/pull/1)
|
|
182
|
-
|
|
183
|
-
<!--- Backport version: 1.2.3-mocked -->
|
|
184
|
-
|
|
185
|
-
### Questions ?
|
|
186
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)"
|
|
187
|
-
`);
|
|
188
|
-
});
|
|
189
|
-
it('replaces template variables in PR description', () => {
|
|
190
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
191
|
-
options: {
|
|
192
|
-
prDescription: 'Backporting the following to {targetBranch}:\n{commitMessages}',
|
|
193
|
-
},
|
|
194
|
-
commits: [
|
|
195
|
-
{
|
|
196
|
-
author: {
|
|
197
|
-
email: 'soren.louv@elastic.co',
|
|
198
|
-
name: 'Søren Louv-Jansen',
|
|
199
|
-
},
|
|
200
|
-
sourcePullRequest: {
|
|
201
|
-
number: 55,
|
|
202
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
203
|
-
mergeCommit: {
|
|
204
|
-
sha: 'abcdefghijklm',
|
|
205
|
-
message: 'My commit message (#55)',
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
sourceCommit: {
|
|
209
|
-
committedDate: '',
|
|
210
|
-
sha: 'abcdefghijklm',
|
|
211
|
-
message: 'My commit message (#55)',
|
|
212
|
-
},
|
|
213
|
-
sourceBranch: 'main',
|
|
214
|
-
expectedTargetPullRequests: [],
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
author: {
|
|
218
|
-
email: 'soren.louv@elastic.co',
|
|
219
|
-
name: 'Søren Louv-Jansen',
|
|
220
|
-
},
|
|
221
|
-
sourceCommit: {
|
|
222
|
-
committedDate: '',
|
|
223
|
-
sha: 'qwertyuiop',
|
|
224
|
-
message: 'Another commit message',
|
|
225
|
-
},
|
|
226
|
-
sourceBranch: 'main',
|
|
227
|
-
expectedTargetPullRequests: [],
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
targetBranch: '7.x',
|
|
231
|
-
})).toMatchInlineSnapshot(`
|
|
232
|
-
"Backporting the following to 7.x:
|
|
233
|
-
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
234
|
-
- Another commit message (qwertyui)"
|
|
235
|
-
`);
|
|
236
|
-
});
|
|
237
|
-
it('appends text to the default descriptions', () => {
|
|
238
|
-
expect((0, createPullRequest_1.getPullRequestBody)({
|
|
239
|
-
options: {
|
|
240
|
-
prDescription: '{defaultPrDescription}\n\ntext to append',
|
|
241
|
-
},
|
|
242
|
-
commits: [
|
|
243
|
-
{
|
|
244
|
-
author: {
|
|
245
|
-
email: 'soren.louv@elastic.co',
|
|
246
|
-
name: 'Søren Louv-Jansen',
|
|
247
|
-
},
|
|
248
|
-
sourcePullRequest: {
|
|
249
|
-
number: 55,
|
|
250
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
251
|
-
mergeCommit: {
|
|
252
|
-
sha: 'abcdefghijklm',
|
|
253
|
-
message: 'My commit message (#55)',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
sourceCommit: {
|
|
257
|
-
committedDate: '',
|
|
258
|
-
sha: 'abcdefghijklm',
|
|
259
|
-
message: 'My commit message (#55)',
|
|
260
|
-
},
|
|
261
|
-
sourceBranch: 'main',
|
|
262
|
-
expectedTargetPullRequests: [],
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
author: {
|
|
266
|
-
email: 'soren.louv@elastic.co',
|
|
267
|
-
name: 'Søren Louv-Jansen',
|
|
268
|
-
},
|
|
269
|
-
sourceCommit: {
|
|
270
|
-
committedDate: '',
|
|
271
|
-
sha: 'qwertyuiop',
|
|
272
|
-
message: 'Another commit message',
|
|
273
|
-
},
|
|
274
|
-
sourceBranch: 'main',
|
|
275
|
-
expectedTargetPullRequests: [],
|
|
276
|
-
},
|
|
277
|
-
],
|
|
278
|
-
targetBranch: '7.x',
|
|
279
|
-
})).toMatchInlineSnapshot(`
|
|
280
|
-
"# Backport
|
|
281
|
-
|
|
282
|
-
This will backport the following commits from \`main\` to \`7.x\`:
|
|
283
|
-
- [My commit message (#55)](https://github.com/backport-org/different-merge-strategies/pull/55)
|
|
284
|
-
- Another commit message (qwertyui)
|
|
285
|
-
|
|
286
|
-
<!--- Backport version: 1.2.3-mocked -->
|
|
287
|
-
|
|
288
|
-
### Questions ?
|
|
289
|
-
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
|
|
290
|
-
|
|
291
|
-
text to append"
|
|
292
|
-
`);
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
describe('getTitle', () => {
|
|
296
|
-
it('has the default title', () => {
|
|
297
|
-
expect((0, createPullRequest_1.getTitle)({
|
|
298
|
-
options: {},
|
|
299
|
-
commits: [
|
|
300
|
-
{
|
|
301
|
-
author: {
|
|
302
|
-
email: 'soren.louv@elastic.co',
|
|
303
|
-
name: 'Søren Louv-Jansen',
|
|
304
|
-
},
|
|
305
|
-
sourceBranch: 'main',
|
|
306
|
-
sourcePullRequest: {
|
|
307
|
-
number: 55,
|
|
308
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
309
|
-
mergeCommit: {
|
|
310
|
-
sha: 'abcdefghi',
|
|
311
|
-
message: 'My commit message (#55)',
|
|
312
|
-
},
|
|
313
|
-
},
|
|
314
|
-
sourceCommit: {
|
|
315
|
-
committedDate: '2020',
|
|
316
|
-
sha: 'abcdefghi',
|
|
317
|
-
message: 'My commit message (#55)',
|
|
318
|
-
},
|
|
319
|
-
expectedTargetPullRequests: [],
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
author: {
|
|
323
|
-
email: 'soren.louv@elastic.co',
|
|
324
|
-
name: 'Søren Louv-Jansen',
|
|
325
|
-
},
|
|
326
|
-
sourcePullRequest: {
|
|
327
|
-
number: 56,
|
|
328
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/56',
|
|
329
|
-
mergeCommit: {
|
|
330
|
-
sha: 'jklmnopqr',
|
|
331
|
-
message: 'Another commit message (#56)',
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
sourceCommit: {
|
|
335
|
-
committedDate: '2020',
|
|
336
|
-
sha: 'jklmnopqr',
|
|
337
|
-
message: 'Another commit message (#56)',
|
|
338
|
-
},
|
|
339
|
-
sourceBranch: 'main',
|
|
340
|
-
expectedTargetPullRequests: [],
|
|
341
|
-
},
|
|
342
|
-
],
|
|
343
|
-
targetBranch: '7.x',
|
|
344
|
-
})).toEqual('[7.x] My commit message (#55) | Another commit message (#56)');
|
|
345
|
-
});
|
|
346
|
-
it('replaces template variables in PR title', () => {
|
|
347
|
-
expect((0, createPullRequest_1.getTitle)({
|
|
348
|
-
options: {
|
|
349
|
-
prTitle: 'Branch: "{targetBranch}". Messages: {commitMessages}',
|
|
350
|
-
},
|
|
351
|
-
commits: [
|
|
352
|
-
{
|
|
353
|
-
author: {
|
|
354
|
-
email: 'soren.louv@elastic.co',
|
|
355
|
-
name: 'Søren Louv-Jansen',
|
|
356
|
-
},
|
|
357
|
-
sourcePullRequest: {
|
|
358
|
-
number: 55,
|
|
359
|
-
url: 'https://github.com/backport-org/different-merge-strategies/pull/55',
|
|
360
|
-
mergeCommit: {
|
|
361
|
-
sha: 'abcdefghi',
|
|
362
|
-
message: 'My commit message (#55)',
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
sourceCommit: {
|
|
366
|
-
committedDate: '',
|
|
367
|
-
sha: 'abcdefghi',
|
|
368
|
-
message: 'My commit message (#55)',
|
|
369
|
-
},
|
|
370
|
-
sourceBranch: 'main',
|
|
371
|
-
expectedTargetPullRequests: [],
|
|
372
|
-
},
|
|
373
|
-
],
|
|
374
|
-
targetBranch: '7.x',
|
|
375
|
-
})).toEqual('Branch: "7.x". Messages: My commit message (#55)');
|
|
376
|
-
});
|
|
377
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BackportResponse } from '../../../backportRun';
|
|
2
|
-
import { ValidConfigOptions } from '../../../options/options';
|
|
3
|
-
export declare function createStatusComment({ options, backportResponse, }: {
|
|
4
|
-
options: ValidConfigOptions;
|
|
5
|
-
backportResponse: BackportResponse;
|
|
6
|
-
}): Promise<void>;
|
|
7
|
-
export declare function getCommentBody({ options, pullNumber, backportResponse, }: {
|
|
8
|
-
options: ValidConfigOptions;
|
|
9
|
-
pullNumber: number;
|
|
10
|
-
backportResponse: BackportResponse;
|
|
11
|
-
}): string | undefined;
|