diff --git a/pr_agent/algo/git_patch_processing.py b/pr_agent/algo/git_patch_processing.py index 383d488f..5ca4e12b 100644 --- a/pr_agent/algo/git_patch_processing.py +++ b/pr_agent/algo/git_patch_processing.py @@ -23,7 +23,10 @@ def extend_patch(original_file_str, patch_str, num_lines) -> str: return patch_str if type(original_file_str) == bytes: - original_file_str = original_file_str.decode('utf-8') + try: + original_file_str = original_file_str.decode('utf-8') + except UnicodeDecodeError: + return "" original_lines = original_file_str.splitlines() patch_lines = patch_str.splitlines() diff --git a/pr_agent/algo/pr_processing.py b/pr_agent/algo/pr_processing.py index 2c5a2957..59b9da26 100644 --- a/pr_agent/algo/pr_processing.py +++ b/pr_agent/algo/pr_processing.py @@ -146,6 +146,9 @@ def pr_generate_extended_diff(pr_languages: list, # extend each patch with extra lines of context extended_patch = extend_patch(original_file_content_str, patch, num_lines=patch_extra_lines) + if not extended_patch: + get_logger().warning(f"Failed to extend patch for file: {file.filename}") + continue full_extended_patch = f"\n\n## {file.filename}\n\n{extended_patch}\n" if add_line_numbers_to_hunks: diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 8ecf04ab..c50ab0f7 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -58,7 +58,7 @@ generate_ai_title=false use_bullet_points=true extra_instructions = "" enable_pr_type=true -final_update_message = false +final_update_message = true enable_help_text=false enable_help_comment=true # describe as comment @@ -152,7 +152,7 @@ override_deployment_type = true # settings for "pull_request" event handle_pr_actions = ['opened', 'reopened', 'ready_for_review'] pr_commands = [ - "/describe", + "/describe --pr_description.final_update_message=false", "/review --pr_reviewer.num_code_suggestions=0", "/improve", ] diff --git a/pr_agent/settings/language_extensions.toml b/pr_agent/settings/language_extensions.toml index eadb80c8..c13992ec 100644 --- a/pr_agent/settings/language_extensions.toml +++ b/pr_agent/settings/language_extensions.toml @@ -44,6 +44,7 @@ default = [ 'ss', 'svg', 'tar', + 'tgz', 'tsv', 'ttf', 'war',