zuul/zuul/driver
James E. Blair 46e48d7b97 Move SQL web handler to driver
The only rest API endpoint that uses sql queries is
/api/tenant/{tenant}/builds.  There's no connection in there, which
means it doesn't make sense for that to be attached to a sql connection
(which is currently the case).  Moreover, it doesn't make sense for
*every* tenant's endpoint to be attached to the *same* connection.

In other words, the current situation only allows for a single sql
connection system-wide, even if someone is using different connections
per tenant.

Moving the handler for the endpoint into the sql driver means that it
can dispatch the query to the appropriate connection for a given tenant
(since a tenant is always implied by the REST endpoint).

Moreover, the *rest* of the system actually allows multiple connections
within a single tenant, and we should support that here, but I don't
immediately have a solution of how to handle pagination across queries
that span multiple connections.  This is an improvement in that it is
now tenant-scoped, but it's not ideal.

This also removes the (undocumented!) sql_connection_name config file
option.

It also uses the tenant name from the path to constructe the query so
that it always includes the correct tenant (this eliminates the
inadvertant ability for one tenant to query another tenant's builds).

The internal API here isn't great, but it will get cleaned up in the
next patch which converts to cherrypy.

Change-Id: Ie1f19f0b392d4c010ef43dc6220ff1c8667f5a4a
2018-05-31 09:08:53 -07:00
..
bubblewrap Add standard ca certificate paths 2018-03-16 16:34:18 +01:00
gerrit gerrit: recognize project-created event 2018-04-11 06:11:30 +00:00
git Support autoholding nodes for specific changes/refs 2018-02-08 19:26:08 +01:00
github github: Do not process comment events for regular issues 2018-05-21 15:48:10 -07:00
mqtt mqtt: add basic reporter 2018-05-02 07:20:46 +00:00
nullwrap Write secrets to tmpfs 2017-08-19 08:08:19 -07:00
smtp Fix for pep8 E722 and ignore E741 2017-10-23 10:50:32 -07:00
sql Move SQL web handler to driver 2018-05-31 09:08:53 -07:00
timer Optionally limit github to protected branches 2017-08-03 11:50:26 +02:00
zuul Support cross-source dependencies 2018-01-16 09:37:40 -08:00
__init__.py Write secrets to tmpfs 2017-08-19 08:08:19 -07:00
util.py Add driver-specific pipeline requirements 2017-05-19 13:24:00 -07:00