From 8a75d3101dc4cddd8c5ccae561cc3ae24d32bad4 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 7 Aug 2024 16:32:36 +0300 Subject: [PATCH] Enhance PR description handling and improve logging for invalid file extensions in Bitbucket provider --- pr_agent/git_providers/bitbucket_provider.py | 2 +- pr_agent/tools/pr_description.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pr_agent/git_providers/bitbucket_provider.py b/pr_agent/git_providers/bitbucket_provider.py index bdc5a632..a29e25be 100644 --- a/pr_agent/git_providers/bitbucket_provider.py +++ b/pr_agent/git_providers/bitbucket_provider.py @@ -170,7 +170,7 @@ class BitbucketProvider(GitProvider): diff_files.append(file_patch_canonic_structure) if invalid_files_names: - get_logger().info(f"Invalid file names: {invalid_files_names}") + get_logger().info(f"Disregarding files with invalid extensions:\n{invalid_files_names}") self.diff_files = diff_files diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index bf8c7205..bcd911d1 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -465,7 +465,7 @@ class PRDescription: pr_body += f'- `{filename}`: {description}\n' if self.git_provider.is_supported("gfm_markdown"): pr_body += "\n" - elif 'pr_files' in key.lower(): + elif 'pr_files' in key.lower() and get_settings().pr_description.enable_semantic_files_types: changes_walkthrough, pr_file_changes = self.process_pr_files_prediction(changes_walkthrough, value) changes_walkthrough = f"### **Changes walkthrough** 📝\n{changes_walkthrough}" else: @@ -506,7 +506,7 @@ class PRDescription: use_collapsible_file_list = num_files > self.COLLAPSIBLE_FILE_LIST_THRESHOLD if not self.git_provider.is_supported("gfm_markdown"): - return pr_body + return pr_body, pr_comments try: pr_body += "" header = f"Relevant files"