Add Review Helper API service#5684
Conversation
Add a new FastAPI backend (reviewhelper-api) implementing the Review Helper service.
6cda261 to
6e5ce42
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive FastAPI backend service called reviewhelper-api that implements Mozilla's Review Helper service. The service processes code review requests from Phabricator (with future GitHub support), generates automated review comments using AI tools from the bugbug library, and manages feedback on those comments. The architecture uses Google Cloud infrastructure including Cloud SQL for PostgreSQL, Cloud Tasks for asynchronous processing, and is designed for deployment on Cloud Run.
Changes:
- New FastAPI application with database models, API routers, and async task processing
- Database schema with Alembic migrations supporting review requests, generated comments, and user feedback
- Integration with Google Cloud services (Cloud SQL, Cloud Tasks) and Phabricator API
- Docker containerization with multi-stage build for Cloud Run deployment
Reviewed changes
Copilot reviewed 26 out of 31 changed files in this pull request and generated 29 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Project dependencies including FastAPI, SQLAlchemy, Cloud integrations, and bugbug tool |
| app/main.py | FastAPI application setup with lifespan management and health check endpoint |
| app/config.py | Pydantic settings for configuration management from environment variables |
| app/auth.py | Bearer token authentication for external and internal API endpoints |
| app/enums.py | Enum definitions for platforms, review statuses, feedback types, and user roles |
| app/database/models.py | SQLAlchemy async models for review requests, comments, and feedback |
| app/database/connection.py | Cloud SQL connection setup using Cloud SQL Python Connector |
| app/routers/request.py | Endpoint for submitting and checking review requests |
| app/routers/feedback.py | Endpoint for submitting user feedback on generated comments |
| app/routers/internal.py | Internal endpoint for Cloud Tasks to process review requests |
| app/tasks.py | Cloud Tasks integration for asynchronous review processing |
| app/review_processor.py | Core logic for processing reviews and submitting comments to platforms |
| app/schemas/*.py | Pydantic schemas for request/response validation |
| alembic/ | Database migration configuration and initial schema |
| Dockerfile | Multi-stage Docker build for production deployment |
| README.md | Setup instructions and Cloud SQL configuration documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
services/reviewhelper-api/alembic/versions/a6b26ceccd9f_initial_schema.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 31 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
services/reviewhelper-api/alembic/versions/a6b26ceccd9f_initial_schema.py
Show resolved
Hide resolved
services/reviewhelper-api/alembic/versions/a6b26ceccd9f_initial_schema.py
Show resolved
Hide resolved
marco-c
left a comment
There was a problem hiding this comment.
I only had a cursory look because it's too much new code, but it LGTM overall.
Add a new FastAPI backend (reviewhelper-api) implementing the Review Helper service.