Add uuid to the launch log record

After a particular change gets scheduled, launch records for each job
that will run for that change are logged.  Subsequent build records will
then be logged to capture state about the running job.  By including the
uuid in the launch log record, it will become possible to correlate the
launch record for a job with the build records for that job for a given
change using a log parser.

Change-Id: I24e1ad43a5c7008a7e0587f5df1d5f332a8e4ac3
This commit is contained in:
Timothy Chavez 2015-07-02 14:15:24 -05:00
parent 07cc33c85c
commit 7a2cfc90d4

View File

@ -265,12 +265,14 @@ class Gearman(object):
params))
def launch(self, job, item, pipeline, dependent_items=[]):
self.log.info("Launch job %s for change %s with dependent changes %s" %
(job, item.change,
[x.change for x in dependent_items]))
uuid = str(uuid4().hex)
self.log.info(
"Launch job %s (uuid: %s) for change %s with dependent "
"changes %s" % (
job, uuid, item.change,
[x.change for x in dependent_items]))
dependent_items = dependent_items[:]
dependent_items.reverse()
uuid = str(uuid4().hex)
params = dict(ZUUL_UUID=uuid,
ZUUL_PROJECT=item.change.project.name)
params['ZUUL_PIPELINE'] = pipeline.name