zuul/zuul
Monty Taylor f93c2fb5f1
Make Info.endpoint a config override
The endpoint field in the info payload is intended to help the
javascript web code find out where the API endpoint is, and to allow
people who are deploying html/js as static assets to an external web
server drop a json file in that deployment to tell it where their
zuul-web server is.

The only scenario where the endpoint information as served by the /info
or /{tenant}/info endpoints of zuul-web is useful is
same-host/single-apache deployments that are hosted on a sub-url ... and
unfortunately, it's not possible for the aiohttp code to be aware of
such suburl deployments from http headers. request.url has the actual
location (such as http://localhost:8080/info) and X-Forwarded-Host will
only contain the host, not the path.

The actual important aspects of the payload are:

* A payload always be able to be found no matter the deployment
  scenario.
* That a deployer can communicate to the javascript code the root of the
  REST API in the scenarios where relative paths will resolve to the
  incorrect thing.

With that in mind, change the Info.endpoint field returned by zuul-web
to default to None (or actually json null), or to a value provided by
the deployer in the zuul.conf file similar to websocket_url.

This way the web app can view 'null' as meaning "I'm deployed in such a
manner that relative paths are the correct thing to fetch from" and a value
as "the deployer has told me explicitly where to fetch from, I will join
my relative paths to the value first."

Because it is a value that is provided by the deployer if it is to
exist, rename it to "rest_api_url" to better match websocket_url and
stats_url.

Change-Id: I6b85a93db6c70c997bbff1329373fbfc2d1007c6
2018-03-02 18:21:45 -05:00
..
ansible Fix broken fail_json in zuul_console 2018-02-12 09:02:46 +01:00
cmd Add /info and /{tenant}/info route to zuul-web 2018-02-19 09:31:13 -06:00
connection Add /info and /{tenant}/info route to zuul-web 2018-02-19 09:31:13 -06:00
driver Add /info and /{tenant}/info route to zuul-web 2018-02-19 09:31:13 -06:00
execution_context Add wrapper driver execution context 2017-08-18 16:35:12 -07:00
executor Merge "Add host/group vars" 2018-02-16 21:27:19 +00:00
lib Merge "Move github webhook from webapp to zuul-web" 2018-02-03 00:16:44 +00:00
manager Add ConfigLoader initializer 2018-02-16 17:40:38 -08:00
merger Merge "Set remote url on every getRepo in merger" 2018-02-15 21:08:06 +00: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 Make Info.endpoint a config override 2018-03-02 18:21:45 -05:00
__init__.py Initial commit. 2012-05-29 14:49:32 -07:00
change_matcher.py Fix implied branch matchers and tags 2017-12-01 15:54:24 -08:00
configloader.py Avoid creating extra project schemas 2018-02-19 13:26:43 -08:00
exceptions.py Support post jobs by supporting rev checkout 2016-07-12 12:51:51 +10:00
model.py Make Info.endpoint a config override 2018-03-02 18:21:45 -05:00
nodepool.py Fix stuck node requests across ZK reconnection 2018-02-06 15:40:28 -08:00
rpcclient.py Support autoholding nodes for specific changes/refs 2018-02-08 19:26:08 +01:00
rpclistener.py Support autoholding nodes for specific changes/refs 2018-02-08 19:26:08 +01:00
scheduler.py Use a status code to detect unknown vs. missing tenant 2018-02-19 16:37:26 -06:00
version.py Migrate to pbr. 2013-06-25 19:04:30 +00:00
zk.py Better exception handling during autohold 2017-10-13 11:26:45 -04:00