# reviewboard/reviewbot architecture

> Architecture diagram of the GitHub repository reviewboard/reviewbot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reviewboard/reviewbot
- Repository: https://github.com/reviewboard/reviewbot

## Overview

Review Bot is a Review Board extension plus Celery workers that run configurable code-checking tools and publish findings as reviews. The main flow starts with an integration-triggered status update, queues a worker task, fetches review data and repository context, executes a selected tool, and publishes comments. The README documents broad tool and plugin capabilities; source excerpts support key worker and extension links, while several subsystem details are represented at directory level because their implementation was not sampled.

Main entry points: [`bot/reviewbot/tasks.py`](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tasks.py) (Run tool task), [`extension/reviewbotext/integration.py`](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/integration.py) (Integration dispatch), [`bot/reviewbot/repositories.py`](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/repositories.py) (Repository access), [`bot/reviewbot/tools/base/tool.py`](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tools/base/tool.py) (Tool execution API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reviewboard["Review Board Extension"]
  node_integration["Integration dispatch<br/>[integration.py]"]
  node_extension["Extension setup<br/>[extension.py]"]
  node_configui["Integration configuration<br/>[forms.py]"]
  node_toolresource["Tool API resource<br/>[resources.py]"]
  node_reviewresource["Review API resource<br/>[resources.py]"]
  node_models["Tool models<br/>[models.py]"]
end

subgraph group_worker["Worker Runtime"]
  node_celery["Task queue setup<br/>[celery.py]"]
  node_task["Run tool task<br/>[tasks.py]"]
end

subgraph group_review["Review Processing"]
  node_reviewdata["Review and diff data<br/>[review.py]"]
  node_repo["Repository access<br/>[repositories.py]"]
  node_publish["Review publication<br/>[resources.py]"]
end

subgraph group_tools["Analysis Tools"]
  node_registry["Tool registry<br/>[registry.py]"]
  node_toolbase["Tool execution API<br/>[tool.py]"]
  node_toolplugins["Tool implementations"]
end

subgraph group_internals["Worker Support"]
  node_config["Worker configuration<br/>[config.py]"]
  node_api["Review Board API client<br/>[api.py]"]
  node_filesystem["File and patch handling<br/>[filesystem.py]"]
  node_process["Process execution<br/>[process.py]"]
  node_logs["Worker logging<br/>[log.py]"]
end

node_reviewer(("Review participants"))
node_rb["Review Board"]

node_reviewer -->|"submits changes"| node_rb
node_rb -->|"configures tools"| node_integration
node_integration -->|"uses settings"| node_configui
node_integration -->|"loads tool"| node_models
node_integration -->|"queues task"| node_celery
node_extension -->|"registers hook"| node_integration
node_extension -->|"configures broker"| node_celery
node_rb -.->|"requests tool list"| node_toolresource
node_toolresource -.->|"refreshes worker tools"| node_registry
node_celery -->|"dispatches task"| node_task
node_task -->|"connects API"| node_api
node_task -->|"selects tool"| node_registry
node_task -->|"loads review"| node_reviewdata
node_task -->|"loads repository"| node_repo
node_task -.->|"executes tool"| node_toolbase
node_registry -.->|"registers implementations"| node_toolplugins
node_toolplugins -.->|"uses execution API"| node_toolbase
node_toolbase -->|"runs commands"| node_process
node_toolbase -->|"reads settings"| node_config
node_reviewdata -->|"creates patch files"| node_filesystem
node_repo -->|"reads configuration"| node_config
node_repo -->|"uses API client"| node_api
node_task -.->|"publishes review"| node_reviewresource
node_reviewresource -->|"creates review"| node_publish
node_publish -->|"posts findings"| node_rb
node_repo -->|"manages worktree"| node_filesystem
node_task -->|"records task activity"| node_logs

click node_integration "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/integration.py"
click node_extension "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/extension.py"
click node_configui "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/forms.py"
click node_toolresource "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py"
click node_reviewresource "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py"
click node_models "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/models.py"
click node_celery "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/celery.py"
click node_task "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tasks.py"
click node_reviewdata "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/processing/review.py"
click node_repo "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/repositories.py"
click node_publish "https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py"
click node_registry "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tools/base/registry.py"
click node_toolbase "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tools/base/tool.py"
click node_toolplugins "https://github.com/reviewboard/reviewbot/tree/master/bot/reviewbot/tools"
click node_config "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/config.py"
click node_api "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/api.py"
click node_filesystem "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/filesystem.py"
click node_process "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/process.py"
click node_logs "https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/log.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_integration,node_extension,node_configui,node_toolresource,node_reviewresource,node_models,node_reviewer,node_rb toneBlue
class node_celery,node_task toneAmber
class node_reviewdata,node_repo,node_publish toneMint
class node_registry,node_toolbase,node_toolplugins toneRose
class node_config,node_api,node_filesystem,node_process,node_logs toneIndigo
```

## Components

### Review Board Extension

- [Integration dispatch](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/integration.py): `extension/reviewbotext/integration.py`
- [Extension setup](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/extension.py): `extension/reviewbotext/extension.py`
- [Integration configuration](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/forms.py): `extension/reviewbotext/forms.py`
- [Tool API resource](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py): `extension/reviewbotext/resources.py`
- [Review API resource](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py): `extension/reviewbotext/resources.py`
- [Tool models](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/models.py): `extension/reviewbotext/models.py`

### Worker Runtime

- [Task queue setup](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/celery.py): `bot/reviewbot/celery.py`
- [Run tool task](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tasks.py): `bot/reviewbot/tasks.py`

### Review Processing

- [Review and diff data](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/processing/review.py): `bot/reviewbot/processing/review.py`
- [Repository access](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/repositories.py): `bot/reviewbot/repositories.py`
- [Review publication](https://github.com/reviewboard/reviewbot/blob/master/extension/reviewbotext/resources.py): `extension/reviewbotext/resources.py`

### Analysis Tools

- [Tool registry](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tools/base/registry.py): `bot/reviewbot/tools/base/registry.py`
- [Tool execution API](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/tools/base/tool.py): `bot/reviewbot/tools/base/tool.py`
- [Tool implementations](https://github.com/reviewboard/reviewbot/tree/master/bot/reviewbot/tools): `bot/reviewbot/tools`

### Worker Support

- [Worker configuration](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/config.py): `bot/reviewbot/config.py`
- [Review Board API client](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/api.py): `bot/reviewbot/utils/api.py`
- [File and patch handling](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/filesystem.py): `bot/reviewbot/utils/filesystem.py`
- [Process execution](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/process.py): `bot/reviewbot/utils/process.py`
- [Worker logging](https://github.com/reviewboard/reviewbot/blob/master/bot/reviewbot/utils/log.py): `bot/reviewbot/utils/log.py`

### Other components

- **Review participants**
- **Review Board**

## Connections

- Review participants → Review Board: submits changes
- Review Board → Integration dispatch: configures tools
- Integration dispatch → Integration configuration: uses settings (evidence: `extension/reviewbotext/integration.py`)
- Integration dispatch → Tool models: loads tool (evidence: `extension/reviewbotext/integration.py`)
- Integration dispatch → Task queue setup: queues task (evidence: `extension/reviewbotext/integration.py`)
- Extension setup → Integration dispatch: registers hook (evidence: `extension/reviewbotext/extension.py`)
- Extension setup → Task queue setup: configures broker (evidence: `extension/reviewbotext/extension.py`)
- Review Board → Tool API resource: requests tool list
- Tool API resource → Tool registry: refreshes worker tools
- Task queue setup → Run tool task: dispatches task (evidence: `bot/reviewbot/celery.py`)
- Run tool task → Review Board API client: connects API (evidence: `bot/reviewbot/tasks.py`)
- Run tool task → Tool registry: selects tool (evidence: `bot/reviewbot/tasks.py`)
- Run tool task → Review and diff data: loads review (evidence: `bot/reviewbot/tasks.py`)
- Run tool task → Repository access: loads repository (evidence: `bot/reviewbot/tasks.py`)
- Run tool task → Tool execution API: executes tool
- Tool registry → Tool implementations: registers implementations
- Tool implementations → Tool execution API: uses execution API (evidence: `bot/reviewbot/tools/base/__init__.py`)
- Tool execution API → Process execution: runs commands (evidence: `bot/reviewbot/tools/base/tool.py`)
- Tool execution API → Worker configuration: reads settings (evidence: `bot/reviewbot/tools/base/tool.py`)
- Review and diff data → File and patch handling: creates patch files (evidence: `bot/reviewbot/processing/review.py`)
- Repository access → Worker configuration: reads configuration (evidence: `bot/reviewbot/repositories.py`)
- Repository access → Review Board API client: uses API client (evidence: `bot/reviewbot/repositories.py`)
- Run tool task → Review API resource: publishes review
- Review API resource → Review publication: creates review (evidence: `extension/reviewbotext/resources.py`)
- Review publication → Review Board: posts findings
- Repository access → File and patch handling: manages worktree (evidence: `bot/reviewbot/repositories.py`)
- Run tool task → Worker logging: records task activity (evidence: `bot/reviewbot/tasks.py`)
