Switch the launcher to Gearman.

Remove the Jenkins launcher and add a new Gearman launcher (designed
to be compatible with Jenkins) in its place.

See the documentation for how to set up the Gearman Plugin for
Jenkins.

Change-Id: Ie7224396271d7375f4ea42eebb57f883bc291738
Revert "report message even if no action is specified"

This reverts commit 031e23f72318c65346f88e3cad3989eed4f7368b
and commit 9ba206866499cbe1bbda4fb5e1b4fabbbc82e934.

This breaks the ability to have silent pipelines.

Instead, how about the following:

  pipelines:
  - name: postmerge
    manager: IndependentPipelineManager
    ...
    success:
      force-message: true

That should work without any additional code.

Change-Id: I0d15b8fcb678a36c46205693ba9a6756ec6a076f
Reviewed-on: https://review.openstack.org/29180
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Antoine Musso <hashar@free.fr>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Merge branch 'master' into feature/gearman

Change-Id: I4f13e8ecfad5075ca40b66a989a5abe2c3be22fc
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: 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
Use a relative URL for status.json.

So that app.js can be less specific about where it's running.

Change-Id: I2a84a659b43027b7eb59ba707396517d8ba635d3
Reviewed-on: https://review.openstack.org/29286
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Add a test for changes that trigger multiple pipelines.

Change-Id: I147491d2c08fa1040f41f0c299113e3eb8968252
Reviewed-on: https://review.openstack.org/29158
Reviewed-by: Antoine Musso <hashar@free.fr>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Merge branch 'master' into feature/gearman

Change-Id: I9494196710a96414573b11788ed6007817c9f774
Update to new Gear API.

It dropped some "waitFor..." calls.

Also, update the unit tests to deal with some indeterminism in the
order jobs are run (showed up while testing this patch).

Change-Id: Id77838cc1bf0823ee0ee3795cb9190f405a1ff21
Reviewed-on: https://review.openstack.org/31109
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Use gear release version 0.1.1.

Change-Id: I14dbe148f0ff57e5d0c50cc712120a2708f158b1
Reviewed-on: https://review.openstack.org/31727
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Add optional internal gearman server.

Change-Id: Id4e6b77f5abba23f46236def28f54509c61fd247
Reviewed-on: https://review.openstack.org/30170
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Update to new zuul-gearman protocol.

* Use non-Jenkins terminology "manager" rather than "master".
* Use name+number as the identifier for both stopping builds and
  descriptions.
* Expect 'url' parameter instead of 'full_url'.

Change-Id: I1fe9851556618fc6d6deb8906e3f2ee41725c3ad
Reviewed-on: https://review.openstack.org/31726
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Wait for internal gearman server to settle.

If we're using the internal gearman server, wait for workers
to register their functions before proceeding with startup.

This is mostly to handle restarts where we may be immediately
ready to run jobs, but workers may not have registered functions
yet.  In that case, we would immediately start declaring jobs
LOST.  So give them a chance to show up first.

The gearman-plugin for jenkins currently tries to reconnect
every 3 seconds.  We could probably even lower that to 1 or 2.

Change-Id: I173b16ba78cecac91acec26b4f2d55f38610e5a2
Reviewed-on: https://review.openstack.org/31735
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Update to gear 0.2.0.

The internal data structure of the server queue changed.

Change-Id: I280a671577d2247b315174f543dfb2ff8b7d51f4
Reviewed-on: https://review.openstack.org/31997
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Add enqueue_time to JSON output for a change

This adds a javascript timestamp for each change in the JSON output.

Change-Id: I7965c6a7ff6e4e5522da3c51936cfdfb6cf36e91
Reviewed-on: https://review.openstack.org/32064
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Add doc for jobs voting parameter

Change-Id: I14e489a98bbbf245ced2726d0bedc32accc7ca42
Reviewed-on: https://review.openstack.org/32665
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Handle failed jobs with no results.

If we get a WORK_FAIL or WORK_EXCEPTION with no preceding WORK_DATA
packet with a result, record the result as LOST.

This can happen if Jenkins encounters an exception while running
the job.

Change-Id: I159248e228af4e67ba6c88282346f366592e0d37
Reviewed-on: https://review.openstack.org/32814
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 branch 'master' into feature/gearman

Change-Id: I0b6d513aaa2536f01bcd4475d843bb93de69c7e0
Require gear 0.3.1.

And less than 0.4.0 for safety.

Change-Id: I539a2cc7816c15491db55975ac07ee7a148535dc
Reviewed-on: https://review.openstack.org/32973
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Fix signal handler.

Change-Id: Idf4c576d6f6576519f1deff85ccc3f3901491d0e
Reviewed-on: https://review.openstack.org/33463
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins