add get_pr_id() to CodeCommitProvider

This commit is contained in:
Phill Zarfos
2023-09-23 08:08:46 -04:00
parent fda47bb5cf
commit a7fb5d98b1
2 changed files with 13 additions and 1 deletions

View File

@ -235,6 +235,18 @@ class CodeCommitProvider(GitProvider):
def get_title(self):
return self.pr.get("title", "")
def get_pr_id(self):
"""
Returns the PR ID in the format: "repo_name/pr_number".
Note: This is an internal identifier for PR-Agent,
and is not the same as the CodeCommit PR identifier.
"""
try:
pr_id = f"{self.repo_name}/{self.pr_num}"
return pr_id
except:
return ""
def get_languages(self):
"""
Returns a dictionary of languages, containing the percentage of each language used in the PR.

View File

@ -67,7 +67,7 @@ class PRDescription:
try:
logging.info(f"Generating a PR description {self.pr_id}")
if get_settings().config.publish_output:
self.git_provider.publish_comment("Preparing pr description...", is_temporary=True)
self.git_provider.publish_comment("Preparing PR description...", is_temporary=True)
await retry_with_fallback_models(self._prepare_prediction)