Update Review Bot 3 to use Celery 5 on Python 3.
Review Request #12157 — Created March 16, 2022 and submitted
Review Bot 2 was using Celery 4, which is no longer maintained, and
Review Bot 3 inherited that dependency. Between Celery 4 (which is no
longer maintained and has security problems) and 5, much has changed
when it comes to thecelery worker
command setup and invocation, and
this is what we were wrapping in order to start a process. This is no
longer feasible.Now, we construct the
Worker
object ourselves. This is more
future-proof, though comes with a few requirements on our end (some
patching functions we have to call, and some arguments to process).We now support setting up both Celery 3 (on Python 2.7) and Celery 5 (on
Python 3). This code is confined tocelery.py
, allowingmain.py
to
be nice and simple. In time, this will also help us upgrade to newer
versions of Celery or to switch to another backend (perhaps
experimentally).
Tested running on Python 2.7 and 3.x in both detached and in-process
modes, with various combinations of options.Unit tests pass.
- Change Summary:
-
- Removed two unused imports.
- Commits:
-
Summary ID 53357259e1d2433f08c86f79e7c442910c8fbae7 54a9e4e91e1372276b79cbbe6dd1325bac998660 - Diff:
-
Revision 2 (+318 -158)
- Change Summary:
-
Removed another unused import intended for an upcoming change.
- Commits:
-
Summary ID 54a9e4e91e1372276b79cbbe6dd1325bac998660 ae85f8a9a3425689ffcd4a669dbf0f128d5da221 - Diff:
-
Revision 3 (+316 -158)