feat: Remove file walkthrough feature from PR agent

This commit is contained in:
mrT23
2024-01-04 09:59:44 +02:00
parent 3c2ed8bbf1
commit 4204d78d7e

View File

@ -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