Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds new functionality to generate GitHub pull request review comments based on an AI chatbot review of the diffs. The chatbot, named CodeReviewGPT, analyzes the structure and logic of code, identifies potential issues including bugs, security vulnerabilities, performance, readability, and maintainability, and provides developers with comprehensive feedback. For each file changed in the pull request, CodeReviewGPT adds comments to the respective line number in the pull request. Additionally, an overall review of the pull request is included.
Changes
PromptReview
and assigned the value ofassets/review.txt
to itPromptReview
has been removed fromPromptOverallReview
ChatCompletion
function to set the temperature to 0.File: cmd/review/main.go
Description: Added functionality to generate comments on a pull request based on an AI review of the code changes. The AI review identifies issues in the code changes and generates comments on the relevant lines of code. The comments are created as pull request comments and can be reviewed by the team. The overall review is also generated and can be added as a pull request review.
File: openai/assets/review.txt
Description: Added an embedded file
assets/review.txt
to the codebase for use in generating prompts for code review. The file contains a detailed report that includes specific recommendations, examples, and explanations to help developers improve their code. If context is not enough, the AI agent marks it as good. The responses are in JSON format and include quality values of good, bad, and neutral, and issue types including bug, security, performance, readability, maintainability, and other.File: openai/openai.go
Description: Added a new constant
PromptReview
for generating a prompt for code review. Adjusted theChatCompletion
function to include a new parameterTemperature
with a default value of 0.1.