In FakeStatsd, use select() rather than poll()

The poll() system call is not available on all systems (like OS X, for
example), causing the test suite to fail. This change replaces poll()
with select(), which is more portable. With this change the test suite passes
under OS X.

Change-Id: I3ad716b127c8781d8dbf870b0f0c0e1162f264d1
Reviewed-on: https://review.openstack.org/28126
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
report message even if no action is specified

Whenever a pipeline does not provide any action, the job message would
not be reported which is a bit annoying.  This patch makes it so we skip
reporting when there is no action and no message.

My use case is:

A `postmerge` pipeline that simply react to the `change-merged` events,
since the change is closed, there is no point in voting on it.  Jobs
then uses the `success-message` and `failure-message` to finely tune
what is reported back to the user.

Configuration exemple

  pipelines:
   - name: postmerge
     manager: IndependentPipelineManager
     trigger:
      - event: change-merged

  projects:
   - name: operations/config
     postmerge:
      - operations-config-deploy

  jobs:
   - name: operations-config-deploy
     branch: ^production$
     success-message: 'Your configuration has been deployed by Jenkins.'
     failure-message: 'Configuration NOT APPLIED. You broke wikipedia.'

Before this patch, the debug would be:

------------8<---------------8<---------------8<-----------------------
INFO zuul.IndependentPipelineManager: Reporting
change <Change 0x7f67a0d61f50 61980,1>, action: None

DEBUG zuul.Gerrit: Report change <Change
0x7f67a0d61f50 61980,1>, action None, message: Build succeeded.

- https://jenkins-url-goes-there.example.com/
  : Your configuration has been deployed by Jenkins.

DEBUG zuul.Gerrit: No action specified; not reporting

DEBUG zuul.IndependentPipelineManager: Removing reported
------------8<---------------8<---------------8<-----------------------

Change-Id: I9ab4d47a8cfc1ae66870e8ac55e8f78dfc29da3d
Reviewed-on: https://review.openstack.org/28045
Reviewed-by: Jesse Keating <jesse.keating@rackspace.com>
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
Drop Jenkins.getBestBuildURL() method

The ability to configure success and failure URL patterns (cf.
'success-pattern' and 'failure-pattern') obsoletes the need to
guess-by-fetching an appropriate link for the build status, which can be
extremely expensive. (Wikimedia's Zuul instance makes three HTTP requests per
invocation -- 'testReport', which 302s to 'testReport/', which 404s, and then
'consoleFull', which often runs to hundreds of kilobytes.)

Also corrects a small typo in README.rst.

Change-Id: Ib222f544c98253152a5e787ec0cdf28fa2d80cf6
Reviewed-on: https://review.openstack.org/28128
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
WMF: workaround Jenkins API slowness

The calls to the jobs /api/json are really slow because they parse the
whole build history.  This work around will make Zuul believe the job
always exist.

Change-Id: Icdf2b70ede617e94eed53e6498fff71f403792db