backport 7.3.5 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -18
- package/dist/backportRun.d.ts +14 -3
- package/dist/backportRun.js +59 -37
- package/dist/entrypoint.cli.js +1 -1
- package/dist/entrypoint.module.d.ts +8 -3
- package/dist/entrypoint.module.js +6 -10
- package/dist/entrypoint.module.private.test.js +129 -330
- package/dist/options/ConfigOptions.d.ts +2 -2
- package/dist/options/cliArgs.d.ts +10 -6
- package/dist/options/cliArgs.js +32 -21
- package/dist/options/cliArgs.test.js +3 -3
- package/dist/options/config/config.d.ts +2 -2
- package/dist/options/config/config.js +2 -2
- package/dist/options/config/globalConfig.d.ts +2 -2
- package/dist/options/config/globalConfig.js +13 -10
- package/dist/options/config/projectConfig.d.ts +2 -2
- package/dist/options/config/projectConfig.js +3 -3
- package/dist/options/config/projectConfig.test.js +19 -7
- package/dist/options/config/readConfigFile.d.ts +4 -4
- package/dist/options/options.d.ts +4 -5
- package/dist/options/options.js +2 -3
- package/dist/options/options.test.js +7 -4
- package/dist/runSequentially.d.ts +5 -1
- package/dist/runSequentially.js +23 -8
- package/dist/scripts/postinstall.js +1 -0
- package/dist/scripts/postinstall.test.js +5 -1
- package/dist/services/HandledError.d.ts +6 -2
- package/dist/services/HandledError.js +8 -8
- package/dist/services/child-process-promisified.d.ts +19 -3
- package/dist/services/child-process-promisified.js +46 -17
- package/dist/services/git.d.ts +6 -7
- package/dist/services/git.integration.test.js +381 -65
- package/dist/services/git.js +188 -126
- package/dist/services/git.private.test.d.ts +1 -0
- package/dist/services/git.private.test.js +618 -0
- package/dist/services/git.test.js +167 -158
- package/dist/services/github/v3/addAssigneesToPullRequest.js +1 -1
- package/dist/services/github/v3/addLabelsToPullRequest.js +1 -1
- package/dist/services/github/v3/addReviewersToPullRequest.js +2 -1
- package/dist/services/github/v3/createPullRequest.js +3 -1
- package/dist/services/github/v3/createStatusComment.js +16 -16
- package/dist/services/github/v3/createStatusComment.test.js +17 -5
- package/dist/services/github/v4/apiRequestV4.js +6 -9
- package/dist/services/github/v4/enablePullRequestAutoMerge.js +2 -4
- package/dist/services/github/v4/fetchAuthorId.private.test.js +3 -6
- package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +5 -6
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +10 -9
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +10 -9
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +1 -0
- package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +9 -8
- package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +3 -6
- package/dist/services/github/v4/fetchCommits/fetchPullRequestsBySearchQuery.js +1 -0
- package/dist/services/github/v4/fetchExistingPullRequest.private.test.js +3 -6
- package/dist/services/github/v4/fetchRemoteProjectConfig.private.test.js +4 -7
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +2 -2
- package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.private.test.js +6 -7
- package/dist/services/github/v4/getRepoOwnerAndNameFromGitRemotes.private.test.js +9 -8
- package/dist/services/logger.d.ts +1 -4
- package/dist/services/logger.js +14 -19
- package/dist/services/test.d.ts +1 -0
- package/dist/services/test.js +23 -0
- package/dist/test/e2e/cli/entrypoint.cli.private.test.d.ts +1 -0
- package/dist/test/e2e/cli/entrypoint.cli.private.test.js +401 -0
- package/dist/test/e2e/cli/repo-with-backportrc-removed.private.test.js +17 -16
- package/dist/test/e2e/cli/runBackportViaCli.d.ts +2 -1
- package/dist/test/e2e/cli/runBackportViaCli.js +10 -2
- package/dist/test/e2e/module/entrypoint.module.mutation.test.d.ts +1 -0
- package/dist/test/e2e/module/entrypoint.module.mutation.test.js +376 -0
- package/dist/test/handleUnbackportedPullRequests.private.test.js +11 -10
- package/dist/test/sandbox.js +5 -1
- package/dist/test/setupFiles/automatic-mocks.js +16 -12
- package/dist/ui/cherrypickAndCreateTargetPullRequest.js +8 -4
- package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +7 -159
- package/dist/ui/getCommitsWithoutBackports.test.js +5 -1
- package/dist/ui/getGitConfigAuthor.js +1 -1
- package/dist/ui/getTargetBranches.test.js +5 -1
- package/dist/ui/ora.d.ts +1 -8
- package/dist/ui/setupRepo.js +1 -1
- package/dist/ui/setupRepo.test.js +98 -61
- package/dist/utils/isErrnoError.d.ts +2 -0
- package/dist/utils/isErrnoError.js +7 -0
- package/dist/utils/packageVersion.d.ts +1 -1
- package/dist/utils/packageVersion.js +1 -1
- package/package.json +13 -13
- package/yarn.lock +414 -695
|
@@ -1,11 +1,123 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const entrypoint_module_1 = require("./entrypoint.module");
|
|
4
|
+
const commitFormatters_1 = require("./services/github/commitFormatters");
|
|
4
5
|
const getDevAccessToken_1 = require("./test/private/getDevAccessToken");
|
|
6
|
+
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
7
|
+
jest.unmock('del');
|
|
8
|
+
jest.unmock('make-dir');
|
|
9
|
+
jest.unmock('find-up');
|
|
5
10
|
describe('entrypoint.module', () => {
|
|
11
|
+
describe('backportRun', () => {
|
|
12
|
+
describe('when running into merge conflict', () => {
|
|
13
|
+
let response;
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
response = (await (0, entrypoint_module_1.backportRun)({
|
|
16
|
+
options: {
|
|
17
|
+
repoOwner: 'backport-org',
|
|
18
|
+
repoName: 'repo-with-conflicts',
|
|
19
|
+
ci: true,
|
|
20
|
+
accessToken,
|
|
21
|
+
pullNumber: 12,
|
|
22
|
+
targetBranches: ['7.x'],
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
it('should have overall status=success', async () => {
|
|
27
|
+
expect(response.status).toBe('success');
|
|
28
|
+
});
|
|
29
|
+
it('should fail with "handled-error"', () => {
|
|
30
|
+
expect(response.results[0].status).toBe('handled-error');
|
|
31
|
+
});
|
|
32
|
+
it('should have correct error code', () => {
|
|
33
|
+
//@ts-expect-error
|
|
34
|
+
expect(response.results[0].error.errorContext.code).toBe('merge-conflict-exception');
|
|
35
|
+
//@ts-expect-error
|
|
36
|
+
expect(response.results[0].error.message).toBe('Commit could not be cherrypicked due to conflicts in: la-liga.md');
|
|
37
|
+
});
|
|
38
|
+
it('contains a list of conflicting files', () => {
|
|
39
|
+
//@ts-expect-error
|
|
40
|
+
expect(response.results[0].error.errorContext.conflictingFiles).toEqual(['la-liga.md']);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('when missing branches to backport to', () => {
|
|
44
|
+
let response;
|
|
45
|
+
beforeAll(async () => {
|
|
46
|
+
response = (await (0, entrypoint_module_1.backportRun)({
|
|
47
|
+
options: {
|
|
48
|
+
repoOwner: 'backport-org',
|
|
49
|
+
repoName: 'repo-with-conflicts',
|
|
50
|
+
ci: true,
|
|
51
|
+
accessToken,
|
|
52
|
+
pullNumber: 12,
|
|
53
|
+
},
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
it('should correct error code', async () => {
|
|
57
|
+
expect(response.status).toBe('aborted');
|
|
58
|
+
//@ts-expect-error
|
|
59
|
+
expect(response.error.errorContext.code).toBe('no-branches-exception');
|
|
60
|
+
expect(response.error.message).toBe('There are no branches to backport to. Aborting.');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
describe('when backporting', () => {
|
|
64
|
+
let response;
|
|
65
|
+
beforeAll(async () => {
|
|
66
|
+
response = (await (0, entrypoint_module_1.backportRun)({
|
|
67
|
+
options: {
|
|
68
|
+
repoOwner: 'backport-org',
|
|
69
|
+
repoName: 'repo-with-conflicts',
|
|
70
|
+
ci: true,
|
|
71
|
+
accessToken,
|
|
72
|
+
pullNumber: 8,
|
|
73
|
+
dryRun: true,
|
|
74
|
+
},
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
it('should return successful backport response', async () => {
|
|
78
|
+
expect(response.status).toBe('success');
|
|
79
|
+
expect(response).toEqual({
|
|
80
|
+
status: 'success',
|
|
81
|
+
results: [
|
|
82
|
+
{
|
|
83
|
+
status: 'success',
|
|
84
|
+
didUpdate: false,
|
|
85
|
+
pullRequestNumber: 1337,
|
|
86
|
+
pullRequestUrl: 'https://localhost/dry-run',
|
|
87
|
+
targetBranch: '7.x',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
commits: [
|
|
91
|
+
{
|
|
92
|
+
author: {
|
|
93
|
+
email: 'sorenlouv@gmail.com',
|
|
94
|
+
name: 'Søren Louv-Jansen',
|
|
95
|
+
},
|
|
96
|
+
expectedTargetPullRequests: [
|
|
97
|
+
{ branch: '7.x', state: 'NOT_CREATED' },
|
|
98
|
+
],
|
|
99
|
+
sourceBranch: 'main',
|
|
100
|
+
sourceCommit: {
|
|
101
|
+
committedDate: '2021-12-16T00:03:34Z',
|
|
102
|
+
message: 'Change Barca to Braithwaite (#8)',
|
|
103
|
+
sha: '343402a748be2375325b2730fa979bcea5b96ba1',
|
|
104
|
+
},
|
|
105
|
+
sourcePullRequest: {
|
|
106
|
+
mergeCommit: {
|
|
107
|
+
message: 'Change Barca to Braithwaite (#8)',
|
|
108
|
+
sha: '343402a748be2375325b2730fa979bcea5b96ba1',
|
|
109
|
+
},
|
|
110
|
+
number: 8,
|
|
111
|
+
url: 'https://github.com/backport-org/repo-with-conflicts/pull/8',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
6
119
|
describe('getCommits', () => {
|
|
7
120
|
it('pullNumber', async () => {
|
|
8
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
9
121
|
const commits = await (0, entrypoint_module_1.getCommits)({
|
|
10
122
|
accessToken: accessToken,
|
|
11
123
|
repoName: 'kibana',
|
|
@@ -56,7 +168,6 @@ describe('entrypoint.module', () => {
|
|
|
56
168
|
expect(commits).toEqual(expectedCommits);
|
|
57
169
|
});
|
|
58
170
|
it('sha', async () => {
|
|
59
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
60
171
|
const commits = await (0, entrypoint_module_1.getCommits)({
|
|
61
172
|
accessToken: accessToken,
|
|
62
173
|
repoName: 'kibana',
|
|
@@ -107,7 +218,6 @@ describe('entrypoint.module', () => {
|
|
|
107
218
|
expect(commits).toEqual(expectedCommits);
|
|
108
219
|
});
|
|
109
220
|
it('prFilter', async () => {
|
|
110
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
111
221
|
const commits = await (0, entrypoint_module_1.getCommits)({
|
|
112
222
|
accessToken: accessToken,
|
|
113
223
|
repoName: 'kibana',
|
|
@@ -115,343 +225,33 @@ describe('entrypoint.module', () => {
|
|
|
115
225
|
prFilter: 'label:Team:apm merged:<2021-06-02 base:master',
|
|
116
226
|
maxNumber: 3,
|
|
117
227
|
});
|
|
118
|
-
|
|
228
|
+
const commitMessage = commits.map((commit) => {
|
|
229
|
+
return {
|
|
230
|
+
...commit.sourceCommit,
|
|
231
|
+
message: (0, commitFormatters_1.getFirstLine)(commit.sourceCommit.message),
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
expect(commitMessage).toMatchInlineSnapshot(`
|
|
119
235
|
Array [
|
|
120
236
|
Object {
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
"expectedTargetPullRequests": Array [
|
|
126
|
-
Object {
|
|
127
|
-
"branch": "7.x",
|
|
128
|
-
"mergeCommit": Object {
|
|
129
|
-
"message": "[7.x] Migrate most plugins to synchronous lifecycle (#89562) (#90579)
|
|
130
|
-
|
|
131
|
-
* Migrate most plugins to synchronous lifecycle (#89562)
|
|
132
|
-
|
|
133
|
-
* first pass
|
|
134
|
-
|
|
135
|
-
* migrate more plugins
|
|
136
|
-
|
|
137
|
-
* migrate yet more plugins
|
|
138
|
-
|
|
139
|
-
* more oss plugins
|
|
140
|
-
|
|
141
|
-
* fix test file
|
|
142
|
-
|
|
143
|
-
* change Plugin signature on the client-side too
|
|
144
|
-
|
|
145
|
-
* fix test types
|
|
146
|
-
|
|
147
|
-
* migrate OSS client-side plugins
|
|
148
|
-
|
|
149
|
-
* migrate OSS client-side test plugins
|
|
150
|
-
|
|
151
|
-
* migrate xpack client-side plugins
|
|
152
|
-
|
|
153
|
-
* revert fix attempt on fleet plugin
|
|
154
|
-
|
|
155
|
-
* fix presentation start signature
|
|
156
|
-
|
|
157
|
-
* fix yet another signature
|
|
158
|
-
|
|
159
|
-
* add warnings for server-side async plugins in dev mode
|
|
160
|
-
|
|
161
|
-
* remove unused import
|
|
162
|
-
|
|
163
|
-
* fix isPromise
|
|
164
|
-
|
|
165
|
-
* Add client-side deprecations
|
|
166
|
-
|
|
167
|
-
* update migration examples
|
|
168
|
-
|
|
169
|
-
* update generated doc
|
|
170
|
-
|
|
171
|
-
* fix xpack unit tests
|
|
172
|
-
|
|
173
|
-
* nit
|
|
174
|
-
|
|
175
|
-
* (will be reverted) explicitly await for license to be ready in the auth hook
|
|
176
|
-
|
|
177
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
178
|
-
|
|
179
|
-
This reverts commit fdf73feb
|
|
180
|
-
|
|
181
|
-
* restore await on on promise contracts
|
|
182
|
-
|
|
183
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
184
|
-
|
|
185
|
-
This reverts commit fdf73feb
|
|
186
|
-
|
|
187
|
-
* Revert \\"restore await on on promise contracts\\"
|
|
188
|
-
|
|
189
|
-
This reverts commit c5f2fe51
|
|
190
|
-
|
|
191
|
-
* add delay before starting tests in FTR
|
|
192
|
-
|
|
193
|
-
* update deprecation ts doc
|
|
194
|
-
|
|
195
|
-
* add explicit contract for monitoring setup
|
|
196
|
-
|
|
197
|
-
* migrate monitoring plugin to sync
|
|
198
|
-
|
|
199
|
-
* change plugin timeout to 10sec
|
|
200
|
-
|
|
201
|
-
* use delay instead of silence
|
|
202
|
-
# Conflicts:
|
|
203
|
-
# x-pack/plugins/xpack_legacy/server/plugin.ts
|
|
204
|
-
|
|
205
|
-
* fix mock",
|
|
206
|
-
"sha": "97f89e256b14dd01a4f20355dd04e8e27241c90a",
|
|
207
|
-
},
|
|
208
|
-
"number": 90579,
|
|
209
|
-
"state": "MERGED",
|
|
210
|
-
"url": "https://github.com/elastic/kibana/pull/90579",
|
|
211
|
-
},
|
|
212
|
-
],
|
|
213
|
-
"sourceBranch": "master",
|
|
214
|
-
"sourceCommit": Object {
|
|
215
|
-
"committedDate": "2021-02-08T09:19:54Z",
|
|
216
|
-
"message": "Migrate most plugins to synchronous lifecycle (#89562)
|
|
217
|
-
|
|
218
|
-
* first pass
|
|
219
|
-
|
|
220
|
-
* migrate more plugins
|
|
221
|
-
|
|
222
|
-
* migrate yet more plugins
|
|
223
|
-
|
|
224
|
-
* more oss plugins
|
|
225
|
-
|
|
226
|
-
* fix test file
|
|
227
|
-
|
|
228
|
-
* change Plugin signature on the client-side too
|
|
229
|
-
|
|
230
|
-
* fix test types
|
|
231
|
-
|
|
232
|
-
* migrate OSS client-side plugins
|
|
233
|
-
|
|
234
|
-
* migrate OSS client-side test plugins
|
|
235
|
-
|
|
236
|
-
* migrate xpack client-side plugins
|
|
237
|
-
|
|
238
|
-
* revert fix attempt on fleet plugin
|
|
239
|
-
|
|
240
|
-
* fix presentation start signature
|
|
241
|
-
|
|
242
|
-
* fix yet another signature
|
|
243
|
-
|
|
244
|
-
* add warnings for server-side async plugins in dev mode
|
|
245
|
-
|
|
246
|
-
* remove unused import
|
|
247
|
-
|
|
248
|
-
* fix isPromise
|
|
249
|
-
|
|
250
|
-
* Add client-side deprecations
|
|
251
|
-
|
|
252
|
-
* update migration examples
|
|
253
|
-
|
|
254
|
-
* update generated doc
|
|
255
|
-
|
|
256
|
-
* fix xpack unit tests
|
|
257
|
-
|
|
258
|
-
* nit
|
|
259
|
-
|
|
260
|
-
* (will be reverted) explicitly await for license to be ready in the auth hook
|
|
261
|
-
|
|
262
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
263
|
-
|
|
264
|
-
This reverts commit fdf73feb
|
|
265
|
-
|
|
266
|
-
* restore await on on promise contracts
|
|
267
|
-
|
|
268
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
269
|
-
|
|
270
|
-
This reverts commit fdf73feb
|
|
271
|
-
|
|
272
|
-
* Revert \\"restore await on on promise contracts\\"
|
|
273
|
-
|
|
274
|
-
This reverts commit c5f2fe51
|
|
275
|
-
|
|
276
|
-
* add delay before starting tests in FTR
|
|
277
|
-
|
|
278
|
-
* update deprecation ts doc
|
|
279
|
-
|
|
280
|
-
* add explicit contract for monitoring setup
|
|
281
|
-
|
|
282
|
-
* migrate monitoring plugin to sync
|
|
283
|
-
|
|
284
|
-
* change plugin timeout to 10sec
|
|
285
|
-
|
|
286
|
-
* use delay instead of silence",
|
|
287
|
-
"sha": "3b3327dbc3c3041c9681e0cd86bd31cf411dc460",
|
|
288
|
-
},
|
|
289
|
-
"sourcePullRequest": Object {
|
|
290
|
-
"mergeCommit": Object {
|
|
291
|
-
"message": "Migrate most plugins to synchronous lifecycle (#89562)
|
|
292
|
-
|
|
293
|
-
* first pass
|
|
294
|
-
|
|
295
|
-
* migrate more plugins
|
|
296
|
-
|
|
297
|
-
* migrate yet more plugins
|
|
298
|
-
|
|
299
|
-
* more oss plugins
|
|
300
|
-
|
|
301
|
-
* fix test file
|
|
302
|
-
|
|
303
|
-
* change Plugin signature on the client-side too
|
|
304
|
-
|
|
305
|
-
* fix test types
|
|
306
|
-
|
|
307
|
-
* migrate OSS client-side plugins
|
|
308
|
-
|
|
309
|
-
* migrate OSS client-side test plugins
|
|
310
|
-
|
|
311
|
-
* migrate xpack client-side plugins
|
|
312
|
-
|
|
313
|
-
* revert fix attempt on fleet plugin
|
|
314
|
-
|
|
315
|
-
* fix presentation start signature
|
|
316
|
-
|
|
317
|
-
* fix yet another signature
|
|
318
|
-
|
|
319
|
-
* add warnings for server-side async plugins in dev mode
|
|
320
|
-
|
|
321
|
-
* remove unused import
|
|
322
|
-
|
|
323
|
-
* fix isPromise
|
|
324
|
-
|
|
325
|
-
* Add client-side deprecations
|
|
326
|
-
|
|
327
|
-
* update migration examples
|
|
328
|
-
|
|
329
|
-
* update generated doc
|
|
330
|
-
|
|
331
|
-
* fix xpack unit tests
|
|
332
|
-
|
|
333
|
-
* nit
|
|
334
|
-
|
|
335
|
-
* (will be reverted) explicitly await for license to be ready in the auth hook
|
|
336
|
-
|
|
337
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
338
|
-
|
|
339
|
-
This reverts commit fdf73feb
|
|
340
|
-
|
|
341
|
-
* restore await on on promise contracts
|
|
342
|
-
|
|
343
|
-
* Revert \\"(will be reverted) explicitly await for license to be ready in the auth hook\\"
|
|
344
|
-
|
|
345
|
-
This reverts commit fdf73feb
|
|
346
|
-
|
|
347
|
-
* Revert \\"restore await on on promise contracts\\"
|
|
348
|
-
|
|
349
|
-
This reverts commit c5f2fe51
|
|
350
|
-
|
|
351
|
-
* add delay before starting tests in FTR
|
|
352
|
-
|
|
353
|
-
* update deprecation ts doc
|
|
354
|
-
|
|
355
|
-
* add explicit contract for monitoring setup
|
|
356
|
-
|
|
357
|
-
* migrate monitoring plugin to sync
|
|
358
|
-
|
|
359
|
-
* change plugin timeout to 10sec
|
|
360
|
-
|
|
361
|
-
* use delay instead of silence",
|
|
362
|
-
"sha": "3b3327dbc3c3041c9681e0cd86bd31cf411dc460",
|
|
363
|
-
},
|
|
364
|
-
"number": 89562,
|
|
365
|
-
"url": "https://github.com/elastic/kibana/pull/89562",
|
|
366
|
-
},
|
|
237
|
+
"committedDate": "2021-06-01T15:53:07Z",
|
|
238
|
+
"message": "Upgrade EUI to v33.0.0 (#99382)",
|
|
239
|
+
"sha": "38fd8a268ad7661d92f0d84c52d6f0a3d84c9801",
|
|
367
240
|
},
|
|
368
241
|
Object {
|
|
369
|
-
"
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
},
|
|
373
|
-
"expectedTargetPullRequests": Array [
|
|
374
|
-
Object {
|
|
375
|
-
"branch": "7.x",
|
|
376
|
-
"mergeCommit": Object {
|
|
377
|
-
"message": "Upgrade to hapi version 20 (#85406) (#86592)",
|
|
378
|
-
"sha": "777c80d8a0f72be16091510d0cb5d09693ba6bb4",
|
|
379
|
-
},
|
|
380
|
-
"number": 86592,
|
|
381
|
-
"state": "MERGED",
|
|
382
|
-
"url": "https://github.com/elastic/kibana/pull/86592",
|
|
383
|
-
},
|
|
384
|
-
],
|
|
385
|
-
"sourceBranch": "master",
|
|
386
|
-
"sourceCommit": Object {
|
|
387
|
-
"committedDate": "2020-12-19T12:10:11Z",
|
|
388
|
-
"message": "Upgrade to hapi version 20 (#85406)",
|
|
389
|
-
"sha": "e8b21bc6c12cfd793c46e1d86577d5e5ec8a71f8",
|
|
390
|
-
},
|
|
391
|
-
"sourcePullRequest": Object {
|
|
392
|
-
"mergeCommit": Object {
|
|
393
|
-
"message": "Upgrade to hapi version 20 (#85406)",
|
|
394
|
-
"sha": "e8b21bc6c12cfd793c46e1d86577d5e5ec8a71f8",
|
|
395
|
-
},
|
|
396
|
-
"number": 85406,
|
|
397
|
-
"url": "https://github.com/elastic/kibana/pull/85406",
|
|
398
|
-
},
|
|
242
|
+
"committedDate": "2021-02-08T09:19:54Z",
|
|
243
|
+
"message": "Migrate most plugins to synchronous lifecycle (#89562)",
|
|
244
|
+
"sha": "3b3327dbc3c3041c9681e0cd86bd31cf411dc460",
|
|
399
245
|
},
|
|
400
246
|
Object {
|
|
401
|
-
"
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
},
|
|
405
|
-
"expectedTargetPullRequests": Array [
|
|
406
|
-
Object {
|
|
407
|
-
"branch": "7.x",
|
|
408
|
-
"mergeCommit": Object {
|
|
409
|
-
"message": "Move EUI styled components integration to kibana_react (#86065) (#89217)
|
|
410
|
-
|
|
411
|
-
...from xpack_legacy.
|
|
412
|
-
|
|
413
|
-
Remove the duplicated typings from the observability plugin and only use the ones from kibana_react.
|
|
414
|
-
|
|
415
|
-
Fixes #78248.",
|
|
416
|
-
"sha": "57b798474ae5ec2892a06ffa5706c5dd405db137",
|
|
417
|
-
},
|
|
418
|
-
"number": 89217,
|
|
419
|
-
"state": "MERGED",
|
|
420
|
-
"url": "https://github.com/elastic/kibana/pull/89217",
|
|
421
|
-
},
|
|
422
|
-
],
|
|
423
|
-
"sourceBranch": "master",
|
|
424
|
-
"sourceCommit": Object {
|
|
425
|
-
"committedDate": "2021-01-25T19:48:35Z",
|
|
426
|
-
"message": "Move EUI styled components integration to kibana_react (#86065)
|
|
427
|
-
|
|
428
|
-
...from xpack_legacy.
|
|
429
|
-
|
|
430
|
-
Remove the duplicated typings from the observability plugin and only use the ones from kibana_react.
|
|
431
|
-
|
|
432
|
-
Fixes #78248.",
|
|
433
|
-
"sha": "e5588a129b1a0b2796822d4773176cc712dd5318",
|
|
434
|
-
},
|
|
435
|
-
"sourcePullRequest": Object {
|
|
436
|
-
"mergeCommit": Object {
|
|
437
|
-
"message": "Move EUI styled components integration to kibana_react (#86065)
|
|
438
|
-
|
|
439
|
-
...from xpack_legacy.
|
|
440
|
-
|
|
441
|
-
Remove the duplicated typings from the observability plugin and only use the ones from kibana_react.
|
|
442
|
-
|
|
443
|
-
Fixes #78248.",
|
|
444
|
-
"sha": "e5588a129b1a0b2796822d4773176cc712dd5318",
|
|
445
|
-
},
|
|
446
|
-
"number": 86065,
|
|
447
|
-
"url": "https://github.com/elastic/kibana/pull/86065",
|
|
448
|
-
},
|
|
247
|
+
"committedDate": "2021-04-01T12:40:47Z",
|
|
248
|
+
"message": "TS Incremental build exclude test files (#95610)",
|
|
249
|
+
"sha": "b6e582c53ebb9c496c232408066b128d2ca2f92c",
|
|
449
250
|
},
|
|
450
251
|
]
|
|
451
252
|
`);
|
|
452
253
|
});
|
|
453
254
|
it('author', async () => {
|
|
454
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
455
255
|
const commits = await (0, entrypoint_module_1.getCommits)({
|
|
456
256
|
accessToken: accessToken,
|
|
457
257
|
repoName: 'kibana',
|
|
@@ -580,7 +380,6 @@ describe('entrypoint.module', () => {
|
|
|
580
380
|
`);
|
|
581
381
|
});
|
|
582
382
|
it('throws when missing a filter', async () => {
|
|
583
|
-
const accessToken = (0, getDevAccessToken_1.getDevAccessToken)();
|
|
584
383
|
await expect(() => (0, entrypoint_module_1.getCommits)({
|
|
585
384
|
accessToken: accessToken,
|
|
586
385
|
repoName: 'kibana',
|
|
@@ -22,9 +22,9 @@ declare type Options = Partial<{
|
|
|
22
22
|
cherrypickRef: boolean;
|
|
23
23
|
ci: boolean;
|
|
24
24
|
commitPaths: string[];
|
|
25
|
-
configFile: string;
|
|
26
25
|
details: boolean;
|
|
27
26
|
dir: string;
|
|
27
|
+
dryRun: boolean;
|
|
28
28
|
editor: string;
|
|
29
29
|
fork: boolean;
|
|
30
30
|
gitAuthorEmail: string;
|
|
@@ -41,6 +41,7 @@ declare type Options = Partial<{
|
|
|
41
41
|
noVerify: boolean;
|
|
42
42
|
prDescription: string;
|
|
43
43
|
prFilter: string;
|
|
44
|
+
projectConfigFile: string;
|
|
44
45
|
prTitle: string;
|
|
45
46
|
publishStatusComment: boolean;
|
|
46
47
|
pullNumber: number;
|
|
@@ -56,7 +57,6 @@ declare type Options = Partial<{
|
|
|
56
57
|
targetBranchChoices: TargetBranchChoiceOrString[];
|
|
57
58
|
targetBranches: string[];
|
|
58
59
|
targetPRLabels: string[];
|
|
59
|
-
verbose: boolean;
|
|
60
60
|
}>;
|
|
61
61
|
export declare type ConfigFileOptions = Options & Partial<{
|
|
62
62
|
help: boolean;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
1
2
|
export declare type OptionsFromCliArgs = ReturnType<typeof getOptionsFromCliArgs>;
|
|
2
|
-
export declare function getOptionsFromCliArgs(processArgs: readonly string[]
|
|
3
|
-
|
|
4
|
-
}): {
|
|
3
|
+
export declare function getOptionsFromCliArgs(processArgs: readonly string[]): {
|
|
4
|
+
cwd?: string | undefined;
|
|
5
5
|
fork?: boolean | undefined;
|
|
6
6
|
dir?: string | undefined;
|
|
7
|
-
verbose?: boolean | undefined;
|
|
8
|
-
logFilePath?: string | undefined;
|
|
9
7
|
accessToken?: string | undefined;
|
|
10
8
|
author?: string | null | undefined;
|
|
11
9
|
autoAssign?: boolean | undefined;
|
|
@@ -14,7 +12,7 @@ export declare function getOptionsFromCliArgs(processArgs: readonly string[], {
|
|
|
14
12
|
autoMergeMethod?: string | undefined;
|
|
15
13
|
ci?: boolean | undefined;
|
|
16
14
|
cherrypickRef?: boolean | undefined;
|
|
17
|
-
|
|
15
|
+
projectConfigFile?: string | undefined;
|
|
18
16
|
details?: boolean | undefined;
|
|
19
17
|
dryRun?: boolean | undefined;
|
|
20
18
|
editor?: string | undefined;
|
|
@@ -24,6 +22,7 @@ export declare function getOptionsFromCliArgs(processArgs: readonly string[], {
|
|
|
24
22
|
githubApiBaseUrlV4?: string | undefined;
|
|
25
23
|
gitAuthorName?: string | undefined;
|
|
26
24
|
gitAuthorEmail?: string | undefined;
|
|
25
|
+
logFilePath?: string | undefined;
|
|
27
26
|
ls?: boolean | undefined;
|
|
28
27
|
mainline?: number | undefined;
|
|
29
28
|
maxNumber?: number | undefined;
|
|
@@ -51,3 +50,8 @@ export declare function getOptionsFromCliArgs(processArgs: readonly string[], {
|
|
|
51
50
|
targetPRLabels?: string[] | undefined;
|
|
52
51
|
publishStatusComment?: boolean | undefined;
|
|
53
52
|
};
|
|
53
|
+
export declare class CliError extends Error {
|
|
54
|
+
message: string;
|
|
55
|
+
yargs: yargs.Argv;
|
|
56
|
+
constructor(message: string, yargs: yargs.Argv);
|
|
57
|
+
}
|
package/dist/options/cliArgs.js
CHANGED
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getOptionsFromCliArgs = void 0;
|
|
6
|
+
exports.CliError = exports.getOptionsFromCliArgs = void 0;
|
|
7
7
|
const yargs_1 = __importDefault(require("yargs"));
|
|
8
8
|
const excludeUndefined_1 = require("../utils/excludeUndefined");
|
|
9
|
-
function getOptionsFromCliArgs(processArgs
|
|
9
|
+
function getOptionsFromCliArgs(processArgs) {
|
|
10
10
|
const yargsInstance = (0, yargs_1.default)(processArgs)
|
|
11
|
+
.strict()
|
|
11
12
|
.parserConfiguration({
|
|
12
13
|
'strip-dashed': true,
|
|
13
14
|
'strip-aliased': true,
|
|
@@ -63,7 +64,12 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
63
64
|
type: 'boolean',
|
|
64
65
|
conflicts: ['noCherrypickRef'],
|
|
65
66
|
})
|
|
66
|
-
.option('
|
|
67
|
+
.option('cwd', {
|
|
68
|
+
hidden: true,
|
|
69
|
+
description: 'Path to source repo',
|
|
70
|
+
type: 'string',
|
|
71
|
+
})
|
|
72
|
+
.option('projectConfigFile', {
|
|
67
73
|
alias: 'config',
|
|
68
74
|
description: 'Path to project config',
|
|
69
75
|
type: 'string',
|
|
@@ -77,7 +83,7 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
77
83
|
type: 'string',
|
|
78
84
|
})
|
|
79
85
|
.option('dir', {
|
|
80
|
-
description: '
|
|
86
|
+
description: 'Path to temporary backport repo',
|
|
81
87
|
type: 'string',
|
|
82
88
|
})
|
|
83
89
|
.option('details', {
|
|
@@ -239,11 +245,13 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
239
245
|
conflicts: ['noFork'],
|
|
240
246
|
})
|
|
241
247
|
.option('repoOwner', {
|
|
248
|
+
hidden: true,
|
|
242
249
|
description: 'Repository owner',
|
|
243
250
|
type: 'string',
|
|
244
251
|
conflicts: ['repo'],
|
|
245
252
|
})
|
|
246
253
|
.option('repoName', {
|
|
254
|
+
hidden: true,
|
|
247
255
|
description: 'Repository name',
|
|
248
256
|
type: 'string',
|
|
249
257
|
conflicts: ['repo'],
|
|
@@ -285,10 +293,6 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
285
293
|
alias: ['label', 'l'],
|
|
286
294
|
type: 'array',
|
|
287
295
|
string: true,
|
|
288
|
-
})
|
|
289
|
-
.option('verbose', {
|
|
290
|
-
description: 'Show additional debug information',
|
|
291
|
-
type: 'boolean',
|
|
292
296
|
})
|
|
293
297
|
// cli-only
|
|
294
298
|
.option('verify', {
|
|
@@ -296,20 +300,17 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
296
300
|
type: 'boolean',
|
|
297
301
|
})
|
|
298
302
|
.alias('version', 'v')
|
|
299
|
-
.alias('version', 'V')
|
|
300
303
|
.help()
|
|
301
|
-
.epilogue('For bugs, feature requests or questions: https://github.com/sqren/backport/issues\nOr contact me directly: https://twitter.com/sorenlouv')
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
});
|
|
312
|
-
}
|
|
304
|
+
.epilogue('For bugs, feature requests or questions: https://github.com/sqren/backport/issues\nOr contact me directly: https://twitter.com/sorenlouv')
|
|
305
|
+
// don't kill process upon error
|
|
306
|
+
// and don't log error to console
|
|
307
|
+
.fail((msg, err, yargs) => {
|
|
308
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
309
|
+
if (err) {
|
|
310
|
+
throw err;
|
|
311
|
+
}
|
|
312
|
+
throw new CliError(msg, yargs);
|
|
313
|
+
});
|
|
313
314
|
const {
|
|
314
315
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
315
316
|
$0, _,
|
|
@@ -355,3 +356,13 @@ function getOptionsFromCliArgs(processArgs, { exitOnError = true } = {}) {
|
|
|
355
356
|
});
|
|
356
357
|
}
|
|
357
358
|
exports.getOptionsFromCliArgs = getOptionsFromCliArgs;
|
|
359
|
+
class CliError extends Error {
|
|
360
|
+
constructor(message, yargs) {
|
|
361
|
+
super(message);
|
|
362
|
+
this.message = message;
|
|
363
|
+
this.yargs = yargs;
|
|
364
|
+
Error.captureStackTrace(this, CliError);
|
|
365
|
+
this.name = 'CliError';
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
exports.CliError = CliError;
|