Update Review Bot 3 to use Celery 5 on Python 3.

Review Request #12157 — Created March 16, 2022 and submitted

chipx86
ReviewBot
release-3.0.x
reviewbot

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 the celery 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 to celery.py, allowing main.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.

Summary
Update Review Bot 3 to use Celery 5 on Python 3.
Description From Last Updated

F401 'celery.__version__ as celery_version_str' imported but unused

reviewbotreviewbot

F811 redefinition of unused 'worker' from line 13

reviewbotreviewbot

F401 'textwrap' imported but unused

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

flake8

chipx86
Review request changed

Change Summary:

  • Removed two unused imports.

Commits:

Summary
-
Update Review Bot 3 to use Celery 5 on Python 3.
+
Update Review Bot 3 to use Celery 5 on Python 3.

Diff:

Revision 2 (+318 -158)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

chipx86
chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (87c0366)
Loading...