From 9ac720c32cc23552db7e4e2b60ebe9a9e903c011 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 1 Apr 2020 13:01:29 +0200 Subject: [PATCH] Kill the real_data_format_version annotation This is part of the plan discussed with @FedericoCeratto here https://github.com/ooni/probe-engine/issues/423 I am anticipating this part of the change so we don't release a probe-cli that uses such annotation. More changes to follow, after probe-engine 0.9.0, but I am not going to guarantee 0.10.0 will happen before stable cli. --- collector/collector.go | 2 +- experiment.go | 6 +----- testdata/collector-expected.jsonl | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/collector/collector.go b/collector/collector.go index a3d1c02a..f05b9052 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -19,7 +19,7 @@ const ( // DefaultDataFormatVersion is the default data format version. // // See https://github.com/ooni/spec/tree/master/data-formats#history. - DefaultDataFormatVersion = "0.4.0" + DefaultDataFormatVersion = "0.2.0" // DefaultFormat is the default format DefaultFormat = "json" diff --git a/experiment.go b/experiment.go index 74e779d8..af574cf0 100644 --- a/experiment.go +++ b/experiment.go @@ -311,10 +311,7 @@ func (e *Experiment) CloseReport() (err error) { func (e *Experiment) newMeasurement(input string) *model.Measurement { utctimenow := time.Now().UTC() m := model.Measurement{ - // Since v0.4.0 we always send the 0.2.0 data format on the - // wire to avoid confusing the pipeline. The real data format - // version is instead submitted as an annotation. - DataFormatVersion: "0.2.0", + DataFormatVersion: collector.DefaultDataFormatVersion, Input: input, MeasurementStartTime: utctimenow.Format(dateFormat), MeasurementStartTimeSaved: utctimenow, @@ -331,7 +328,6 @@ func (e *Experiment) newMeasurement(input string) *model.Measurement { TestStartTime: e.testStartTime, TestVersion: e.testVersion, } - m.AddAnnotation("real_data_format_version", collector.DefaultDataFormatVersion) return &m } diff --git a/testdata/collector-expected.jsonl b/testdata/collector-expected.jsonl index 7d12fbcc..321415ba 100644 --- a/testdata/collector-expected.jsonl +++ b/testdata/collector-expected.jsonl @@ -1 +1 @@ -{"format":"json","content":{"data_format_version":"0.4.0","id":"bdd20d7a-bba5-40dd-a111-9863d7908572","measurement_start_time":"2018-11-01 15:33:20","test_runtime":5.0565230846405,"probe_asn":"AS0","probe_cc":"ZZ","probe_ip":"1.2.3.4","report_id":"_id","resolver_asn":"AS15169","resolver_ip":"8.8.8.8","resolver_network_name":"Google LLC","software_name":"ooniprobe-engine","software_version":"0.1.0","test_keys":{"failure":null},"test_name":"dummy","test_start_time":"2018-11-01 15:33:17","test_version":"0.1.0"}} \ No newline at end of file +{"format":"json","content":{"data_format_version":"0.2.0","id":"bdd20d7a-bba5-40dd-a111-9863d7908572","measurement_start_time":"2018-11-01 15:33:20","test_runtime":5.0565230846405,"probe_asn":"AS0","probe_cc":"ZZ","probe_ip":"1.2.3.4","report_id":"_id","resolver_asn":"AS15169","resolver_ip":"8.8.8.8","resolver_network_name":"Google LLC","software_name":"ooniprobe-engine","software_version":"0.1.0","test_keys":{"failure":null},"test_name":"dummy","test_start_time":"2018-11-01 15:33:17","test_version":"0.1.0"}} \ No newline at end of file