mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-11 00:00:38 +08:00
Merge pull request #582 from Codium-ai/tr/unique_titles
Enhance PR description headers with bold formatting and include original user description
This commit is contained in:
@ -84,7 +84,7 @@ class GitProvider(ABC):
|
|||||||
|
|
||||||
# if the existing description was generated by the pr-agent, but it doesn't contain a user description,
|
# 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
|
# 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:
|
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")
|
get_logger().info(f"Existing description was generated by the pr-agent, but it doesn't contain a user description")
|
||||||
return ""
|
return ""
|
||||||
@ -113,8 +113,8 @@ class GitProvider(ABC):
|
|||||||
return original_user_description
|
return original_user_description
|
||||||
|
|
||||||
def _possible_headers(self):
|
def _possible_headers(self):
|
||||||
return ("## user description", "## pr type", "## pr description", "## pr labels", "## type", "## description",
|
return ("## **user description**", "## **pr type**", "## **pr description**", "## **pr labels**", "## **type**", "## **description**",
|
||||||
"## labels", "### 🤖 generated by pr agent")
|
"## **labels**", "### 🤖 generated by pr agent")
|
||||||
|
|
||||||
def _is_generated_by_pr_agent(self, description_lowercase: str) -> bool:
|
def _is_generated_by_pr_agent(self, description_lowercase: str) -> bool:
|
||||||
possible_headers = self._possible_headers()
|
possible_headers = self._possible_headers()
|
||||||
|
@ -46,7 +46,7 @@ enable_help_text=true # Determines whether to include help text in the PR review
|
|||||||
[pr_description] # /describe #
|
[pr_description] # /describe #
|
||||||
publish_labels=true
|
publish_labels=true
|
||||||
publish_description_as_comment=false
|
publish_description_as_comment=false
|
||||||
add_original_user_description=false
|
add_original_user_description=true
|
||||||
keep_original_user_title=false
|
keep_original_user_title=false
|
||||||
use_bullet_points=true
|
use_bullet_points=true
|
||||||
extra_instructions = ""
|
extra_instructions = ""
|
||||||
|
@ -289,7 +289,7 @@ class PRDescription:
|
|||||||
if not get_settings().pr_description.enable_pr_type:
|
if not get_settings().pr_description.enable_pr_type:
|
||||||
self.data.pop('type')
|
self.data.pop('type')
|
||||||
for key, value in self.data.items():
|
for key, value in self.data.items():
|
||||||
markdown_text += f"## {key}\n\n"
|
markdown_text += f"## **{key}**\n\n"
|
||||||
markdown_text += f"{value}\n\n"
|
markdown_text += f"{value}\n\n"
|
||||||
|
|
||||||
# Remove the 'PR Title' key from the dictionary
|
# Remove the 'PR Title' key from the dictionary
|
||||||
@ -310,7 +310,7 @@ class PRDescription:
|
|||||||
key_publish = "Changes walkthrough"
|
key_publish = "Changes walkthrough"
|
||||||
else:
|
else:
|
||||||
key_publish = key.rstrip(':').replace("_", " ").capitalize()
|
key_publish = key.rstrip(':').replace("_", " ").capitalize()
|
||||||
pr_body += f"## {key_publish}\n"
|
pr_body += f"## **{key_publish}**\n"
|
||||||
if 'walkthrough' in key.lower():
|
if 'walkthrough' in key.lower():
|
||||||
if self.git_provider.is_supported("gfm_markdown"):
|
if self.git_provider.is_supported("gfm_markdown"):
|
||||||
pr_body += "<details> <summary>files:</summary>\n\n"
|
pr_body += "<details> <summary>files:</summary>\n\n"
|
||||||
|
Reference in New Issue
Block a user