Skip to content

Commit

Permalink
Add in memory provider
Browse files Browse the repository at this point in the history
  • Loading branch information
okotek committed Aug 31, 2023
1 parent e4e1eb6 commit a81cbaa
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions pr_agent/git_providers/in_memory_provider.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import itertools
from collections import Counter
from typing import List, Optional

from pr_agent.algo.utils import FilePatchInfo
from pr_agent.git_providers.git_provider import GitProvider


class InMemoryProvider(GitProvider):
def __init__(self, head_branch: str, target_branch: str, files: List[FilePatchInfo]):
self.head_branch = head_branch
self.target_branch = target_branch
self.files = files

def is_supported(self, capability: str) -> bool:
pass

def get_files(self) -> list[FilePatchInfo]:
return self.files

def get_diff_files(self) -> list[FilePatchInfo]:
return self.get_files()

def publish_description(self, pr_title: str, pr_body: str):
pass

def publish_comment(self, pr_comment: str, is_temporary: bool = False):
pass

def publish_inline_comment(self, body: str, relevant_file: str, relevant_line_in_file: str):
pass

def create_inline_comment(self, body: str, relevant_file: str, relevant_line_in_file: str):
pass

def publish_inline_comments(self, comments: list[dict]):
pass

def publish_code_suggestions(self, code_suggestions: list) -> bool:
pass

def publish_labels(self, labels):
pass

def get_labels(self):
pass

def remove_initial_comment(self):
pass

def get_languages(self):
language_count = Counter(file.language for file in self.files)
return dict(language_count)

def get_pr_branch(self):
pass

def get_user_id(self):
pass

def get_pr_description_full(self) -> str:
pass

def get_issue_comments(self):
pass

def get_repo_settings(self):
pass

def add_eyes_reaction(self, issue_comment_id: int) -> Optional[int]:
pass

def remove_reaction(self, issue_comment_id: int, reaction_id: int) -> bool:
pass

def get_commit_messages(self):
pass


0 comments on commit a81cbaa

Please sign in to comment.