zuul/zuul
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
..
ansible dont wait infinitely for the connection to zuul_console server 2018-05-11 15:42:08 +02:00
cmd Move SQL web handler to driver 2018-05-31 09:08:53 -07:00
connection Add /info and /{tenant}/info route to zuul-web 2018-02-19 09:31:13 -06:00
driver Move SQL web handler to driver 2018-05-31 09:08:53 -07:00
execution_context Add wrapper driver execution context 2017-08-18 16:35:12 -07:00
executor Inventory groups should be under children key 2018-04-30 12:59:13 -07:00
lib Merge "mqtt: add basic reporter" 2018-05-31 15:13:41 +00:00
manager Merge "Fix layout generation for trusted projects" 2018-05-02 16:15:12 +00:00
merger Don't try to delete non-existing local refs 2018-04-24 19:38:54 +02:00
reporter Move status_url from webapp to web section 2018-01-29 14:16:28 +01:00
source Support cross-source dependencies 2018-01-16 09:37:40 -08:00
sphinx Add zuul-sphinx as a requirement 2017-08-07 14:56:17 -07:00
trigger Remove use of six library 2017-06-19 10:34:57 -05:00
web Move SQL web handler to driver 2018-05-31 09:08:53 -07:00
__init__.py Initial commit. 2012-05-29 14:49:32 -07:00
_setup_hook.py Use yarn and webpack to manage zuul-web javascript 2018-03-04 07:20:40 -06:00
change_matcher.py Fix implied branch matchers and tags 2017-12-01 15:54:24 -08:00
configloader.py Don't validate references for excluded config items 2018-05-03 09:58:02 +02:00
exceptions.py mqtt: add basic reporter 2018-05-02 07:20:46 +00:00
model.py Fix regex project templates 2018-05-01 16:24:58 -07:00
nodepool.py zuul autohold: allow operator to specify nodes TTL 2018-03-26 10:32:18 +02:00
rpcclient.py zuul autohold: allow operator to specify nodes TTL 2018-03-26 10:32:18 +02:00
rpclistener.py Don't count non-live queue items in tenant list 2018-04-13 19:47:45 +02:00
scheduler.py Merge "reporter: do not expect branch attribute in Tag object" 2018-05-02 14:16:00 +00:00
version.py Report git sha in status page version 2018-04-27 10:21:43 -07:00
zk.py Better exception handling during autohold 2017-10-13 11:26:45 -04:00