This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.
Gerrit Productivity Hacks – Add Default Reviewer
We often get requests from the TeamForge users who’re using Git Integration for the one very common use case: “How can I add a default reviewer to the code review request ? ”
Well, answer became much simpler with Gerrit’s Reviewer plugin and Gerrit 2.11 with which plugin can be configured per project with the comfort of Gerrit webUI.
The verified version of the plugin can be downloaded or install directly.
Download and install
ssh -p 29418 <USERNAME>@<GERRIT_HOST> gerrit plugin install -n reviewers.jar -< reviewers.jar
ssh -p 29418 <USERNAME>@<GERRIT_HOST> gerrit plugin install -n reviewers.jar - https://s3-ap-southeast-1.amazonaws.com/ctf-dev-environment-vagrant/reviewers.jar
Replace USERNAME with the user with administrators user and GERRIT_HOST with the hostname of your Git integration server. In the future release of Gerrit 2.11, this plugin will be bundled so going forward it will not require to install it separately.
Plugin allows to configure default reviewer(s) per repository.
Go to Gerrit WebUI->project menu bar-> List-> Select project (repository name in TeamForge)
Click on the Reviewers tab
Here you can specify filter and the default reviewer.
reviewer can be added by name or email address.
filter can be of multiple types:
- * (wildcard) for any code review request for this repository
- branch:master for any code review request for the branch
- branch:release file:^lib/.* for any code review request for the release branch which involves change in lib directory
Now with this configuration in place, any new change will have reviewer added as per configuration.
That’s it. Very easy. isn’t it? Add your peers as a default reviewer and get their attention easily !