{"id":23878805,"url":"https://github.com/sydowma/codereviewbot","last_synced_at":"2025-09-09T06:31:37.794Z","repository":{"id":250393283,"uuid":"831233070","full_name":"sydowma/codeReviewBot","owner":"sydowma","description":"This tool automates code reviews for GitLab merge requests and GitHub pull requests using OpenAI's GPT model.","archived":false,"fork":false,"pushed_at":"2024-10-27T06:31:58.000Z","size":71,"stargazers_count":11,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-27T07:35:09.661Z","etag":null,"topics":["ai","codereview"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sydowma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-20T02:01:13.000Z","updated_at":"2024-10-27T06:32:01.000Z","dependencies_parsed_at":"2024-10-23T06:32:38.972Z","dependency_job_id":null,"html_url":"https://github.com/sydowma/codeReviewBot","commit_stats":null,"previous_names":["sydowma/codereviewbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sydowma%2FcodeReviewBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sydowma%2FcodeReviewBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sydowma%2FcodeReviewBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sydowma%2FcodeReviewBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sydowma","download_url":"https://codeload.github.com/sydowma/codeReviewBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232400124,"owners_count":18517351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","codereview"],"created_at":"2025-01-03T21:50:00.059Z","updated_at":"2025-09-09T06:31:37.783Z","avatar_url":"https://github.com/sydowma.png","language":"Python","readme":"# Code Review Platform Development Outline\n\n## Project Overview\nThis project aims to create a web-based code review platform that integrates with GitLab and GitHub, leveraging AI-powered code analysis. The backend will be built with FastAPI, and the frontend (to be added later) will provide a user-friendly interface. The platform will support reviewing pull requests (GitHub) and merge requests (GitLab), offering detailed line-by-line feedback and summaries powered by AI (e.g., OpenAI or Ollama).\n\n### Key Features\n- Integration with GitLab and GitHub for fetching and reviewing code changes.\n- AI-powered code reviews with detailed comments and summaries.\n- RESTFul API backend using FastAPI.\n- Support for both CLI and web-based usage.\n- Extensible architecture for adding more AI providers or repository platforms.\n- User authentication and project management (future enhancement).\n\n### Tech Stack\n- **Backend**: Python, FastAPI, GitHub/GitLab APIs, OpenAI/Ollama APIs.\n- **Frontend** (Future): React, Axios for API calls, Tailwind CSS or similar.\n\n## Development Roadmap\n\n### Phase 1: Backend Foundation (Current Code Base)\n**Goal**: Establish a working backend with core functionality based on the provided code.\n- [x] Set up FastAPI application with lifespan management for background tasks.\n- [x] Implement configuration loading from `config.json` and `.env`.\n- [x] Create abstract `BaseReview` class with GitHub (`GitHubReview`) and GitLab (`GitLabReview`) implementations.\n- [x] Add AI client abstraction (`AIClient`) supporting OpenAI and Ollama.\n- [x] Implement code review logic with detailed comments and summaries.\n- [x] Add `/review` API endpoint for reviewing code changes.\n- [x] Set up CLI interface for manual testing.\n- [x] Implement background task to periodically check for new GitHub pull requests.\n\n**Next Steps**:\n- Test the current code with real GitHub and GitLab repositories.\n- Fix any bugs in the review parsing or comment submission logic.\n- Add logging to track errors and review progress.\n\n### Phase 2: Backend Enhancements\n**Goal**: Improve robustness, scalability, and usability of the backend.\n- [ ] **Authentication**: Add API key or OAuth-based authentication for secure access.\n  - Use `fastapi.security` for API key management.\n  - Integrate GitHub/GitLab OAuth for user login.\n- [ ] **Database Integration**: Store review history and user settings.\n  - Use SQLite or PostgreSQL with SQLAlchemy.\n  - Create tables for users, reviews, and repository configs.\n- [ ] **Queue System**: Handle large review requests asynchronously.\n  - Integrate `Celery` with Redis or RabbitMQ for task queuing.\n  - Move AI review processing to background tasks.\n- [ ] **Error Handling**: Improve exception handling and user feedback.\n  - Add detailed error responses in API.\n  - Log errors to a file or external service (e.g., Sentry).\n- [ ] **Rate Limiting**: Prevent abuse of the API.\n  - Use `slowapi` or similar to enforce limits.\n- [ ] **Configuration API**: Allow runtime updates to AI provider/model via API.\n\n**Deliverables**:\n- Secure and scalable backend API.\n- Database schema and initial data population.\n- Documentation for new endpoints (e.g., `/auth`, `/config`).\n\n### Phase 3: Frontend Development\n**Goal**: Build a basic web interface for interacting with the backend.\n- [ ] **Setup**: Choose a frontend framework (e.g., React, Vue.js) and set up the project.\n- [ ] **Authentication UI**: Login page with GitHub/GitLab OAuth.\n- [ ] **Dashboard**: Display list of connected repositories and recent reviews.\n- [ ] **Review Page**: Show pull/merge request details with AI comments and summary.\n- [ ] **Settings Page**: Configure AI provider, model, and repository settings.\n- [ ] **API Integration**: Use Axios or Fetch to connect to FastAPI endpoints.\n- [ ] **Styling**: Apply a CSS framework (e.g., Tailwind CSS) for a clean UI.\n\n**Deliverables**:\n- Working frontend prototype.\n- Basic navigation and styling.\n- Integration with backend API endpoints.\n\n### Phase 4: Advanced Features\n**Goal**: Add features to enhance user experience and platform capabilities.\n- [ ] **Multi-Repository Support**: Allow users to connect multiple GitHub/GitLab repositories.\n- [ ] **Custom Prompts**: Enable users to define custom AI review prompts via UI.\n- [ ] **Review History**: Show past reviews with filtering and search.\n- [ ] **Notifications**: Email or webhook notifications for new reviews.\n- [ ] **Team Features**: Support for multiple users per project with roles (e.g., reviewer, admin).\n- [ ] **Performance Optimization**: Cache AI responses and optimize diff parsing.\n\n**Deliverables**:\n- Enhanced platform functionality.\n- User documentation for advanced features.\n\n### Phase 5: Deployment and Testing\n**Goal**: Prepare the platform for production use.\n- [ ] **Testing**: Write unit and integration tests for backend (e.g., `pytest`).\n- [ ] **CI/CD**: Set up GitHub Actions or GitLab CI for automated testing and deployment.\n- [ ] **Deployment**: Deploy backend to a cloud provider (e.g., Heroku, AWS, DigitalOcean).\n- [ ] **Monitoring**: Add logging and monitoring (e.g., Prometheus, Grafana).\n- [ ] **Documentation**: Write full API docs with OpenAPI/Swagger and user guide.\n\n**Deliverables**:\n- Production-ready application.\n- Comprehensive test suite.\n- Deployment scripts and documentation.\n\n\n## License\n[Apache 2.0 License](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsydowma%2Fcodereviewbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsydowma%2Fcodereviewbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsydowma%2Fcodereviewbot/lists"}