• 
      

    Reimplement the TREES config option.

    Review Request #14219 — Created Oct. 31, 2024 and submitted

    Information

    RBTools
    release-5.x

    Reviewers

    Older versions of RBTools had an undocumented config option called
    TREES, which allowed people to set the REVIEWBOARD_URL for multiple
    remote repository paths from a single .reviewboardrc file in their home
    directory. After a deprecation cycle, we removed this, but it turns out
    that some people were using it and had just skipped all the intermediate
    versions of RBTools and went straight from 1 to 5, missing the
    deprecation warnings.

    This change implements a new version of TREES which is much more full
    featured. This allows using either the remote repository path or local
    directory name as the keys, and the value dictionaries now support the
    full RBTools configuration.

    The way this works is that we go through the basic initialization
    routine to the point where we've initialized the repository. After that,
    we'll look to see if there's a matching TREES configuration. If there
    is, we merge that into the base config, remove TREES entirely from the
    loaded config, and then rerun all initialization.

    • Set up TREES in my own .reviewboardrc file and verified that things
      worked as expected.
    • Added some new tests that cover the three main codepaths for command
      initialization--no configured server URL, a single server URL, and a
      server URL that gets overridden inside of TREES.
    • Ran all unit tests.
    Summary ID
    Reimplement the TREES config option.
    Older versions of RBTools had an undocumented config option called `TREES`, which allowed people to set the `REVIEWBOARD_URL` for multiple remote repository paths from a single .reviewboardrc file in their home directory. After a deprecation cycle, we removed this, but it turns out that some people were using it and had just skipped all the intermediate versions of RBTools and went straight from 1 to 5, missing the deprecation warnings. This change implements a new version of `TREES` which is much more full featured. This allows using either the remote repository path or local directory name as the keys, and the value dictionaries now support the full RBTools configuration. The way this works is that we go through the basic initialization routine to the point where we've initialized the repository. After that, we'll look to see if there's a matching TREES configuration. If there is, we merge that into the base config, remove TREES entirely from the loaded config, and then rerun all initialization. Testing Done: - Set up TREES in my own .reviewboardrc file and verified that things worked as expected. - Added some new tests that cover the three main codepaths for command initialization--no configured server URL, a single server URL, and a server URL that gets overridden inside of TREES. - Ran all unit tests.
    d01e2525ee243c91ee09baaa876bab26d66f47fd
    Description From Last Updated

    continuation line over-indented for visual indent Column: 21 Error code: E127

    reviewbotreviewbot

    We should use :file: for .reviewboardrc

    chipx86chipx86

    The upcoming release is 5.1.

    chipx86chipx86

    For this, we want to be explicit and use: ... code-block:: python TREES = { ...

    chipx86chipx86

    This needs a Version Added.

    chipx86chipx86

    Missing a Version Added. Same with the classes below.

    chipx86chipx86

    Missing Returns.

    chipx86chipx86

    No trailing period here or in the ones below for test docstrings.

    chipx86chipx86

    Should be 5.1, assuming it's coming to the upcoming release.

    chipx86chipx86

    Should we add a Raises section to the method docs for this and the NeedsReinitialize error?

    maubinmaubin

    We should maybe use https in the example here, so this doesn't look stale.

    chipx86chipx86
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    david
    chipx86
    1. Code looks good. Just a few docs nits.

    2. Show all issues

      We should use :file: for .reviewboardrc

    3. docs/rbtools/rbt/configuration/users.rst (Diff revision 2)
       
       
       
       
      Show all issues

      For this, we want to be explicit and use:

      ... code-block:: python
      
          TREES = { ...
      
    4. rbtools/commands/base/errors.py (Diff revision 2)
       
       
       
      Show all issues

      This needs a Version Added.

    5. Show all issues

      Missing a Version Added. Same with the classes below.

    6. Show all issues

      Missing Returns.

    7. Show all issues

      No trailing period here or in the ones below for test docstrings.

    8. 
        
    chipx86
    1. 
        
    2. Show all issues

      The upcoming release is 5.1.

    3. rbtools/config/config.py (Diff revision 2)
       
       
      Show all issues

      Should be 5.1, assuming it's coming to the upcoming release.

    4. 
        
    david
    maubin
    1. 
        
    2. rbtools/commands/base/commands.py (Diff revision 3)
       
       
      Show all issues

      Should we add a Raises section to the method docs for this and the NeedsReinitialize error?

    3. 
        
    david
    chipx86
    1. 
        
    2. Show all issues

      We should maybe use https in the example here, so this doesn't look stale.

    3. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-5.x (d93ff87)