Reimplement the TREES config option.

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

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.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4

Commits

First Last Summary ID Author
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.
564217e85ecdb0f89b989c354efcc1a313f698bc David Trowbridge
docs/rbtools/rbt/configuration/users.rst
rbtools/commands/base/commands.py
rbtools/commands/base/errors.py
rbtools/commands/tests/test_alias.py
rbtools/commands/tests/test_command_initialization.py
rbtools/commands/tests/test_post.py
rbtools/config/__init__.py
rbtools/config/config.py
rbtools/testing/commands.py
Loading...