How prodreams/revu works
ReVu is a self-hosted webhook service that turns Git pull-request events into AI code reviews, then publishes the result back to the pull request. The main path validates and normalizes provider events, fetches the diff, chooses whole-PR comment or annotated inline review, and sends the review through a configured Git provider. Provider adapters and a shared HTTP gateway support Git hosting and AI integrations. README capabilities include GitHub, Gitea, Bitbucket, OpenAI-compatible services, GigaChat, and YandexGPT. Some adapter dispatch details are unsampled, so those links are shown only where documented or indexed.
Main entry points: di.py Provider selection · routes.py Webhook routes · webhook_service.py Review orchestration · http_client_gateway.py HTTP gateway
Components 23
Webhook intake
- FastAPI app
src/revu/application/app.py - Webhook routes
src/revu/presentation/webhooks/routes.py - Webhook validation
src/revu/presentation/webhooks/validators.py - Webhook schemas
src/revu/presentation/webhooks/schemas/github_schemas.py - Event mapping
src/revu/presentation/webhooks/mappers.py
Review workflow
- Review orchestration
src/revu/application/services/webhook_service.py - Inline diff annotation
src/revu/application/services/webhook_service.py - Review response DTO
src/revu/domain/entities/dto/ai_provider_dto.py - AI provider contract
src/revu/domain/protocols/ai_provider_protocol.py - Git provider contract
src/revu/domain/protocols/git_provider_protocol.py - Review prompts
src/revu/application/entities/default_prompts.py
Provider adapters
- Provider selection
src/revu/presentation/webhooks/di.py - AI prompt base
src/revu/infrastructure/ai_providers/base.py - OpenAI adapters
src/revu/infrastructure/ai_providers/openai/openai_port.py - Compatible AI
src/revu/infrastructure/ai_providers/openai_compatible/openai_compatible_port.py - GigaChat adapter
src/revu/infrastructure/ai_providers/gigachat/gigachat_port.py - YandexGPT adapter
src/revu/infrastructure/ai_providers/yandexgpt/yandexgpt_port.py - GitHub adapter
src/revu/infrastructure/git_providers/github/github_port.py - Gitea adapter
src/revu/infrastructure/git_providers/gitea/gitea_port.py - Bitbucket adapter
src/revu/infrastructure/git_providers/bitbucket/bitbucket_port.py
HTTP transport
- HTTP gateway
src/revu/infrastructure/http_client/http_client_gateway.py
Other components
- Git provider
- AI service
Connections 34
- Git provider → Webhook routes: sends webhook
src/revu/presentation/webhooks/routes.py - FastAPI app → Webhook routes: mounts router
src/revu/application/app.py - Webhook routes → Webhook validation: validates event
src/revu/presentation/webhooks/routes.py - Webhook validation → Webhook schemas: parses payload
src/revu/presentation/webhooks/validators.py - Webhook routes → Event mapping: maps event
src/revu/presentation/webhooks/routes.py - Event mapping → Webhook schemas: reads payload
src/revu/presentation/webhooks/mappers.py - Webhook routes → Provider selection: resolves service
src/revu/presentation/webhooks/routes.py - Provider selection → Review orchestration: creates service
src/revu/presentation/webhooks/di.py - Webhook routes → Review orchestration: schedules processing
src/revu/presentation/webhooks/routes.py - Review orchestration → Git provider contract: fetches diff
src/revu/application/services/webhook_service.py - Review orchestration → AI provider contract: requests review
src/revu/application/services/webhook_service.py - Review orchestration → Git provider contract: publishes review
src/revu/application/services/webhook_service.py - Review orchestration → Inline diff annotation: annotates diff
src/revu/application/services/webhook_service.py - AI prompt base → Review prompts: formats prompts
src/revu/infrastructure/ai_providers/base.py - AI prompt base → Review response DTO: selects response model
src/revu/infrastructure/ai_providers/base.py - Provider selection → OpenAI adapters: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → Compatible AI: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → GigaChat adapter: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → YandexGPT adapter: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → GitHub adapter: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → Gitea adapter: selects provider
src/revu/presentation/webhooks/di.py - Provider selection → Bitbucket adapter: selects provider
src/revu/presentation/webhooks/di.py - GitHub adapter → HTTP gateway: sends requests
src/revu/infrastructure/git_providers/github/github_port.py - Gitea adapter → HTTP gateway: sends requests
src/revu/infrastructure/git_providers/gitea/gitea_port.py - Bitbucket adapter → HTTP gateway: sends requests
src/revu/infrastructure/git_providers/bitbucket/bitbucket_port.py - OpenAI adapters → HTTP gateway: uses gateway
- Compatible AI → HTTP gateway: uses gateway
- OpenAI adapters → AI service: calls API
- Compatible AI → AI service: calls API
- GigaChat adapter → AI service: calls API
- YandexGPT adapter → AI service: calls API
- GitHub adapter → Git provider: reads and writes PR
- Gitea adapter → Git provider: reads and writes PR
- Bitbucket adapter → Git provider: reads and writes PR