A modern, patch-based code review tool designed for scalability and high availability while maintaining simplicity for single-node deployments. Revue provides an alternative to Phabricator with a focus on performance and modern development practices.
- Patch-based workflow: Similar to Phabricator/arc, not git branch dependent
- REST API: Comprehensive API for all operations
- CLI tool: Command-line interface for developers
- Review workflow: Create, approve, reject, and merge reviews
- Comments: General and inline comments on patches
- Herald system: Event-driven automation with V8 JavaScript rules
- PostgreSQL storage: Reliable and scalable data storage
- Modern Go backend: High-performance server implementation
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ CLI Tool │ │ REST API │ │ Herald Engine │
│ (cr) │────│ (Go/Gin) │────│ (V8 isolates) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
┌─────────────────┐
│ PostgreSQL │
│ Database │
└─────────────────┘
- Go 1.21 or later
- PostgreSQL 12 or later
- Git
git clone https://github.com/albertywu/revue
cd revue
go mod download
go build -o cr# Create PostgreSQL database
createdb revue
# Start the server (runs migrations automatically)
./cr server --port 8080 --db-url "postgres://localhost/revue?sslmode=disable"export REVUE_SERVER_URL="http://localhost:8080"
export REVUE_USER_ID="1" # Your user IDcurl -X POST http://localhost:8080/api/v1/users \
-H "Content-Type: application/json" \
-d '{"username": "john", "email": "[email protected]", "display_name": "John Doe"}'# Create a patch and merge request from your current git changes
./cr diff --title "Fix authentication bug" --message "This fixes the issue with login validation" --reviewers alice,bob
# List merge requests
./cr list
# Show merge request details
./cr show 123
# Approve a merge request
./cr approve 123 --comment "Looks good to me!"
# Add a comment
./cr comment 123 "Please add unit tests for this change"
# Add an inline comment
./cr comment 123 "This function could be optimized" --file "src/auth.go" --line 42
# Reject a merge request
./cr reject 123 --comment "Needs more error handling"
# Land (merge) an approved merge request
./cr land 123POST /api/v1/users- Create userGET /api/v1/users/{id}- Get user by IDGET /api/v1/users- List usersPUT /api/v1/users/{id}- Update userDELETE /api/v1/users/{id}- Delete user
POST /api/v1/patches- Create patchGET /api/v1/patches/{id}- Get patch by IDGET /api/v1/patches- List patchesPUT /api/v1/patches/{id}- Update patchDELETE /api/v1/patches/{id}- Delete patch
POST /api/v1/merge-requests- Create merge requestGET /api/v1/merge-requests/{id}- Get merge request by IDGET /api/v1/merge-requests- List merge requestsPUT /api/v1/merge-requests/{id}- Update merge requestDELETE /api/v1/merge-requests/{id}- Delete merge requestGET /api/v1/merge-requests/{id}/comments- Get merge request commentsGET /api/v1/merge-requests/{id}/reviews- Get merge request reviews
POST /api/v1/reviews- Create review actionGET /api/v1/reviews/{id}- Get review by IDPUT /api/v1/reviews/{id}- Update reviewDELETE /api/v1/reviews/{id}- Delete review
POST /api/v1/comments- Create commentGET /api/v1/comments/{id}- Get comment by IDPUT /api/v1/comments/{id}- Update commentDELETE /api/v1/comments/{id}- Delete comment
Herald rules allow you to automate actions based on events in Revue. Rules are written in JavaScript and executed in isolated V8 contexts.
// Rule to trigger CI for JavaScript/TypeScript changes
export function shouldTriggerRule(context) {
if (context.noun === "patch" && context.verb === "created") {
return context.patch.files.some(file =>
file.path.endsWith('.js') ||
file.path.endsWith('.ts') ||
file.path.endsWith('.jsx') ||
file.path.endsWith('.tsx')
);
}
return false;
}- webhook: Send HTTP POST to external service
- comment: Add automated comment to review
- ci_trigger: Trigger CI/CD pipeline
Revue uses PostgreSQL with the following main tables:
users- User informationpatches- Git diffs and metadatamerge_requests- Merge request state and metadatareviews- Review actions (approve/reject/comment)comments- General and inline commentsevents- Event log for Herald systemherald_rules- Automation rules
REVUE_SERVER_URL- API server URL (default: http://localhost:8080)REVUE_USER_ID- Current user ID for CLI operations
Create ~/.cr.yaml:
server_url: "http://localhost:8080"
user_id: 1
default_reviewers:
- alice
- bobgo test ./...Migrations are run automatically when the server starts. Migration files are in the migrations/ directory.
- Update database schema in
migrations/ - Add models in
internal/models/ - Implement repository methods in
internal/repository/ - Add API handlers in
internal/server/handlers/ - Update CLI commands in
cmd/
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details.