Add a registry of Review Bot worker tools.

Review Request #11533 — Created March 17, 2021 and submitted

chipx86
ReviewBot
release-3.0.x
reviewbot

Review Bot has been heavily dependent on
pkg_resources.iter_entry_points for tool lookup. This is fine to use
for an initial scan, but we were calling it on every tool execution,
which was slow, and made it hard to write unit tests against anything
not provided by a package.

This change introduces a basic tools registry in
reviewbot.tools.base.registry. This handles tool discovery,
registration, unregistration, iteration, and fetching of tools.

Tools are only discovered on startup now, and we fetch directly from the
registry when executing one.

Unit tests were added to cover the new registry functions.

Unit tests pass for Python 2.x and 3.x.

Manually tested starting the worker, loading in the tools list into
Review Board, and running tools against new code.

Summary
Add a registry of Review Bot worker tools.
Description From Last Updated

E999 SyntaxError: invalid syntax

reviewbotreviewbot
chipx86
Review request changed

Change Summary:

ADded back the error condition in RunTool when a tool couldn't be found.

Commits:

Summary
-
Add a registry of Review Bot worker tools.
+
Add a registry of Review Bot worker tools.

Diff:

Revision 2 (+602 -74)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

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

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (8e97744)
Loading...