Prime github app install map on connection load

When scheduler comes online it will query every repo it knows about for
the branches of the repo. On GitHub this is done via the API. At this
point there wasn't a mapping of installation IDs to project names, so
the regular API was used as opposed to the app specific API, and that
chewed into the API limits rather quickly.

This change will preemptively query for every install known to the app,
and then every repo said install has access to, in order to build up the
map of installation IDs for the projects. It has a side effect of
priming the cache for app tokens as well. With this change when Zuul
asks for the branches of the projects it's far more likely that the
installation_id will be found within the cache.

Change-Id: I2173c089d816fa376ac9ca54addd3529d03e11d1
Signed-off-by: Jesse Keating <omgjlk@us.ibm.com>
1 file changed