summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-03-10 01:44:51 +0000
committerGerrit Code Review <review@openstack.org>2023-03-10 01:44:51 +0000
commit0d35927e2c0a010aae92b8f08997b036c318d55a (patch)
treeab06b0e86ada4a98506a41f1ea3b1de36f61cd43
parentd6d592f5a75d6ee50a67115230698501a5cd0b24 (diff)
parent8c6b87cfff410164c84a4db64ba58ff7fa31acf3 (diff)
downloadzuul-0d35927e2c0a010aae92b8f08997b036c318d55a.tar.gz
Merge "Elasticsearch: filter zuul data from job returned vars"
-rw-r--r--releasenotes/notes/elasticsearch-filter-zuul-returned-vars-4a883813481cc313.yaml6
-rw-r--r--tests/fixtures/config/elasticsearch-driver/git/common-config/playbooks/test.yaml2
-rw-r--r--zuul/driver/elasticsearch/reporter.py4
3 files changed, 11 insertions, 1 deletions
diff --git a/releasenotes/notes/elasticsearch-filter-zuul-returned-vars-4a883813481cc313.yaml b/releasenotes/notes/elasticsearch-filter-zuul-returned-vars-4a883813481cc313.yaml
new file mode 100644
index 000000000..70b388b16
--- /dev/null
+++ b/releasenotes/notes/elasticsearch-filter-zuul-returned-vars-4a883813481cc313.yaml
@@ -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.
diff --git a/tests/fixtures/config/elasticsearch-driver/git/common-config/playbooks/test.yaml b/tests/fixtures/config/elasticsearch-driver/git/common-config/playbooks/test.yaml
index 75e5b6934..7902f19d0 100644
--- a/tests/fixtures/config/elasticsearch-driver/git/common-config/playbooks/test.yaml
+++ b/tests/fixtures/config/elasticsearch-driver/git/common-config/playbooks/test.yaml
@@ -2,4 +2,6 @@
tasks:
- zuul_return:
data:
+ zuul:
+ log_url: some-log-url
foo: 'bar'
diff --git a/zuul/driver/elasticsearch/reporter.py b/zuul/driver/elasticsearch/reporter.py
index 7802cb609..e5e90e052 100644
--- a/zuul/driver/elasticsearch/reporter.py
+++ b/zuul/driver/elasticsearch/reporter.py
@@ -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)