MCPcopy
hub / github.com/PyGithub/PyGithub / create_review

Method create_review

github/PullRequest.py:544–567  ·  view source on GitHub ↗

:calls: `POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews `_

(
        self,
        commit: Opt[github.Commit.Commit] = NotSet,
        body: Opt[str] = NotSet,
        event: Opt[str] = NotSet,
        comments: Opt[list[ReviewComment]] = NotSet,
    )

Source from the content-addressed store, hash-verified

542 return github.IssueComment.IssueComment(self._requester, headers, data, completed=True)
543
544 def create_review(
545 self,
546 commit: Opt[github.Commit.Commit] = NotSet,
547 body: Opt[str] = NotSet,
548 event: Opt[str] = NotSet,
549 comments: Opt[list[ReviewComment]] = NotSet,
550 ) -> PullRequestReview:
551 """
552 :calls: `POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews <https://docs.github.com/en/free-pro-team@latest/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request>`_
553 """
554 assert is_optional(commit, github.Commit.Commit), commit
555 assert is_optional(body, str), body
556 assert is_optional(event, str), event
557 assert is_optional_list(comments, dict), comments
558 post_parameters: dict[str, Any] = NotSet.remove_unset_items(
559 {
560 "body": body,
561 "event": event,
562 "commit_id": commit.sha if is_defined(commit) else NotSet,
563 "comments": comments if is_defined(comments) else [],
564 }
565 )
566 headers, data = self._requester.requestJsonAndCheck("POST", f"{self.url}/reviews", input=post_parameters)
567 return github.PullRequestReview.PullRequestReview(self._requester, headers, data)
568
569 def create_review_request(
570 self,

Callers 2

setUpMethod · 0.80

Calls 5

is_optionalFunction · 0.90
is_optional_listFunction · 0.90
is_definedFunction · 0.90
remove_unset_itemsMethod · 0.80
requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected