chipx86 got a fish trophy!
Future-proof config file loading, and allow control of config file location.
Review Request #11511 — Created March 11, 2021 and submitted
The worker config file has historically been loaded through an
imp.load_module
call, which is deprecated in Python 3. Instead, we're
now using the same logic we used in RBTools to load in the configuration
file.The configuration file's location can also be controlled now through the
$REVIEWBOT_CONFIG_FILE
environment variable, making it easier to test
Review Bot and run it in more locked-down setups.Better logging has been added for when things go wrong, and unit tests
have been added to test all the conditions.
Tested with both Python 2 and 3, with Celery 3.x and 4.x (respectively).
Tested looking up config files in the standard location, setting
$REVIEWBOT_CONFIG_FILE
, and without a config file available.Tested that I saw all variations of log messages when using
-l INFO
.Unit tests pass on Python 2 and 3.
Summary | ID |
---|---|
507698bbff3f16730019b932f360e5c64c33256c |