glean-parser 17.2.0__tar.gz → 17.3.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-17.2.0 → glean_parser-17.3.0}/PKG-INFO +1 -1
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/lint.py +34 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/metrics.py +0 -1
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/schemas/metrics.2-0-0.schema.yaml +0 -9
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/schemas/pings.2-0-0.schema.yaml +0 -4
- glean_parser-17.3.0/tests/data/events_data_sensitivity.yaml +78 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_lint.py +109 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_parser.py +26 -1
- {glean_parser-17.2.0 → glean_parser-17.3.0}/.gitignore +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/AUTHORS.md +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/LICENSE +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/README.md +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/__init__.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/__main__.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/coverage.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/data_review.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/go_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/javascript.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/javascript_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/kotlin.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/markdown.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/parser.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/pings.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/python_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/ruby_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/rust.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/rust_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/schemas/metrics.1-0-0.schema.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/schemas/pings.1-0-0.schema.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/schemas/tags.1-0-0.schema.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/swift.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/tags.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/data_review.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/go_server.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/javascript.buildinfo.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/javascript.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/javascript_server.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/kotlin.buildinfo.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/kotlin.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/markdown.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/python_server.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/qmldir.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/ruby_server.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/rust.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/rust_server.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/templates/swift.jinja2 +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/translate.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/translation_options.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/util.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/glean_parser/validate_ping.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/pyproject.toml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/server_telemetry/sdk-metrics-compat.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/server_telemetry/server-side-pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/conftest.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/all_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/all_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/attribution.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/bad_attribution.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/bad_ping.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/core.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/dual_labeled.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/dual_labeled_invalid.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/duplicate_labeled.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/duplicate_send_in_ping.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/empty.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/event_key_ordering.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/events_with_types.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/fxa-server-metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/fxa-server-pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_custom_ping_only_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_events_and_custom_ping_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_events_only_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_metrics_unsupported.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/invalid-ping-names.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/invalid.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/jwe.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/metric-with-tags.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/mixed-expirations.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/name_too_similar.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/object.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/old_event_api.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/ordering.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rate.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/redefined_category.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/redefined_metric.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/redefined_ping.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/reserved_categories.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/ruby_server_metrics_unsupported.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/ruby_server_pings_unsupported.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_custom_ping_only_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_custom_ping_only_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_events_and_custom_ping_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_events_and_custom_ping_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_events_only_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_metrics_unsupported.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/same_name_different_category.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/schema-violation.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/send_if_empty_with_metrics.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_custom_ping_only_compare.go +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_custom_ping_only_compare.rs +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_and_custom_ping_compare.go +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_and_custom_ping_compare.rs +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_compare.rb +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_only_compare.go +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_only_compare.rs +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_metrics_no_events_no_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_metrics_with_event.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_pings.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/single_labeled.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/smaller.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/tags.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/telemetry_mirror.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/text.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/text_invalid.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/unknown_ping_used.yaml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/wrong_key.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/yaml_nits.yamlx +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/detekt.yml +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-go/test.go.tmpl +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-js/package.json +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-js/test.js.tmpl +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-py/test.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-rb/test.rb.tmpl +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test-rs/test.rs.tmpl +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_cli.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_go_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_javascript.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_javascript_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_kotlin.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_markdown.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_metrics.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_pings.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_python_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_ruby_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_rust.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_rust_server.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_swift.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_tags.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_translate.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_utils.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/test_validate_ping.py +0 -0
- {glean_parser-17.2.0 → glean_parser-17.3.0}/tests/util.py +0 -0
|
@@ -320,6 +320,36 @@ def check_empty_datareview(
|
|
|
320
320
|
yield "List of data reviews should not contain empty strings or TODO markers."
|
|
321
321
|
|
|
322
322
|
|
|
323
|
+
def check_event_extras_potential_data_sensitivity_required(
|
|
324
|
+
metric: metrics.Metric, parser_config: Dict[str, Any]
|
|
325
|
+
) -> LintGenerator:
|
|
326
|
+
# Only looking at event metrics
|
|
327
|
+
if not isinstance(metric, metrics.Event):
|
|
328
|
+
return
|
|
329
|
+
|
|
330
|
+
# TODO(bug 1890648): Not all metrics have `data_sensitivity` defined.
|
|
331
|
+
has_data_sensitivity = hasattr(metric, "data_sensitivity")
|
|
332
|
+
# If already marked as "highly sensitive" no need for further checks
|
|
333
|
+
if has_data_sensitivity and any(
|
|
334
|
+
[
|
|
335
|
+
sensitivity == metrics.DataSensitivity.highly_sensitive
|
|
336
|
+
for sensitivity in metric.data_sensitivity
|
|
337
|
+
]
|
|
338
|
+
):
|
|
339
|
+
return
|
|
340
|
+
|
|
341
|
+
# List of potentially sensitive extra key names we want to flag.
|
|
342
|
+
potential_sensitive_names = ["url", "uri"]
|
|
343
|
+
name_list = ", ".join(potential_sensitive_names)
|
|
344
|
+
|
|
345
|
+
for extra_key in metric.extra_keys.keys():
|
|
346
|
+
if extra_key in potential_sensitive_names:
|
|
347
|
+
yield (
|
|
348
|
+
f"`{extra_key}` could potentially be used to collect sensitive data. Increase the metric's data sensitivity or disable the lint."
|
|
349
|
+
+ f" (This lint applies for the following extra key names: {name_list})"
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
|
|
323
353
|
def check_redundant_ping(
|
|
324
354
|
pings: pings.Ping, parser_config: Dict[str, Any]
|
|
325
355
|
) -> LintGenerator:
|
|
@@ -432,6 +462,10 @@ METRIC_CHECKS: Dict[
|
|
|
432
462
|
"METRIC_ON_EVENTS_LIFETIME": (check_metric_on_events_lifetime, CheckType.error),
|
|
433
463
|
"UNEXPECTED_UNIT": (check_unexpected_unit, CheckType.warning),
|
|
434
464
|
"EMPTY_DATAREVIEW": (check_empty_datareview, CheckType.warning),
|
|
465
|
+
"HIGHER_DATA_SENSITIVITY_REQUIRED": (
|
|
466
|
+
check_event_extras_potential_data_sensitivity_required,
|
|
467
|
+
CheckType.warning,
|
|
468
|
+
),
|
|
435
469
|
}
|
|
436
470
|
|
|
437
471
|
|
|
@@ -15,10 +15,6 @@ description: |
|
|
|
15
15
|
$id: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|
16
16
|
|
|
17
17
|
definitions:
|
|
18
|
-
token:
|
|
19
|
-
type: string
|
|
20
|
-
pattern: "^[A-Za-z_][A-Za-z0-9_\\.]*$"
|
|
21
|
-
|
|
22
18
|
snake_case:
|
|
23
19
|
type: string
|
|
24
20
|
pattern: "^[a-z_][a-z0-9_]*$"
|
|
@@ -39,11 +35,6 @@ definitions:
|
|
|
39
35
|
type: string
|
|
40
36
|
pattern: "^[a-z][a-z0-9-]{0,29}$"
|
|
41
37
|
|
|
42
|
-
long_id:
|
|
43
|
-
allOf:
|
|
44
|
-
- $ref: "#/definitions/snake_case"
|
|
45
|
-
- maxLength: 40
|
|
46
|
-
|
|
47
38
|
short_id:
|
|
48
39
|
allOf:
|
|
49
40
|
- $ref: "#/definitions/snake_case"
|
|
@@ -15,10 +15,6 @@ description: |
|
|
|
15
15
|
$id: moz://mozilla.org/schemas/glean/pings/2-0-0
|
|
16
16
|
|
|
17
17
|
definitions:
|
|
18
|
-
dotted_snake_case:
|
|
19
|
-
type: string
|
|
20
|
-
pattern: "^[a-z_][a-z0-9_]{0,29}(\\.[a-z_][a-z0-9_]{0,29})*$"
|
|
21
|
-
maxLength: 40
|
|
22
18
|
# Prior to version 2.0.0 of the schema, special ping names with underscores
|
|
23
19
|
# were also supported.
|
|
24
20
|
kebab_case:
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Any copyright is dedicated to the Public Domain.
|
|
2
|
+
# https://creativecommons.org/publicdomain/zero/1.0/
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
|
6
|
+
|
|
7
|
+
event:
|
|
8
|
+
low_sensitivity:
|
|
9
|
+
type: event
|
|
10
|
+
description: |
|
|
11
|
+
Just testing events
|
|
12
|
+
bugs:
|
|
13
|
+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1973017
|
|
14
|
+
data_reviews:
|
|
15
|
+
- http://example.com/reviews
|
|
16
|
+
notification_emails:
|
|
17
|
+
- CHANGE-ME@example.com
|
|
18
|
+
extra_keys:
|
|
19
|
+
url:
|
|
20
|
+
type: string
|
|
21
|
+
description: "This is key one"
|
|
22
|
+
expires: never
|
|
23
|
+
data_sensitivity:
|
|
24
|
+
- technical
|
|
25
|
+
|
|
26
|
+
no_data_sensitivity:
|
|
27
|
+
type: event
|
|
28
|
+
description: |
|
|
29
|
+
Just testing events
|
|
30
|
+
bugs:
|
|
31
|
+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1973017
|
|
32
|
+
data_reviews:
|
|
33
|
+
- http://example.com/reviews
|
|
34
|
+
notification_emails:
|
|
35
|
+
- CHANGE-ME@example.com
|
|
36
|
+
extra_keys:
|
|
37
|
+
url:
|
|
38
|
+
type: string
|
|
39
|
+
description: "This is key one"
|
|
40
|
+
expires: never
|
|
41
|
+
|
|
42
|
+
correct_sensitivity:
|
|
43
|
+
type: event
|
|
44
|
+
description: |
|
|
45
|
+
Just testing events
|
|
46
|
+
bugs:
|
|
47
|
+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1973017
|
|
48
|
+
data_reviews:
|
|
49
|
+
- http://example.com/reviews
|
|
50
|
+
notification_emails:
|
|
51
|
+
- CHANGE-ME@example.com
|
|
52
|
+
extra_keys:
|
|
53
|
+
url:
|
|
54
|
+
type: string
|
|
55
|
+
description: "This is key one"
|
|
56
|
+
expires: never
|
|
57
|
+
data_sensitivity:
|
|
58
|
+
- highly_sensitive
|
|
59
|
+
|
|
60
|
+
exempt:
|
|
61
|
+
type: event
|
|
62
|
+
description: |
|
|
63
|
+
Just testing events
|
|
64
|
+
bugs:
|
|
65
|
+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1973017
|
|
66
|
+
data_reviews:
|
|
67
|
+
- http://example.com/reviews
|
|
68
|
+
notification_emails:
|
|
69
|
+
- CHANGE-ME@example.com
|
|
70
|
+
extra_keys:
|
|
71
|
+
url:
|
|
72
|
+
type: string
|
|
73
|
+
description: "This is key one"
|
|
74
|
+
expires: never
|
|
75
|
+
data_sensitivity:
|
|
76
|
+
- technical
|
|
77
|
+
no_lint:
|
|
78
|
+
- HIGHER_DATA_SENSITIVITY_REQUIRED
|
|
@@ -644,3 +644,112 @@ def test_unit_on_metrics(metric, num_nits):
|
|
|
644
644
|
assert len(nits) == num_nits
|
|
645
645
|
if num_nits > 0:
|
|
646
646
|
assert set(["UNEXPECTED_UNIT"]) == set(v.check_name for v in nits)
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
@pytest.mark.parametrize(
|
|
650
|
+
"metric, num_nits",
|
|
651
|
+
[
|
|
652
|
+
(
|
|
653
|
+
{
|
|
654
|
+
"metric": {
|
|
655
|
+
"type": "event",
|
|
656
|
+
"extra_keys": {
|
|
657
|
+
"id": {"type": "string", "description": "description"}
|
|
658
|
+
},
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
0,
|
|
662
|
+
),
|
|
663
|
+
(
|
|
664
|
+
{
|
|
665
|
+
"metric": {
|
|
666
|
+
"type": "event",
|
|
667
|
+
"extra_keys": {
|
|
668
|
+
"url": {"type": "string", "description": "description"}
|
|
669
|
+
},
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
1,
|
|
673
|
+
),
|
|
674
|
+
(
|
|
675
|
+
{
|
|
676
|
+
"metric": {
|
|
677
|
+
"type": "event",
|
|
678
|
+
"extra_keys": {
|
|
679
|
+
"url": {"type": "string", "description": "description"}
|
|
680
|
+
},
|
|
681
|
+
"no_lint": ["HIGHER_DATA_SENSITIVITY_REQUIRED"],
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
0,
|
|
685
|
+
),
|
|
686
|
+
(
|
|
687
|
+
{
|
|
688
|
+
"metric": {
|
|
689
|
+
"type": "event",
|
|
690
|
+
"extra_keys": {
|
|
691
|
+
"url": {"type": "string", "description": "description"}
|
|
692
|
+
},
|
|
693
|
+
"data_sensitivity": ["technical"],
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
1,
|
|
697
|
+
),
|
|
698
|
+
(
|
|
699
|
+
{
|
|
700
|
+
"metric": {
|
|
701
|
+
"type": "event",
|
|
702
|
+
"extra_keys": {
|
|
703
|
+
"url": {"type": "string", "description": "description"}
|
|
704
|
+
},
|
|
705
|
+
"data_sensitivity": ["highly_sensitive"],
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
0,
|
|
709
|
+
),
|
|
710
|
+
(
|
|
711
|
+
{
|
|
712
|
+
"metric": {
|
|
713
|
+
"type": "event",
|
|
714
|
+
"extra_keys": {
|
|
715
|
+
"url": {"type": "string", "description": "description"}
|
|
716
|
+
},
|
|
717
|
+
"data_sensitivity": ["technical", "highly_sensitive"],
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
0,
|
|
721
|
+
),
|
|
722
|
+
],
|
|
723
|
+
)
|
|
724
|
+
def test_events_data_sensitivity(metric, num_nits):
|
|
725
|
+
content = {"category": metric}
|
|
726
|
+
content = util.add_required(content)
|
|
727
|
+
all_metrics = parser.parse_objects(content)
|
|
728
|
+
|
|
729
|
+
errs = list(all_metrics)
|
|
730
|
+
assert len(errs) == 0
|
|
731
|
+
|
|
732
|
+
nits = lint.lint_metrics(all_metrics.value)
|
|
733
|
+
|
|
734
|
+
assert len(nits) == num_nits
|
|
735
|
+
if num_nits > 0:
|
|
736
|
+
assert set(["HIGHER_DATA_SENSITIVITY_REQUIRED"]) == set(
|
|
737
|
+
v.check_name for v in nits
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
def test_events_data_sensitivity_from_file():
|
|
742
|
+
"""Test that the 'glinter' reports issues with the old event API."""
|
|
743
|
+
all_metrics = parser.parse_objects([ROOT / "data" / "events_data_sensitivity.yaml"])
|
|
744
|
+
errs = list(all_metrics)
|
|
745
|
+
assert len(errs) == 0
|
|
746
|
+
|
|
747
|
+
nits = lint.lint_metrics(all_metrics.value, parser_config={})
|
|
748
|
+
assert len(nits) == 2
|
|
749
|
+
assert nits[0].check_name == "HIGHER_DATA_SENSITIVITY_REQUIRED"
|
|
750
|
+
assert nits[0].name == "event.low_sensitivity"
|
|
751
|
+
assert "data sensitivity" in nits[0].msg
|
|
752
|
+
|
|
753
|
+
assert nits[1].check_name == "HIGHER_DATA_SENSITIVITY_REQUIRED"
|
|
754
|
+
assert nits[1].name == "event.no_data_sensitivity"
|
|
755
|
+
assert "data sensitivity" in nits[1].msg
|
|
@@ -1153,6 +1153,13 @@ def test_no_internal_fields_exposed():
|
|
|
1153
1153
|
"extra_keys": {
|
|
1154
1154
|
"key_a": {"description": "desc-a", "type": "boolean"}
|
|
1155
1155
|
},
|
|
1156
|
+
},
|
|
1157
|
+
"metric2": {
|
|
1158
|
+
"type": "dual_labeled_counter",
|
|
1159
|
+
"dual_labels": {
|
|
1160
|
+
"key": { "description": "desc-a" },
|
|
1161
|
+
"category": { "description": "desc-b" },
|
|
1162
|
+
}
|
|
1156
1163
|
}
|
|
1157
1164
|
},
|
|
1158
1165
|
}
|
|
@@ -1185,7 +1192,25 @@ def test_no_internal_fields_exposed():
|
|
|
1185
1192
|
"send_in_pings": ["events"],
|
|
1186
1193
|
"type": "event",
|
|
1187
1194
|
"version": 0,
|
|
1188
|
-
}
|
|
1195
|
+
},
|
|
1196
|
+
"category.metric2": {
|
|
1197
|
+
"bugs": ["http://bugzilla.mozilla.org/12345678"],
|
|
1198
|
+
"categories": None,
|
|
1199
|
+
"data_reviews": ["https://example.com/review/"],
|
|
1200
|
+
"defined_in": {"line": 17},
|
|
1201
|
+
"description": "DESCRIPTION...",
|
|
1202
|
+
"disabled": False,
|
|
1203
|
+
"expires": "never",
|
|
1204
|
+
"gecko_datapoint": "",
|
|
1205
|
+
"keys": None,
|
|
1206
|
+
"lifetime": "ping",
|
|
1207
|
+
"metadata": {},
|
|
1208
|
+
"no_lint": [],
|
|
1209
|
+
"notification_emails": ["nobody@example.com"],
|
|
1210
|
+
"send_in_pings": ["metrics"],
|
|
1211
|
+
"type": "dual_labeled_counter",
|
|
1212
|
+
"version": 0,
|
|
1213
|
+
},
|
|
1189
1214
|
}
|
|
1190
1215
|
expected_json = json.dumps(expected, sort_keys=True, indent=2)
|
|
1191
1216
|
|
|
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-17.2.0 → glean_parser-17.3.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
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_custom_ping_only_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/go_server_events_and_custom_ping_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.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
|
|
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-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_custom_ping_only_metrics.yaml
RENAMED
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/rust_server_custom_ping_only_pings.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.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
|
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_and_custom_ping_compare.go
RENAMED
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.0}/tests/data/server_events_and_custom_ping_compare.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{glean_parser-17.2.0 → glean_parser-17.3.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
|