Merge "Elasticsearch: filter zuul data from job returned vars"

This commit is contained in:
Zuul 2023-03-10 01:44:51 +00:00 committed by Gerrit Code Review
commit 0d35927e2c
3 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
The Elasticsearch reporter now filters `zuul` data from the job returned vars.
The job returned vars under the `zuul` key are meant for Zuul and may include large
amount of data such as file comments.

View File

@ -2,4 +2,6 @@
tasks:
- zuul_return:
data:
zuul:
log_url: some-log-url
foo: 'bar'

View File

@ -103,7 +103,9 @@ class ElasticsearchReporter(BaseReporter):
build_doc['job_vars'] = job.variables
if self.index_returned_vars:
build_doc['job_returned_vars'] = build.result_data
rdata = build.result_data.copy()
rdata.pop('zuul', None)
build_doc['job_returned_vars'] = rdata
docs.append(build_doc)