Elasticsearch: filter zuul data from job returned vars

Remove data under the `zuul` key from the job returned vars.
These returned values are meant to be used only by Zuul and
shouldn't be included in documents as it may include large amount
of data such as file comments.

Change-Id: Ie6de7e3373b21b7c234ffedd5db7d3ca5a0645b6
This commit is contained in:
Thomas Cardonne 2022-08-31 11:27:22 +02:00
parent 20e89b83cc
commit 8c6b87cfff
No known key found for this signature in database
GPG Key ID: D54D1314DAAF41F7
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)