Skip to content

Commit

Permalink
Enable custom distribution without a gecko_datapoint
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed Jun 11, 2021
1 parent 4a87c21 commit f6915ad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Add a command `data-review` to generate a skeleton Data Review Request for all metrics matching a supplied bug number. ([bug 1704541](https://bugzilla.mozilla.org/show_bug.cgi?id=1704541))
- Enable custom distribution outside of GeckoView (`gecko_datapoint` becomes optional)

## 3.5.0 (2021-06-03)

Expand Down
12 changes: 0 additions & 12 deletions glean_parser/schemas/metrics.2-0-0.schema.yaml
Expand Up @@ -567,18 +567,6 @@ additionalProperties:
`custom_distribution`, `memory_distribution`, `quantity`,
`boolean`, `string` and `labeled_counter`.
maxLength: 0
-
if:
properties:
type:
enum:
- custom_distribution
then:
required:
- gecko_datapoint
description: |
`custom_distribution` is only allowed for Gecko
metrics.
-
if:
properties:
Expand Down
9 changes: 2 additions & 7 deletions tests/test_parser.py
Expand Up @@ -338,9 +338,6 @@ def test_geckoview_only_on_valid_metrics():
]
contents = [util.add_required(x) for x in contents]

all_metrics = parser.parse_objects(contents)
errs = list(all_metrics)

contents = [{"category1": {"metric1": {"type": "event", "gecko_datapoint": "FOO"}}}]
contents = [util.add_required(x) for x in contents]

Expand Down Expand Up @@ -390,7 +387,7 @@ def test_all_pings_reserved():


def test_custom_distribution():
# Test that custom_distribution isn't allowed on non-Gecko metric
# Test plain custom_distribution, now also allowed generally
contents = [
{
"category": {
Expand All @@ -408,8 +405,7 @@ def test_custom_distribution():
contents = [util.add_required(x) for x in contents]
all_metrics = parser.parse_objects(contents)
errors = list(all_metrics)
assert len(errors) == 1
assert "is only allowed for Gecko" in errors[0]
assert len(errors) == 0

# Test that custom_distribution has required parameters
contents = [
Expand Down Expand Up @@ -456,7 +452,6 @@ def test_custom_distribution():
"category": {
"metric": {
"type": "custom_distribution",
"gecko_datapoint": "FROM_GECKO",
"range_max": 60000,
"bucket_count": 100,
"histogram_type": "exponential",
Expand Down

0 comments on commit f6915ad

Please sign in to comment.