You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnself.repo.get_collaborator_permission(user) in ["admin", "write"]
315
+
# There is a UnknownObjectException for this scenario, but this method
316
+
# does not use it.
317
+
exceptgithub.GithubExceptionase:
318
+
# 404 means the author was not found in the collaborator list, so we
319
+
# know they don't have push permissions. Anything else is a real API
320
+
# issue, raise it so it is visible.
321
+
ife.status!=404:
322
+
raisee
323
+
returnFalse
324
+
325
+
defrun(self) ->bool:
326
+
# Check this first because it only costs 1 API point.
327
+
ifself.can_merge(self.author):
328
+
return
329
+
330
+
# A review can be approved more than once, only comment the first time.
331
+
forcommentinself.pr.as_issue().get_comments():
332
+
ifself.COMMENT_TAGincomment.body:
333
+
return
334
+
335
+
# This text is using Markdown formatting.
336
+
ifself.can_merge(self.reviewer):
337
+
comment=f"""\
338
+
{self.COMMENT_TAG}
339
+
@{self.reviewer} the PR author does not have permission to merge their own PRs yet. Please merge on their behalf."""
340
+
else:
341
+
comment=f"""\
342
+
{self.COMMENT_TAG}
343
+
@{self.reviewer} the author of this PR does not have permission to merge and neither do you.
344
+
Please find someone who has merge permissions who can merge it on the author's behalf. This could be one of the other reviewers or you can ask on [Discord](https://discord.com/invite/xS7Z362)."""
345
+
346
+
self.pr.as_issue().create_comment(comment)
347
+
returnTrue
348
+
349
+
301
350
defsetup_llvmbot_git(git_dir="."):
302
351
"""
303
352
Configure the git repo in `git_dir` with the llvmbot account so
0 commit comments