You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Code Review is an AI-powered tool that automatically reviews and provides feedback on code changes in your pull requests (PRs). It helps streamline the code review process and ensures high code quality across your codebase.
3
+
Automatically get reviews and feedback on code changes in your pull requests on GitHub.
4
+
Streamline code reviews and ensure high code quality commit messages across your codebase.
4
5
5
6

6
7
7
-
### How it Works
8
+
### Key Features:
8
9
9
-
1.**Diff Analysis**: When you create or update a pull request, the Code Review Bot analyzes the code changes (diff) and generates detailed feedback based on the modified code snippets.
10
+
1.**Automated Code Analysis**: Analyzes code changes in pull requests and generates detailed feedback.
11
+
12
+
2.**Organized Feedback**: Provides review comments organized by topics and confidence levels.
13
+
14
+
3.**Interactive Reviews**: Allows engagement with the bot for clarification or additional context.
15
+
16
+
4.**PR Description Generation**: Automatically generates descriptive summaries of code changes.
17
+
18
+
5.**Continuous Learning**: Improves review quality over time based on user interactions.
19
+
20
+
## Usage Guide:
21
+
22
+
1.**Getting Started**: For a quickstart you can use the cloud hosted web application that we provide by following [this](../cloud_platform/getting_started). You can also choose to self host the Kaizen Github Bot locally by following the advanced guide [here](../self_hosting_guide).
23
+
The next given steps explore the latter approach in details.
24
+
2.**Create or Update a Pull Request**: The Kaizen Bot will automatically analyze the code changes and generate a review.
25
+
3.**Review the Feedback**: The bot's feedback will be shared as a comment on your pull request, organized by topics and confidence levels.
26
+
4.**Engage with the Bot**: You can interact with the bot, provide additional context, or request clarification on its feedback.
27
+
5.**Iterate and Improve**: As you work with the bot, it will learn from your responses and improve the quality of its reviews over time.
28
+
29
+
### Example:
30
+
31
+
Here's a complete example to review a pull request:
32
+
33
+
```python
34
+
from kaizen.reviewer.code_review import CodeReviewer
35
+
from kaizen.generator.pr_description import PRDescriptionGenerator
36
+
from kaizen.llms.provider import LLMProvider
37
+
from github_app.github_helper.utils import get_diff_text, get_pr_files
38
+
from github_app.github_helper.pull_requests import clean_keys, create_review_comments
39
+
from kaizen.formatters.code_review_formatter import create_pr_review_text
- GitHub pull request information (diff, files, title, description)
94
+
95
+
## How it Works:
96
+
97
+
1.**Diff Analysis**: When you create or update a pull request, the Kaizen Bot analyzes the code changes (diff) and generates detailed feedback based on the modified code snippets.
10
98
11
99
2.**Organized Feedback**: The bot's feedback is organized into topics or categories like performance, security, code style, or documentation, making it easier to navigate and prioritize the comments.
12
100
@@ -16,26 +104,64 @@ The Code Review is an AI-powered tool that automatically reviews and provides fe
16
104
17
105
5.**PR Description Generation**: The bot can generate a descriptive summary of the code changes, helping you better document your pull requests.
18
106
19
-
### Using the Code Review Bot
107
+

108
+
109
+
You can find an example [here](https://github.com/Cloud-Code-AI/kaizen/tree/main/examples/code_review)
110
+
111
+
## API Reference:
112
+
113
+
### Class: CodeReviewer
114
+
115
+
#### Constructor
116
+
117
+
-`__init__(self, llm_provider: LLMProvider)`
118
+
Initializes the CodeReviewer with the provided LLM provider.
-`pull_request_title`: The title of the pull request.
150
+
-`pull_request_desc`: The existing description of the pull request.
151
+
-`pull_request_files`: List of files changed in the pull request.
152
+
-`user`: The user or context for generating the description.
153
+
- Returns: A string containing the generated pull request description.
30
154
31
-
-**Improved Code Quality**: Catch potential issues and receive suggestions for improvements early in the development process.
32
-
-**Time Savings**: Automated reviews reduce the time and effort required for manual code reviews.
33
-
-**Consistent Standards**: Ensure consistent application of coding standards, best practices, and guidelines across your codebase.
34
-
-**Knowledge Sharing**: The bot's reviews serve as a knowledge-sharing mechanism, providing insights that can benefit your entire development team.
155
+
## Benefits:
35
156
36
-
### Limitations
157
+
- Improved Code Quality
158
+
- Time Savings
159
+
- Consistent Standards
160
+
- Knowledge Sharing
161
+
- Automated Documentation
37
162
38
-
-**AI Limitations**: While advanced, the bot may still have limitations in understanding complex code or context-specific nuances.
39
-
-**Human Oversight**: The bot's feedback should be considered a complementary tool to human code reviews, not a complete replacement.
163
+
## Limitations:
40
164
41
-
With the Code Review Bot, you can streamline your code review process, maintain high code quality, and leverage the power of AI to enhance your development workflow.
165
+
- AI Limitations: While advanced, the bot may still have limitations in understanding complex code or context-specific nuances.
166
+
- Human Oversight: The bot's feedback should be considered a complementary tool to human code reviews, not a complete replacement.
167
+
- GitHub API Limitations: Rate limits and authentication requirements may affect large-scale usage.
0 commit comments