Merge "Add the project to GithubUser" into feature/zuulv3

This commit is contained in:
Zuul 2018-01-08 21:39:48 +00:00 committed by Gerrit Code Review
commit e6de18790c
1 changed files with 5 additions and 3 deletions

View File

@ -341,7 +341,9 @@ class GithubEventConnector(threading.Thread):
def _get_sender(self, body):
login = body.get('sender').get('login')
if login:
return self.connection.getUser(login)
# TODO(tobiash): it might be better to plumb in the installation id
project = body.get('repository', {}).get('full_name')
return self.connection.getUser(login, project=project)
def run(self):
while True:
@ -981,8 +983,8 @@ class GithubConnection(BaseConnection):
log_rate_limit(self.log, github)
return reviews
def getUser(self, login):
return GithubUser(self.getGithubClient(), login)
def getUser(self, login, project=None):
return GithubUser(self.getGithubClient(project), login)
def getUserUri(self, login):
return 'https://%s/%s' % (self.server, login)