• 
      

    Allow Features to disable web API resources

    Review Request #8470 — Created Oct. 17, 2016 and submitted

    Information

    Review Board
    release-3.0.x
    bb2dddd...

    Reviewers

    Review Board web API resources now have a required_features attribute
    which indicates which features must be enabled for the feature to be
    available. If any of the listed features are disabled, the resource will
    return a 403 Forbidden error for any of the resource's methods. When all
    features are enabled, the resource will behave as normal.

    Ran unit tests.

    Description From Last Updated

    Col: 1 W391 blank line at end of file

    reviewbotreviewbot

    'Feature' imported but unused

    reviewbotreviewbot

    Col: 21 E126 continuation line over-indented for hanging indent

    reviewbotreviewbot

    redefinition of unused 'test_disabled_feature_get_list' from line 125

    reviewbotreviewbot

    redefinition of unused 'test_disabled_feature_get' from line 131

    reviewbotreviewbot

    Col: 23 E251 unexpected spaces around keyword / parameter equals

    reviewbotreviewbot

    Col: 25 E251 unexpected spaces around keyword / parameter equals

    reviewbotreviewbot

    This should also state that this is optional and what the default behavior is.

    chipx86chipx86

    The docs make this seem like the function is all about features. I think the summary and description should start …

    chipx86chipx86

    Blank line after the docstring.

    daviddavid

    Blank line after the docstring.

    daviddavid

    Blank line here.

    chipx86chipx86

    Private methods go last.

    chipx86chipx86

    The suspense is killing me.

    daviddavid

    No blank line here.

    chipx86chipx86

    Typo: specied.

    daviddavid
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
    2. reviewboard/webapi/tests/test_base.py (Diff revision 1)
       
       
      Show all issues
      Col: 1
       W391 blank line at end of file
      
    3. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
    2. 
        
    brennie
    brennie
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
    2. reviewboard/webapi/base.py (Diff revision 3)
       
       
      Show all issues
       'Feature' imported but unused
      
    3. reviewboard/webapi/tests/test_base.py (Diff revision 3)
       
       
      Show all issues
      Col: 21
       E126 continuation line over-indented for hanging indent
      
    4. reviewboard/webapi/tests/test_base.py (Diff revision 3)
       
       
      Show all issues
       redefinition of unused 'test_disabled_feature_get_list' from line 125
      
    5. reviewboard/webapi/tests/test_base.py (Diff revision 3)
       
       
      Show all issues
       redefinition of unused 'test_disabled_feature_get' from line 131
      
    6. reviewboard/webapi/tests/test_base.py (Diff revision 3)
       
       
      Show all issues
      Col: 23
       E251 unexpected spaces around keyword / parameter equals
      
    7. reviewboard/webapi/tests/test_base.py (Diff revision 3)
       
       
      Show all issues
      Col: 25
       E251 unexpected spaces around keyword / parameter equals
      
    8. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
    2. 
        
    david
    1. Mind making a change to use this for the status updates resource?

    2. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
      Show all issues

      Blank line after the docstring.

    3. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
      Show all issues

      Blank line after the docstring.

    4. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
      Show all issues

      The suspense is killing me.

      1. Looks fine to me :)

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

      This should also state that this is optional and what the default behavior is.

    3. reviewboard/webapi/base.py (Diff revision 4)
       
       
       
       
       
       
      Show all issues

      The docs make this seem like the function is all about features. I think the summary and description should start off by just saying what call_method_view does, generally. Then it can modify that by talking about features, and about API policies (because this method ultimately takes that into account as well, even though the code in this block of code doesn't itself address it).

    4. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
       
      Show all issues

      Blank line here.

    5. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
      Show all issues

      Private methods go last.

    6. reviewboard/webapi/tests/test_base.py (Diff revision 4)
       
       
       
       
      Show all issues

      No blank line here.

    7. 
        
    brennie
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/base.py
          reviewboard/webapi/tests/test_base.py
      
      
    2. 
        
    david
    1. 
        
    2. reviewboard/webapi/base.py (Diff revision 5)
       
       
      Show all issues

      Typo: specied.

    3. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.0.x (d239388)