Merge pull request #4 from hashar/zuul-1.3.0

Zuul 1.3.0
This commit is contained in:
Paul Belanger 2013-10-31 17:40:50 -07:00
commit f4ceb7eba4
7 changed files with 9 additions and 256 deletions

4
debian/changelog vendored
View File

@ -1,5 +1,5 @@
zuul (1.2.0-1) UNRELEASED; urgency=low
zuul (1.3.0-1) UNRELEASED; urgency=low
* Initial release (Closes: #705844)
-- Paul Belanger <paul.belanger@polybeacon.com> Tue, 14 May 2013 19:27:22 -0400
-- Paul Belanger <paul.belanger@polybeacon.com> Thu, 31 Oct 2013 16:57:26 +0000

1
debian/control vendored
View File

@ -3,6 +3,7 @@ Maintainer: Paul Belanger <paul.belanger@polybeacon.com>
Section: python
Priority: optional
Build-Depends: debhelper (>= 8.0.0),
openstack-pkg-tools,
python (>= 2.6)
Build-Depends-Indep:
python-extras,

View File

@ -1,29 +0,0 @@
From 46b55c5a7461936fe332a016f45217b8ea134341 Mon Sep 17 00:00:00 2001
From: Paul Belanger <paul.belanger@polybeacon.com>
Date: Wed, 27 Mar 2013 10:52:29 -0400
Subject: [PATCH] Fix import error for zuul version with docs
When using sphinx-build to generate documentation, it would fail to
properly find our version information.
Change-Id: Iee14aa76b69ca9398688345cb2dcd0db9ecdaedc
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
---
doc/source/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index f357e29..2e05cc2 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -16,7 +16,7 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration -----------------------------------------------------
--
1.7.9.5

View File

@ -1,180 +0,0 @@
From b67aba1d94ee95399ed09bd287be16fbf558d8dc Mon Sep 17 00:00:00 2001
From: Paul Belanger <paul.belanger@polybeacon.com>
Date: Mon, 13 May 2013 19:22:14 -0400
Subject: [PATCH] Add the ability to set git user.email and user.name
It is possible the host system does not have git properly configured,
which results in merge failures because the git client is complain. For
example:
GitCommandError: 'git merge FETCH_HEAD' returned exit status 128:
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
Now we can pass user.name and user.email settings to git, if configured
to do so.
Change-Id: I896194d8d1f5334026954b02f3a1a8dd82bed2ac
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/29015
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
---
doc/source/zuul.rst | 8 ++++++++
etc/zuul.conf-sample | 2 ++
tests/fixtures/zuul.conf | 2 ++
tests/test_scheduler.py | 4 ++++
zuul/merger.py | 15 ++++++++++++---
zuul/scheduler.py | 12 +++++++++++-
6 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/doc/source/zuul.rst b/doc/source/zuul.rst
index 96faf86..2899fdd 100644
--- a/doc/source/zuul.rst
+++ b/doc/source/zuul.rst
@@ -94,6 +94,14 @@ zuul
Directory that Zuul should clone local git repositories to.
``git_dir=/var/lib/zuul/git``
+**git_user_email**
+ Optional: Value to pass to `git config user.email`.
+ ``git_user_email=zuul@example.com``
+
+**git_user_name**
+ Optional: Value to pass to `git config user.name`.
+ ``git_user_name=zuul``
+
**push_change_refs**
Boolean value (``true`` or ``false``) that determines if Zuul should
push change refs to the git origin server for the git repositories in
diff --git a/etc/zuul.conf-sample b/etc/zuul.conf-sample
index 75d1ca5..47e1d7e 100644
--- a/etc/zuul.conf-sample
+++ b/etc/zuul.conf-sample
@@ -15,4 +15,6 @@ log_config=/etc/zuul/logging.conf
pidfile=/var/run/zuul/zuul.pid
state_dir=/var/lib/zuul
git_dir=/var/lib/zuul/git
+;git_user_email=zuul@example.com
+;git_user_name=zuul
status_url=https://jenkins.example.com/zuul/status
diff --git a/tests/fixtures/zuul.conf b/tests/fixtures/zuul.conf
index c031ae3..3054c23 100644
--- a/tests/fixtures/zuul.conf
+++ b/tests/fixtures/zuul.conf
@@ -11,5 +11,7 @@ sshkey=none
[zuul]
layout_config=layout.yaml
git_dir=/tmp/zuul-test/git
+git_user_email=zuul@example.com
+git_user_name=zuul
push_change_refs=true
url_pattern=http://logs.example.com/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index 508af42..2d5fff3 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -74,6 +74,10 @@ def init_repo(project):
path = os.path.join(UPSTREAM_ROOT, project)
repo = git.Repo.init(path)
+ repo.config_writer().set_value('user', 'email', 'user@example.com')
+ repo.config_writer().set_value('user', 'name', 'User Name')
+ repo.config_writer().write()
+
fn = os.path.join(path, 'README')
f = open(fn, 'w')
f.write("test\n")
diff --git a/zuul/merger.py b/zuul/merger.py
index 7ad7eed..aaffa43 100644
--- a/zuul/merger.py
+++ b/zuul/merger.py
@@ -26,11 +26,16 @@ class ZuulReference(git.Reference):
class Repo(object):
log = logging.getLogger("zuul.Repo")
- def __init__(self, remote, local):
+ def __init__(self, remote, local, email, username):
self.remote_url = remote
self.local_path = local
self._ensure_cloned()
self.repo = git.Repo(self.local_path)
+ if email:
+ self.repo.config_writer().set_value('user', 'email', email)
+ if username:
+ self.repo.config_writer().set_value('user', 'name', username)
+ self.repo.config_writer().write()
def _ensure_cloned(self):
if not os.path.exists(self.local_path):
@@ -117,7 +122,8 @@ class Repo(object):
class Merger(object):
log = logging.getLogger("zuul.Merger")
- def __init__(self, trigger, working_root, push_refs, sshkey):
+ def __init__(self, trigger, working_root, push_refs, sshkey, email,
+ username):
self.trigger = trigger
self.repos = {}
self.working_root = working_root
@@ -126,6 +132,8 @@ class Merger(object):
self.push_refs = push_refs
if sshkey:
self._makeSSHWrapper(sshkey)
+ self.email = email
+ self.username = username
def _makeSSHWrapper(self, key):
name = os.path.join(self.working_root, '.ssh_wrapper')
@@ -139,7 +147,8 @@ class Merger(object):
def addProject(self, project, url):
try:
path = os.path.join(self.working_root, project.name)
- repo = Repo(url, path)
+ repo = Repo(url, path, self.email, self.username)
+
self.repos[project] = repo
except:
self.log.exception("Unable to initialize repo for %s" % project)
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 8ff5a27..cf862e3 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -246,6 +246,16 @@ class Scheduler(threading.Thread):
else:
merge_root = '/var/lib/zuul/git'
+ if self.config.has_option('zuul', 'git_user_email'):
+ merge_email = self.config.get('zuul', 'git_user_email')
+ else:
+ merge_email = None
+
+ if self.config.has_option('zuul', 'git_user_name'):
+ merge_name = self.config.get('zuul', 'git_user_name')
+ else:
+ merge_name = None
+
if self.config.has_option('zuul', 'push_change_refs'):
push_refs = self.config.getboolean('zuul', 'push_change_refs')
else:
@@ -257,7 +267,7 @@ class Scheduler(threading.Thread):
sshkey = None
self.merger = merger.Merger(self.trigger, merge_root, push_refs,
- sshkey)
+ sshkey, merge_email, merge_name)
for project in self.projects.values():
url = self.trigger.getGitUrl(project)
self.merger.addProject(project, url)
--
1.7.9.5

View File

@ -1,39 +0,0 @@
From d5dcfd7d202ff384232bef0b097367f36728102d Mon Sep 17 00:00:00 2001
From: Antoine Musso <hashar@free.fr>
Date: Wed, 15 May 2013 22:13:17 +0200
Subject: [PATCH] doc: rename manpage from `zuul` to `zuul-server`
On Debian, all binaries should have an associated manpage. While
building Zuul package we got the following lintian error:
W: zuul: binary-without-manpage usr/bin/zuul-server
This is easily fixed by making sphinx to name the man page zuul-server.
Change-Id: Ie9fa681654a8e7e8785c1dcfa5ec21ba27ae3049
Reviewed-on: https://review.openstack.org/29287
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
---
doc/source/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 2e05cc2..6943bd4 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -216,7 +216,7 @@ latex_documents = [
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'zuul', u'Zuul Documentation',
+ ('index', 'zuul-server', u'Zuul Documentation',
[u'OpenStack'], 1)
]
--
1.8.2.3

View File

@ -1,3 +0,0 @@
0001-Fix-import-error-for-zuul-version-with-docs.patch
0002-Add-the-ability-to-set-git-user.email-and-user.name.patch
0003-doc-rename-manpage-from-zuul-to-zuul-server.patch

9
debian/rules vendored
View File

@ -3,6 +3,12 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
UPSTREAM_GIT = git://github.com/openstack-infra/zuul.git
include /usr/share/openstack-pkg-tools/pkgos.make
export OSLO_PACKAGE_VERSION=$(VERSION)
%:
dh $@ --with python2,sphinxdoc
@ -24,6 +30,3 @@ override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
nosetests
endif
get-orig-source:
uscan --noconf --force-download --rename --repack --destdir=.