-
-
Notifications
You must be signed in to change notification settings - Fork 45
Test new prompt #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test new prompt #32
Conversation
|
/gemini-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gemini AI Code Reviewer Comments
| def create_prompt(file: PatchedFile, hunk: Hunk, pr_details: PRDetails) -> str: | ||
| """Creates the prompt for the Gemini model.""" | ||
| return f"""Your task is reviewing pull requests. Instructions: | ||
| - Provide the response in following JSON format: {{"reviews": [{{"lineNumber": <line_number>, "reviewComment": "<review comment>"}}]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The instruction "Skip style or documentation suggestions" contradicts the purpose of code review, which includes maintaining code quality and readability. Consider removing this instruction.
|
/gemini-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gemini AI Code Reviewer Comments
Dockerfile
Outdated
|
|
||
| # testing the security detection | ||
| RUN echo Password is `cat /cfg/password.txt` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storing sensitive information like passwords directly in the Dockerfile is a security risk. Use environment variables or secrets management tools instead.
| def create_prompt(file: PatchedFile, hunk: Hunk, pr_details: PRDetails) -> str: | ||
| """Creates the prompt for the Gemini model.""" | ||
| return f"""Your task is reviewing pull requests. Instructions: | ||
| - Provide the response in following JSON format: {{"reviews": [{{"lineNumber": <line_number>, "reviewComment": "<review comment>"}}]}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prompt should explicitly mention that the review response should ONLY contain code suggestions and comments related to the provided code diff. It should also specify that the response must adhere to the provided JSON format even if there are no suggestions (i.e., return an empty reviews array).
| return f"""Your task is reviewing pull requests. Instructions: | ||
| - Provide the response in following JSON format: {{"reviews": [{{"lineNumber": <line_number>, "reviewComment": "<review comment>"}}]}} | ||
| - Do not give positive comments or compliments. | ||
| - Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instructions should be more precise. For example, instead of "Focus on bugs, security issues, and performance problems", it should say something like "Focus on identifying and suggesting fixes for bugs, potential security issues, and performance problems within the provided code diff."
| - Do not give positive comments or compliments. | ||
| - Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array. | ||
| - Write the comment in GitHub Markdown format. | ||
| - Use the given description only for the overall context and only comment the code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable adjusted_line_number looks like it should be zero-indexed based on hunk.source_start and the subsequent usage in the position field of the comment. Consider clarifying this with a comment or renaming to zero_indexed_line_number for better readability. Also, it might be worth adding a check to ensure adjusted_line_number does not exceed hunk.source_start + hunk.source_length.
No description provided.