diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py
index a3fd82bdf..b877106dc 100644
--- a/pr_agent/algo/utils.py
+++ b/pr_agent/algo/utils.py
@@ -68,11 +68,11 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool = True, increment
output_data (dict): A dictionary containing data to be converted to markdown format.
Returns:
str: The markdown formatted text generated from the input dictionary.
- """
+ """
emojis = {
"Can be split": "๐",
- "Possible issues": "๐",
+ "Possible issues": "โก",
"Score": "๐
",
"Relevant tests": "๐งช",
"Focused PR": "โจ",
@@ -83,9 +83,9 @@ def convert_to_markdown(output_data: dict, gfm_supported: bool = True, increment
}
markdown_text = ""
if not incremental_review:
- markdown_text += f"## PR Review\n\n"
+ markdown_text += f"## PR Review ๐\n\n"
else:
- markdown_text += f"## Incremental PR Review\n\n"
+ markdown_text += f"## Incremental PR Review ๐ \n\n"
markdown_text += f"โฎ๏ธ Review for commits since previous PR-Agent review {incremental_review}.\n\n"
if gfm_supported:
markdown_text += "
\n\n"
diff --git a/pr_agent/git_providers/git_provider.py b/pr_agent/git_providers/git_provider.py
index a7d772b7e..0ff5caf1e 100644
--- a/pr_agent/git_providers/git_provider.py
+++ b/pr_agent/git_providers/git_provider.py
@@ -71,7 +71,7 @@ def get_user_description(self) -> str:
# if the existing description was generated by the pr-agent, but it doesn't contain a user description,
# return nothing (empty string) because it means there is no user description
- user_description_header = "## **user description**"
+ user_description_header = "### **user description**"
if user_description_header not in description_lowercase:
get_logger().info(f"Existing description was generated by the pr-agent, but it doesn't contain a user description")
return ""
@@ -102,8 +102,8 @@ def get_user_description(self) -> str:
return original_user_description
def _possible_headers(self):
- return ("## **user description**", "## **pr type**", "## **pr description**", "## **pr labels**", "## **type**", "## **description**",
- "## **labels**", "### ๐ค generated by pr agent")
+ return ("### **user description**", "### **pr type**", "### **pr description**", "### **pr labels**", "### **type**", "### **description**",
+ "### **labels**", "### ๐ค generated by pr agent")
def _is_generated_by_pr_agent(self, description_lowercase: str) -> bool:
possible_headers = self._possible_headers()
diff --git a/pr_agent/servers/help.py b/pr_agent/servers/help.py
index 07ade44c6..5578fb0f5 100644
--- a/pr_agent/servers/help.py
+++ b/pr_agent/servers/help.py
@@ -179,7 +179,7 @@ def get_ask_usage_guide():
@staticmethod
def get_improve_usage_guide():
output = "**Overview:**\n"
- output += "The `improve` tool scans the PR code changes, and automatically generates suggestions for improving the PR code. "
+ output += "The code suggestions tool, named `improve`, scans the PR code changes, and automatically generates code suggestions for improving the PR."
output += "The tool can be triggered [automatically](https://pr-agent-docs.codium.ai/usage-guide/automations_and_usage/#github-app-automatic-tools-when-a-new-pr-is-opened) every time a new PR is opened, or can be invoked manually by commenting on a PR.\n"
output += """\
- When commenting, to edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L78) related to the improve tool (`pr_code_suggestions` section), use the following template:
diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml
index 22ed6ccc0..b2c65a3d0 100644
--- a/pr_agent/settings/configuration.toml
+++ b/pr_agent/settings/configuration.toml
@@ -44,7 +44,7 @@ enable_review_labels_effort=true
require_all_thresholds_for_incremental_review=false
minimal_commits_for_incremental_review=0
minimal_minutes_for_incremental_review=0
-enable_help_text=true # Determines whether to include help text in the PR review. Enabled by default.
+enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
# auto approval
enable_auto_approval=false
maximal_review_effort=5
@@ -74,7 +74,7 @@ include_generated_by_header=true
#custom_labels = ['Bug fix', 'Tests', 'Bug fix with tests', 'Enhancement', 'Documentation', 'Other']
[pr_questions] # /ask #
-enable_help_text=true
+enable_help_text=false
[pr_code_suggestions] # /improve #
@@ -83,7 +83,7 @@ num_code_suggestions=4
commitable_code_suggestions = false
extra_instructions = ""
rank_suggestions = false
-enable_help_text=true
+enable_help_text=false
persistent_comment=false
# params for '/improve --extended' mode
auto_extended_mode=true
@@ -110,7 +110,7 @@ num_tests=3 # number of tests to generate. max 5.
avoid_mocks=true # if true, the generated tests will prefer to use real objects instead of mocks
file = "" # in case there are several components with the same name, you can specify the relevant file
class_name = "" # in case there are several methods with the same name in the same file, you can specify the relevant class name
-enable_help_text=true
+enable_help_text=false
[pr_improve_component] # /improve_component #
num_code_suggestions=4
diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py
index 813ccbfaf..ff4eb96fa 100644
--- a/pr_agent/tools/pr_code_suggestions.py
+++ b/pr_agent/tools/pr_code_suggestions.py
@@ -90,7 +90,7 @@ async def run(self):
if (not data) or (not 'code_suggestions' in data) or (not data['code_suggestions']):
get_logger().error('No code suggestions found for PR.')
- pr_body = "## PR Code Suggestions\n\nNo code suggestions found for PR."
+ pr_body = "## PR Code Suggestions โจ\n\nNo code suggestions found for PR."
get_logger().debug(f"PR output", artifact=pr_body)
if self.progress_response:
self.git_provider.edit_comment(self.progress_response, body=pr_body)
@@ -113,14 +113,14 @@ async def run(self):
# add usage guide
if get_settings().pr_code_suggestions.enable_help_text:
- pr_body += "
\n\n โจ Improve tool usage guide:
\n\n"
+ pr_body += "
\n\n ๐ก Tool usage guide:
\n\n"
pr_body += HelpMessage.get_improve_usage_guide()
pr_body += "\n \n"
if get_settings().pr_code_suggestions.persistent_comment:
final_update_message = False
self.git_provider.publish_persistent_comment(pr_body,
- initial_header="## PR Code Suggestions",
+ initial_header="## PR Code Suggestions โจ",
update_header=True,
name="suggestions",
final_update_message=final_update_message, )
@@ -382,7 +382,7 @@ async def rank_suggestions(self, data: List) -> List:
def generate_summarized_suggestions(self, data: Dict) -> str:
try:
- pr_body = "## PR Code Suggestions\n\n"
+ pr_body = "## PR Code Suggestions โจ\n\n"
if len(data.get('code_suggestions', [])) == 0:
pr_body += "No suggestions found to improve this PR."
@@ -394,7 +394,7 @@ def generate_summarized_suggestions(self, data: Dict) -> str:
for ext in extensions:
extension_to_language[ext] = language
- pr_body = "## PR Code Suggestions\n\n"
+ pr_body = "## PR Code Suggestions โจ\n\n"
pr_body += ""
header = f"Suggestions"
diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py
index fa662464e..661d9dd83 100644
--- a/pr_agent/tools/pr_description.py
+++ b/pr_agent/tools/pr_description.py
@@ -113,7 +113,7 @@ async def run(self):
pr_body += HelpMessage.get_describe_usage_guide()
pr_body += "\n\n"
elif get_settings().pr_description.enable_help_comment:
- pr_body += "\n\n___\n\n> โจ **PR-Agent usage**:"
+ pr_body += "\n\n___\n\n> ๐ก **PR-Agent usage**:"
pr_body += "\n>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions\n\n"
if get_settings().config.publish_output:
@@ -317,7 +317,11 @@ def _prepare_pr_answer(self) -> Tuple[str, str, str, List[dict]]:
value = self.file_label_dict
else:
key_publish = key.rstrip(':').replace("_", " ").capitalize()
- pr_body += f"## **{key_publish}**\n"
+ if key_publish== "Type":
+ key_publish = "PR Type"
+ # elif key_publish == "Description":
+ # key_publish = "PR Description"
+ pr_body += f"### **{key_publish}**\n"
if 'walkthrough' in key.lower():
if self.git_provider.is_supported("gfm_markdown"):
pr_body += " files:
\n\n"
@@ -329,7 +333,7 @@ def _prepare_pr_answer(self) -> Tuple[str, str, str, List[dict]]:
pr_body += " \n"
elif 'pr_files' in key.lower():
changes_walkthrough, pr_file_changes = self.process_pr_files_prediction(changes_walkthrough, value)
- changes_walkthrough = f"## **Changes walkthrough**\n{changes_walkthrough}"
+ changes_walkthrough = f"### **Changes walkthrough** ๐\n{changes_walkthrough}"
else:
# if the value is a list, join its items by comma
if isinstance(value, list):
diff --git a/pr_agent/tools/pr_help_message.py b/pr_agent/tools/pr_help_message.py
index df2698cfb..9f76434da 100644
--- a/pr_agent/tools/pr_help_message.py
+++ b/pr_agent/tools/pr_help_message.py
@@ -18,8 +18,8 @@ async def run(self):
relevant_configs = {'pr_help': dict(get_settings().pr_help),
'config': dict(get_settings().config)}
get_logger().debug("Relevant configs", artifacts=relevant_configs)
- pr_comment = "## PR Agent Walkthrough\n\n"
- pr_comment += "๐ค Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more."""
+ pr_comment = "## PR Agent Walkthrough ๐ค\n\n"
+ pr_comment += "Welcome to the PR Agent, an AI-powered tool for automated pull request analysis, feedback, suggestions and more."""
pr_comment += "\n\nHere is a list of tools you can use to interact with the PR Agent:\n"
base_path = "https://pr-agent-docs.codium.ai/tools"
diff --git a/pr_agent/tools/pr_questions.py b/pr_agent/tools/pr_questions.py
index d78d08803..78db1452b 100644
--- a/pr_agent/tools/pr_questions.py
+++ b/pr_agent/tools/pr_questions.py
@@ -68,7 +68,7 @@ async def run(self):
get_logger().debug(f"PR output", artifact=pr_comment)
if self.git_provider.is_supported("gfm_markdown") and get_settings().pr_questions.enable_help_text:
- pr_comment += "
\n\n โจ Ask tool usage guide:
\n\n"
+ pr_comment += "
\n\n ๐ก Tool usage guide:
\n\n"
pr_comment += HelpMessage.get_ask_usage_guide()
pr_comment += "\n \n"
@@ -116,6 +116,6 @@ async def _get_prediction(self, model: str):
return response
def _prepare_pr_answer(self) -> str:
- answer_str = f"Question: {self.question_str}\n\n"
- answer_str += f"Answer:\n{self.prediction.strip()}\n\n"
+ answer_str = f"### **Ask**โ\n{self.question_str}\n\n"
+ answer_str += f"### **Answer:**\n{self.prediction.strip()}\n\n"
return answer_str
diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py
index 33149cad1..46036816b 100644
--- a/pr_agent/tools/pr_reviewer.py
+++ b/pr_agent/tools/pr_reviewer.py
@@ -137,7 +137,7 @@ async def run(self) -> None:
if get_settings().pr_reviewer.persistent_comment and not self.incremental.is_incremental:
final_update_message = get_settings().pr_reviewer.final_update_message
self.git_provider.publish_persistent_comment(pr_review,
- initial_header="## PR Review",
+ initial_header="## PR Review ๐",
update_header=True,
final_update_message=final_update_message, )
else:
@@ -234,7 +234,7 @@ def _prepare_pr_review(self) -> str:
# Add help text if gfm_markdown is supported
if self.git_provider.is_supported("gfm_markdown") and get_settings().pr_reviewer.enable_help_text:
- markdown_text += "
\n\n โจ Review tool usage guide:
\n\n"
+ markdown_text += "
\n\n ๐ก Tool usage guide:
\n\n"
markdown_text += HelpMessage.get_review_usage_guide()
markdown_text += "\n \n"
diff --git a/pr_agent/tools/pr_update_changelog.py b/pr_agent/tools/pr_update_changelog.py
index 399e05990..1475d9f21 100644
--- a/pr_agent/tools/pr_update_changelog.py
+++ b/pr_agent/tools/pr_update_changelog.py
@@ -81,7 +81,7 @@ async def run(self):
if self.commit_changelog:
self._push_changelog_update(new_file_content, answer)
else:
- self.git_provider.publish_comment(f"**Changelog updates:**\n\n{answer}")
+ self.git_provider.publish_comment(f"**Changelog updates:** ๐\n\n{answer}")
async def _prepare_prediction(self, model: str):
self.patches_diff = get_pr_diff(self.git_provider, self.token_handler, model)
@@ -141,7 +141,7 @@ def _push_changelog_update(self, new_file_content, answer):
self.git_provider.pr.create_review(commit=last_commit_id, comments=[d])
except Exception:
# we can't create a review for some reason, let's just publish a comment
- self.git_provider.publish_comment(f"**Changelog updates:**\n\n{answer}")
+ self.git_provider.publish_comment(f"**Changelog updates: ๐**\n\n{answer}")
def _get_default_changelog(self):
example_changelog = \
diff --git a/tests/unittest/test_convert_to_markdown.py b/tests/unittest/test_convert_to_markdown.py
index 9b071a747..676d0eea8 100644
--- a/tests/unittest/test_convert_to_markdown.py
+++ b/tests/unittest/test_convert_to_markdown.py
@@ -52,7 +52,7 @@ def test_simple_dictionary_input(self):
'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 = '## PR Review\n\n\n\n
โฑ๏ธ Estimated effort to review [1-5] | \n\n1, because the changes are minimal and straightforward, focusing on a single functionality addition.\n\n\n |
\n ๐งช Relevant tests | \n\nNo\n\n\n |
\n ๐ Possible issues | \n\nNo\n\n |
\n ๐ Security concerns | \n\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 = '## PR Review ๐\n\n\n\n
โฑ๏ธ Estimated effort to review [1-5] | \n\n1, because the changes are minimal and straightforward, focusing on a single functionality addition.\n\n\n |
\n ๐งช Relevant tests | \n\nNo\n\n\n |
\n โก Possible issues | \n\nNo\n\n |
\n ๐ Security concerns | \n\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()