feat: Update user description extraction and placement in PR description

This commit is contained in:
mrT23
2024-01-04 17:46:24 +02:00
parent 1bba0162f8
commit c3b5aaf8cc
2 changed files with 13 additions and 4 deletions

View File

@ -81,8 +81,13 @@ class GitProvider(ABC):
# return nothing (empty string) because it means there is no user description
if "## User Description:" not in description:
return ""
# otherwise, extract the original user description from the existing pr-agent description and return it
return description.split("## User Description:", 1)[1].strip()
# # otherwise, extract the original user description from the existing pr-agent description and return it
# return description.split("## User Description:", 1)[1].strip()
# the 'user description' is in the beginning. extract it
return description.split("\n\n___", 1)[0].strip()
@abstractmethod
def get_repo_settings(self):