Add a LocalSite-enabled feature checker

Review Request #8472 - Created Oct. 17, 2016 and submitted

Barret Rennie
Review Board
release-3.0.x
8470
499d182...
reviewboard

The LocalSiteFeatureChecker allows features to be enabled or disabled
at the LocalSite level. Features not configured on a LocalSite will
fall back to the global configuration (first site configuration, then
Django settings).

Additionally, the status update work has been reworked to provide the
necessary information (a LocalSite or a HttpRequest) to use the new
feature checker.

This feature checker is now the default for Review Board.

Ran unit tests.

  • 0
  • 0
  • 11
  • 8
  • 19
Description From Last Updated
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/features/checkers.py
        reviewboard/reviews/views.py
        reviewboard/reviews/detail.py
        reviewboard/features/tests.py
        reviewboard/settings.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/features/checkers.py
        reviewboard/reviews/views.py
        reviewboard/reviews/detail.py
        reviewboard/features/tests.py
        reviewboard/settings.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
  2. reviewboard/features/checkers.py (Diff revision 1)
     
     
    Col: 1
     W391 blank line at end of file
    
  3. reviewboard/features/tests.py (Diff revision 1)
     
     
    Col: 76
     W291 trailing whitespace
    
  4. reviewboard/features/tests.py (Diff revision 1)
     
     
    Col: 1
     W391 blank line at end of file
    
  5. reviewboard/settings.py (Diff revision 1)
     
     
     'django_reset' imported but unused
    
  6. reviewboard/settings.py (Diff revision 1)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  7. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
  2. reviewboard/settings.py (Diff revision 2)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 2)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
David Trowbridge
  1. 
      
  2. reviewboard/features/checkers.py (Diff revision 2)
     
     

    Can you move this into the try? That way it will do the right thing if self.EXTRA_DATA_KEY doesn't exist in local_site.extra_data.

  3. reviewboard/reviews/detail.py (Diff revision 2)
     
     

    Although the __init__ method doesn't do anything too offensive, we should still gate it off like it was before.

  4. 
      
Christian Hammond
  1. 
      
  2. reviewboard/features/checkers.py (Diff revision 2)
     
     

    "feature"

  3. reviewboard/features/checkers.py (Diff revision 2)
     
     

    Let's call this RBFeatureChecker. The reason being that this isn't specific to local sites.

    This should also check features specific to the user (probably based on Profile.settings['enabled_features']).

    Docs will need to be updated accordingly.

  4. reviewboard/features/checkers.py (Diff revision 2)
     
     

    "Feature checker"

  5. reviewboard/features/checkers.py (Diff revision 2)
     
     
     

    Too many "setting"s.

  6. reviewboard/features/checkers.py (Diff revision 2)
     
     

    reviewboard.site.models (not "sites").

  7. reviewboard/features/checkers.py (Diff revision 2)
     
     

    **kwargs

  8. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
  2. reviewboard/settings.py (Diff revision 3)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 3)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
Barret Rennie
Review Bot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/views.py
        reviewboard/settings.py
        reviewboard/features/checkers.py
        reviewboard/reviews/detail.py
        reviewboard/site/models.py
        reviewboard/site/evolutions/__init__.py
        reviewboard/site/evolutions/localsite_extra_data.py
        reviewboard/features/tests.py
    
    Ignored Files:
        reviewboard/features/__init__.py
    
    
  2. reviewboard/settings.py (Diff revision 4)
     
     
     'django_reset' imported but unused
    
  3. reviewboard/settings.py (Diff revision 4)
     
     
     'from settings_local import *' used; unable to detect undefined names
    
  4. 
      
David Trowbridge
  1. Ship It!
  2. 
      
Barret Rennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (7e9928b)
Loading...