Let user specify search path for .reviewboardrc

Review Request #7679 — Created Oct. 6, 2015 and submitted

Information

RBTools
master
6c1524f...

Reviewers

If a user sets $RBTOOLS_CONFIG_PATH, it should contain a list of paths
separated by the characters conventionally used for this on the
operating system (":" on Linux, Mac OS X, ";" on Windows). These paths
are searched first for .reviewboardrc and can be used to override
repository-wide settings.

Reviewed at https://reviews.reviewboard.org/r/7679/

Ran RBTOOLS_CONFIG_PATH=$HOME rbt status in a project directory with REVIEWBOARD_URL set to http://127.0.0.1 in $HOME/.reviewboardrc, got:

 ERROR: Unexpected API Error: HTTP 404

Confirmed that it picks up the private .reviewboardrc first.

Description From Last Updated

:file:`.reviewboardrc`

brenniebrennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. 
      
brennie
  1. Minor nit.

  2. rbtools/utils/filesystem.py (Diff revision 1)
     
     
    Show all issues

    :file:`.reviewboardrc`

    1. Just to fix the minor nit, not to forgo the question brought up by David.

  3. 
      
david
  1. This is going to be very controversial. We had initially done this when we moved from post-review to rbt, and we had a number of complaints. I'd like to see some discussion of this on the Review Board mailing list before we accept this change.

    1. I understand. Would optionally (and then preferentially) reading a separate, clearly named file (e.g. $HOME/.reviewboard-overrides) be less controversial?

    2. I think that'd end up causing some additional confusion as to which file people should put things in.

      Here's an idea for discussion: How about an environment variable, $RBTOOLS_CONFIG_PATH, that defines where to look for .reviewboardrc, prior to the built-in checks? So, it's prepended to the list of configs we search by default (and if any built-in searched directory exists in the path, we just skip it).

      That would let you do:

      export RBTOOLS_CONFIG_PATH=$HOME
      

      Then that would be searched first, prior to any of the other directories. Gives the control you need, without breaking existing setups.

    3. Sounds reasonable to me. David?

    4. Yeah, seems fine.

  2. 
      
nilsph
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    
  2. 
      
nilsph
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/utils/filesystem.py
    
    Ignored Files:
        docs/rbtools/rbt/configuration/users.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/filesystem.py
    
    Ignored Files:
        docs/rbtools/rbt/configuration/users.rst
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
nilsph
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.7.x (8bda4a3)