@mattpolzin/harmony 2.0.0 → 2.2.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.
Files changed (3) hide show
  1. harmony-npm/README.md +24 -14
  2. harmony-npm/harmony +725 -543
  3. harmony-npm/package.json +1 -1
harmony-npm/README.md CHANGED
@@ -91,7 +91,18 @@ Would you like harmony to assign teams in addition to individuals when it assign
91
91
  Creating config...
92
92
  ```
93
93
 
94
- Once configured, Harmony supports the following commands: `branch`, `pr`, `label`, `assign`, `contribute`, `whoami`, `reflect`, `list`, `graph`, `config`, and `sync`.
94
+ Once configured, Harmony supports the following commands: `config`, `branch`, `pr`, `label`, `assign`, `contribute`, `whoami`, `reflect`, `list`, `graph`, and `sync`.
95
+
96
+ ### Config
97
+ Running `harmony config <property>` will read the given configuration property. `harmony config <property> <value>` will set the configuration property.
98
+
99
+ Not all configuration properties can be read/set with this command.
100
+ #### Properties
101
+ - `assignTeams` (`true`/`false`) -- When picking a reviewer from a team, assign the team as a reviewer as well.
102
+ - `assignUsers` (`true`/`false`) -- When assigning a team as a reviewer, pick a user to review as well.
103
+ - `commentOnAssign` (`true`/`false`) -- When assigning a reviewer chosen by Harmony, comment on the pull request.
104
+ - `defaultRemote` (optional string) -- When pushing new branches, what remote destination should be used.
105
+ - `githubPAT` (optional string) -- If the `$GITHUB_PAT` environment variable is not set, this Personal Access Token is used to authenticate with GitHub.
95
106
 
96
107
  ### Branch
97
108
  Running `harmony branch` will print the URI for accessing the currently checked out branch on GitHub.
@@ -99,7 +110,7 @@ Running `harmony branch` will print the URI for accessing the currently checked
99
110
  Many operating systems have an `open` command (though the name "open" is not ubiquitous); this means you can run something like `open $(harmony branch)` to open a web browser to the current branch on GitHub.
100
111
 
101
112
  ### PR
102
- Running `harmony pr` with a branch checked out will reach out to GitHub to determine if there is an open PR for that branch. If there is a PR, Harmony will print a URI that can be used to view the PR. IF there is not a PR, Harmony will help you create one.
113
+ Running `harmony pr [--draft]` with a branch checked out will reach out to GitHub to determine if there is an open PR for that branch. If there is a PR, Harmony will print a URI that can be used to view the PR. If there is not a PR, Harmony will help you create one. New PRs can be created as drafts by specifying the `--draft` flag with the `pr` command.
103
114
 
104
115
  If you need to create a PR still, you will be prompted for a branch to open the PR against (merge into, eventually), a title for the PR, and a description for the PR. If you have an `EDITOR` environment variable set, Harmony will use that editor to get the PR description from you. If you have a PR template at `.github/PULL_REQUEST_TEMPLATE.md`, Harmony will also preload that into your editor. If you do not have an `EDITOR` environment variable set, you will still be able to enter a description from the command line but PR templates are only supported when an `EDITOR` is specified.
105
116
 
@@ -109,10 +120,20 @@ Many operating systems have an `open` command (though the name "open" is not ubi
109
120
  Running `harmony label {<label>} [...]` will help you create a PR if one does not exist yet and then it will apply the given labels to the PR.
110
121
 
111
122
  ### Assign
112
- Running `harmony assign {<team> | +<user>} [...]` will help you create a PR if one does not exist yet and then it will pick someone to review the PR (from one of the listed teams) and assign both that user and the teams you listed as reviewers of the PR.
123
+ Running `harmony assign {<team> | +<user>} [#<label>] [...]` will help you create a PR if one does not exist yet and then it will assign teams and/or users to the PR.
124
+
125
+ If `harmony config assignUsers` is `True` (defualt) then harmony will pick someone to review the PR (from one of the listed teams) and assign them to the PR. If `harmony config assignTeams` is `True` then harmony will assign the teams you listed as reviewers of the PR. If `harmony config commentOnAssign` is `True` then harmony will comment on the Pull Request indicating that teams & users were "harmoniously assigned" -- this comment will @mention assigned users so it may be useful or annoying depending on the assigned user's GitHub notification settings.
113
126
 
114
127
  You can also require that specific additional users (on top of the one Harmony will pick for you) are assigned to the PR. You do this by specifying those users' logins prefixed with '+' as arguments to Harmony.
115
128
 
129
+ If your team has GitHub set up to auto-assign individuals when a team is requested for review, you probably want to tell harmony not to also pick someone using its heuristics. You can run the following `config` commands to tell harmony to assign a team but not also pick an individual from that team:
130
+ ```shell
131
+ harmony config assignTeams true
132
+ harmony config assignUsers false
133
+ ```
134
+
135
+ You can optionally apply any number of labels to the PR at the same time as assigning reviewers by prefixing the labels with '#'.
136
+
116
137
  #### Examples
117
138
  Assign the most available reviewer from the "developers" GitHub Team:
118
139
  ```shell
@@ -168,17 +189,6 @@ Running `harmony graph <team>` will graph the relative review workload of each o
168
189
 
169
190
  You can optionally graph completed PR reviews with the `--completed` flag as well, though these are not considered for Harmony's weighting algorithm for review workload.
170
191
 
171
- ### Config
172
- Running `harmony config <property>` will read the given configuration property. `harmony config <property> <value>` will set the configuration property.
173
-
174
- Not all configuration properties can be read/set with this command.
175
- #### Properties
176
- - `assignTeams` -- When picking a reviewer from a team, assign the team as a reviewer as well.
177
- - `assignUsers` -- When assigning a team as a reviewer, pick a user to review as well.
178
- - `commentOnAssign` -- When assigning a reviewer chosen by Harmony, comment on the pull request.
179
- - `defaultRemote` -- When pushing new branches, what remote destination should be used.
180
- - `githubPAT` -- If the `$GITHUB_PAT` environment variable is not set, this Personal Access Token is used to authenticate with GitHub.
181
-
182
192
  ### Sync
183
193
  Running `harmony sync` will sync the locally configured team slugs and user logins that are used by auto-completion for Harmony. This sync is also performed automatically the first time you run Harmony after more than a day without the configuration being synced.
184
194