-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbase.py
More file actions
37 lines (30 loc) · 983 Bytes
/
base.py
File metadata and controls
37 lines (30 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from abc import ABC, abstractmethod
from typing import Dict
from ..classes import Comment
from .client import ScmClient
class SCM(ABC):
def __init__(self, client: ScmClient):
self.client = client
@abstractmethod
def check_event_type(self) -> str:
"""Determine the type of event (push, pr, comment)"""
pass
@abstractmethod
def add_socket_comments(
self,
security_comment: str,
overview_comment: str,
comments: Dict[str, Comment],
new_security_comment: bool = True,
new_overview_comment: bool = True
) -> None:
"""Add or update comments on PR"""
pass
@abstractmethod
def get_comments_for_pr(self, repo: str, pr: str) -> Dict[str, Comment]:
"""Get existing comments for PR"""
pass
@abstractmethod
def remove_comment_alerts(self, comments: Dict[str, Comment]) -> None:
"""Process and remove alerts from comments"""
pass