Skip to content

Commit

Permalink
Add --copy-source-pr-labels option and rename `--add-original-revie…
Browse files Browse the repository at this point in the history
…wers` to `--copy-source-pr-reviewers` (#474)
  • Loading branch information
sorenlouv authored Sep 2, 2023
1 parent c3e8a3d commit b642721
Show file tree
Hide file tree
Showing 32 changed files with 616 additions and 423 deletions.
86 changes: 44 additions & 42 deletions docs/cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,50 @@

The CLI options will override the [config-file-options.md](/docs/config-file-options.md).

| Option | Shorthand notation | Description | Default |
| ------------------- | ------------------ | --------------------------------------------------------------------------- | ------------------------- |
| --access-token | | Github access token | |
| --all | -a | Show commits from any author. Opposite of `--author` | false |
| --assignee | --assign | Assign users to the target PR | |
| --author | | Filter commits by Github username. Opposite of `--all` | _Current user_ |
| --auto-assign | | Assign current user to the target PR | false |
| --branch | -b | Target branch to backport to | |
| --commit-conflicts | | Commit conflicts instead of aborting. Only takes effect in `non-interactive | false |
| --config-file | | Custom path to project config file (.backportrc.json) | |
| --dir | | Clone repository into custom directory | ~/.backport/repositories/ |
| --dry-run | | Perform backport without pushing to Github | false |
| --editor | | Editor (eg. `code`) to open and resolve conflicts | nano |
| --fork | | Create backports in fork repo | true |
| --git-hostname | | Hostname for Git | github.com |
| --interactive | | Enable interactive prompts | true |
| --mainline | | Parent id of merge commit | 1 |
| --max-number | --number, -n | Number of commits to choose from | 10 |
| --multiple | | Multi-select for commits and branches | false |
| --multiple-branches | | Multi-select for branches | true |
| --multiple-commits | | Multi-select for commits | false |
| --no-cherrypick-ref | | Do not append "(cherry picked from commit...)". [Git Docs][1] | false |
| --no-status-comment | | Do not publish a status comment to Github with the results of the backport | false |
| --no-verify | | Bypass the pre-commit and commit-msg hooks | false |
| --path | -p | Filter commits by path | |
| --pr-description | --description | Description for pull request | |
| --pr-filter | | Find PRs using [Github's search syntax][2] | |
| --pr-title | --title | Title of pull request | |
| --pull-number | --pr | Backport pull request by number | |
| --repo-fork-owner | | The owner of the fork where the backport branch is pushed. | _Current user_ |
| --repo-name | | Name of repository | |
| --repo-owner | | Owner of repository | |
| --reset-author | | Set yourself as commit author | |
| --reviewer | | Add reviewer to the target PR | |
| --sha | | Sha of commit to backport | |
| --signoff | -s | Pass the --signoff option to the cherry-pick command | false |
| --source-branch | | Specify a non-default branch to backport from | |
| --source-pr-label | | Labels added to the source PR | |
| --target-branch | -b | Target branch(es) to backport to | |
| --target-pr-label | --label, -l | Labels added to the target PR | |
| --help | | Show help | |
| -v, --version | | Show version number | |
| Option | Shorthand notation | Description | Default |
| ----------------------- | ------------------ | --------------------------------------------------------------------------- | ------------------------- |
| --access-token | | Github access token | |
| --all | -a | Show commits from any author. Opposite of `--author` | false |
| --assignee | --assign | Assign users to the target PR | |
| --author | | Filter commits by Github username. Opposite of `--all` | _Current user_ |
| --auto-assign | | Assign current user to the target PR | false |
| --branch | -b | Target branch to backport to | |
| --commit-conflicts | | Commit conflicts instead of aborting. Only takes effect in `non-interactive | false |
| --config-file | | Custom path to project config file (.backportrc.json) | |
| --dir | | Clone repository into custom directory | ~/.backport/repositories/ |
| --dry-run | | Perform backport without pushing to Github | false |
| --editor | | Editor (eg. `code`) to open and resolve conflicts | nano |
| --fork | | Create backports in fork repo | true |
| --git-hostname | | Hostname for Git | github.com |
| --interactive | | Enable interactive prompts | true |
| --mainline | | Parent id of merge commit | 1 |
| --max-number | --number, -n | Number of commits to choose from | 10 |
| --multiple | | Multi-select for commits and branches | false |
| --multiple-branches | | Multi-select for branches | true |
| --multiple-commits | | Multi-select for commits | false |
| --no-cherrypick-ref | | Do not append "(cherry picked from commit...)". [Git Docs][1] | false |
| --no-status-comment | | Do not publish a status comment to Github with the results of the backport | false |
| --no-verify | | Bypass the pre-commit and commit-msg hooks | false |
| --path | -p | Filter commits by path | |
| --pr-description | --description | Description for pull request | |
| --pr-filter | | Find PRs using [Github's search syntax][2] | |
| --pr-title | --title | Title of pull request | |
| --pull-number | --pr | Backport pull request by number | |
| --repo-fork-owner | | The owner of the fork where the backport branch is pushed. | _Current user_ |
| --repo-name | | Name of repository | |
| --repo-owner | | Owner of repository | |
| --reset-author | | Set yourself as commit author | |
| --reviewer | | Add reviewer to the target PR | |
| --sha | | Sha of commit to backport | |
| --signoff | -s | Pass the --signoff option to the cherry-pick command | false |
| --copySourcePRLabels | | Copy labels from source PR to the target PR | false |
| --copySourcePRReviewers | | Copy reviewers from source PR to the target PR | false |
| --source-branch | | Specify a non-default branch to backport from | |
| --source-pr-label | | Labels added to the source PR | |
| --target-branch | -b | Target branch(es) to backport to | |
| --target-pr-label | --label, -l | Labels added to the target PR | |
| --help | | Show help | |
| -v, --version | | Show version number | |

[1]: https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt--x
[2]: https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax
21 changes: 20 additions & 1 deletion docs/config-file-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ Default: `"[{{targetBranch}}] {{commitMessages}}"`
{{targetBranch}} {{sourcePullRequest.title}}
```


**Example**

```json
Expand Down Expand Up @@ -470,6 +469,26 @@ Default: master (unless the default branch on Github is changed)
}
```

#### `copySourcePRReviewers`

Copies all labels from the original (source) pull request to the backport (target) pull request.

```json
{
"copySourcePRReviewers": false
}
```

#### `copySourcePRLabels`

Assign the same reviewers to the target pull request that were assigned to the original (source) pull request.

```json
{
"copySourcePRLabels": false
}
```

#### `sourcePRLabels`

Labels that will be added to the source (original) pull request. This can be useful if you, at a later time, want to find the PRs that were already backported.
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ process.env.TZ = 'UTC';
process.env.NODE_ENV = 'jest';

const baseConfig: JestConfigWithTsJest = {
prettierPath: null,
prettierPath: null, // disable prettier until it is supported by jest
transform: {
'^.+\\.ts?$': ['ts-jest', { diagnostics: false }],
},
Expand Down
Loading

0 comments on commit b642721

Please sign in to comment.