@@ -337,18 +337,7 @@ def get_pr_author(self) -> str:
337
337
338
338
def get_pr_comments (self ):
339
339
"""Download the PR review comments using the comfort-fade preview headers"""
340
-
341
- def get_element (
342
- requester : Requester , headers : dict , element : dict , completed : bool
343
- ):
344
- return element
345
-
346
- return PaginatedList (
347
- get_element ,
348
- self .pull_request ._requester ,
349
- self .pull_request .review_comments_url ,
350
- None ,
351
- )
340
+ return self .pull_request .get_review_comments ()
352
341
353
342
def post_lgtm_comment (self , body : str ):
354
343
"""Post a "LGTM" comment if everything's clean, making sure not to spam"""
@@ -359,7 +348,7 @@ def post_lgtm_comment(self, body: str):
359
348
comments = self .get_pr_comments ()
360
349
361
350
for comment in comments :
362
- if comment [ " body" ] == body :
351
+ if comment . body == body :
363
352
print ("Already posted, no need to update" )
364
353
return
365
354
@@ -1240,7 +1229,10 @@ def cull_comments(pull_request: PullRequest, review, max_comments):
1240
1229
"""
1241
1230
1242
1231
unposted_comments = {HashableComment (** c ) for c in review ["comments" ]}
1243
- posted_comments = {HashableComment (** c ) for c in pull_request .get_pr_comments ()}
1232
+ posted_comments = {
1233
+ HashableComment (c .body , c .line or c .original_line , c .path , c .side )
1234
+ for c in pull_request .get_pr_comments ()
1235
+ }
1244
1236
1245
1237
review ["comments" ] = [
1246
1238
c .__dict__ for c in sorted (unposted_comments - posted_comments )
0 commit comments