Deprecate the type argument of review request signals

Review Request #8896 - Created April 12, 2017 and submitted

Barret Rennie
Review Board
release-3.0.x
8895
8897
reviewboard

This patch deprecates the type argument of the review_request_closed
and review_request_closing signals, due to shadowing the type
builtin. We still provide the type argument, but it is wrapped in a
lazy object that will emit a warning when casted to a unicode string. We
now include the close_type argument which takes the place of the old
type argument. Usages and unit tests have been updated for this new
behaviour.

Ran unit tests.

  • 0
  • 0
  • 7
  • 1
  • 8
Description From Last Updated
Barret Rennie
Barret Rennie
  1. 
      
  2. this file isnt supposed to be in the diff.

  3. 
      
Barret Rennie
David Trowbridge
  1. 
      
  2. Typo in summary: rquest

  3. 
      
Barret Rennie
Christian Hammond
  1. 
      
  2. Sooo the difficulty here is that if an extension does:

    review_request.close(type=..., ...)
    

    then things are going to break. The problem is that if **kwargs is provided, and we try to check for it there, then it'll still break since close_type won't be supported.

    Hmm..

    Not the end of the world, but would be nice to fix.

    Perhaps we could say that close() will, by default, close as submitted. Then we can do that and have a **kwargs that checks for type and overrides close_type?

    I think submitted is going to be far more common than discarded, so I wouldn't have a problem with this as a default.

  3. Can you pass these as keyword arguments? It'll help with readability a lot.

  4. reviewboard/reviews/models/review_request.py (Diff revision 3)
     
     
     
     

    Here, too.

  5. reviewboard/reviews/signals.py (Diff revision 3)
     
     
     
     

    This should have a .. deprecated::

  6. reviewboard/reviews/signals.py (Diff revision 3)
     
     
     

    Here, too.

  7. reviewboard/signals.py (Diff revision 3)
     
     

    This would be great in Djblets :)

    1. Can we put this into another change later? I really wanna get this in.

  8. 
      
Barret Rennie
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (9a02c1e)
Loading...