From 4b4fda37a61569fffa0b92051186e9937461cf0c Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 13 Jul 2023 18:04:28 +0300 Subject: [PATCH] publish_description as abstract method --- pr_agent/git_providers/git_provider.py | 4 ++++ pr_agent/git_providers/gitlab_provider.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/pr_agent/git_providers/git_provider.py b/pr_agent/git_providers/git_provider.py index a30df90b..e86f461d 100644 --- a/pr_agent/git_providers/git_provider.py +++ b/pr_agent/git_providers/git_provider.py @@ -16,6 +16,10 @@ class GitProvider(ABC): def get_diff_files(self) -> list[FilePatchInfo]: pass + @abstractmethod + def publish_description(self, pr_title: str, pr_body: str): + pass + @abstractmethod def publish_comment(self, pr_comment: str, is_temporary: bool = False): pass diff --git a/pr_agent/git_providers/gitlab_provider.py b/pr_agent/git_providers/gitlab_provider.py index e9279a82..485e0cf9 100644 --- a/pr_agent/git_providers/gitlab_provider.py +++ b/pr_agent/git_providers/gitlab_provider.py @@ -44,6 +44,10 @@ class GitLabProvider(GitProvider): def get_files(self): return [change['new_path'] for change in self.mr.changes()['changes']] + def publish_description(self, pr_title: str, pr_body: str): + logging.exception("Not implemented yet") + pass + def publish_comment(self, mr_comment: str, is_temporary: bool = False): comment = self.mr.notes.create({'body': mr_comment}) if is_temporary: