backport 7.2.0-beta.2 → 7.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -5
- package/dist/entrypoint.cli.d.ts +0 -1
- package/dist/entrypoint.cli.js +0 -1
- package/dist/entrypoint.cli.private.test.d.ts +1 -0
- package/dist/entrypoint.cli.private.test.js +47 -0
- package/dist/options/ConfigOptions.d.ts +2 -0
- package/dist/options/cliArgs.test.d.ts +1 -0
- package/dist/options/cliArgs.test.js +182 -0
- package/dist/options/config/config.d.ts +2 -0
- package/dist/options/config/config.test.d.ts +1 -0
- package/dist/options/config/config.test.js +32 -0
- package/dist/options/config/globalConfig.test.d.ts +1 -0
- package/dist/options/config/globalConfig.test.js +61 -0
- package/dist/options/config/projectConfig.test.d.ts +1 -0
- package/dist/options/config/projectConfig.test.js +109 -0
- package/dist/options/config/readConfigFile.d.ts +2 -0
- package/dist/options/options.d.ts +2 -0
- package/dist/options/options.test.d.ts +1 -0
- package/dist/options/options.test.js +384 -0
- package/dist/runSequentially.js +2 -2
- package/dist/runSequentially.test.d.ts +1 -0
- package/dist/runSequentially.test.js +243 -0
- package/dist/scripts/postinstall.test.d.ts +1 -0
- package/dist/scripts/postinstall.test.js +53 -0
- package/dist/services/env.test.d.ts +1 -0
- package/dist/services/env.test.js +21 -0
- package/dist/services/git.d.ts +11 -4
- package/dist/services/git.integration.test.d.ts +1 -0
- package/dist/services/git.integration.test.js +286 -0
- package/dist/services/git.js +34 -16
- package/dist/services/git.test.d.ts +1 -0
- package/dist/services/git.test.js +543 -0
- package/dist/services/github/commitFormatters.test.d.ts +1 -0
- package/dist/services/github/commitFormatters.test.js +11 -0
- package/dist/services/github/v3/addAssigneesToPullRequest.test.d.ts +1 -0
- package/dist/services/github/v3/addAssigneesToPullRequest.test.js +27 -0
- package/dist/services/github/v3/createPullRequest.test.d.ts +1 -0
- package/dist/services/github/v3/createPullRequest.test.js +377 -0
- package/dist/services/github/v3/createStatusComment.test.d.ts +1 -0
- package/dist/services/github/v3/createStatusComment.test.js +396 -0
- package/dist/services/github/v4/apiRequestV4.test.d.ts +1 -0
- package/dist/services/github/v4/apiRequestV4.test.js +109 -0
- package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.d.ts +1 -0
- package/dist/services/github/v4/enablePullRequestAutoMerge.private.test.js +112 -0
- package/dist/services/github/v4/fetchAuthorId.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchAuthorId.private.test.js +28 -0
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +94 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +135 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +117 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +195 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +157 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +104 -0
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +47 -0
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.d.ts +1 -0
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.js +52 -0
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +2 -0
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.d.ts +1 -0
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +117 -0
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.js +1 -0
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.d.ts +1 -0
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +71 -0
- package/dist/services/github/v4/mocks/commitsByAuthorMock.d.ts +2 -0
- package/dist/services/github/v4/mocks/commitsByAuthorMock.js +176 -0
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.d.ts +1 -0
- package/dist/services/github/v4/throwOnInvalidAccessToken.test.js +87 -0
- package/dist/services/prompt.test.d.ts +1 -0
- package/dist/services/prompt.test.js +139 -0
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.d.ts +1 -0
- package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.js +467 -0
- package/dist/services/sourceCommit/getMockSourceCommit.js +1 -0
- package/dist/services/sourceCommit/parseSourceCommit.d.ts +5 -0
- package/dist/services/sourceCommit/parseSourceCommit.js +6 -0
- package/dist/services/sourceCommit/parseSourceCommit.test.d.ts +1 -0
- package/dist/services/sourceCommit/parseSourceCommit.test.js +226 -0
- package/dist/test/ExecError.d.ts +16 -0
- package/dist/test/ExecError.js +15 -0
- package/dist/test/e2e/cli/cli.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/cli.private.test.js +215 -0
- package/dist/test/e2e/cli/different-merge-strategies.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/different-merge-strategies.private.test.js +108 -0
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.js +49 -0
- package/dist/test/e2e/cli/runBackportViaCli.d.ts +5 -0
- package/dist/test/e2e/cli/runBackportViaCli.js +53 -0
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/test-that-repo-can-be-cloned.private.test.js +73 -0
- package/dist/test/e2e/cli.e2e.private.test.d.ts +1 -0
- package/dist/test/e2e/cli.e2e.private.test.js +433 -0
- package/dist/test/e2e/module.e2e.mutation.test.d.ts +1 -0
- package/dist/test/e2e/module.e2e.mutation.test.js +369 -0
- package/dist/test/e2e/module.e2e.private.test.d.ts +1 -0
- package/dist/test/e2e/module.e2e.private.test.js +369 -0
- package/dist/test/handleUnbackportedPullRequests.private.test.d.ts +1 -0
- package/dist/test/handleUnbackportedPullRequests.private.test.js +56 -0
- package/dist/test/mockConfigFiles.d.ts +5 -0
- package/dist/test/mockConfigFiles.js +21 -0
- package/dist/test/mocks.d.ts +10 -0
- package/dist/test/mocks.js +23 -0
- package/dist/test/nockHelpers.d.ts +16 -0
- package/dist/test/nockHelpers.js +36 -0
- package/dist/test/private/getDevAccessToken.d.ts +2 -0
- package/dist/test/private/getDevAccessToken.js +12 -0
- 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 +63 -0
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +3 -3
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.d.ts +1 -0
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +469 -0
- package/dist/ui/getCommitsWithoutBackports.test.d.ts +1 -0
- package/dist/ui/getCommitsWithoutBackports.test.js +331 -0
- package/dist/ui/getTargetBranches.test.d.ts +1 -0
- package/dist/ui/getTargetBranches.test.js +200 -0
- package/dist/ui/maybeSetupRepo.js +7 -3
- package/dist/ui/maybeSetupRepo.test.d.ts +1 -0
- package/dist/ui/maybeSetupRepo.test.js +238 -0
- package/dist/ui/ora.d.ts +1 -1
- package/dist/ui/ora.js +2 -2
- package/dist/ui/setupRepo.d.ts +3 -0
- package/dist/ui/setupRepo.js +88 -0
- package/dist/ui/setupRepo.test.d.ts +1 -0
- package/dist/ui/setupRepo.test.js +288 -0
- package/dist/utils/excludeUndefined.test.d.ts +1 -0
- package/dist/utils/excludeUndefined.test.js +24 -0
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +6 -6
- package/yarn.lock +3 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commitsByAuthorMock = void 0;
|
|
4
|
+
exports.commitsByAuthorMock = {
|
|
5
|
+
repository: {
|
|
6
|
+
ref: {
|
|
7
|
+
target: {
|
|
8
|
+
history: {
|
|
9
|
+
edges: [
|
|
10
|
+
{
|
|
11
|
+
node: {
|
|
12
|
+
author: {
|
|
13
|
+
email: 'soren.louv@elastic.co',
|
|
14
|
+
name: 'Søren Louv-Jansen',
|
|
15
|
+
},
|
|
16
|
+
repository: {
|
|
17
|
+
name: 'kibana',
|
|
18
|
+
owner: { login: 'elastic' },
|
|
19
|
+
},
|
|
20
|
+
committedDate: '2021-12-24T00:00:00Z',
|
|
21
|
+
sha: '2e63475c483f7844b0f2833bc57fdee32095bacb',
|
|
22
|
+
message: 'Add 👻',
|
|
23
|
+
associatedPullRequests: {
|
|
24
|
+
edges: [],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
node: {
|
|
30
|
+
author: {
|
|
31
|
+
email: 'soren.louv@elastic.co',
|
|
32
|
+
name: 'Søren Louv-Jansen',
|
|
33
|
+
},
|
|
34
|
+
repository: {
|
|
35
|
+
name: 'kibana',
|
|
36
|
+
owner: { login: 'elastic' },
|
|
37
|
+
},
|
|
38
|
+
committedDate: '2021-12-23T00:00:00Z',
|
|
39
|
+
sha: 'f3b618b9421fdecdb36862f907afbdd6344b361d',
|
|
40
|
+
message: 'Add witch (#85)',
|
|
41
|
+
associatedPullRequests: {
|
|
42
|
+
edges: [
|
|
43
|
+
{
|
|
44
|
+
node: {
|
|
45
|
+
url: 'https://github.com/elastic/kibana/pull/85',
|
|
46
|
+
baseRefName: 'master',
|
|
47
|
+
labels: {
|
|
48
|
+
nodes: [{ name: 'my-label-b' }],
|
|
49
|
+
},
|
|
50
|
+
number: 85,
|
|
51
|
+
mergeCommit: {
|
|
52
|
+
remoteConfigHistory: { edges: [] },
|
|
53
|
+
sha: 'f3b618b9421fdecdb36862f907afbdd6344b361d',
|
|
54
|
+
message: 'Add witch (#85)',
|
|
55
|
+
},
|
|
56
|
+
timelineItems: {
|
|
57
|
+
edges: [],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
node: {
|
|
67
|
+
author: {
|
|
68
|
+
email: 'soren.louv@elastic.co',
|
|
69
|
+
name: 'Søren Louv-Jansen',
|
|
70
|
+
},
|
|
71
|
+
repository: {
|
|
72
|
+
name: 'kibana',
|
|
73
|
+
owner: { login: 'elastic' },
|
|
74
|
+
},
|
|
75
|
+
committedDate: '2021-12-22T00:00:00Z',
|
|
76
|
+
sha: '79cf18453ec32a4677009dcbab1c9c8c73fc14fe',
|
|
77
|
+
message: 'Add SF mention (#80)\n\n* Add SF mention\r\n\r\n* Add several emojis!',
|
|
78
|
+
associatedPullRequests: {
|
|
79
|
+
edges: [
|
|
80
|
+
{
|
|
81
|
+
node: {
|
|
82
|
+
url: 'https://github.com/elastic/kibana/pull/80',
|
|
83
|
+
labels: {
|
|
84
|
+
nodes: [{ name: 'v6.3.0' }],
|
|
85
|
+
},
|
|
86
|
+
baseRefName: 'master',
|
|
87
|
+
number: 80,
|
|
88
|
+
mergeCommit: {
|
|
89
|
+
remoteConfigHistory: { edges: [] },
|
|
90
|
+
sha: '79cf18453ec32a4677009dcbab1c9c8c73fc14fe',
|
|
91
|
+
message: 'Add SF mention (#80)\n\n* Add SF mention\r\n\r\n* Add several emojis!',
|
|
92
|
+
},
|
|
93
|
+
timelineItems: {
|
|
94
|
+
edges: [
|
|
95
|
+
{
|
|
96
|
+
node: {
|
|
97
|
+
targetPullRequest: {
|
|
98
|
+
__typename: 'PullRequest',
|
|
99
|
+
targetMergeCommit: {
|
|
100
|
+
sha: 'target-merge-commit-sha',
|
|
101
|
+
message: 'Add SF mention (#80)\n\n* Add SF mention\r\n\r\n* Add several emojis!',
|
|
102
|
+
},
|
|
103
|
+
repository: {
|
|
104
|
+
name: 'kibana',
|
|
105
|
+
owner: { login: 'elastic' },
|
|
106
|
+
},
|
|
107
|
+
url: 'https://github.com/elastic/kibana/pull/99',
|
|
108
|
+
title: 'some title',
|
|
109
|
+
state: 'MERGED',
|
|
110
|
+
number: 99,
|
|
111
|
+
baseRefName: '6.3',
|
|
112
|
+
commits: {
|
|
113
|
+
edges: [
|
|
114
|
+
{
|
|
115
|
+
node: {
|
|
116
|
+
targetCommit: {
|
|
117
|
+
sha: 'abc',
|
|
118
|
+
message: 'Add SF mention (#80)\n\n* Add SF mention\r\n\r\n* Add several emojis!',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
node: {
|
|
137
|
+
author: {
|
|
138
|
+
email: 'soren.louv@elastic.co',
|
|
139
|
+
name: 'Søren Louv-Jansen',
|
|
140
|
+
},
|
|
141
|
+
repository: {
|
|
142
|
+
name: 'kibana',
|
|
143
|
+
owner: { login: 'elastic' },
|
|
144
|
+
},
|
|
145
|
+
committedDate: '2021-12-21T00:00:00Z',
|
|
146
|
+
sha: '3827bbbaf39914eda4f02f6940189844375fd097',
|
|
147
|
+
message: 'Add backport config',
|
|
148
|
+
associatedPullRequests: {
|
|
149
|
+
edges: [],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
node: {
|
|
155
|
+
author: {
|
|
156
|
+
email: 'soren.louv@elastic.co',
|
|
157
|
+
name: 'Søren Louv-Jansen',
|
|
158
|
+
},
|
|
159
|
+
repository: {
|
|
160
|
+
name: 'kibana',
|
|
161
|
+
owner: { login: 'elastic' },
|
|
162
|
+
},
|
|
163
|
+
committedDate: '2021-12-20T00:00:00Z',
|
|
164
|
+
sha: '5ea0da550ac191029459289d67f99ad7d310812b',
|
|
165
|
+
message: 'Initial commit',
|
|
166
|
+
associatedPullRequests: {
|
|
167
|
+
edges: [],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const throwOnInvalidAccessToken_1 = require("./throwOnInvalidAccessToken");
|
|
4
|
+
describe('throwOnInvalidAccessToken', () => {
|
|
5
|
+
describe('when status code is', () => {
|
|
6
|
+
it('should handle invalid access token', () => {
|
|
7
|
+
const error = {
|
|
8
|
+
githubResponse: {
|
|
9
|
+
status: 401,
|
|
10
|
+
headers: {},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
return expect(() => (0, throwOnInvalidAccessToken_1.throwOnInvalidAccessToken)({
|
|
14
|
+
repoOwner: 'elastic',
|
|
15
|
+
repoName: 'kibana',
|
|
16
|
+
error,
|
|
17
|
+
})).toThrowError('Please check your access token and make sure it is valid');
|
|
18
|
+
});
|
|
19
|
+
it('should handle SSO error', () => {
|
|
20
|
+
const error = {
|
|
21
|
+
githubResponse: {
|
|
22
|
+
status: 200,
|
|
23
|
+
headers: { 'x-github-sso': 'required; url=https://ssourl.com' },
|
|
24
|
+
data: {
|
|
25
|
+
errors: [{ type: 'FORBIDDEN' }],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
return expect(() => (0, throwOnInvalidAccessToken_1.throwOnInvalidAccessToken)({
|
|
30
|
+
repoOwner: 'elastic',
|
|
31
|
+
repoName: 'kibana',
|
|
32
|
+
error,
|
|
33
|
+
})).toThrowErrorMatchingSnapshot();
|
|
34
|
+
});
|
|
35
|
+
it('should handle non-existing repo', () => {
|
|
36
|
+
const error = {
|
|
37
|
+
githubResponse: {
|
|
38
|
+
status: 200,
|
|
39
|
+
headers: {
|
|
40
|
+
'x-oauth-scopes': 'a,b,c',
|
|
41
|
+
'x-accepted-oauth-scopes': 'a,b,c',
|
|
42
|
+
},
|
|
43
|
+
data: {
|
|
44
|
+
errors: [{ type: 'NOT_FOUND', path: ['repository'] }],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
return expect(() => (0, throwOnInvalidAccessToken_1.throwOnInvalidAccessToken)({
|
|
49
|
+
repoOwner: 'elastic',
|
|
50
|
+
repoName: 'kibana',
|
|
51
|
+
error,
|
|
52
|
+
})).toThrowError(`The repository "elastic/kibana" doesn't exist`);
|
|
53
|
+
});
|
|
54
|
+
it('should handle insufficient permissions (oauth scopes)', () => {
|
|
55
|
+
const error = {
|
|
56
|
+
githubResponse: {
|
|
57
|
+
status: 200,
|
|
58
|
+
headers: {
|
|
59
|
+
'x-oauth-scopes': 'a,b',
|
|
60
|
+
'x-accepted-oauth-scopes': 'a,b,c',
|
|
61
|
+
},
|
|
62
|
+
data: {
|
|
63
|
+
errors: [{ type: 'NOT_FOUND', path: ['repository'] }],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
return expect(() => (0, throwOnInvalidAccessToken_1.throwOnInvalidAccessToken)({
|
|
68
|
+
repoOwner: 'elastic',
|
|
69
|
+
repoName: 'kibana',
|
|
70
|
+
error,
|
|
71
|
+
})).toThrowErrorMatchingSnapshot();
|
|
72
|
+
});
|
|
73
|
+
it('should not handle unknown cases', () => {
|
|
74
|
+
const error = {
|
|
75
|
+
githubResponse: {
|
|
76
|
+
status: 500,
|
|
77
|
+
headers: {},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
return expect((0, throwOnInvalidAccessToken_1.throwOnInvalidAccessToken)({
|
|
81
|
+
repoOwner: 'elastic',
|
|
82
|
+
repoName: 'kibana',
|
|
83
|
+
error,
|
|
84
|
+
})).toBe(undefined);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,139 @@
|
|
|
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 strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
7
|
+
const prompts_1 = require("./prompts");
|
|
8
|
+
describe('prompt', () => {
|
|
9
|
+
describe('getChoicesForCommitPrompt', () => {
|
|
10
|
+
it('should display status badges via `expectedTargetPullRequests`', () => {
|
|
11
|
+
const commits = [
|
|
12
|
+
{
|
|
13
|
+
author: { email: 'soren.louv@elastic.co', name: 'Søren Louv-Jansen' },
|
|
14
|
+
sourceBranch: 'master',
|
|
15
|
+
sourceCommit: {
|
|
16
|
+
committedDate: '1',
|
|
17
|
+
sha: 'ae9d51b7fe3ee6f30d0d196c782e0dcabb7ac5ff',
|
|
18
|
+
message: '[APM] Remove log-log descriptions from correlation charts (#119700)',
|
|
19
|
+
},
|
|
20
|
+
sourcePullRequest: {
|
|
21
|
+
number: 119700,
|
|
22
|
+
url: 'foo',
|
|
23
|
+
mergeCommit: {
|
|
24
|
+
sha: 'ae9d51b7fe3ee6f30d0d196c782e0dcabb7ac5ff',
|
|
25
|
+
message: '[APM] Remove log-log descriptions from correlation charts (#119700)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
expectedTargetPullRequests: [
|
|
29
|
+
{ number: 120178, branch: '8.0', state: 'MERGED' },
|
|
30
|
+
{ number: 120179, branch: '7.16', state: 'MERGED' },
|
|
31
|
+
{ number: 120179, branch: '7.15', state: 'MISSING' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const choices = (0, prompts_1.getChoicesForCommitPrompt)(commits, false).map(({ name, short }) => ({ name: (0, strip_ansi_1.default)(name), short }));
|
|
36
|
+
expect(choices).toEqual([
|
|
37
|
+
{
|
|
38
|
+
name: '1. [APM] Remove log-log descriptions from correlation charts (#119700) 8.0, 7.16, 7.15',
|
|
39
|
+
short: '#119700 (ae9d51b7)',
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
});
|
|
43
|
+
it('should list choices', () => {
|
|
44
|
+
const commits = [
|
|
45
|
+
{
|
|
46
|
+
author: { email: 'soren.louv@elastic.co', name: 'Søren Louv-Jansen' },
|
|
47
|
+
sourceBranch: 'master',
|
|
48
|
+
sourceCommit: {
|
|
49
|
+
committedDate: '',
|
|
50
|
+
sha: 'b1b491959dab47aeb83c88ee2accb2db46d23793',
|
|
51
|
+
message: '[APM] Prefer service.name for logs correlation (#120694)',
|
|
52
|
+
},
|
|
53
|
+
sourcePullRequest: {
|
|
54
|
+
number: 120694,
|
|
55
|
+
url: 'foo',
|
|
56
|
+
mergeCommit: {
|
|
57
|
+
sha: 'b1b491959dab47aeb83c88ee2accb2db46d23793',
|
|
58
|
+
message: '[APM] Prefer service.name for logs correlation (#120694)',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
expectedTargetPullRequests: [],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
author: { email: 'soren.louv@elastic.co', name: 'Søren Louv-Jansen' },
|
|
65
|
+
sourceBranch: 'master',
|
|
66
|
+
sourceCommit: {
|
|
67
|
+
committedDate: '',
|
|
68
|
+
sha: 'b1bb4a93959f19a653b9cfb207a5c6acb6559482',
|
|
69
|
+
message: '[APM] Disable telemetry in agent config endpoint (#120106)',
|
|
70
|
+
},
|
|
71
|
+
sourcePullRequest: {
|
|
72
|
+
number: 120106,
|
|
73
|
+
url: 'foo',
|
|
74
|
+
mergeCommit: {
|
|
75
|
+
sha: 'b1bb4a93959f19a653b9cfb207a5c6acb6559482',
|
|
76
|
+
message: '[APM] Disable telemetry in agent config endpoint (#120106)',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
expectedTargetPullRequests: [],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
author: { email: 'soren.louv@elastic.co', name: 'Søren Louv-Jansen' },
|
|
83
|
+
sourceBranch: 'master',
|
|
84
|
+
sourceCommit: {
|
|
85
|
+
committedDate: '',
|
|
86
|
+
sha: '434f6e6a88faf24dc1ea41f9f726db78e46355a7',
|
|
87
|
+
message: '[APM] Remove index_pattern.json and add custom field formatters (#119915)',
|
|
88
|
+
},
|
|
89
|
+
sourcePullRequest: {
|
|
90
|
+
number: 119915,
|
|
91
|
+
url: 'foo',
|
|
92
|
+
mergeCommit: {
|
|
93
|
+
sha: '434f6e6a88faf24dc1ea41f9f726db78e46355a7',
|
|
94
|
+
message: '[APM] Remove index_pattern.json and add custom field formatters (#119915)',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
expectedTargetPullRequests: [],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
author: { email: 'soren.louv@elastic.co', name: 'Søren Louv-Jansen' },
|
|
101
|
+
sourceBranch: 'master',
|
|
102
|
+
sourceCommit: {
|
|
103
|
+
committedDate: '',
|
|
104
|
+
sha: 'ae9d51b7fe3ee6f30d0d196c782e0dcabb7ac5ff',
|
|
105
|
+
message: '[APM] Remove log-log descriptions from correlation charts (#119700)',
|
|
106
|
+
},
|
|
107
|
+
sourcePullRequest: {
|
|
108
|
+
number: 119700,
|
|
109
|
+
url: 'foo',
|
|
110
|
+
mergeCommit: {
|
|
111
|
+
sha: 'ae9d51b7fe3ee6f30d0d196c782e0dcabb7ac5ff',
|
|
112
|
+
message: '[APM] Remove log-log descriptions from correlation charts (#119700)',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
expectedTargetPullRequests: [],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
const choices = (0, prompts_1.getChoicesForCommitPrompt)(commits, false).map(({ name, short }) => ({ name: (0, strip_ansi_1.default)(name), short }));
|
|
119
|
+
expect(choices).toEqual([
|
|
120
|
+
{
|
|
121
|
+
name: '1. [APM] Prefer service.name for logs correlation (#120694) ',
|
|
122
|
+
short: '#120694 (b1b49195)',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: '2. [APM] Disable telemetry in agent config endpoint (#120106) ',
|
|
126
|
+
short: '#120106 (b1bb4a93)',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: '3. [APM] Remove index_pattern.json and add custom field formatters (#119915) ',
|
|
130
|
+
short: '#119915 (434f6e6a)',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: '4. [APM] Remove log-log descriptions from correlation charts (#119700) ',
|
|
134
|
+
short: '#119700 (ae9d51b7)',
|
|
135
|
+
},
|
|
136
|
+
]);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|