Fix some issues with the default webhook signal handlers.

Review Request #6392 — Created Oct. 1, 2014 and submitted

Information

Review Board
master
fa0ca32...

Reviewers

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

reviewbotreviewbot

local variable 'target2' is assigned to but never used

reviewbotreviewbot

local variable 'target1' is assigned to but never used

reviewbotreviewbot

local variable 'target3' is assigned to but never used

reviewbotreviewbot

local variable 'target3' is assigned to but never used

reviewbotreviewbot

local variable 'target2' is assigned to but never used

reviewbotreviewbot

local variable 'target3' is assigned to but never used

reviewbotreviewbot

'Q' imported but unused

reviewbotreviewbot

'Template' imported but unused

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/notifications/webhooks.py
        reviewboard/notifications/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/notifications/webhooks.py
        reviewboard/notifications/tests.py
    
    
  2. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target1' is assigned to but never used
    
  3. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target2' is assigned to but never used
    
  4. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target1' is assigned to but never used
    
  5. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target3' is assigned to but never used
    
  6. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target3' is assigned to but never used
    
  7. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target2' is assigned to but never used
    
  8. reviewboard/notifications/tests.py (Diff revision 1)
     
     
    Show all issues
     local variable 'target3' is assigned to but never used
    
  9. reviewboard/notifications/webhooks.py (Diff revision 1)
     
     
    Show all issues
     'Q' imported but unused
    
  10. reviewboard/notifications/webhooks.py (Diff revision 1)
     
     
    Show all issues
     'Template' imported but unused
    
  11. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (b67f8fb)
Loading...