Notify build servers about create or changed review requests

Review Request #1672 — Created June 15, 2010 and discarded


Review Board


Notify build servers about create or changed review requests.

If the build server gets notified about the new review request it can fetch the patch from the review board, apply it and execute a build. When the build is finished it can post a review for the review request containing the result (success, test failures, results of audits of the patch e.g. whether new tests have been added, etc)

For a repository you can configure a build server url and several build groups. When a review request for that repository has been published or changed and one of the target groups of the review request matches one of the build groups, the build server gets notified using the configured url. The review request id will be interpolated into the url. 

It is possible prevent the notification of the build server using a checkbox beside the Publish/Discard Buttons.

Here are two example shell script functions which can be used to interact with the reviewboard from the build server. These functions could be used as steps in a build script:

function report_to_review_board {
    if [ "$EXITCODE" == 0 ]; then
        MESSAGE="%2B1 The patch builds succesfully.%0A"
        MESSAGE="%2D1 The patch fails to build! See http://$HUDSON_URL/hudson/job/xing-review/$BUILD_NUMBER for more details.%0A"
    echo $MESSAGE
    wget -O /dev/null --post-data="shipit=0&body_top=$MESSAGE&body_bottom=" http://$REVIEWBOARD_USER:$REVIEWBOARD_PASSWORD@$REVIEWBOARD_URL/api/json/reviewrequests/$REVIEW_ID/reviews/draft/publish/

function patch_source {
    wget -O patch http://$REVIEWBOARD_URL/r/$REVIEW_ID/diff/raw/ && patch -p1 < patch
    echo "done"