Move status_url to webapp config section

This is the last entry standing in the 'zuul' section, it seems
like it may be more appropriate here.

Change-Id: I48d2c4d69025a93a61c4d4fc64574545e3215e2c
This commit is contained in:
James E. Blair 2017-07-05 14:52:08 -07:00
parent a8387ec78b
commit 4f3e6227be
6 changed files with 17 additions and 17 deletions

View File

@ -54,18 +54,14 @@ Client connection information for gearman.
zookeeper
"""""""""
.. NOTE: this is a white lie at this point, since only the scheduler
uses this, however, we expect other components to use it later, so
it's reasonable for admins to plan for this now.
**hosts**
A list of zookeeper hosts for Zuul to use when communicating with
Nodepool. ``hosts=zk1.example.com,zk2.example.com,zk3.example.com``
zuul
""""
**status_url**
URL that will be posted in Zuul comments made to changes when
starting jobs for a change. Used by zuul-scheduler only.
``status_url=https://zuul.example.com/status``
Scheduler
---------
@ -126,6 +122,11 @@ webapp
optional value and ``1`` is used by default.
``status_expiry=1``
**status_url**
URL that will be posted in Zuul comments made to changes when
starting jobs for a change. Used by zuul-scheduler only.
``status_url=https://zuul.example.com/status``
scheduler
"""""""""

View File

@ -1,7 +1,7 @@
[gearman]
server=127.0.0.1
[zuul]
[webapp]
status_url=http://zuul.example.com/status
[merger]

View File

@ -1,7 +1,7 @@
[gearman]
server=127.0.0.1
[zuul]
[webapp]
status_url=http://zuul.example.com/status/#{change.number},{change.patchset}
[merger]

View File

@ -1,7 +1,7 @@
[gearman]
server=127.0.0.1
[zuul]
[webapp]
status_url=http://zuul.example.com/status
[merger]

View File

@ -85,8 +85,8 @@ class GithubReporter(BaseReporter):
url_pattern = self.config.get('status-url')
if not url_pattern:
sched_config = self.connection.sched.config
if sched_config.has_option('zuul', 'status_url'):
url_pattern = sched_config.get('zuul', 'status_url')
if sched_config.has_option('webapp', 'status_url'):
url_pattern = sched_config.get('webapp', 'status_url')
url = item.formatUrlPattern(url_pattern) if url_pattern else ''
description = ''

View File

@ -14,6 +14,7 @@
import abc
import logging
from zuul.lib.config import get_default
class BaseReporter(object, metaclass=abc.ABCMeta):
@ -69,10 +70,8 @@ class BaseReporter(object, metaclass=abc.ABCMeta):
return ret
def _formatItemReportStart(self, item, with_jobs=True):
status_url = ''
if self.connection.sched.config.has_option('zuul', 'status_url'):
status_url = self.connection.sched.config.get('zuul',
'status_url')
status_url = get_default(self.connection.sched.config,
'webapp', 'status_url', '')
return item.pipeline.start_message.format(pipeline=item.pipeline,
status_url=status_url)