def usernames(self) -> AbstractSet[str]:
"""Return an iterable with all of the contributors' usernames."""
pull_request = self.request['pull_request']
# Start with the author of the pull request.
logins = {pull_request['user']['login']}
# For each commit, get the author and committer.
async for commit in self._gh.getiter(pull_request['commits_url']):
author = commit['author']
# When the author is missing there seems to typically be a
# matching commit that **does** specify the author. (issue #56)
if author is not None:
author_login = author['login']
if commit['commit']['author']['email'].lower() == GITHUB_EMAIL:
self.server.log("Ignoring GitHub-managed username: "
+ author_login)
else:
logins.add(author_login)
committer = commit['committer']
if committer is not None:
committer_login = committer['login']
if commit['commit']['committer']['email'].lower() == GITHUB_EMAIL:
self.server.log("Ignoring GitHub-managed username: "
+ committer_login)
else:
logins.add(committer_login)
return frozenset(logins)
评论列表
文章目录