@@ -30,6 +30,9 @@ Commands:
3030 create-review-comment-line <pr_id> <commit_id> <body> <path> <side> <line>
3131 create-review-comment-multiline <pr_id> <commit_id> <body> <path> <side> <start_side> <start_line> <end_line>
3232 update-review-comment <pr_id> <comment_id> <body>
33+ get-review-comment-reactions <pr_id> <comment_id> [--cursor <n>] [--per-page <n>]
34+ create-review-comment-reaction <pr_id> <comment_id> <reaction>
35+ delete-review-comment-reaction <pr_id> <comment_id> <reaction_id>
3336 collapse-pull-request-comment <pr_id> <thread_id> <comment_node_id> [--reason OUTDATED]
3437 update-and-collapse-pull-request-comment <pr_id> <thread_id> <comment_id> <comment_node_id> <body>
3538 [--reason OUTDATED]
@@ -95,8 +98,10 @@ from scm.types import (
9598 CreatePullRequestCommentProtocol ,
9699 CreateReviewCommentLineProtocol ,
97100 CreateReviewCommentMultilineProtocol ,
101+ CreateReviewCommentReactionProtocol ,
98102 DeleteBranchProtocol ,
99103 DeleteCommitAction ,
104+ DeleteReviewCommentReactionProtocol ,
100105 DownloadArchiveProtocol ,
101106 DownloadWorkflowJobLogProtocol ,
102107 GetAppInstallationProtocol ,
@@ -129,6 +134,7 @@ from scm.types import (
129134 GetRepositoryProtocol ,
130135 GetRepositoryTopicsProtocol ,
131136 GetRepositoryUserPermissionProtocol ,
137+ GetReviewCommentReactionsProtocol ,
132138 GetReviewCommentsProtocol ,
133139 ListCheckRunsForRefProtocol ,
134140 ListCheckRunsInCheckSuiteProtocol ,
@@ -157,6 +163,7 @@ BUILD_CONCLUSION_CHOICES = [
157163 "action_required" ,
158164 "unknown" ,
159165]
166+ REACTION_CHOICES = ["+1" , "-1" , "laugh" , "confused" , "heart" , "hooray" , "rocket" , "eyes" ]
160167
161168
162169def build_check_run_output (args : argparse .Namespace ) -> CheckRunOutput | None :
@@ -300,6 +307,22 @@ def main() -> None:
300307 p .add_argument ("comment_id" )
301308 p .add_argument ("body" )
302309
310+ p = sub .add_parser ("get-review-comment-reactions" )
311+ p .add_argument ("pr_id" )
312+ p .add_argument ("comment_id" )
313+ p .add_argument ("--cursor" , type = int , default = None )
314+ p .add_argument ("--per-page" , type = int , default = None )
315+
316+ p = sub .add_parser ("create-review-comment-reaction" )
317+ p .add_argument ("pr_id" )
318+ p .add_argument ("comment_id" )
319+ p .add_argument ("reaction" , choices = REACTION_CHOICES )
320+
321+ p = sub .add_parser ("delete-review-comment-reaction" )
322+ p .add_argument ("pr_id" )
323+ p .add_argument ("comment_id" )
324+ p .add_argument ("reaction_id" )
325+
303326 p = sub .add_parser ("collapse-pull-request-comment" )
304327 p .add_argument ("pr_id" )
305328 p .add_argument ("thread_id" , help = "review thread id (e.g. PRRT_...)" )
@@ -551,6 +574,23 @@ def main() -> None:
551574 assert isinstance (scm , UpdateReviewCommentProtocol )
552575 dump (scm .update_review_comment (args .pr_id , args .comment_id , args .body ))
553576
577+ elif args .command == "get-review-comment-reactions" :
578+ assert isinstance (scm , GetReviewCommentReactionsProtocol )
579+ pagination = {}
580+ if args .cursor is not None :
581+ pagination ["cursor" ] = args .cursor
582+ if args .per_page is not None :
583+ pagination ["per_page" ] = args .per_page
584+ dump (scm .get_review_comment_reactions (args .pr_id , args .comment_id , pagination = pagination or None ))
585+
586+ elif args .command == "create-review-comment-reaction" :
587+ assert isinstance (scm , CreateReviewCommentReactionProtocol )
588+ dump (scm .create_review_comment_reaction (args .pr_id , args .comment_id , args .reaction ))
589+
590+ elif args .command == "delete-review-comment-reaction" :
591+ assert isinstance (scm , DeleteReviewCommentReactionProtocol )
592+ scm .delete_review_comment_reaction (args .pr_id , args .comment_id , args .reaction_id )
593+
554594 elif args .command == "collapse-pull-request-comment" :
555595 assert isinstance (scm , CollapsePullRequestCommentProtocol )
556596 scm .collapse_pull_request_comment (args .pr_id , args .thread_id , args .comment_node_id , args .reason )
0 commit comments