summaryrefslogtreecommitdiff
path: root/zuul
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-09-07 11:52:03 -0700
committerJames E. Blair <jim@acmegating.com>2022-09-13 18:05:42 -0700
commit9a3b028fa21013812585fcf1291bad130563c64c (patch)
tree1453b9a832f6928b9ec51b5f71242548bce47983 /zuul
parent0b4c6b011701f8723cb722a739d2ce24d6ad4376 (diff)
downloadzuul-9a3b028fa21013812585fcf1291bad130563c64c.tar.gz
Add option to include returned data in MQTT reporter
This adds an option to include result data from a job in the MQTT reporter. It is off by default since it may be quite large for some jobs. Change-Id: I802adee834b60256abd054eda2db834f8db82650
Diffstat (limited to 'zuul')
-rw-r--r--zuul/driver/mqtt/mqttreporter.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/zuul/driver/mqtt/mqttreporter.py b/zuul/driver/mqtt/mqttreporter.py
index 4090bb082..5c95a19ea 100644
--- a/zuul/driver/mqtt/mqttreporter.py
+++ b/zuul/driver/mqtt/mqttreporter.py
@@ -30,6 +30,7 @@ class MQTTReporter(BaseReporter):
def report(self, item, phase1=True, phase2=True):
if not phase1:
return
+ include_returned_data = self.config.get('include-returned-data')
log = get_annotated_logger(self.log, item.event)
log.debug("Report change %s, params %s", item.change, self.config)
message = {
@@ -80,6 +81,10 @@ class MQTTReporter(BaseReporter):
'artifacts': get_artifacts_from_result_data(
build.result_data, logger=log)
})
+ if include_returned_data:
+ rdata = build.result_data.copy()
+ rdata.pop('zuul', None)
+ job_informations['returned_data'] = rdata
# Report build data of retried builds if available
retry_builds = item.current_build_set.getRetryBuildsForJob(
@@ -144,4 +149,8 @@ def qosValue(value):
def getSchema():
- return v.Schema({v.Required('topic'): topicValue, 'qos': qosValue})
+ return v.Schema({
+ v.Required('topic'): topicValue,
+ 'qos': qosValue,
+ 'include-returned-data': bool,
+ })