Set log_url for retried builds in MQTT payload correctly

Currently, the log_url for retried builds in the MQTT payload always
points to the build result page in Zuul web. As mqtt is meant to be
consumed by machines this breaks e.g. log post processing for those
builds.

To fix this, we do the same as for non-retried builds and provide a
dedicated web_url and log_url [1].

[1]: https://review.opendev.org/c/zuul/zuul/+/703983

Change-Id: I139a80d616d59e262a4f21772d7712fda3b5c03b
This commit is contained in:
Felix Edel
2023-10-27 10:45:15 +02:00
parent beb4f97c13
commit 733f02ae1e
2 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
fixes:
- |
The MQTT reporter now sets the log_url for retried builds correctly.
The link to the build result page is reported in a dedicated web_url
field.

View File

@@ -91,7 +91,7 @@ class MQTTReporter(BaseReporter):
retry_builds = item.current_build_set.getRetryBuildsForJob(
job.name)
for build in retry_builds:
(result, url) = item.formatJobResult(job, build)
(result, web_url) = item.formatJobResult(job, build)
retry_build_information = {
'job_name': job.name,
'voting': job.voting,
@@ -99,7 +99,8 @@ class MQTTReporter(BaseReporter):
'start_time': build.start_time,
'end_time': build.end_time,
'execute_time': build.execute_time,
'log_url': url,
'log_url': build.log_url,
'web_url': web_url,
'result': result,
}
message['buildset']['retry_builds'].append(