Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pr_agent/git_providers/codecommit_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from ..log import get_logger
from .git_provider import GitProvider

_CODECOMMIT_HOSTNAME_PATTERN = re.compile(r"^[a-z]{2}-(gov-)?[a-z]+-\d\.console\.aws\.amazon\.com$")


class PullRequestCCMimic:
"""
Expand Down Expand Up @@ -359,7 +361,7 @@ def _is_valid_codecommit_hostname(hostname: str) -> bool:
Returns:
- bool: True if the hostname is valid, False otherwise.
"""
return re.match(r"^[a-z]{2}-(gov-)?[a-z]+-\d\.console\.aws\.amazon\.com$", hostname) is not None
return _CODECOMMIT_HOSTNAME_PATTERN.match(hostname) is not None

def _get_pr(self):
response = self.codecommit_client.get_pr(self.repo_name, self.pr_num)
Expand Down