FileProvider resource web API for providers

Review Request #7124 — Created March 26, 2015 and updated

Information

Review Board
master
f853527...

Reviewers

Any instance of ReviewBoard may support the FileProvider framework. If they do, they may support different sets of file providers and each one may be implemented differently. By having an API for GET requests, it can lists all of the supported file providers for users and implementations to know what file providers are supported, and information associated with them. GET requests for to learn about individual file providers can also be made with api/file-providers/<name>/

Test cases for the GET api calls (via reviewboard/webapi/tests/test_file_provider.py), and manual testing with GET requests

Description From Last Updated

'webapi_response_errors' imported but unused

reviewbotreviewbot

This can be one line. Same below.

chipx86chipx86

No parens here.

chipx86chipx86

Or here.

chipx86chipx86

Where is this being caught? Also, can we raise FileProvider.DoesNotExist? the ObjectDoesNotExist exception could apply to any model.

brenniebrennie

This can be a single line.

brenniebrennie

No blank line here.

brenniebrennie

"file-providers/"

brenniebrennie

Test docstrings should not end in a period.

brenniebrennie

Should be in the imperative mood ("Return")

daviddavid

Should be in the imperative mood ("Return")

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/tests/test_file_provider.py
        reviewboard/fileproviders/fileprovider.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/tests/test_file_provider.py
        reviewboard/fileproviders/fileprovider.py
    
    
  2. Show all issues
     'webapi_response_errors' imported but unused
    
  3. 
      
VT
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
  2. 
      
VT
chipx86
  1. 
      
  2. reviewboard/webapi/resources/file_provider.py (Diff revision 2)
     
     
     
     
    Show all issues

    This can be one line.

    Same below.

  3. Show all issues

    No parens here.

  4. Show all issues

    Or here.

  5. 
      
VT
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
  2. 
      
VT
brennie
  1. 
      
  2. Show all issues

    Where is this being caught?

    Also, can we raise FileProvider.DoesNotExist? the ObjectDoesNotExist exception could apply to any model.

    1. This would be handled the parent class WebAPIResource in djblets (djblets/djblets/webapi/resources.py). The documentation in get_queryset for WebAPIResource specifies to throw that particular ObjectDoesNotExist if the requested object is not found. The parent class would handle the rest. Drop issue?

    2. It should still raise a FileProvider.DoesNotExist error instead.

  3. reviewboard/webapi/resources/file_provider.py (Diff revision 3)
     
     
     
     
    Show all issues

    This can be a single line.

  4. Show all issues

    No blank line here.

  5. Show all issues

    "file-providers/"

  6. Show all issues

    Test docstrings should not end in a period.

  7. 
      
VT
Review request changed
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/file_provider.py
        reviewboard/webapi/resources/root.py
        reviewboard/fileproviders/fileprovider.py
        reviewboard/webapi/tests/urls.py
        reviewboard/webapi/tests/mimetypes.py
        reviewboard/webapi/resources/file_provider_account.py
        reviewboard/webapi/tests/test_file_provider.py
    
    
  2. 
      
david
  1. 
      
  2. Show all issues

    Should be in the imperative mood ("Return")

  3. Show all issues

    Should be in the imperative mood ("Return")

  4.