Add closing/reopening signals

Review Request #7407 — Created June 11, 2015 and submitted

Information

Review Board
release-2.0.x
875b8f0...

Reviewers

Fire "review_request_closing" when attempting to close a review request.
If a signal receiver raises a CloseError abort the close operation.
This signal allows extensions to prevent a review request from being
closed. Alert the user in the UI when a close request has failed.

Also introduce a new "review_request_reopening" signal which behaves the
same way as the closing signal but deals with reopening review requests.

These new signals expand upon publishing signals that were previously
added to allow extensions control over publishing - see commit
ab84ccdf3d5bb883f18d34133c30af410c7ff1d2.

Documentation for the new WebAPI errorss have been added to the manual.

NB: This work is just some minor fixups of work done by Steven MacLeod.

Wrote a dummy extension to raise the new errors inside of the new
signals - API requests were properly blocked and the error messages
were alerted to the user.

Compared change description behaviour to Review Board without this
change and observed it to be unchanged after the patch.

Built and looked at the docs.

Description From Last Updated

Should be unicode in this case.

chipx86chipx86

Here too.

chipx86chipx86

Error code 229 is already taken on 2.5. We'll need to start at 230 here.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
chipx86
  1. Thanks for taking care of this!

  2. reviewboard/reviews/signals.py (Diff revision 2)
     
     
    Show all issues

    Should be unicode in this case.

  3. reviewboard/reviews/signals.py (Diff revision 2)
     
     
    Show all issues

    Here too.

  4. 
      
chipx86
  1. 
      
  2. reviewboard/webapi/errors.py (Diff revision 2)
     
     
     
    Show all issues

    Error code 229 is already taken on 2.5. We'll need to start at 230 here.

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
    
    
  2. 
      
chipx86
  1. Oh, one last thing I almost forgot. Can you add the doc files for these new errors in docs/manual/webapi/2.0/errors?

  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        docs/manual/webapi/2.0/errors/230-close-error.rst
        docs/manual/webapi/2.0/errors/231-reopen-error.rst
        docs/manual/webapi/2.0/errors/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request.py
        reviewboard/webapi/errors.py
        reviewboard/reviews/signals.py
        reviewboard/reviews/errors.py
        reviewboard/reviews/models/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/views/reviewRequestEditorView.js
        docs/manual/webapi/2.0/errors/230-close-error.rst
        docs/manual/webapi/2.0/errors/231-reopen-error.rst
        docs/manual/webapi/2.0/errors/index.rst
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (47e1f43)