2977: add abilily to run external hooks.

adrie*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Aug. 13, 2013
I am using reviewboard 1.7.7.1

I would like to interface reviewboard with our Trac ticket system, to be able write directly in the trac ticket associated to the review a comment as the user click on the "Ship It" button.

To do it in a generic way, it would be interesting to have a generic hook system that runs user-defined shell script after some event:

for example:
hooks/ship-it $REVIEW_ID $BUGS $USER_NAME $COMMENT

where $REVIEW_ID would be the current reviewboard review number
$BUGS the value of the "Bugs" field 
$USER_NAME the name of the user that clicked the "Ship It" button
$COMMENT the text entered in the comment field. 


The same mechanism could be applied for other events:

hooks/bugs-list-changed $REVIEW_ID $BUGS
to notify a change in the "Bugs field"


hooks/close-review $REVIEW_ID $REVIEW_OUTCOME $AUTHOR
as a review is closed
where $REVIEW_OUTCOME could be "Subitted" "Discared" "Deleted"


That would allow administrators to implement themself more interactions between reviewboard and external systems.
#1 adrie*****@gmai***** (Google Code) (Is this you? Claim this profile.)
and Thank you for building a such great system !


#2 raja****@gmai***** (Google Code) (Is this you? Claim this profile.)
These events are available already as signals within reviewboard, so for e.g. you could listen to the review_request_closed event which will contain the review_request object and you could act upon it. Some of the available signals are review_request_published, review_published, reply_published, review_request_closed etc. 

The other way through an extension mechanism (which in-turn uses the signals) is available at
https://github.com/reviewboard/rb-extension-pack/tree/master/rbwebhooks
#3 adrie*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Thhank you very much for your comment !
I am going to try that.

Have a nice day.

Adrien.
david
#4 david
I think either the rbwebhooks extension or a custom extension is probably the right way to do this.
  • +Fixed