Fix cross source dependencies for github
We need to lookup the installation ids by project name and not by
project. Otherwise an exception [1] is thrown which will bubble up to
the run handler and break various hard to debug things.
[1] Trace:
2018-01-24 15:05:46,247 ERROR zuul.GithubConnection: No installation ID available for project codecraft/cilib
2018-01-24 15:05:46,272 ERROR zuul.Scheduler: Exception in run handler:
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/zuul/scheduler.py", line 847, in run
self.process_event_queue()
File "/usr/lib/python3.6/site-packages/zuul/scheduler.py", line 915, in process_event_queue
pipeline.manager.addChange(change)
File "/usr/lib/python3.6/site-packages/zuul/manager/__init__.py", line 331, in addChange
change_queue)
File "/usr/lib/python3.6/site-packages/zuul/manager/dependent.py", line 112, in enqueueChangesBehind
change_queue.projects):
File "/usr/lib/python3.6/site-packages/zuul/driver/github/githubsource.py", line 95, in getChangesDependingOn
return self.connection.getChangesDependingOn(change, projects)
File "/usr/lib/python3.6/site-packages/zuul/driver/github/githubconnection.py", line 745, in getChangesDependingOn
for issue in github.search_issues(query=query):
File "/usr/lib/python3.6/site-packages/github3/structs.py", line 76, in __iter__
json = self._get_json(response)
File "/usr/lib/python3.6/site-packages/github3/structs.py", line 147, in _get_json
json = self._json(response, 200)
File "/usr/lib/python3.6/site-packages/github3/models.py", line 211, in _json
if self._boolean(response, status_code, 404) and response.content:
File "/usr/lib/python3.6/site-packages/github3/models.py", line 233, in _boolean
raise exceptions.error_for(response)
github3.exceptions.AuthenticationFailed: 401 Must authenticate to access this API.
Change-Id: I10aecce44c581c00cb9c6885f90afe66b5527d8d
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py
index b766c6f..7093b55 100644
--- a/zuul/driver/github/githubconnection.py
+++ b/zuul/driver/github/githubconnection.py
@@ -722,10 +722,10 @@
# installation -- change queues aren't likely to span more
# than one installation.
for project in projects:
- installation_id = self.installation_map.get(project)
+ installation_id = self.installation_map.get(project.name)
if installation_id not in installation_ids:
installation_ids.add(installation_id)
- installation_projects.add(project)
+ installation_projects.add(project.name)
else:
# We aren't in the context of a change queue and we just
# need to query all installations. This currently only