Fix some issues with the default webhook signal handlers.
Review Request #6392 — Created Oct. 1, 2014 and submitted
While testing webhooks, I hit a few issues with the current signal
handlers, which this change fixes.First, there's no guarantee that
ReviewRequest.publish
will have a user
passed, so we can't rely on the user when we get the signal callback.
This is also true when a review request is reopened. Now, we default to
the review request submitter.We were providing a
close_type
field in the payload for the closed
handler of'S'
or'D'
, which are internal states. We now pass
'submitted' or 'discarded' instead.We also now use
'reply'
instead of'review'
for reply payloads, to help
differentiate them. This leaves room for us to include a 'review' entry
as well, if we decide to.Unit tests have been written for all the signal-based webhook
dispatchers to ensure they continue to work.
Unit tests pass.
Description | From | Last Updated |
---|---|---|
local variable 'target1' is assigned to but never used |
reviewbot | |
local variable 'target2' is assigned to but never used |
reviewbot | |
local variable 'target1' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
local variable 'target2' is assigned to but never used |
reviewbot | |
local variable 'target3' is assigned to but never used |
reviewbot | |
'Q' imported but unused |
reviewbot | |
'Template' imported but unused |
reviewbot |