Pin docutils.

https://bitbucket.org/birkenfeld/sphinx/issue/998/docutils-010-will-break-sphinx-manpage

Change-Id: Ic50912e626b5d4ffcec3dc4eca57b526f4ff0274
Reviewed-on: https://review.openstack.org/18203
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Updated .gitreview location

Change-Id: I840e1d1fb66d22d14deb4e3307962c7b7f85c63a
Reviewed-on: https://review.openstack.org/18194
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Update README for project move.

* README: Correct clone URL.

Change-Id: If7f790d2a9352476fc634eba5784406e6cec43bb
Reviewed-on: https://review.openstack.org/18201
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
filter events by user email

On some setup we might restrict a pipeline to trusted users. The new
email_filter will matches the email coming from the event account
attribute.

In Gerrit, each event hold the account in a different field
name so I have simply added a map to find out the correct field.

email_filter works just like comment_filter, fields are ORed and are
considered to be regex.

Change-Id: I775f67b48d5f162106c024f94fe498a049b3fe94
Reviewed-on: https://review.openstack.org/17609
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
reset on origin/HEAD not master

Some repositories might not have a master branch or could use a
different default HEAD. A git reset was made to remotes/master which
would produce a stacktrace.

Fix https://bugs.launchpad.net/zuul/+bug/1083154

Change-Id: Ie9390c0c5dd707d77fbfa8cff2078a9b31fd31ae
Reviewed-on: https://review.openstack.org/17239
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Add per-job URL patterns.

Add the option to specify the URL pattern left in Gerrit, per-job.

Example: a job that builds documentation and uploads it to a staging
site can leave the URL of the staging site iff the job succeeds.

Change-Id: I34841e61e9116fd8d4de7ac09d8f9cfe36fe78ec
Reviewed-on: https://review.openstack.org/18264
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Add JSON status endpoint.

Can be used for nifty ajax-style status pages.

Add optional description field to pipeline.

Change-Id: If5db3f6945f65f038833cbf9c783de5ffef63b49
Reviewed-on: https://review.openstack.org/18579
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Set change url to gitweb URL.

So that status pages can easily link to gitweb urls of ref-update
triggered changes.

Change-Id: Id9b708a473d92c30727f66578a0174f18c657723
Reviewed-on: https://review.openstack.org/18602
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Add statsd.

Reports statistics on job runtime, number/rate of jobs run, and
number/rate of individual gerrit events to statsd.

Change-Id: I0db9352610b4c268c95da98fd282d7f463945f90
Reviewed-on: https://review.openstack.org/18628
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Output comment and email filters in debugging.

Also, minor optimization to email filter matching.

Change-Id: Iedea0fc14b10a8f68ec52e38ceab4b2fb407e364
Reviewed-on: https://review.openstack.org/18515
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
precision on email_filter

The filtering regexp should not allow greedy matchers (such as .*) but
use non greedy ones (such as .*?).  One want to escape dots as well.

Additionally, whenever one want to add several emails, he should use a
YAML list.

Change-Id: I9deea0893151358ddde9b1ec5a40c322c45d7ff2
Reviewed-on: https://review.openstack.org/18350
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Fix exception calculating run time for lost builds.

When a build is reported as lost, it has no start_time, so the
code that calculated the run-time for statsd threw an exception.

Correct that by only calculating the run time for jobs that have
really completed.

Add debug lines to onBuild* that would have helped diagnose this.

Keep track of the throwaway threads that are used to report LOST
builds so that the test suite can more correctly know when the
system is settled.

Add a test case for a single non-existent post job.

Add STATSD_* env variables in tox to make sure that the statsd
code paths are executed by tests.

Change-Id: I339443cbad7b0858d70e9180d63dfb701b8eaee9
Reviewed-on: https://review.openstack.org/18792
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Be more cautious with stats calculations.

These occur at critical points in the code and should be protected
with exception handlers.

Make sure that a build actually has a start time before calculating
its duration.

Change-Id: I1ff1260da0b7b5095c6b075bd0d78c7a1490686a
Reviewed-on: https://review.openstack.org/19023
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Merge remote-tracking branch 'gtt/master'
Clean cookie if 401 raised.

Private gerrit need login with valid cookie. Sometimes cookie will expired.
So when exception raised, clean cookie and get an new one.
Merge remote-tracking branch 'gtt/master'