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
* fix: improve PR description field guidance for clarity
* feat: refine suggestion guidelines to avoid redundant recommendations in PR reviews
* feat: enhance YAML parsing logic with additional keys and fallback strategies
* fix: update expected output format in YAML parsing test case
Copy file name to clipboardExpand all lines: pr_agent/settings/code_suggestions/pr_code_suggestions_prompts.toml
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -63,10 +63,15 @@ Specific guidelines for generating code suggestions:
63
63
- Don't suggest to add docstring, type hints, or comments, to remove unused imports, or to use more specific exception types.
64
64
{%- else %}
65
65
- Only give suggestions that address critical problems and bugs in the PR code. If no relevant suggestions are applicable, return an empty list.
66
-
- Do not suggest to change packages version, add missing import statement, or declare undefined variable.
66
+
- DO NOT suggest the following:
67
+
- change packages version
68
+
- add missing import statement
69
+
- declare undefined variable, or remove unused variable
70
+
- use more specific exception types
71
+
- repeat changes already done in the PR code
67
72
{%- endif %}
73
+
- Be aware that your input consists only of partial code segments (PR diff code), not the complete codebase. Therefore, avoid making suggestions that might duplicate existing functionality, and refrain from questioning code elements (such as variable declarations or import statements) that may be defined elsewhere in the codebase.
68
74
- When mentioning code elements (variables, names, or files) in your response, surround them with backticks (`). For example: "verify that `user_id` is..."
69
-
- Note that you only see changed code segments (diff hunks in a PR), not the entire codebase. Avoid suggestions that might duplicate existing functionality or questioning code elements (like variables declarations or import statements) that may be defined elsewhere in the codebase.
Copy file name to clipboardExpand all lines: pr_agent/settings/pr_description_prompts.toml
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ class FileDescription(BaseModel):
45
45
46
46
class PRDescription(BaseModel):
47
47
type: List[PRType] = Field(description="one or more types that describe the PR content. Return the label member value (e.g. 'Bug fix', not 'bug_fix')")
48
-
description: str = Field(description="summarize the PR changes in up to four bullet points, each up to 8 words. For large PRs, add sub-bullets if needed. Order bullets by importance, with each bullet highlighting a key change group.")
48
+
description: str = Field(description="summarize the PR changes with 1-4 bullet points, each up to 8 words. For large PRs, add sub-bullets for each bullet if needed. Order bullets by importance, with each bullet highlighting a key change group.")
49
49
title: str = Field(description="a concise and descriptive title that captures the PR's main theme")
50
50
{%- if enable_pr_diagram %}
51
51
changes_diagram: str = Field(description='a horizontal diagram that represents the main PR changes, in the format of a valid mermaid LR flowchart. The diagram should be concise and easy to read. Leave empty if no diagram is relevant. To create robust Mermaid diagrams, follow this two-step process: (1) Declare the nodes: nodeID["node description"]. (2) Then define the links: nodeID1 -- "link text" --> nodeID2. Node description must always be surrounded with double quotation marks')
expected_output= {'code_suggestions': [{'relevant_file': 'a.c\n', 'existing_code': ' int sum(int a, int b) {\n return a + b;\n }\n\n int sub(int a, int b) {\n return a - b;\n }\n'}]}
0 commit comments