mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
feat: Remove file walkthrough feature from PR agent
This commit is contained in:
@ -51,7 +51,6 @@ keep_original_user_title=false
|
||||
use_bullet_points=true
|
||||
extra_instructions = ""
|
||||
enable_pr_type=true
|
||||
enable_file_walkthrough=false
|
||||
enable_semantic_files_types=true
|
||||
final_update_message = true
|
||||
|
||||
|
@ -35,12 +35,6 @@ class PRType(str, Enum):
|
||||
|
||||
{%- endif %}
|
||||
|
||||
{%- if enable_file_walkthrough %}
|
||||
class FileWalkthrough(BaseModel):
|
||||
filename: str = Field(description="the relevant file full path")
|
||||
changes_in_file: str = Field(description="minimal and concise summary of the changes in the relevant file")
|
||||
{%- endif %}
|
||||
|
||||
{%- if enable_semantic_files_types %}
|
||||
|
||||
Class FileDescription(BaseModel):
|
||||
|
@ -52,7 +52,6 @@ class PRDescription:
|
||||
"commit_messages_str": self.git_provider.get_commit_messages(),
|
||||
"enable_custom_labels": get_settings().config.enable_custom_labels,
|
||||
"custom_labels_class": "", # will be filled if necessary in 'set_custom_labels' function
|
||||
"enable_file_walkthrough": get_settings().pr_description.enable_file_walkthrough,
|
||||
"enable_semantic_files_types": get_settings().pr_description.enable_semantic_files_types,
|
||||
}
|
||||
|
||||
@ -248,12 +247,12 @@ class PRDescription:
|
||||
body = body.replace('pr_agent:summary', summary)
|
||||
|
||||
if not re.search(r'<!--\s*pr_agent:walkthrough\s*-->', body):
|
||||
ai_walkthrough = self.data.get('PR Main Files Walkthrough')
|
||||
ai_walkthrough = self.data.get('PR changes walkthrough')
|
||||
if ai_walkthrough:
|
||||
walkthrough = str(ai_header)
|
||||
for file in ai_walkthrough:
|
||||
filename = file['filename'].replace("'", "`")
|
||||
description = file['changes in file'].replace("'", "`")
|
||||
description = file['changes_summary'].replace("'", "`")
|
||||
walkthrough += f'- `{filename}`: {description}\n'
|
||||
|
||||
body = body.replace('pr_agent:walkthrough', walkthrough)
|
||||
@ -329,7 +328,7 @@ class PRDescription:
|
||||
try:
|
||||
filename = file['filename'].replace("'", "`").replace('"', '`')
|
||||
changes_summary = file['changes_summary']
|
||||
label = file['label']
|
||||
label = file.get('label')
|
||||
if label not in self.file_label_dict:
|
||||
self.file_label_dict[label] = []
|
||||
self.file_label_dict[label].append((filename, changes_summary))
|
||||
|
Reference in New Issue
Block a user