Annotate logs around build states

It's useful to have logs around build states annotated with the event
ids that caused it.

Change-Id: Ib2173210516823cfe16e34710e8d01319aba8cce
This commit is contained in:
Tobias Henkel
2019-05-26 18:50:43 +02:00
parent 6b37468a38
commit a703f42c24
4 changed files with 48 additions and 38 deletions

View File

@@ -825,12 +825,14 @@ class PipelineManager(object):
return changed
def onBuildStarted(self, build):
self.log.debug("Build %s started" % build)
log = get_annotated_logger(self.log, build.zuul_event_id)
log.debug("Build %s started", build)
return True
def onBuildPaused(self, build):
log = get_annotated_logger(self.log, build.zuul_event_id)
item = build.build_set.item
self.log.debug("Build %s of %s paused", build, item.change)
log.debug("Build %s of %s paused", build, item.change)
item.setResult(build)
# We need to resume builds because we could either have no children