From 4f3e6227be46cbdf43c97e454ba747d90821caa0 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 5 Jul 2017 14:52:08 -0700 Subject: [PATCH] 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 --- doc/source/admin/components.rst | 17 +++++++++-------- tests/fixtures/zuul-connections-merger.conf | 2 +- tests/fixtures/zuul-github-driver.conf | 2 +- tests/fixtures/zuul-push-reqs.conf | 2 +- zuul/driver/github/githubreporter.py | 4 ++-- zuul/reporter/__init__.py | 7 +++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/doc/source/admin/components.rst b/doc/source/admin/components.rst index b91e7e7eb2..a24b833a7a 100644 --- a/doc/source/admin/components.rst +++ b/doc/source/admin/components.rst @@ -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 """"""""" diff --git a/tests/fixtures/zuul-connections-merger.conf b/tests/fixtures/zuul-connections-merger.conf index 4499493b06..df465d541d 100644 --- a/tests/fixtures/zuul-connections-merger.conf +++ b/tests/fixtures/zuul-connections-merger.conf @@ -1,7 +1,7 @@ [gearman] server=127.0.0.1 -[zuul] +[webapp] status_url=http://zuul.example.com/status [merger] diff --git a/tests/fixtures/zuul-github-driver.conf b/tests/fixtures/zuul-github-driver.conf index f868997a9d..3d61ab6506 100644 --- a/tests/fixtures/zuul-github-driver.conf +++ b/tests/fixtures/zuul-github-driver.conf @@ -1,7 +1,7 @@ [gearman] server=127.0.0.1 -[zuul] +[webapp] status_url=http://zuul.example.com/status/#{change.number},{change.patchset} [merger] diff --git a/tests/fixtures/zuul-push-reqs.conf b/tests/fixtures/zuul-push-reqs.conf index c5272aae9d..4faac13d96 100644 --- a/tests/fixtures/zuul-push-reqs.conf +++ b/tests/fixtures/zuul-push-reqs.conf @@ -1,7 +1,7 @@ [gearman] server=127.0.0.1 -[zuul] +[webapp] status_url=http://zuul.example.com/status [merger] diff --git a/zuul/driver/github/githubreporter.py b/zuul/driver/github/githubreporter.py index 72087bf7c7..ea41ccd9cb 100644 --- a/zuul/driver/github/githubreporter.py +++ b/zuul/driver/github/githubreporter.py @@ -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 = '' diff --git a/zuul/reporter/__init__.py b/zuul/reporter/__init__.py index 0ac57669c0..95b9208ce7 100644 --- a/zuul/reporter/__init__.py +++ b/zuul/reporter/__init__.py @@ -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)