ReviewBoard extension hook

96 views
Skip to first unread message

jer...@bodycad.com

unread,
Dec 15, 2015, 11:05:22 AM12/15/15
to reviewboard
Hi,
I'm looking to create a hook extension inside ReviewBoard. I manage to create and install it seem to be recognized and I can enable it. But I think I got the wrong hook and I cannot figure out when it is really called.

I try the review-request-approval-hook, but it doesn't seem to be called after a ship it occure. When does this hook get called exactly?


What I want to do is, when a review is getting a ship it, I want to change the related issue status inside Redmine. I installed python-redmine into my bitnami python stack fro review board. But I'm not sure which hook to use when a reviewer click on ship it, to perform script hook.


Maybe there's some extension already existing for that? any good page for extension list?
I found this, but aside from power pack, there ain't much: https://www.reviewboard.org/store/

Thanks,
Jerome


David Trowbridge

unread,
Dec 15, 2015, 12:26:47 PM12/15/15
to reviewboard
Jerome,

The hook that you're looking at is a pluggable way to choose how the "approved" and "approval_failure" fields should behave (https://www.reviewboard.org/docs/manual/2.5/webapi/2.0/resources/review-request/#fields). These fields are used in things like git hook scripts to automatically accept/reject a push based on whatever custom workflow a team may have. That hook is therefore called when the API is accessed.

Probably what you want to do is have your extension listen to the "review_published" signal from `reviewboard.reviews.signals` and then check the ship_it state on the review object. There's an example of an extension listening to signals at https://github.com/reviewboard/rb-extension-pack/blob/master/rbwebhooks/rbwebhooks/handlers.py

-David

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
-David

Jérôme Godbout

unread,
Dec 15, 2015, 12:33:47 PM12/15/15
to revie...@googlegroups.com
Thanks David, that really helpful, I was indeed looking for the signals and got confuse with the hook. I now get the differences between the two now. 

Thanks again, regards,
Jerome

You received this message because you are subscribed to a topic in the Google Groups "reviewboard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/reviewboard/AEWqU7wrI0k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to reviewboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages