mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
feat: Remove file walkthrough feature from PR agent
This commit is contained in:
@ -246,16 +246,15 @@ class PRDescription:
|
|||||||
summary = f"{ai_header}{ai_summary}"
|
summary = f"{ai_header}{ai_summary}"
|
||||||
body = body.replace('pr_agent:summary', summary)
|
body = body.replace('pr_agent:summary', summary)
|
||||||
|
|
||||||
if not re.search(r'<!--\s*pr_agent:walkthrough\s*-->', body):
|
ai_walkthrough = self.data.get('pr_files')
|
||||||
ai_walkthrough = self.data.get('PR changes walkthrough')
|
if ai_walkthrough and not re.search(r'<!--\s*pr_agent:walkthrough\s*-->', body):
|
||||||
if ai_walkthrough:
|
try:
|
||||||
walkthrough = str(ai_header)
|
walkthrough_gfm = ""
|
||||||
for file in ai_walkthrough:
|
walkthrough_gfm = self.process_pr_files_prediction(walkthrough_gfm, self.file_label_dict)
|
||||||
filename = file['filename'].replace("'", "`")
|
body = body.replace('pr_agent:walkthrough', walkthrough_gfm)
|
||||||
description = file['changes_summary'].replace("'", "`")
|
except Exception as e:
|
||||||
walkthrough += f'- `{filename}`: {description}\n'
|
get_logger().error(f"Failing to process walkthrough {self.pr_id}: {e}")
|
||||||
|
body = body.replace('pr_agent:walkthrough', "")
|
||||||
body = body.replace('pr_agent:walkthrough', walkthrough)
|
|
||||||
|
|
||||||
return title, body
|
return title, body
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user