diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py
index c8915d07..4eb62e91 100644
--- a/pr_agent/algo/utils.py
+++ b/pr_agent/algo/utils.py
@@ -23,10 +23,12 @@ class ModelType(str, Enum):
REGULAR = "regular"
TURBO = "turbo"
-class ReviewHeaderTitle(str, Enum):
+
+class PRReviewHeader(str, Enum):
REGULAR = "## PR Reviewer Guide"
INCREMENTAL = "## Incremental PR Reviewer Guide"
+
def get_setting(key: str) -> Any:
try:
key = key.upper()
@@ -90,9 +92,9 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool = True, increment
}
markdown_text = ""
if not incremental_review:
- markdown_text += f"{ReviewHeaderTitle.REGULAR.value} ๐\n\n"
+ markdown_text += f"{PRReviewHeader.REGULAR.value} ๐\n\n"
else:
- markdown_text += f"{ReviewHeaderTitle.INCREMENTAL.value} ๐\n\n"
+ markdown_text += f"{PRReviewHeader.INCREMENTAL.value} ๐\n\n"
markdown_text += f"โฎ๏ธ Review for commits since previous PR-Agent review {incremental_review}.\n\n"
if gfm_supported:
markdown_text += "
\n"
diff --git a/tests/unittest/test_convert_to_markdown.py b/tests/unittest/test_convert_to_markdown.py
index 9cf59c85..32f4bef5 100644
--- a/tests/unittest/test_convert_to_markdown.py
+++ b/tests/unittest/test_convert_to_markdown.py
@@ -1,5 +1,5 @@
# Generated by CodiumAI
-from pr_agent.algo.utils import ReviewHeaderTitle, convert_to_markdown
+from pr_agent.algo.utils import PRReviewHeader, convert_to_markdown
from pr_agent.tools.pr_description import insert_br_after_x_chars
"""
@@ -52,7 +52,7 @@ class TestConvertToMarkdown:
'suggestion': "Consider raising an exception or logging a warning when 'pr_url' attribute is not found. This can help in debugging issues related to the absence of 'pr_url' in instances where it's expected. [important]\n",
'relevant_line': '[return ""](https://github.com/Codium-ai/pr-agent-pro/pull/102/files#diff-52d45f12b836f77ed1aef86e972e65404634ea4e2a6083fb71a9b0f9bb9e062fR199)'}]}
- expected_output = f'{ReviewHeaderTitle.REGULAR.value} ๐\n\n\n โฑ๏ธ Estimated effort to review [1-5] | \n1, because the changes are minimal and straightforward, focusing on a single functionality addition.\n\n\n |
\n ๐งช Relevant tests | \nNo\n\n\n |
\n โก Possible issues | \nNo\n\n\n |
\n ๐ Security concerns | \nNo\n\n |
\n
\n\n\n Code feedback:
\n\n
relevant file | pr_agent/git_providers/git_provider.py\n |
suggestion | \n\n\n\nConsider raising an exception or logging a warning when \'pr_url\' attribute is not found. This can help in debugging issues related to the absence of \'pr_url\' in instances where it\'s expected. [important]\n\n\n |
relevant line | return "" |
\n\n '
+ expected_output = f'{PRReviewHeader.REGULAR.value} ๐\n\n\n โฑ๏ธ Estimated effort to review [1-5] | \n1, because the changes are minimal and straightforward, focusing on a single functionality addition.\n\n\n |
\n ๐งช Relevant tests | \nNo\n\n\n |
\n โก Possible issues | \nNo\n\n\n |
\n ๐ Security concerns | \nNo\n\n |
\n
\n\n\n Code feedback:
\n\n
relevant file | pr_agent/git_providers/git_provider.py\n |
suggestion | \n\n\n\nConsider raising an exception or logging a warning when \'pr_url\' attribute is not found. This can help in debugging issues related to the absence of \'pr_url\' in instances where it\'s expected. [important]\n\n\n |
relevant line | return "" |
\n\n '
assert convert_to_markdown(input_data).strip() == expected_output.strip()