fix publish description for bitbucket

This commit is contained in:
sarbjitgrewal
2023-09-06 09:26:23 +05:30
parent 704c169181
commit 335877c4a7
2 changed files with 16 additions and 7 deletions

View File

@ -68,7 +68,7 @@ class PRDescription:
await retry_with_fallback_models(self._prepare_prediction)
logging.info('Preparing answer...')
pr_title, pr_body, pr_types, markdown_text = self._prepare_pr_answer()
pr_title, pr_body, pr_types, markdown_text, description = self._prepare_pr_answer()
if get_settings().config.publish_output:
logging.info('Pushing answer...')
@ -77,6 +77,7 @@ class PRDescription:
else:
# bitbucket does not support publishing PR labels yet
if get_settings().config.git_provider == 'bitbucket':
self.git_provider.publish_description(pr_title, description)
return
else:
self.git_provider.publish_description(pr_title, pr_body)
@ -147,6 +148,7 @@ class PRDescription:
- pr_body: a string containing the PR body in a markdown format.
- pr_types: a list of strings containing the PR types.
- markdown_text: a string containing the AI prediction data in a markdown format. used for publishing a comment
- user_description: a string containing the user description
"""
# Load the AI prediction data into a dictionary
data = load_yaml(self.prediction.strip())
@ -193,8 +195,9 @@ class PRDescription:
pr_body += "\n___\n"
markdown_text = f"## Title\n\n{title}\n\n___\n{pr_body}"
description = data['PR Description']
if get_settings().config.verbosity_level >= 2:
logging.info(f"title:\n{title}\n{pr_body}")
return title, pr_body, pr_types, markdown_text
return title, pr_body, pr_types, markdown_text, description