We have been running Review Board along with Perforce Software Configuration
Management System for about 12 months now.
We wanted to add some kind of verification of a Review Done for that
Changelist, before any changelist is checked-in to Perforce. Perforce
provides pre-submit/pre-commit triggers to run custom scripts.
So i was planning to run a script to verify if every changelist that is
being submitted has been Reviewed by at least one Reviewer before the
Changelist is allowed to be checked-in to Perforce.
As of now i've written a small script to accomplish this. My approach is to
remotely query the mysql server for the "reviewrequest" table to verify if
that changelist has already been reviewed and "shipped" by atleast one
reviewer. I'm attaching the script below. I've verified the script on my
local machine and it works fine.
I wanted to get some review of this to know if this is the best solution to
accomplish this OR if there any tools out there which would accomplish the
same in a better way.
if [ $# -ne 1 ]
echo "Usage pre_commit_reviewboard_script.sh <changenumber>"
#echo "Changelist Number for Validation: $1"
resp=`mysql -u<MYSQL_USERNAME> -p<MYSQL_PASSWORD> -h <REVIEWBOARD_IPADDRESS>
-P <PORT> --database reviewboard -e "select shipit_count from
reviews_reviewrequest where changenum='$1';"`
if [ ! -n "$resp" ]
echo "No Response For the query. Probably there is no such review done"
#echo "Response from the MySql Server: $resp"
no_of_shipit=`echo $resp | cut -f2 -d' '`
if [ ! -n "$no_of_shipit" ]
echo "Wrong Format for reponse. Generic Error"
#echo "No of reviewers who have clicked on ship it: $no_of_shipit"
if [ "$no_of_shipit" -eq "0" ]
echo "None of the Reviewers have shipped it"
echo "Successfully validated the Changelist number for Review. Allow
Want to help the Review Board project? Donate today at
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to
For more options, visit this group at