make report times a little more user friendly

report times as 1h 22m 08s

only report hours if the job runs longer than an hour

only report minutes if the job runs longer than a minute

don't zero pad whatever the leading time unit is, making it a
little easier to scan and see differences.

Change-Id: Ibb58be233fdef1bbdf4e90a83731d43eb0be47f1
Reviewed-on: https://review.openstack.org/28143
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: matthew-wagoner <matthew.wagoner@hp.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
Ignore pep8 E123.

From the pep8 spec:

  The closing brace/bracket/parenthesis on multi-line constructs
  may either line up under the last item of the list, as in:
  ...
  or it may be lined up under the first character of the line that
  starts the multi-line construct, as in:
  ...

Bizzarly, the pep8 tool ignores the first option.

Change-Id: Ic0e8f8ad964881276d213ffd50deb75a537c250b
Reviewed-on: https://review.openstack.org/28609
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
fix message report when no action is given

031e23f allowed the Gerrit trigger to report a message even when no
action has been given (for the context of postmerge builds where the
change cant be altered).  I have noticed the Gerrit lib would stack
trace because it is missing an action (actually None).  This patch skip
the action expansion in Gerrit command line whenever there is no action.

Related stacktrace:

  INFO zuul.IndependentPipelineManager: Reporting
   change <Change 0x7fb72099d190 62446,3>, action: None
  DEBUG zuul.Gerrit: Report change <Change 0x7fb72099d190 62446,3>,
   action None, message: Build succeeded.
  ERROR zuul.IndependentPipelineManager: Exception while reporting:
  Traceback (most recent call last):
  File "zuul-5b84b5c-py2.7.egg/zuul/scheduler.py",
    line 883, in reportChange
      ret = self.sched.trigger.report(change, report, action)
  File "zuul-5b84b5c-py2.7.egg/zuul/trigger/gerrit.py",
    line 142, in report message, action)
  File "zuul-5b84b5c-py2.7.egg/zuul/lib/gerrit.py",
    line 119, in review
      for k, v in action.items():
  AttributeError: 'NoneType' object has no attribute 'items'

Change-Id: I51b66025eb6e1d074d79cf77ac4085ba3ffde77e
Reviewed-on: https://review.openstack.org/28395
Reviewed-by: Clark Boylan <clark.boylan@gmail.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
Sync from oslo-incubator.

Change-Id: I3a7c6bdfae9f2273cf8059c322d648cda07d830d
Reviewed-on: https://review.openstack.org/28619
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
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