backport 6.1.0 → 6.1.4

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.
Files changed (63) hide show
  1. package/README.md +45 -34
  2. package/dist/entrypoint.module.d.ts +2 -0
  3. package/dist/entrypoint.module.js +5 -1
  4. package/dist/entrypoint.module.private.test.js +16 -12
  5. package/dist/main.js +1 -1
  6. package/dist/options/ConfigOptions.d.ts +1 -0
  7. package/dist/options/cliArgs.d.ts +5 -3
  8. package/dist/options/cliArgs.js +20 -6
  9. package/dist/options/cliArgs.test.js +0 -7
  10. package/dist/options/config/config.d.ts +1 -0
  11. package/dist/options/config/globalConfig.js +1 -1
  12. package/dist/options/config/readConfigFile.d.ts +1 -0
  13. package/dist/options/options.d.ts +8 -0
  14. package/dist/options/options.js +9 -4
  15. package/dist/options/options.test.js +150 -104
  16. package/dist/runSequentially.test.js +13 -6
  17. package/dist/services/HandledError.d.ts +1 -1
  18. package/dist/services/git.d.ts +2 -1
  19. package/dist/services/git.js +4 -2
  20. package/dist/services/github/v3/createPullRequest.js +1 -1
  21. package/dist/services/github/v3/createPullRequest.test.js +38 -6
  22. package/dist/services/github/v3/createStatusComment.d.ts +1 -1
  23. package/dist/services/github/v3/createStatusComment.js +43 -25
  24. package/dist/services/github/v3/createStatusComment.test.js +155 -73
  25. package/dist/services/github/v4/fetchCommits/allFetchers.private.test.d.ts +1 -0
  26. package/dist/services/github/v4/fetchCommits/allFetchers.private.test.js +78 -0
  27. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.js +1 -1
  28. package/dist/services/github/v4/fetchCommits/fetchCommitByPullNumber.private.test.js +64 -0
  29. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.js +5 -5
  30. package/dist/services/github/v4/fetchCommits/fetchCommitBySha.private.test.js +60 -0
  31. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.d.ts +2 -0
  32. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.js +17 -10
  33. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.private.test.js +72 -0
  34. package/dist/services/github/v4/fetchCommits/fetchCommitsByAuthor.test.js +6 -0
  35. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.js +8 -7
  36. package/dist/services/github/v4/fetchCommits/fetchPullRequestBySearchQuery.private.test.js +8 -0
  37. package/dist/services/github/v4/getOptionsFromGithub/getOptionsFromGithub.d.ts +1 -0
  38. package/dist/services/github/v4/mocks/commitsByAuthorMock.js +16 -5
  39. package/dist/services/sourceCommit/getExpectedTargetPullRequests.d.ts +4 -0
  40. package/dist/services/sourceCommit/getExpectedTargetPullRequests.js +8 -2
  41. package/dist/services/sourceCommit/getExpectedTargetPullRequests.test.js +37 -0
  42. package/dist/services/sourceCommit/getMockSourceCommit.d.ts +1 -0
  43. package/dist/services/sourceCommit/getMockSourceCommit.js +72 -46
  44. package/dist/services/sourceCommit/parseSourceCommit.d.ts +22 -8
  45. package/dist/services/sourceCommit/parseSourceCommit.js +29 -10
  46. package/dist/services/sourceCommit/parseSourceCommit.test.js +10 -2
  47. package/dist/test/inquirer.private.test.js +4 -15
  48. package/dist/test/integration/integration.private.test.js +14 -4
  49. package/dist/test/nockHelpers.js +1 -3
  50. package/dist/test/setupFiles/automatic-mocks.js +1 -0
  51. package/dist/ui/cherrypickAndCreatePullRequest.test.js +19 -6
  52. package/dist/ui/cherrypickAndCreateTargetPullRequest.d.ts +0 -9
  53. package/dist/ui/cherrypickAndCreateTargetPullRequest.js +11 -48
  54. package/dist/ui/cherrypickAndCreateTargetPullRequest.test.js +224 -260
  55. package/dist/ui/getCommits.js +1 -1
  56. package/dist/ui/getCommitsWithoutBackports.d.ts +11 -0
  57. package/dist/ui/getCommitsWithoutBackports.js +68 -0
  58. package/dist/ui/getCommitsWithoutBackports.test.d.ts +1 -0
  59. package/dist/ui/getCommitsWithoutBackports.test.js +259 -0
  60. package/dist/utils/excludeUndefined.js +1 -1
  61. package/dist/utils/excludeUndefined.test.js +3 -3
  62. package/package.json +3 -3
  63. package/yarn.lock +462 -284
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
- # backport
1
+ <div align="center">
2
+ <img src="https://user-images.githubusercontent.com/209966/148229483-9f867a20-da7d-4cff-8c52-fcb27d482b89.png" height="200">
3
+ <p>
4
+ <b>A CLI tool that automates the process of backporting commits.</b>
5
+ </p>
6
+ <br>
7
+ </div>
2
8
 
3
- [![Build Status](https://travis-ci.com/sqren/backport.svg?branch=master)](https://app.travis-ci.com/github/sqren/backport)
4
- [![NPM version](https://img.shields.io/npm/v/backport.svg)](https://www.npmjs.com/package/backport)
5
- [![Coverage Status](https://coveralls.io/repos/github/sqren/backport/badge.svg?branch=master)](https://coveralls.io/github/sqren/backport?branch=master)
9
+ ## How it works
6
10
 
7
- A simple CLI tool that automates the process of backporting commits on a GitHub repo.
11
+ 1. Select a commit to backport
12
+ 2. Select a branch to backport to
13
+ 3. The commit will be cherrypicked, pushed and a pull request created.
8
14
 
9
15
  ![backport-demo](https://user-images.githubusercontent.com/209966/80993576-95766380-8e3b-11ea-9efd-b35eb2e6a9ec.gif)
10
16
 
@@ -34,7 +40,7 @@ Add a [project config](https://github.com/sqren/backport/blob/master/docs/config
34
40
  // the branches available to backport to
35
41
  "targetBranchChoices": ["main", "6.3", "6.2", "6.1", "6.0"],
36
42
 
37
- // Automatically detect which branches a pull request should be backported to based on the pull request labels.
43
+ // Optional: Automatically detect which branches a pull request should be backported to based on the pull request labels.
38
44
  "branchLabelMapping": {
39
45
  "^backport-to-(.+)$": "$1"
40
46
  }
@@ -100,37 +106,37 @@ See [configuration.md](https://github.com/sqren/backport/blob/master/docs/config
100
106
 
101
107
  The CLI options will override the [configuration options](https://github.com/sqren/backport/blob/master/docs/configuration.md).
102
108
 
103
- ### Node module
109
+ ## Backport Module API
104
110
 
105
- `backport` can be imported as a Node module and interacted with programatically.
111
+ `backport` can be imported as a Node module and interacted with programatically. This can be useful when creating automation around the Backport tool. See for example the [Backport Github Action](https://github.com/elastic/kibana-github-actions/blob/f5c58195840b8b0cf6036cfeba6e0b497306fb39/backport/index.ts)
106
112
 
107
- #### `backportRun`
113
+ ### `backportRun`
108
114
 
109
115
  Backport a commit programatically. Commits can be selected via `pullNumber` or `sha`.
110
116
 
111
- ##### Arguments:
117
+ #### Arguments:
112
118
 
113
119
  All of the options listed on [configuration.md](https://github.com/sqren/backport/blob/main/docs/configuration.md) are valid. The most common options are:
114
120
 
115
- `accessToken` _string_ **(Required)**
121
+ `accessToken` _string_ **(Required)**<br/>
116
122
  Github access token to authenticate the request
117
123
 
118
- `repoName` _string_ **(Required)**
124
+ `repoName` _string_ **(Required)**<br/>
119
125
  Name of repository
120
126
 
121
- `repoOwner` _string_ **(Required)**
127
+ `repoOwner` _string_ **(Required)**<br/>
122
128
  Owner of repository (organisation or username)
123
129
 
124
- `pullNumber` _number_
130
+ `pullNumber` _number_<br/>
125
131
  Filter commits by pull request number
126
132
 
127
- `sha` _string_
133
+ `sha` _string_<br/>
128
134
  Filter commits by commit sha
129
135
 
130
- `ci` _boolean_
136
+ `ci` _boolean_<br/>
131
137
  Enabling this will disable the interactive prompts
132
138
 
133
- ##### Example
139
+ #### Example
134
140
 
135
141
  ```ts
136
142
  import { backportRun } from 'backport';
@@ -149,34 +155,34 @@ const result = await backportRun({
149
155
  console.log(result);
150
156
  ```
151
157
 
152
- #### `getCommits`
158
+ ### `getCommits`
153
159
 
154
160
  Retrieve information about commits and whether they are backported
155
161
 
156
- ##### Arguments:
162
+ #### Arguments:
157
163
 
158
- `accessToken` _string_ **(Required)**
164
+ `accessToken` _string_ **(Required)**<br/>
159
165
  Github access token to authenticate the request
160
166
 
161
- `repoName` _string_ **(Required)**
167
+ `repoName` _string_ **(Required)**<br/>
162
168
  Name of repository
163
169
 
164
- `repoOwner` _string_ **(Required)**
170
+ `repoOwner` _string_ **(Required)**<br/>
165
171
  Owner of repository (organisation or username)
166
172
 
167
- `author` _string_
173
+ `author` _string_<br/>
168
174
  Filter commits by Github user
169
175
 
170
- `pullNumber` _number_
176
+ `pullNumber` _number_<br/>
171
177
  Filter commits by pull request number
172
178
 
173
- `sha` _string_
179
+ `sha` _string_<br/>
174
180
  Filter commits by commit sha
175
181
 
176
- `sourceBranch` _string_
182
+ `sourceBranch` _string_<br/>
177
183
  The branch to display commits from. Defaults to the default branch (normally "main" or "master")
178
184
 
179
- ##### Example
185
+ #### Example
180
186
 
181
187
  ```ts
182
188
  import { getCommits } from 'backport';
@@ -210,9 +216,9 @@ console.log(commits);
210
216
  */
211
217
  ```
212
218
 
213
- ## Github Action (beta)
219
+ ## The Backport Tool as a Github Action
214
220
 
215
- A [Github Action](https://github.com/elastic/kibana-github-actions/tree/main/backport) for automatically backporting pull requests.
221
+ A [Github Action](https://github.com/elastic/kibana-github-actions/tree/main/backport) around The Backport Tool for automatically creating backports when pull requests are merged.
216
222
 
217
223
  ## What is backporting?
218
224
 
@@ -224,20 +230,21 @@ Source: [https://en.wikipedia.org/wiki/Backporting](https://en.wikipedia.org/wik
224
230
 
225
231
  This tools is for anybody who is working on a codebase where they have to maintain multiple versions. If you manually cherry-pick commits from master and apply them to one or more branches, this tool might save you a lot of time.
226
232
 
227
- `backport` is a CLI tool that will let you backport commit(s) interactively and then cherry-pick and create pull requests automatically. `backport` will always perform the git operation in a temporary folder (`~/.backport/repositories/`) separate from your working directory, thereby never interfering with any unstages changes your might have.
233
+ `backport` is a CLI tool that will let you backport commit(s) interactively and then cherry-pick and create pull requests automatically. `backport` will perform all git operations in a temporary folder (`~/.backport/repositories/`) separate from your working directory, thereby never interfering with any unstages changes your might have.
228
234
 
229
235
  **Features:**
230
236
 
231
237
  - interactively backport one or more commits to one or more branches with an intuitive UI
232
- - will never run `git reset --hard` or other git commands in your working directory - all git operations are handled in a separate directory
238
+ - ability to see which commits have been backported and to which branches
239
+ - ability to customize the title, description and labels of the created backport PRs
240
+ - all git operations are handled in a separate directory to not interfere with unstaged files
241
+ - Conflicts are handled gracefully, and hints are provided to help the user understand the source of the conflict
233
242
  - backport a commit by specifying a PR: `backport --pr 1337`
234
243
  - list and backport commits by a particular user: `backport --author john`
235
244
  - list and backport commits by a particular path: `backport --path src/plugins/chatbot`
236
245
  - list PRs filtered by a query: `backport --pr-filter label:backport-v2` (will list commits from PRs with the label "backport-v2")
237
- - forward port commits: `backport --sourceBranch 7.x --branch master` (will forwardport from 7.x to master)
246
+ - forward port commits: `backport --source-branch 7.x --branch master` (will forwardport from 7.x to master)
238
247
  - backport merge commits: `backport --mainline`
239
- - ability to see which commits have been backported and to which branches
240
- - customize the title, description and labels of the created backport PRs
241
248
 
242
249
  ## Contributing
243
250
 
@@ -245,3 +252,7 @@ See [CONTRIBUTING.md](https://github.com/sqren/backport/blob/master/CONTRIBUTING
245
252
 
246
253
  [1]: https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--x
247
254
  [2]: https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax
255
+
256
+ [![Build Status](https://travis-ci.com/sqren/backport.svg?branch=master)](https://app.travis-ci.com/github/sqren/backport)
257
+ [![NPM version](https://img.shields.io/npm/v/backport.svg)](https://www.npmjs.com/package/backport)
258
+ [![Coverage Status](https://coveralls.io/repos/github/sqren/backport/badge.svg?branch=master)](https://coveralls.io/github/sqren/backport?branch=master)
@@ -16,4 +16,6 @@ export declare function getCommits(options: {
16
16
  sha?: string;
17
17
  skipRemoteConfig?: boolean;
18
18
  sourceBranch?: string;
19
+ dateUntil?: string;
20
+ dateSince?: string;
19
21
  }): Promise<import("./services/sourceCommit/parseSourceCommit").Commit[]>;
@@ -7,6 +7,7 @@ const fetchCommitBySha_1 = require("./services/github/v4/fetchCommits/fetchCommi
7
7
  const fetchCommitsByAuthor_1 = require("./services/github/v4/fetchCommits/fetchCommitsByAuthor");
8
8
  const getOptionsFromGithub_1 = require("./services/github/v4/getOptionsFromGithub/getOptionsFromGithub");
9
9
  const logger_1 = require("./services/logger");
10
+ const excludeUndefined_1 = require("./utils/excludeUndefined");
10
11
  (0, logger_1.initLogger)();
11
12
  var fetchProjectConfig_1 = require("./services/github/v4/fetchProjectConfig");
12
13
  Object.defineProperty(exports, "fetchProjectConfig", { enumerable: true, get: function () { return fetchProjectConfig_1.fetchProjectConfig; } });
@@ -19,7 +20,7 @@ function backportRun(options,
19
20
  // backportRun(options, args)
20
21
  //
21
22
  args = []) {
22
- return (0, main_1.main)(args, options);
23
+ return (0, main_1.main)(args, (0, excludeUndefined_1.excludeUndefined)(options));
23
24
  }
24
25
  exports.backportRun = backportRun;
25
26
  async function getCommits(options) {
@@ -45,7 +46,10 @@ async function getCommits(options) {
45
46
  return (0, fetchCommitsByAuthor_1.fetchCommitsByAuthor)({
46
47
  ...optionsFromGithub,
47
48
  ...options,
49
+ // filters
48
50
  author: options.author ?? null,
51
+ dateSince: options.dateSince ?? null,
52
+ dateUntil: options.dateUntil ?? null,
49
53
  });
50
54
  }
51
55
  exports.getCommits = getCommits;
@@ -7,26 +7,30 @@ describe('entrypoint.module', () => {
7
7
  const accessToken = await (0, getDevAccessToken_1.getDevAccessToken)();
8
8
  const commits = await (0, entrypoint_module_1.getCommits)({
9
9
  accessToken: accessToken,
10
- repoName: 'kibana',
11
- repoOwner: 'elastic',
12
- pullNumber: 121633,
10
+ repoName: 'backport-e2e',
11
+ repoOwner: 'backport-org',
12
+ pullNumber: 2,
13
13
  });
14
14
  expect(commits).toEqual([
15
15
  {
16
- committedDate: '2021-12-20T14:20:16Z',
16
+ committedDate: '2020-08-15T10:44:04Z',
17
17
  expectedTargetPullRequests: [
18
18
  {
19
- branch: '8.0',
20
- number: 121643,
19
+ branch: '7.x',
20
+ number: 4,
21
21
  state: 'MERGED',
22
- url: 'https://github.com/elastic/kibana/pull/121643',
22
+ url: 'https://github.com/backport-org/backport-e2e/pull/4',
23
+ mergeCommit: {
24
+ message: 'Add family emoji (#2) (#4)',
25
+ sha: 'f8b4f6ae7ffaf2732fa5e33e98b3ea772bdfff1d',
26
+ },
23
27
  },
24
28
  ],
25
- originalMessage: '[APM] Add note about synthtrace to APM docs (#121633)',
26
- pullNumber: 121633,
27
- pullUrl: 'https://github.com/elastic/kibana/pull/121633',
28
- sha: 'd421ddcf6157150596581c7885afa3690cec6339',
29
- sourceBranch: 'main',
29
+ originalMessage: 'Add family emoji (#2)',
30
+ pullNumber: 2,
31
+ pullUrl: 'https://github.com/backport-org/backport-e2e/pull/2',
32
+ sha: '59d6ff1ca90a4ce210c0a4f0e159214875c19d60',
33
+ sourceBranch: 'master',
30
34
  },
31
35
  ]);
32
36
  });
package/dist/main.js CHANGED
@@ -39,7 +39,7 @@ async function main(argv, optionsFromModule) {
39
39
  errorMessage: e.message,
40
40
  error: e,
41
41
  };
42
- if (options?.ci) {
42
+ if (options) {
43
43
  await (0, createStatusComment_1.createStatusComment)({
44
44
  options,
45
45
  backportResponse,
@@ -18,6 +18,7 @@ declare type Options = Partial<{
18
18
  autoFixConflicts: AutoFixConflictsHandler;
19
19
  autoMerge: boolean;
20
20
  autoMergeMethod: string;
21
+ backportBinary: string;
21
22
  cherrypickRef: boolean;
22
23
  ci: boolean;
23
24
  commitPaths: string[];
@@ -5,14 +5,14 @@ export declare function getOptionsFromCliArgs(argv: readonly string[], { exitOnE
5
5
  fork?: boolean | undefined;
6
6
  verbose?: boolean | undefined;
7
7
  accessToken?: string | undefined;
8
- assignees: string[];
8
+ assignees?: string[] | undefined;
9
9
  author?: string | null | undefined;
10
10
  autoAssign?: boolean | undefined;
11
11
  autoMerge?: boolean | undefined;
12
12
  autoMergeMethod?: string | undefined;
13
13
  cherrypickRef?: boolean | undefined;
14
14
  ci?: boolean | undefined;
15
- commitPaths: string[];
15
+ commitPaths?: string[] | undefined;
16
16
  details?: boolean | undefined;
17
17
  editor?: string | undefined;
18
18
  gitHostname?: string | undefined;
@@ -29,7 +29,7 @@ export declare function getOptionsFromCliArgs(argv: readonly string[], { exitOnE
29
29
  repoName?: string | undefined;
30
30
  repoOwner?: string | undefined;
31
31
  resetAuthor?: boolean | undefined;
32
- reviewers: string[];
32
+ reviewers?: string[] | undefined;
33
33
  sha?: string | undefined;
34
34
  skipRemoteConfig?: boolean | undefined;
35
35
  sourceBranch?: string | undefined;
@@ -38,4 +38,6 @@ export declare function getOptionsFromCliArgs(argv: readonly string[], { exitOnE
38
38
  targetBranches?: string[] | undefined;
39
39
  targetPRLabels?: string[] | undefined;
40
40
  mainline?: number | undefined;
41
+ dateSince?: string | undefined;
42
+ dateUntil?: string | undefined;
41
43
  };
@@ -56,6 +56,14 @@ function getOptionsFromCliArgs(argv, { exitOnError = true } = {}) {
56
56
  description: 'Append commit message with "(cherry picked from commit...)',
57
57
  type: 'boolean',
58
58
  conflicts: ['noCherrypickRef'],
59
+ })
60
+ .option('since', {
61
+ description: 'ISO-8601 date for filtering commits',
62
+ type: 'string',
63
+ })
64
+ .option('until', {
65
+ description: 'ISO-8601 date for filtering commits',
66
+ type: 'string',
59
67
  })
60
68
  .option('details', {
61
69
  description: 'Show details about each commit',
@@ -94,9 +102,10 @@ function getOptionsFromCliArgs(argv, { exitOnError = true } = {}) {
94
102
  description: 'Parent id of merge commit. Defaults to 1 when supplied without arguments',
95
103
  type: 'number',
96
104
  coerce: (mainline) => {
97
- // `--mainline` (default to 1 when no parent is given)
98
105
  if (mainline === undefined) {
99
- return 1;
106
+ // return 1 if `--mainline` is given without a value
107
+ // return undefined if --mainline is not supplied at all
108
+ return argv.includes('--mainline') ? 1 : undefined;
100
109
  }
101
110
  // use specified mainline parent
102
111
  if (Number.isInteger(mainline)) {
@@ -255,21 +264,26 @@ function getOptionsFromCliArgs(argv, { exitOnError = true } = {}) {
255
264
  /* eslint-disable @typescript-eslint/no-unused-vars */
256
265
  $0, _,
257
266
  /* eslint-enable @typescript-eslint/no-unused-vars */
258
- multiple, multipleBranches, multipleCommits, all, author,
267
+ multiple, multipleBranches, multipleCommits, all,
268
+ // filters
269
+ author, since, until,
259
270
  // negations
260
271
  verify, noVerify, noCherrypickRef, noFork,
261
272
  // array types (should be renamed to plural form)
262
273
  assignee, path, reviewer, sourcePRLabel, targetBranch, targetBranchChoice, targetPRLabel, ...restOptions } = yargsInstance.parseSync();
263
274
  return (0, excludeUndefined_1.excludeUndefined)({
264
275
  ...restOptions,
276
+ // filters
265
277
  author: all ? null : author,
278
+ dateSince: since,
279
+ dateUntil: until,
266
280
  // `multiple` is a cli-only flag to override `multipleBranches` and `multipleCommits`
267
281
  multipleBranches: multiple ?? multipleBranches,
268
282
  multipleCommits: multiple ?? multipleCommits,
269
283
  // rename array types to plural
270
- assignees: assignee ?? [],
271
- commitPaths: path ?? [],
272
- reviewers: reviewer ?? [],
284
+ assignees: assignee,
285
+ commitPaths: path,
286
+ reviewers: reviewer,
273
287
  sourcePRLabels: sourcePRLabel,
274
288
  targetBranchChoices: targetBranchChoice,
275
289
  targetBranches: targetBranch,
@@ -20,8 +20,6 @@ describe('getOptionsFromCliArgs', () => {
20
20
  const argv = [
21
21
  '--access-token',
22
22
  'my access token',
23
- '--author',
24
- 'sqren',
25
23
  '--repo-owner',
26
24
  'elastic',
27
25
  '--repo-name',
@@ -32,11 +30,6 @@ describe('getOptionsFromCliArgs', () => {
32
30
  accessToken: 'my access token',
33
31
  repoOwner: 'elastic',
34
32
  repoName: 'kibana',
35
- author: 'sqren',
36
- mainline: 1,
37
- reviewers: [],
38
- assignees: [],
39
- commitPaths: [],
40
33
  });
41
34
  });
42
35
  });
@@ -19,6 +19,7 @@ export declare function getOptionsFromConfigFiles(optionsFromModule?: ConfigFile
19
19
  }) => boolean | Promise<boolean>) | undefined;
20
20
  autoMerge?: boolean | undefined;
21
21
  autoMergeMethod?: string | undefined;
22
+ backportBinary?: string | undefined;
22
23
  cherrypickRef?: boolean | undefined;
23
24
  ci?: boolean | undefined;
24
25
  commitPaths?: string[] | undefined;
@@ -50,7 +50,7 @@ async function createGlobalConfigIfNotExist(globalConfigPath, configTemplate) {
50
50
  exports.createGlobalConfigIfNotExist = createGlobalConfigIfNotExist;
51
51
  function getConfigTemplate() {
52
52
  return `{
53
- // Github personal access token. Must be created here: https://github.com/settings/tokens/new
53
+ // Create a personal access token here: https://github.com/settings/tokens
54
54
  // Must have "Repo: Full control of private repositories"
55
55
  "accessToken": ""
56
56
  }`;
@@ -21,6 +21,7 @@ export declare function withConfigMigrations({ upstream, labels, branches, ...co
21
21
  }) => boolean | Promise<boolean>) | undefined;
22
22
  autoMerge?: boolean | undefined;
23
23
  autoMergeMethod?: string | undefined;
24
+ backportBinary?: string | undefined;
24
25
  cherrypickRef?: boolean | undefined;
25
26
  ci?: boolean | undefined;
26
27
  commitPaths?: string[] | undefined;
@@ -5,8 +5,12 @@ export declare const defaultConfigOptions: {
5
5
  autoAssign: boolean;
6
6
  autoMerge: boolean;
7
7
  autoMergeMethod: string;
8
+ backportBinary: string;
8
9
  cherrypickRef: boolean;
9
10
  ci: boolean;
11
+ commitPaths: string[];
12
+ dateSince: null;
13
+ dateUntil: null;
10
14
  details: boolean;
11
15
  fork: boolean;
12
16
  maxNumber: number;
@@ -14,6 +18,7 @@ export declare const defaultConfigOptions: {
14
18
  multipleCommits: boolean;
15
19
  noVerify: boolean;
16
20
  resetAuthor: boolean;
21
+ reviewers: string[];
17
22
  sourcePRLabels: string[];
18
23
  targetBranchChoices: TargetBranchChoiceOrString[];
19
24
  targetBranches: string[];
@@ -57,6 +62,8 @@ export declare function getOptions(argv: string[], optionsFromModule?: ConfigFil
57
62
  targetBranches: string[];
58
63
  targetPRLabels: string[];
59
64
  mainline?: number | undefined;
65
+ dateSince: string | null;
66
+ dateUntil: string | null;
60
67
  historicalBranchLabelMappings: {
61
68
  branchLabelMapping: Record<string, string>;
62
69
  committedDate: string;
@@ -73,6 +80,7 @@ export declare function getOptions(argv: string[], optionsFromModule?: ConfigFil
73
80
  };
74
81
  targetBranch: string;
75
82
  }) => boolean | Promise<boolean>) | undefined;
83
+ backportBinary: string;
76
84
  multiple?: boolean | undefined;
77
85
  branchLabelMapping?: Record<string, string> | undefined;
78
86
  upstream?: string | undefined;
@@ -15,8 +15,12 @@ exports.defaultConfigOptions = {
15
15
  autoAssign: false,
16
16
  autoMerge: false,
17
17
  autoMergeMethod: 'merge',
18
+ backportBinary: 'backport',
18
19
  cherrypickRef: true,
19
20
  ci: false,
21
+ commitPaths: [],
22
+ dateSince: null,
23
+ dateUntil: null,
20
24
  details: false,
21
25
  fork: true,
22
26
  maxNumber: 10,
@@ -24,6 +28,7 @@ exports.defaultConfigOptions = {
24
28
  multipleCommits: false,
25
29
  noVerify: true,
26
30
  resetAuthor: false,
31
+ reviewers: [],
27
32
  sourcePRLabels: [],
28
33
  targetBranchChoices: [],
29
34
  targetBranches: [],
@@ -82,19 +87,19 @@ function requireAccessToken(combinedOptions) {
82
87
  // accessToken must be supplied in config or via cli args
83
88
  if (!combinedOptions.accessToken) {
84
89
  const globalConfigPath = (0, env_1.getGlobalConfigPath)();
85
- throw new HandledError_1.HandledError(`Please update your config file: ${globalConfigPath}.\nIt must contain a valid "accessToken".\n\nRead more: ${GLOBAL_CONFIG_DOCS_LINK}`);
90
+ throw new HandledError_1.HandledError(`Please update your config file: "${globalConfigPath}".\nIt must contain a valid "accessToken".\n\nRead more: ${GLOBAL_CONFIG_DOCS_LINK}`);
86
91
  }
87
92
  return combinedOptions.accessToken;
88
93
  }
89
94
  function requireRepoName(combinedOptions) {
90
95
  if (!combinedOptions.repoName) {
91
- throw new HandledError_1.HandledError(`Please specify a repo name: "--repo-name kibana". \n\nRead more: ${PROJECT_CONFIG_DOCS_LINK}`);
96
+ throw new HandledError_1.HandledError(`Please specify a repo name: "--repo-name kibana".\n\nRead more: ${PROJECT_CONFIG_DOCS_LINK}`);
92
97
  }
93
98
  return combinedOptions.repoName;
94
99
  }
95
100
  function requireRepoOwner(combinedOptions) {
96
101
  if (!combinedOptions.repoOwner) {
97
- throw new HandledError_1.HandledError(`Please specify a repo owner: "--repo-owner elastic". \n\nRead more: ${PROJECT_CONFIG_DOCS_LINK}`);
102
+ throw new HandledError_1.HandledError(`Please specify a repo owner: "--repo-owner elastic".\n\nRead more: ${PROJECT_CONFIG_DOCS_LINK}`);
98
103
  }
99
104
  return combinedOptions.repoOwner;
100
105
  }
@@ -104,6 +109,6 @@ function requireTargetBranch(config) {
104
109
  (0, lodash_1.isEmpty)(config.targetBranchChoices) &&
105
110
  // this is primarily necessary on CI where `targetBranches` and `targetBranchChoices` and not given
106
111
  (0, lodash_1.isEmpty)(config.branchLabelMapping)) {
107
- throw new HandledError_1.HandledError(`Please specify a target branch: "--branch 6.1". \n\n Read more: ${PROJECT_CONFIG_DOCS_LINK}`);
112
+ throw new HandledError_1.HandledError(`Please specify a target branch: "--branch 6.1".\n\nRead more: ${PROJECT_CONFIG_DOCS_LINK}`);
108
113
  }
109
114
  }