Development_Code Reviews - ACCESS-NRI/accessdev-Trac-archive GitHub Wiki

Code Reviews

A software package called Reviewboard is available at https://accessdev.nci.org.au/review to assist with collaborative code reviews. A code review is where other developers can look at your code and make suggestions on how it could be improved.

Requesting a Review

Using 'rose review'

To request a review of a Rose suite just run rose review from within a checked-out suite directory. By default this requests a review of all files in the suite, you can request a review of specific changes like rose review -r 101:102 (syntax is the same as 'svn diff').

Once Rose has submitted the review it will give the address of the review on Reviewboard, you need to go to this address and fill in the review title and description before other people can see it.

RBT Submission

You can request a review on the commandline directly from a checked out repository. To do this you will need the 'RBTools' Python package (it's already installed on accessdev, to install on your own workstation run pip install --user RBTools).

From within your repository run

rbt post

This will create a diff against the repository's trunk and request a code review. By default this will be a draft, meaning that other people haven't been notified of the review. To ask other people to review it you'll need to go to the URL that rbt post gave you and fill in some extra details, for instance explaining what you've changed and what you'd like checked, then press the 'Publish' button to notify reviewers. If you need to make changes you can update the review using rbt post --update rather than creating a new review.

Manual Submission

To manually submit a review of your code go to the [//review/r/new 'New Review Request'] section at the top of the Reviewboard page. Here you select the repository your code is in and then upload a diff file created by running e.g. svn diff.

Who reviews your code

The intention of the review process is to have your peers review your code. Anyone in the ACCESS NCI group can register to be in the default 'Rose' review group by going to their [_review/account/preferences preferences page] and selecting the 'Rose' group. There are also a number of more specific review groups that you can find on the [_review/groups Groups] page, or you can send a review to specific users by entering their NCI ID in the 'People' section of the review. If you'd like a new review group to be created submit a [/newticket Trac ticket].

Linking reviews with Trac tickets

To link a code review with a Trac ticket on Reviewboard add the Trac ticket number to the 'Bugs' field of the code review, Reviewboard will automatically add a comment on the ticket saying that code is waiting to be reviewed.

To link a code review from a Trac ticket use the syntax review:4, which turns into a link like review:4