Merge "Rename project to project_name in getPullBySha"
This commit is contained in:
commit
8d40ea3b3a
|
@ -1181,19 +1181,18 @@ class GithubConnection(BaseConnection):
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def getPullBySha(self, sha, project, log):
|
def getPullBySha(self, sha, project_name, log):
|
||||||
cached_pr_numbers = self._sha_pr_cache.get(project, sha)
|
cached_pr_numbers = self._sha_pr_cache.get(project_name, sha)
|
||||||
if len(cached_pr_numbers) > 1:
|
if len(cached_pr_numbers) > 1:
|
||||||
raise Exception('Multiple pulls found with head sha %s' % sha)
|
raise Exception('Multiple pulls found with head sha %s' % sha)
|
||||||
if len(cached_pr_numbers) == 1:
|
if len(cached_pr_numbers) == 1:
|
||||||
for pr in cached_pr_numbers:
|
for pr in cached_pr_numbers:
|
||||||
pr_body, pr_obj = self.getPull(project, pr, log)
|
pr_body, pr_obj = self.getPull(project_name, pr, log)
|
||||||
return pr_body
|
return pr_body
|
||||||
|
|
||||||
pulls = []
|
pulls = []
|
||||||
project_name = project
|
github = self.getGithubClient(project_name)
|
||||||
owner, project = project.split('/')
|
owner, project = project_name.split('/')
|
||||||
github = self.getGithubClient("%s/%s" % (owner, project))
|
|
||||||
repo = github.repository(owner, project)
|
repo = github.repository(owner, project)
|
||||||
for pr in repo.pull_requests(state='open'):
|
for pr in repo.pull_requests(state='open'):
|
||||||
pr_dict = pr.as_dict()
|
pr_dict = pr.as_dict()
|
||||||
|
@ -1204,7 +1203,7 @@ class GithubConnection(BaseConnection):
|
||||||
continue
|
continue
|
||||||
pulls.append(pr_dict)
|
pulls.append(pr_dict)
|
||||||
|
|
||||||
log.debug('Got PR on project %s for sha %s', project, sha)
|
log.debug('Got PR on project %s for sha %s', project_name, sha)
|
||||||
self.log_rate_limit(self.log, github)
|
self.log_rate_limit(self.log, github)
|
||||||
if len(pulls) > 1:
|
if len(pulls) > 1:
|
||||||
raise Exception('Multiple pulls found with head sha %s' % sha)
|
raise Exception('Multiple pulls found with head sha %s' % sha)
|
||||||
|
|
Loading…
Reference in New Issue