added github action support

This commit is contained in:
mrT23
2024-02-16 14:49:01 +02:00
parent 40fbd55da4
commit c98e736e3b
10 changed files with 31 additions and 18 deletions

View File

@ -444,7 +444,7 @@ class AzureDevopsProvider(GitProvider):
"Azure DevOps provider does not support issue comments yet"
)
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
return True
def remove_reaction(self, issue_comment_id: int, reaction_id: int) -> bool:

View File

@ -298,7 +298,7 @@ class BitbucketProvider(GitProvider):
"Bitbucket provider does not support issue comments yet"
)
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
return True
def remove_reaction(self, issue_comment_id: int, reaction_id: int) -> bool:

View File

@ -288,7 +288,7 @@ class BitbucketServerProvider(GitProvider):
"Bitbucket provider does not support issue comments yet"
)
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
return True
def remove_reaction(self, issue_comment_id: int, reaction_id: int) -> bool:

View File

@ -297,7 +297,7 @@ class CodeCommitProvider(GitProvider):
settings_filename = ".pr_agent.toml"
return self.codecommit_client.get_file(self.repo_name, settings_filename, self.pr.source_commit, optional=True)
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
get_logger().info("CodeCommit provider does not support eyes reaction yet")
return True

View File

@ -212,7 +212,7 @@ class GerritProvider(GitProvider):
raise NotImplementedError(
'Getting labels is not implemented for the gerrit provider')
def add_eyes_reaction(self, issue_comment_id: int):
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False):
raise NotImplementedError(
'Adding reactions is not implemented for the gerrit provider')

View File

@ -162,7 +162,7 @@ class GitProvider(ABC):
pass
@abstractmethod
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
pass
@abstractmethod

View File

@ -452,7 +452,9 @@ class GithubProvider(GitProvider):
except Exception:
return ""
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
if disable_eyes:
return None
try:
reaction = self.pr.get_issue_comment(issue_comment_id).create_reaction("eyes")
return reaction.id

View File

@ -368,7 +368,7 @@ class GitLabProvider(GitProvider):
except Exception:
return ""
def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
def add_eyes_reaction(self, issue_comment_id: int, disable_eyes: bool = False) -> Optional[int]:
return True
def remove_reaction(self, issue_comment_id: int, reaction_id: int) -> bool: