Consolidate tool reports into batched reviews.
Review Request #6002 — Created June 16, 2014 and discarded
Previously, every tool that ran generated its own review, which could
lead to a large number of potentially useless reviews, depending on
which tools were invoked.Now, reviews are batched together as much as possible. This is done by
farming off the tool task execution to a new "run_tools" task, which
handles the execution of every tool that will run on the review request,
as well as the publishing of reviews.This task constructs a ToolMaster, which monitors the status of the tool
tasks. Every 30 seconds, if there are still tools waiting to finish,
ToolMaster will publish what's already been created. This is done until
the last tool has finished, at which point a final publish will occur.Tools still submit their own review payloads, but those no longer result
in immediately-published reivews. Instead, those are simply staged
reviews, containing state that may eventually be merged into a batched
review. (This state should later move into the database in a nicer form,
instead of re-using Review.)When the publish occurs, each draft Review that has been created will be
merged together into one main Review, and published.In order to prevent merging from taking place while a review is being
published (while the diff comments are still being created), the merging
logic will wait until each review it's planning to merge has a
"reviewbot_populated" flag set in the review's extra_data. This is
always set after a draft review from Review Bot is finished.
Added an artificial delay to one tool, and set the batch wait time to 10 seconds.
Published a change that would result in comments on both tools. Got 2 separate
reviews.Removed the delay and wait time changes, and repeated. Got 1 combined review with
all comments.Repeated these tests dozens of times while fine-tuning the code, and consistently
saw the expected behavior.(There was one time that tool execution stalled, but this was before any of the new
special stuff ran, and this problem went away after upgrading Celery. Still, worth
noting.)
Description | From | Last Updated |
---|---|---|
'time' imported but unused |
reviewbot | |
Col: 13 E129 visually indented line with same indent as next logical line |
reviewbot | |
Col: 80 E501 line too long (83 > 79 characters) |
reviewbot | |
Col: 80 E501 line too long (80 > 79 characters) |
reviewbot | |
Col: 9 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 39 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 35 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 21 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 11 E126 continuation line over-indented for hanging indent |
reviewbot | |
Instead of "a specified number of seconds", how about "PUBLISH_WAIT_TIME_SECS seconds"? |
david | |
This seems more like a debug log level sort of message. |
david | |
Also seems debug-ish. |
david | |
Col: 36 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 39 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 35 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 21 E126 continuation line over-indented for hanging indent |
reviewbot | |
Col: 11 E126 continuation line over-indented for hanging indent |
reviewbot | |
Indentation too deep. |
david |
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: extension/reviewbotext/resources.py bot/reviewbot/celery.py bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py Ignored Files:
- Change Summary:
-
Require Celery 3.1.12, to (I think) prevent issues I was hitting.
- Commit:
-
9001a947558cdeda0a55a180128a0e1861f30cb1e817730b2d667c4f21ac5e743dc88428de61f055
- Change Summary:
-
Replaced the while loop, which caused some deadlock issues, with periodic timers.
Nice thing about these is that they'll actually attempt to resume if the workers are restarted.
- Commit:
-
e817730b2d667c4f21ac5e743dc88428de61f055fe203aa8a5bcfbebaeedcc4872e423844f72c793
-
Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py
-
-
-
-
-
-
-
-
-
-
- Change Summary:
-
-
Fixed a bunch of the open issues reported by Review Bot (thanks buddy!).
Didn't fix the ones on unrelated lines. -
Fixed an issue with tool settings getting overwritten, due to reuse of the
tool_payload
dictionary.
-
- Commit:
-
fe203aa8a5bcfbebaeedcc4872e423844f72c793a47c3ccd7c1a8266b578a0b45b9cfcdef883bf13
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py
-
-
-
-
-
- Change Summary:
-
- Switched some info logging to debug.
- Updated a docstring to reference a constant.
- Fixed an over-indentation.
- Fixed a crash due to indexing into an empty list of reviews (which can happen, for instance, when the review request applies to a repository ReviewBot doesn't have access to).
- Commit:
-
a47c3ccd7c1a8266b578a0b45b9cfcdef883bf13a135b1b8109bd8e193c8851321322c28a91111af
-
Tool: PEP8 Style Checker Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py Tool: Pyflakes Processed Files: bot/reviewbot/tasks.py extension/reviewbotext/extension.py bot/reviewbot/tools/__init__.py extension/setup.py bot/reviewbot/celery.py extension/reviewbotext/resources.py