• 
      

    Fix 'interdiff-revision' field name in the diff context resource.

    Review Request #6292 — Created Sept. 3, 2014 and submitted

    Information

    Review Board
    release-2.0.x
    a377a3c...

    Reviewers

    When I added this resource, I copied the field names that are used for POST/PUT
    operations (which use underscores), rather than those in GET operations (which
    use hyphens). This worked from the web UI (where we assemble the URL directly),
    but caused problems when using the RBTools API (which transforms all
    underscores into hyphens for GET requests). This change fixes that field name
    to be 'interdiff-revision'.

    Verified that diff and interdiff selection still worked properly using the new
    URL parameters.

    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/diff_context.py
      
      Ignored Files:
          reviewboard/static/rb/js/pages/views/diffViewerPageView.js
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/diff_context.py
      
      Ignored Files:
          reviewboard/static/rb/js/pages/views/diffViewerPageView.js
      
      
    2. 
        
    chipx86
    1. This breaks backwards-compatibility. Maybe we don't care. If we do care, though, we can have @webapi_request_fields allow all unspecified arguments (by passing allow_unknown=True) and then fall back to checking for the old names in kwargs.

      Either way, we should add some documentation stating that in 2.0 through 2.0.6, the old names were used, but we've renamed them (and then mention the backwards-compatibility if we go that route, stating that those old names are deprecated and subject for removal).

      1. I don't care. This API was really meant to be internal anyway, and I'm pretty surprised that anyone was trying to use it.

        Where and how should I add this documentation? I don't really know how the webapi docs work.

      2. You can just add to the docstring for get(). That'll be turned into the doc page for HTTP GET.

    2. 
        
    david
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/diff_context.py
      
      Ignored Files:
          reviewboard/static/rb/js/pages/views/diffViewerPageView.js
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/diff_context.py
      
      Ignored Files:
          reviewboard/static/rb/js/pages/views/diffViewerPageView.js
      
      
    2. 
        
    chipx86
    1. Ship It!

    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (375d93a)