Differentiate between servers, workers, and scripts during initialization.
Review Request #15246 — Created Aug. 20, 2026 and updated — Latest diff uploaded
Review Board's gaining worker support, and already differs when run
backed by a web server or via a script, but until now we've had no way
of telling what mode Review Board is in.This change adds a
process_mode=argument toinitialize()for
specifying a mode. This default todefault, which is used for scripts
or other operations, but can be put intoserverorworkermode.Right now, there's no difference between the modes, but going forward
we'll be able to alter setup or key off some functionality based on the
mode. For example, servers will be able to launch workers, but scripts
and workers will not.The current mode is available via
reviewboard.process.get_rb_process_mode()and via the
$RB_PROCESS_MODEenvironment variable.There's a bit of cleanup in the initialization while here to avoid
redundant or unnecessary calls. Some of this may be updated based on the
process mode in a later change.
All unit tests pass.
Ran locally and saw that Review Board was initialized in server mode.