glean-parser 18.1.0__tar.gz → 18.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {glean_parser-18.1.0 → glean_parser-18.2.0}/PKG-INFO +1 -1
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/go_server.py +3 -1
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/lint.py +16 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/python_server.jinja2 +3 -2
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/conftest.py +12 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_custom_ping_only_metrics.yaml +15 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_events_and_custom_ping_metrics.yaml +16 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_events_only_metrics.yaml +15 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_metrics_unsupported.yaml +0 -15
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_custom_ping_only_compare.go +4 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_and_custom_ping_compare.go +8 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_only_compare.go +4 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_go_server.py +21 -18
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_lint.py +86 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/.gitignore +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/AUTHORS.md +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/LICENSE +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/README.md +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/__init__.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/__main__.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/coverage.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/data_review.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/javascript.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/javascript_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/kotlin.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/markdown.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/metrics.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/parser.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/pings.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/python_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/ruby_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/rust.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/rust_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/schemas/metrics.1-0-0.schema.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/schemas/metrics.2-0-0.schema.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/schemas/pings.1-0-0.schema.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/schemas/pings.2-0-0.schema.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/schemas/tags.1-0-0.schema.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/swift.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/tags.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/data_review.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/go_server.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/javascript.buildinfo.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/javascript.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/javascript_server.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/kotlin.buildinfo.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/kotlin.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/markdown.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/qmldir.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/ruby_server.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/rust.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/rust_server.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/swift.jinja2 +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/translate.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/translation_options.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/util.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/validate_ping.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/pyproject.toml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/server_telemetry/sdk-metrics-compat.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/server_telemetry/server-side-pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/all_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/all_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/attribution.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/bad_attribution.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/bad_ping.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/core.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/custom_ping_no_event_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/custom_ping_no_event_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/dual_labeled.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/dual_labeled_invalid.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/duplicate_labeled.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/duplicate_send_in_ping.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/empty.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/event_key_ordering.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/events_data_sensitivity.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/events_with_types.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/fxa-server-metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/fxa-server-pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/invalid-ping-names.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/invalid.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/jwe.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/metric-with-tags.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/mixed-expirations.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/name_too_similar.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/object.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/old_event_api.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/ordering.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/python_server_metrics_unsupported.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rate.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/redefined_category.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/redefined_metric.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/redefined_ping.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/reserved_categories.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/ruby_server_metrics_unsupported.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/ruby_server_pings_unsupported.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_custom_ping_only_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_events_and_custom_ping_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_events_only_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_metrics_unsupported.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/same_name_different_category.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/schema-violation.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/send_if_empty_with_metrics.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_custom_ping_only_compare.rs +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_and_custom_ping_compare.rs +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_compare.rb +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_only_compare.rs +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_metrics_no_events_no_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_metrics_with_event.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_pings.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/single_labeled.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/smaller.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/tags.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/telemetry_mirror.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/text.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/text_invalid.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/unknown_ping_used.yaml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/wrong_key.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/yaml_nits.yamlx +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/detekt.yml +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-go/test.go.tmpl +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-js/package.json +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-js/test.js.tmpl +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-py/test.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-rb/test.rb.tmpl +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test-rs/test.rs.tmpl +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_cli.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_javascript.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_javascript_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_kotlin.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_markdown.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_metrics.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_parser.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_pings.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_python_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_ruby_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_rust.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_rust_server.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_swift.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_tags.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_translate.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_utils.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/test_validate_ping.py +0 -0
- {glean_parser-18.1.0 → glean_parser-18.2.0}/tests/util.py +0 -0
|
@@ -32,7 +32,7 @@ from . import util
|
|
|
32
32
|
|
|
33
33
|
# Adding a metric here will require updating the `generate_metric_type` function
|
|
34
34
|
# and require adjustments to `metrics` variables the the template.
|
|
35
|
-
SUPPORTED_METRIC_TYPES = ["string", "quantity", "event", "datetime", "boolean"]
|
|
35
|
+
SUPPORTED_METRIC_TYPES = ["string", "quantity", "event", "datetime", "boolean", "string_list"]
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def generate_ping_type_name(ping_name: str) -> str:
|
|
@@ -68,6 +68,8 @@ def generate_metric_type(metric_type: str) -> str:
|
|
|
68
68
|
return "bool"
|
|
69
69
|
elif metric_type == "datetime":
|
|
70
70
|
return "time.Time"
|
|
71
|
+
elif metric_type == "string_list":
|
|
72
|
+
return "[]string"
|
|
71
73
|
else:
|
|
72
74
|
print("❌ Unable to generate Go type from metric type: " + metric_type)
|
|
73
75
|
exit
|
|
@@ -300,6 +300,21 @@ def check_metric_on_events_lifetime(
|
|
|
300
300
|
)
|
|
301
301
|
|
|
302
302
|
|
|
303
|
+
def check_event_on_non_events_ping(
|
|
304
|
+
metric: metrics.Metric, parser_config: Dict[str, Any]
|
|
305
|
+
) -> LintGenerator:
|
|
306
|
+
"""
|
|
307
|
+
An event metric should usually go on the `events` ping or a custom ping,
|
|
308
|
+
not on a builtin ping.
|
|
309
|
+
"""
|
|
310
|
+
disallowed_pings = set(pings.RESERVED_PING_NAMES) - {"default", "events"} | {"health"}
|
|
311
|
+
if metric.type == "event" and any([ping in disallowed_pings for ping in metric.send_in_pings]):
|
|
312
|
+
yield (
|
|
313
|
+
"An event metric should usually go on the `events` ping or a custom ping, "
|
|
314
|
+
+ "not on a builtin ping."
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
|
|
303
318
|
def check_unexpected_unit(
|
|
304
319
|
metric: metrics.Metric, parser_config: Dict[str, Any]
|
|
305
320
|
) -> LintGenerator:
|
|
@@ -466,6 +481,7 @@ METRIC_CHECKS: Dict[
|
|
|
466
481
|
"EXPIRED": (check_expired_metric, CheckType.warning),
|
|
467
482
|
"OLD_EVENT_API": (check_old_event_api, CheckType.warning),
|
|
468
483
|
"METRIC_ON_EVENTS_LIFETIME": (check_metric_on_events_lifetime, CheckType.error),
|
|
484
|
+
"EVENT_ON_NON_EVENTS_PING": (check_event_on_non_events_ping, CheckType.warning),
|
|
469
485
|
"UNEXPECTED_UNIT": (check_unexpected_unit, CheckType.warning),
|
|
470
486
|
"EMPTY_DATAREVIEW": (check_empty_datareview, CheckType.warning),
|
|
471
487
|
"HIGHER_DATA_SENSITIVITY_REQUIRED": (
|
|
@@ -12,6 +12,7 @@ from datetime import datetime, timezone
|
|
|
12
12
|
from typing import Any
|
|
13
13
|
from uuid import uuid4
|
|
14
14
|
import json
|
|
15
|
+
import sys
|
|
15
16
|
|
|
16
17
|
GLEAN_EVENT_MOZLOG_TYPE = "glean-server-event"
|
|
17
18
|
|
|
@@ -111,7 +112,7 @@ class {{ ping|camelize }}ServerEventLogger:
|
|
|
111
112
|
}
|
|
112
113
|
ping_envelope_serialized = json.dumps(ping_envelope)
|
|
113
114
|
|
|
114
|
-
|
|
115
|
+
sys.stdout.write(f"{ping_envelope_serialized}\n")
|
|
115
116
|
|
|
116
117
|
{% for event in metrics_by_type["event"] %}
|
|
117
118
|
def {{ event|record_event_function_name }}(
|
|
@@ -132,7 +133,7 @@ class {{ ping|camelize }}ServerEventLogger:
|
|
|
132
133
|
"""
|
|
133
134
|
Record and submit a {{ event.category }}_{{ event.name }} event:
|
|
134
135
|
{{ event.description|clean_string }}
|
|
135
|
-
Event is logged to STDOUT via `
|
|
136
|
+
Event is logged to STDOUT via `sys.stdout.write`.
|
|
136
137
|
|
|
137
138
|
:param str user_agent: The user agent.
|
|
138
139
|
:param str ip_address: The IP address. Will be used to decode Geo information
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import pytest
|
|
2
|
+
import subprocess
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
def pytest_addoption(parser):
|
|
@@ -46,6 +47,17 @@ def pytest_collection_modifyitems(config, items):
|
|
|
46
47
|
for item in items:
|
|
47
48
|
if "node_dependency" in item.keywords:
|
|
48
49
|
item.add_marker(skip_node)
|
|
50
|
+
else:
|
|
51
|
+
# Node.js removed some deprecated items currently in use by dependencies of mozlog.
|
|
52
|
+
# We can't fix that.
|
|
53
|
+
node_version = subprocess.check_output(["node", "--version"]).decode("utf-8").strip()
|
|
54
|
+
major_version = int(node_version[1:].split(".")[0])
|
|
55
|
+
print(f"jer. {node_version=}, {major_version=}")
|
|
56
|
+
if major_version >= 24:
|
|
57
|
+
skip_node = pytest.mark.skip(reason="Node.js < v24 required")
|
|
58
|
+
for item in items:
|
|
59
|
+
if "node_dependency" in item.keywords:
|
|
60
|
+
item.add_marker(skip_node)
|
|
49
61
|
|
|
50
62
|
if not config.getoption("--run-ruby-tests"):
|
|
51
63
|
skip_ruby = pytest.mark.skip(reason="Need --run-ruby-tests option to run")
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_custom_ping_only_metrics.yaml
RENAMED
|
@@ -66,6 +66,21 @@ metric:
|
|
|
66
66
|
- TBD
|
|
67
67
|
expires: never
|
|
68
68
|
|
|
69
|
+
request_string_list:
|
|
70
|
+
type: string_list
|
|
71
|
+
description: >
|
|
72
|
+
Test string_list metric
|
|
73
|
+
lifetime: application
|
|
74
|
+
send_in_pings:
|
|
75
|
+
- server-telemetry-scenario-one
|
|
76
|
+
notification_emails:
|
|
77
|
+
- CHANGE-ME@example.com
|
|
78
|
+
bugs:
|
|
79
|
+
- TBD
|
|
80
|
+
data_reviews:
|
|
81
|
+
- TBD
|
|
82
|
+
expires: never
|
|
83
|
+
|
|
69
84
|
backend:
|
|
70
85
|
special_event:
|
|
71
86
|
type: event
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_events_and_custom_ping_metrics.yaml
RENAMED
|
@@ -70,6 +70,22 @@ metric:
|
|
|
70
70
|
- TBD
|
|
71
71
|
expires: never
|
|
72
72
|
|
|
73
|
+
request_string_list:
|
|
74
|
+
type: string_list
|
|
75
|
+
description: >
|
|
76
|
+
Test string_list metric
|
|
77
|
+
lifetime: application
|
|
78
|
+
send_in_pings:
|
|
79
|
+
- events
|
|
80
|
+
- server-telemetry-scenario-one
|
|
81
|
+
notification_emails:
|
|
82
|
+
- CHANGE-ME@example.com
|
|
83
|
+
bugs:
|
|
84
|
+
- TBD
|
|
85
|
+
data_reviews:
|
|
86
|
+
- TBD
|
|
87
|
+
expires: never
|
|
88
|
+
|
|
73
89
|
backend:
|
|
74
90
|
test_event:
|
|
75
91
|
type: event
|
|
@@ -66,6 +66,21 @@ metric:
|
|
|
66
66
|
- TBD
|
|
67
67
|
expires: never
|
|
68
68
|
|
|
69
|
+
request_string_list:
|
|
70
|
+
type: string_list
|
|
71
|
+
description: >
|
|
72
|
+
Test string_list metric
|
|
73
|
+
lifetime: application
|
|
74
|
+
send_in_pings:
|
|
75
|
+
- events
|
|
76
|
+
notification_emails:
|
|
77
|
+
- CHANGE-ME@example.com
|
|
78
|
+
bugs:
|
|
79
|
+
- TBD
|
|
80
|
+
data_reviews:
|
|
81
|
+
- TBD
|
|
82
|
+
expires: never
|
|
83
|
+
|
|
69
84
|
backend:
|
|
70
85
|
test_event:
|
|
71
86
|
type: event
|
|
@@ -60,21 +60,6 @@ metric:
|
|
|
60
60
|
attribute_two:
|
|
61
61
|
type: number
|
|
62
62
|
|
|
63
|
-
string_list:
|
|
64
|
-
type: string_list
|
|
65
|
-
description: >
|
|
66
|
-
string list
|
|
67
|
-
bugs:
|
|
68
|
-
- TBD
|
|
69
|
-
data_reviews:
|
|
70
|
-
- TBD
|
|
71
|
-
notification_emails:
|
|
72
|
-
- CHANGE-ME@example.com
|
|
73
|
-
lifetime: application
|
|
74
|
-
expires: never
|
|
75
|
-
send_in_pings:
|
|
76
|
-
- events
|
|
77
|
-
|
|
78
63
|
timespan:
|
|
79
64
|
type: timespan
|
|
80
65
|
description: >
|
|
@@ -218,6 +218,7 @@ type ServerTelemetryScenarioOnePing struct {
|
|
|
218
218
|
MetricRequestBool bool // boolean
|
|
219
219
|
MetricRequestCount int64 // Test quantity metric
|
|
220
220
|
MetricRequestDatetime time.Time // Test datetime metric
|
|
221
|
+
MetricRequestStringList []string // Test string_list metric
|
|
221
222
|
Event ServerTelemetryScenarioOnePingEvent // valid event for this ping
|
|
222
223
|
}
|
|
223
224
|
|
|
@@ -239,6 +240,9 @@ func (g GleanEventsLogger) RecordServerTelemetryScenarioOnePing(
|
|
|
239
240
|
"datetime": {
|
|
240
241
|
"metric.request_datetime": params.MetricRequestDatetime.Format("2006-01-02T15:04:05.000Z"),
|
|
241
242
|
},
|
|
243
|
+
"string_list": {
|
|
244
|
+
"metric.request_string_list": params.MetricRequestStringList,
|
|
245
|
+
},
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
events := []gleanEvent{}
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_and_custom_ping_compare.go
RENAMED
|
@@ -218,6 +218,7 @@ type EventsPing struct {
|
|
|
218
218
|
MetricRequestBool bool // boolean
|
|
219
219
|
MetricRequestCount int64 // Test quantity metric
|
|
220
220
|
MetricRequestDatetime time.Time // Test datetime metric
|
|
221
|
+
MetricRequestStringList []string // Test string_list metric
|
|
221
222
|
Event EventsPingEvent // valid event for this ping
|
|
222
223
|
}
|
|
223
224
|
|
|
@@ -239,6 +240,9 @@ func (g GleanEventsLogger) RecordEventsPing(
|
|
|
239
240
|
"datetime": {
|
|
240
241
|
"metric.request_datetime": params.MetricRequestDatetime.Format("2006-01-02T15:04:05.000Z"),
|
|
241
242
|
},
|
|
243
|
+
"string_list": {
|
|
244
|
+
"metric.request_string_list": params.MetricRequestStringList,
|
|
245
|
+
},
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
events := []gleanEvent{}
|
|
@@ -260,6 +264,7 @@ type ServerTelemetryScenarioOnePing struct {
|
|
|
260
264
|
MetricRequestBool bool // boolean
|
|
261
265
|
MetricRequestCount int64 // Test quantity metric
|
|
262
266
|
MetricRequestDatetime time.Time // Test datetime metric
|
|
267
|
+
MetricRequestStringList []string // Test string_list metric
|
|
263
268
|
}
|
|
264
269
|
|
|
265
270
|
// Record and submit `server-telemetry-scenario-one` ping
|
|
@@ -280,6 +285,9 @@ func (g GleanEventsLogger) RecordServerTelemetryScenarioOnePing(
|
|
|
280
285
|
"datetime": {
|
|
281
286
|
"metric.request_datetime": params.MetricRequestDatetime.Format("2006-01-02T15:04:05.000Z"),
|
|
282
287
|
},
|
|
288
|
+
"string_list": {
|
|
289
|
+
"metric.request_string_list": params.MetricRequestStringList,
|
|
290
|
+
},
|
|
283
291
|
}
|
|
284
292
|
|
|
285
293
|
events := []gleanEvent{}
|
|
@@ -218,6 +218,7 @@ type EventsPing struct {
|
|
|
218
218
|
MetricRequestBool bool // boolean
|
|
219
219
|
MetricRequestCount int64 // Test quantity metric
|
|
220
220
|
MetricRequestDatetime time.Time // Test datetime metric
|
|
221
|
+
MetricRequestStringList []string // Test string_list metric
|
|
221
222
|
Event EventsPingEvent // valid event for this ping
|
|
222
223
|
}
|
|
223
224
|
|
|
@@ -239,6 +240,9 @@ func (g GleanEventsLogger) RecordEventsPing(
|
|
|
239
240
|
"datetime": {
|
|
240
241
|
"metric.request_datetime": params.MetricRequestDatetime.Format("2006-01-02T15:04:05.000Z"),
|
|
241
242
|
},
|
|
243
|
+
"string_list": {
|
|
244
|
+
"metric.request_string_list": params.MetricRequestStringList,
|
|
245
|
+
},
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
events := []gleanEvent{}
|
|
@@ -42,7 +42,6 @@ def test_parser_go_server_metrics_unsupported_type(tmp_path, capsys):
|
|
|
42
42
|
"boolean",
|
|
43
43
|
"labeled_boolean",
|
|
44
44
|
"labeled_string",
|
|
45
|
-
"string_list",
|
|
46
45
|
"timespan",
|
|
47
46
|
"uuid",
|
|
48
47
|
"url",
|
|
@@ -102,7 +101,7 @@ def test_parser_go_server_events_and_custom_ping(tmp_path):
|
|
|
102
101
|
assert content == compare
|
|
103
102
|
|
|
104
103
|
|
|
105
|
-
def
|
|
104
|
+
def test_parser_go_server_custom_ping_only(tmp_path):
|
|
106
105
|
"""Test that parser works for definitions that only use custom pings"""
|
|
107
106
|
translate.translate(
|
|
108
107
|
[
|
|
@@ -170,10 +169,11 @@ def test_run_logging_events_ping(tmp_path):
|
|
|
170
169
|
IpAddress: "127.0.0.1",
|
|
171
170
|
},
|
|
172
171
|
glean.EventsPing{
|
|
173
|
-
MetricName:
|
|
174
|
-
MetricRequestBool:
|
|
175
|
-
MetricRequestCount:
|
|
176
|
-
MetricRequestDatetime:
|
|
172
|
+
MetricName: "string value",
|
|
173
|
+
MetricRequestBool: true,
|
|
174
|
+
MetricRequestCount: 10,
|
|
175
|
+
MetricRequestDatetime: time.Now(),
|
|
176
|
+
MetricRequestStringList: []string{"list", "of", "strings"},
|
|
177
177
|
Event: glean.BackendTestEventEvent{
|
|
178
178
|
EventFieldString: "event extra string value",
|
|
179
179
|
EventFieldQuantity: 100,
|
|
@@ -227,10 +227,11 @@ def test_run_logging_custom_ping_without_event(tmp_path):
|
|
|
227
227
|
IpAddress: "127.0.0.1",
|
|
228
228
|
},
|
|
229
229
|
glean.ServerTelemetryScenarioOnePing{
|
|
230
|
-
MetricName:
|
|
231
|
-
MetricRequestBool:
|
|
232
|
-
MetricRequestCount:
|
|
233
|
-
MetricRequestDatetime:
|
|
230
|
+
MetricName: "string value",
|
|
231
|
+
MetricRequestBool: true,
|
|
232
|
+
MetricRequestCount: 20,
|
|
233
|
+
MetricRequestDatetime: time.Now(),
|
|
234
|
+
MetricRequestStringList: []string{"list", "of", "strings"},
|
|
234
235
|
},
|
|
235
236
|
)
|
|
236
237
|
"""
|
|
@@ -285,10 +286,11 @@ def test_run_logging_discard_writer(tmp_path):
|
|
|
285
286
|
IpAddress: "127.0.0.1",
|
|
286
287
|
},
|
|
287
288
|
glean.ServerTelemetryScenarioOnePing{
|
|
288
|
-
MetricName:
|
|
289
|
-
MetricRequestBool:
|
|
290
|
-
MetricRequestCount:
|
|
291
|
-
MetricRequestDatetime:
|
|
289
|
+
MetricName: "string value",
|
|
290
|
+
MetricRequestBool: true,
|
|
291
|
+
MetricRequestCount: 20,
|
|
292
|
+
MetricRequestDatetime: time.Now(),
|
|
293
|
+
MetricRequestStringList: []string{"list", "of", "strings"},
|
|
292
294
|
},
|
|
293
295
|
)
|
|
294
296
|
if err != nil {
|
|
@@ -362,10 +364,11 @@ def test_run_logging_custom_ping_with_event(tmp_path):
|
|
|
362
364
|
IpAddress: "127.0.0.1",
|
|
363
365
|
},
|
|
364
366
|
glean.ServerTelemetryScenarioOnePing{
|
|
365
|
-
MetricName:
|
|
366
|
-
MetricRequestBool:
|
|
367
|
-
MetricRequestCount:
|
|
368
|
-
MetricRequestDatetime:
|
|
367
|
+
MetricName: "string value",
|
|
368
|
+
MetricRequestBool: true,
|
|
369
|
+
MetricRequestCount: 20,
|
|
370
|
+
MetricRequestDatetime: time.Now(),
|
|
371
|
+
MetricRequestStringList: []string{"list", "of", "strings"},
|
|
369
372
|
Event: glean.BackendSpecialEventEvent{
|
|
370
373
|
EventFieldString: "exta value string",
|
|
371
374
|
EventFieldQuantity: 30,
|
|
@@ -875,3 +875,89 @@ def test_unknown_lint_warning(content, num_nits):
|
|
|
875
875
|
assert set(["UNKNOWN_LINT"]) == set(
|
|
876
876
|
v.check_name for v in nits
|
|
877
877
|
)
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
@pytest.mark.parametrize(
|
|
881
|
+
"content,num_nits",
|
|
882
|
+
[
|
|
883
|
+
(
|
|
884
|
+
{
|
|
885
|
+
"plain_event": {
|
|
886
|
+
"type": "event",
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
0,
|
|
890
|
+
),
|
|
891
|
+
(
|
|
892
|
+
{
|
|
893
|
+
"event_on_metrics": {
|
|
894
|
+
"type": "event",
|
|
895
|
+
"send_in_pings": ["metrics"],
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
1,
|
|
899
|
+
),
|
|
900
|
+
(
|
|
901
|
+
{
|
|
902
|
+
"event_on_metrics_and_events": {
|
|
903
|
+
"type": "event",
|
|
904
|
+
"send_in_pings": ["metrics", "events"],
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
1,
|
|
908
|
+
),
|
|
909
|
+
(
|
|
910
|
+
{
|
|
911
|
+
"event_on_baseline": {
|
|
912
|
+
"type": "event",
|
|
913
|
+
"send_in_pings": ["baseline"],
|
|
914
|
+
"no_lint": ["BASELINE_PING"],
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
1,
|
|
918
|
+
),
|
|
919
|
+
(
|
|
920
|
+
{
|
|
921
|
+
"event_on_baseline_and_metrics": {
|
|
922
|
+
"type": "event",
|
|
923
|
+
"send_in_pings": ["baseline", "metrics"],
|
|
924
|
+
"no_lint": ["BASELINE_PING"],
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
1,
|
|
928
|
+
),
|
|
929
|
+
(
|
|
930
|
+
{
|
|
931
|
+
"no_lint_events_on_metrics": {
|
|
932
|
+
"type": "event",
|
|
933
|
+
"send_in_pings": ["metrics", "events"],
|
|
934
|
+
"no_lint": ["EVENT_ON_NON_EVENTS_PING"],
|
|
935
|
+
}
|
|
936
|
+
},
|
|
937
|
+
0,
|
|
938
|
+
),
|
|
939
|
+
(
|
|
940
|
+
{
|
|
941
|
+
"default_ping": {
|
|
942
|
+
"type": "event",
|
|
943
|
+
"send_in_pings": ["default"],
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
0,
|
|
947
|
+
),
|
|
948
|
+
],
|
|
949
|
+
)
|
|
950
|
+
def test_events_on_metrics_ping(content, num_nits):
|
|
951
|
+
content = {"cat": content}
|
|
952
|
+
content = util.add_required(content)
|
|
953
|
+
all_metrics = parser.parse_objects(content)
|
|
954
|
+
|
|
955
|
+
errs = list(all_metrics)
|
|
956
|
+
assert len(errs) == 0
|
|
957
|
+
|
|
958
|
+
nits = lint.lint_metrics(all_metrics.value)
|
|
959
|
+
assert len(nits) == num_nits
|
|
960
|
+
if num_nits > 0:
|
|
961
|
+
assert set(["EVENT_ON_NON_EVENTS_PING"]) == set(
|
|
962
|
+
v.check_name for v in nits
|
|
963
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/glean_parser/templates/javascript.buildinfo.jinja2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/go_server_events_and_custom_ping_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/python_server_metrics_unsupported.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_custom_ping_only_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/rust_server_events_and_custom_ping_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_events_and_custom_ping_compare.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-18.1.0 → glean_parser-18.2.0}/tests/data/server_metrics_no_events_no_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|