Added sandboxing to ReviewRequestFieldset

Review Request #5738 — Created April 24, 2014 and submitted

Information

Review Board
master

Reviewers

Added sandboxing to ReviewRequestFieldset

Wrote unit tests for tests

Unit testing for init function for BaseReviewRequestFieldSet and BaseReviewRequestField, is_empty for BaseReviewRequestFieldSet, and should_render for BaseReviewRequestField

Description From Last Updated

Because the fields are third-party, this should be wrapped too.

daviddavid

Should wrap this.

daviddavid

Can you put the dictionary items on their own lines?

daviddavid

This should indicate the class name: logging.error('Error instantiating ReviewRequestfieldSet %r: %s', field_cls, e, exc_info=1)

daviddavid

This should include the class name as above.

daviddavid

This should include the class name as above.

daviddavid

Almost. What I want looks more like this: context = Context({ 'review_request_details': review, 'request': request, })

daviddavid

The text here still isn't great-- "fieldset_cls" is just an implementation detail of this method. It should read something like …

daviddavid
david
  1. Like the auth backends, the registration step isn't something that needs to be sandboxed (especially since you added try/except blocks around the built-in fields). Look for code that calls get_review_request_fieldsets, get_review_request_fields, or any other methods of iterating over the registered fields and fieldsets. For instance, the for_review_request_fieldset template tag will iterate over all the registered fieldset classes and instantiate them. That instantiation could fail if an extension author had a bug, which would end up making all the review request pages unusable.

  2. 
      
ED
david
  1. 
      
  2. reviewboard/reviews/templatetags/reviewtags.py (Diff revision 2)
     
     
     
     
     
     
    Show all issues

    Because the fields are third-party, this should be wrapped too.

  3. Show all issues

    Should wrap this.

  4. 
      
ED
ED
ED
ED
david
  1. 
      
  2. reviewboard/extensions/tests.py (Diff revision 6)
     
     
    Show all issues

    Can you put the dictionary items on their own lines?

  3. Show all issues

    This should indicate the class name:

    logging.error('Error instantiating ReviewRequestfieldSet %r: %s',
                  field_cls, e, exc_info=1)
    
  4. Show all issues

    This should include the class name as above.

  5. Show all issues

    This should include the class name as above.

  6. 
      
ED
david
  1. 
      
  2. reviewboard/extensions/tests.py (Diff revision 7)
     
     
     
    Show all issues

    Almost. What I want looks more like this:

    context = Context({
        'review_request_details': review,
        'request': request,
    })
    
  3. Show all issues

    The text here still isn't great-- "fieldset_cls" is just an implementation detail of this method. It should read something like "Error instantiating ReviewRequestFieldset %r: %s"

  4. 
      
ED
david
  1. This looks good. I'm going to hold off on pushing it because we're frozen for release.

  2. 
      
ED
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (51d5807)