summaryrefslogtreecommitdiff
path: root/kodereviewer/network_manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/network_manager.py')
-rw-r--r--kodereviewer/network_manager.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/kodereviewer/network_manager.py b/kodereviewer/network_manager.py
index 3296153..089e69e 100644
--- a/kodereviewer/network_manager.py
+++ b/kodereviewer/network_manager.py
@@ -18,6 +18,7 @@ PULL_REQUEST_LIST_URL = re.compile(r'/pulls$')
COMMENT_LIST_URL = re.compile(r'/issues/(\d+)/comments')
FILE_LIST_URL = re.compile(r'/pulls/(\d+)/files')
CREATE_REVIEW_URL = re.compile(r'/pulls/(\d+)/reviews')
+REVIEW_COMMENTS_URL = re.compile(r'/pulls/(\d+)/comments')
logger = logging.getLogger(__name__)
@@ -90,6 +91,11 @@ class NetworkManager(QObject):
pull_request.load_files(response_body)
elif (match := CREATE_REVIEW_URL.search(reply.url().toString())):
logger.info(f'Got review reply: {response_body}')
+ elif (match := REVIEW_COMMENTS_URL.search(reply.url().toString())):
+ pull_request_number = int(match.groups()[0])
+ pull_request: Optional[PullRequest] = self._project.find_pull_request(pull_request_number)
+ if pull_request is not None:
+ pull_request.load_reviews(response_body)
else:
logger.info(f"Can't handle {reply.url()}")
@@ -111,6 +117,14 @@ class NetworkManager(QObject):
)
)
+ @Slot(int)
+ def getPullRequestReviews(self, pull_request_number: int) -> None:
+ self._manager.get(
+ self._request_factory.createRequest(
+ f'/pulls/{pull_request_number}/comments'
+ )
+ )
+
@Slot(int, str, str, str)
def createReview(
self, pull_request_number: str, commit_id: str,