gh-rr
GitHub CLI extension to request reviews from defined groups of reviewers.
Installation
gh extension install g-rath/gh-rr
Usage
Create a gh-rr.yml file in your home directory for configuring groups of
reviewers:
# this is a map of repositories to groups of GitHub usernames
repositories:
# these are "global" groups, which can be enabled with -g|--global
'*':
bob: [octopus]
security:
- octopus
g-rath/my-awesome-app:
# this is the implicit default group that will be used for this repository
- g-rath
- octocat
g-rath/my-awesome-api:
# this is the default group that will be used for this repository
default:
- g-rath
# this is an alternative group for this repository, which can be selected with -f|--from
infra:
- octodog
- octopus
Then start requesting reviewers on your pull requests:
gh rr
As a thin wrapper around
gh pr edit, the repository and
pull request are inferred automatically based on the current directory and
checked out branch when called without any flags or arguments.
Like with gh pr edit, you can pass either a pull request number, url, or
branch as the first argument, and can use the -R|--repo flag to specify the
repository the pull request you're targeting belongs to:
# targeting a specific pull request in the current repository
gh rr 123
# targeting the pull request associated with a specific branch in another repository
gh --repo octocat/hello-world my-feature
You can also use the -f|--from flag to target alternative reviewer groups:
gh rr --from infra
This can be combined with the -g|--global to target "global" groups which are
defined under the * repository:
# makes it easy to add a specific person
gh rr -gf bob
# or target a group of common people
gh rr -gf security
Both of these can be used to achieve a similar result as this extension, but
they're not entirely equivalent: team-focused reviews generally dismiss the team
review when a single member of that team submits their review, and automatic
review assignment has a limit of up to 7 people (plus, it skips people who set
their status to "busy" - while well intended, it assumes everyone diligently
updates their status).
While you can use CODEOWNERS to work around this by specifying users instead of
teams, that means you then need to do a commit to update the file (which is
particularly annoying when you're using branches for deployments), and it only
applies at the file level rather than the change level (e.g. you might make an
update to a section of your readme that relates to infrastructure, so should be
reviewed by your platforms team)