mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
s
This commit is contained in:
@ -75,18 +75,18 @@ class GitProvider(ABC):
|
|||||||
def get_user_description(self) -> str:
|
def get_user_description(self) -> str:
|
||||||
description = (self.get_pr_description_full() or "").strip()
|
description = (self.get_pr_description_full() or "").strip()
|
||||||
description_lowercase = description.lower()
|
description_lowercase = description.lower()
|
||||||
get_logger().debug(f"Existing description\n{description_lowercase}")
|
get_logger().info(f"Existing description\n{description_lowercase}")
|
||||||
|
|
||||||
# if the existing description wasn't generated by the pr-agent, just return it as-is
|
# if the existing description wasn't generated by the pr-agent, just return it as-is
|
||||||
if not self._is_generated_by_pr_agent(description_lowercase):
|
if not self._is_generated_by_pr_agent(description_lowercase):
|
||||||
get_logger().debug(f"Existing description was not generated by the pr-agent")
|
get_logger().info(f"Existing description was not generated by the pr-agent")
|
||||||
return description
|
return description
|
||||||
|
|
||||||
# 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().debug(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 ""
|
||||||
|
|
||||||
# otherwise, extract the original user description from the existing pr-agent description and return it
|
# otherwise, extract the original user description from the existing pr-agent description and return it
|
||||||
@ -109,7 +109,7 @@ class GitProvider(ABC):
|
|||||||
if original_user_description.lower().startswith(user_description_header):
|
if original_user_description.lower().startswith(user_description_header):
|
||||||
original_user_description = original_user_description[len(user_description_header):].strip()
|
original_user_description = original_user_description[len(user_description_header):].strip()
|
||||||
|
|
||||||
get_logger().debug(f"Extracted user description from existing description\n{original_user_description}")
|
get_logger().info(f"Extracted user description from existing description\n{original_user_description}")
|
||||||
return original_user_description
|
return original_user_description
|
||||||
|
|
||||||
def _possible_headers(self):
|
def _possible_headers(self):
|
||||||
|
@ -22,7 +22,7 @@ class HelpMessage:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def get_review_usage_guide():
|
def get_review_usage_guide():
|
||||||
output ="**Overview:**\n"
|
output ="**Overview:**\n"
|
||||||
output +="The `review` tool scans the PR code changes, and generates a PR review. The tool can be triggered [automatically][automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on any PR.\n"
|
output +="The `review` tool scans the PR code changes, and generates a PR review. The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on any PR.\n"
|
||||||
output +="""\
|
output +="""\
|
||||||
When commenting, to edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L19) related to the review tool (`pr_reviewer` section), use the following template:
|
When commenting, to edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L19) related to the review tool (`pr_reviewer` section), use the following template:
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user