Provide zuul_event_id in MQTT Report Message

When trying to trace logs of builds it is often useful to search for log
messages via the event id of a specific build.
The event id is printed in (nearly) all log messages but is not provided
by the MQTT reporter, so one has to look it up first based on the build
id. To circumvent this extra step and make searching the logs more
straight forward, this patch makes sure the event id is provided in the
JSON message by the MQTT reporter.

Change-Id: I908dd7eca250825eed97bf8261fd33b69cc5f543
This commit is contained in:
Benjamin Schanzel 2019-10-16 10:13:51 +02:00
parent 9741018ff6
commit 25ac3feb28
2 changed files with 2 additions and 0 deletions

View File

@ -492,6 +492,7 @@ class TestMQTTConnection(ZuulTestCase):
self.assertIn('timestamp', mqtt_payload)
self.assertIn('enqueue_time', mqtt_payload)
self.assertIn('trigger_time', mqtt_payload)
self.assertIn('zuul_event_id', mqtt_payload)
self.assertEquals(dependent_test_job['dependencies'], ['test'])
def test_mqtt_invalid_topic(self):

View File

@ -49,6 +49,7 @@ class MQTTReporter(BaseReporter):
'uuid': item.current_build_set.uuid,
'builds': []
},
'zuul_event_id': item.event.zuul_event_id,
}
for job in item.getJobs():
job_informations = {