mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00
Bug 1672951 - Upgrade glean_parser to 3.2.0 r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D114971
This commit is contained in:
parent
ea19316503
commit
f693b0a77c
@ -27,7 +27,7 @@ commands:
|
||||
.rb/bin/pip install requirements-builder
|
||||
.rb/bin/requirements-builder --level=min setup.py > min_requirements.txt
|
||||
|
||||
pip install --use-feature=2020-resolver --progress-bar off --user -U -r min_requirements.txt
|
||||
pip install --progress-bar off --user -U -r min_requirements.txt
|
||||
|
||||
test-python-version:
|
||||
parameters:
|
||||
@ -38,7 +38,7 @@ commands:
|
||||
- run:
|
||||
name: install
|
||||
command: |
|
||||
pip install --use-feature=2020-resolver --progress-bar off --user -U -r <<parameters.requirements-file>>
|
||||
pip install --progress-bar off --user -U -r <<parameters.requirements-file>>
|
||||
sudo apt update -q
|
||||
sudo apt upgrade -q
|
||||
sudo apt install openjdk-11-jdk-headless
|
||||
@ -112,6 +112,13 @@ jobs:
|
||||
- test-start
|
||||
- test-python-version
|
||||
|
||||
build-310:
|
||||
docker:
|
||||
- image: circleci/python:3.10-rc
|
||||
steps:
|
||||
- test-start
|
||||
- test-python-version
|
||||
|
||||
docs-deploy:
|
||||
docker:
|
||||
- image: node:8.10.0
|
||||
@ -149,7 +156,7 @@ jobs:
|
||||
- run:
|
||||
name: install
|
||||
command: |
|
||||
pip install --use-feature=2020-resolver --user -U -r requirements_dev.txt
|
||||
pip install --user -U -r requirements_dev.txt
|
||||
- run:
|
||||
name: deploy
|
||||
# Requires that the TWINE_USERNAME and TWINE_PASSWORD environment
|
||||
@ -185,6 +192,10 @@ workflows:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- build-310:
|
||||
filters:
|
||||
tags:
|
||||
only: /.*/
|
||||
- docs-deploy:
|
||||
requires:
|
||||
- build-37
|
||||
|
@ -4,5 +4,5 @@
|
||||
- `make test` runs without emitting any warnings
|
||||
- `make lint` runs without emitting any errors
|
||||
- [ ] **Tests**: This PR includes thorough tests or an explanation of why it does not
|
||||
- [ ] **Changelog**: This PR includes a changelog entry to `HISTORY.rst` or an explanation of why it does not need one
|
||||
- [ ] **Changelog**: This PR includes a changelog entry to `CHANGELOG.md` or an explanation of why it does not need one
|
||||
- Any breaking changes to language binding APIs are noted explicitly
|
||||
|
26
third_party/python/glean_parser/CHANGELOG.md
vendored
26
third_party/python/glean_parser/CHANGELOG.md
vendored
@ -1,6 +1,30 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## 3.2.0 (2021-04-28)
|
||||
|
||||
- Add option to add extra introductory text to generated markdown ([#298](https://github.com/mozilla/glean_parser/pull/298))
|
||||
- Add support for Qt in Javascript templates ([bug 1706252](https://bugzilla.mozilla.org/show_bug.cgi?id=1706252))
|
||||
- Javascript templates will now accept the `platform` option. If this option is set to `qt`
|
||||
the generated templates will be Qt compatible. Default value is `webext`.
|
||||
|
||||
## 3.1.2 (2021-04-21)
|
||||
|
||||
- BUGFIX: Remove the "DO NOT COMMIT" notice from the documentation.
|
||||
|
||||
## 3.1.1 (2021-04-19)
|
||||
|
||||
- Recommend to not commit as well as to not edit the generated files. ([bug 1706042](https://bugzilla.mozilla.org/show_bug.cgi?id=1706042))
|
||||
- BUGFIX: Include import statement for labeled metric subtypes in Javascript and Typescript templates.
|
||||
|
||||
## 3.1.0 (2021-04-16)
|
||||
|
||||
- Add support for labeled metric types in Javascript and Typescript templates.
|
||||
|
||||
## 3.0.0 (2021-04-13)
|
||||
|
||||
- Raise limit on number of statically-defined lables to 100. ([bug 1702263](https://bugzilla.mozilla.org/show_bug.cgi?id=1702263))
|
||||
- BUGFIX: Version 2.0.0 of the schema now allows the "special" `glean_.*` ping names for Glean-internal use again.
|
||||
- Remove support for JWE metric types.
|
||||
|
||||
## 2.5.0 (2021-02-23)
|
||||
|
||||
|
38
third_party/python/glean_parser/PKG-INFO
vendored
38
third_party/python/glean_parser/PKG-INFO
vendored
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: glean_parser
|
||||
Version: 2.5.0
|
||||
Version: 3.2.0
|
||||
Summary: Parser tools for Mozilla's Glean telemetry
|
||||
Home-page: https://github.com/mozilla/glean_parser
|
||||
Author: Michael Droettboom
|
||||
@ -12,13 +12,15 @@ Description: # Glean Parser
|
||||
|
||||
## Features
|
||||
|
||||
Parses the `metrics.yaml` files for the Glean telemetry SDK and produces
|
||||
output for various integrations.
|
||||
Contains various utilities for handling `metrics.yaml` and `pings.yaml` for [the
|
||||
Glean SDK](https://mozilla.github.io/glean). This includes producing generated
|
||||
code for various integrations, linting and coverage testing.
|
||||
|
||||
## Documentation
|
||||
|
||||
The full documentation is available
|
||||
[here](https://mozilla.github.io/glean_parser/).
|
||||
- [How to Contribute](https://github.com/mozilla/glean_parser/blob/main/CONTRIBUTING.md). Please file bugs in [bugzilla](https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fission_milestone=---&cf_fx_iteration=---&cf_fx_points=---&cf_status_firefox65=---&cf_status_firefox66=---&cf_status_firefox67=---&cf_status_firefox_esr60=---&cf_status_thunderbird_esr60=---&cf_tracking_firefox65=---&cf_tracking_firefox66=---&cf_tracking_firefox67=---&cf_tracking_firefox_esr60=---&cf_tracking_firefox_relnote=---&cf_tracking_thunderbird_esr60=---&product=Data%20Platform%20and%20Tools&component=Glean%3A%20SDK&contenttypemethod=list&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-203=X&flag_type-37=X&flag_type-41=X&flag_type-607=X&flag_type-721=X&flag_type-737=X&flag_type-787=X&flag_type-799=X&flag_type-800=X&flag_type-803=X&flag_type-835=X&flag_type-846=X&flag_type-855=X&flag_type-864=X&flag_type-916=X&flag_type-929=X&flag_type-930=X&flag_type-935=X&flag_type-936=X&flag_type-937=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=P3&&rep_platform=Unspecified&status_whiteboard=%5Btelemetry%3Aglean-rs%3Am%3F%5D&target_milestone=---&version=unspecified).
|
||||
- [User documentation for Glean](https://mozilla.github.io/glean/).
|
||||
- [`glean_parser` developer documentation](https://mozilla.github.io/glean_parser/).
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -60,7 +62,31 @@ Description: # Glean Parser
|
||||
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## 3.2.0 (2021-04-28)
|
||||
|
||||
- Add option to add extra introductory text to generated markdown ([#298](https://github.com/mozilla/glean_parser/pull/298))
|
||||
- Add support for Qt in Javascript templates ([bug 1706252](https://bugzilla.mozilla.org/show_bug.cgi?id=1706252))
|
||||
- Javascript templates will now accept the `platform` option. If this option is set to `qt`
|
||||
the generated templates will be Qt compatible. Default value is `webext`.
|
||||
|
||||
## 3.1.2 (2021-04-21)
|
||||
|
||||
- BUGFIX: Remove the "DO NOT COMMIT" notice from the documentation.
|
||||
|
||||
## 3.1.1 (2021-04-19)
|
||||
|
||||
- Recommend to not commit as well as to not edit the generated files. ([bug 1706042](https://bugzilla.mozilla.org/show_bug.cgi?id=1706042))
|
||||
- BUGFIX: Include import statement for labeled metric subtypes in Javascript and Typescript templates.
|
||||
|
||||
## 3.1.0 (2021-04-16)
|
||||
|
||||
- Add support for labeled metric types in Javascript and Typescript templates.
|
||||
|
||||
## 3.0.0 (2021-04-13)
|
||||
|
||||
- Raise limit on number of statically-defined lables to 100. ([bug 1702263](https://bugzilla.mozilla.org/show_bug.cgi?id=1702263))
|
||||
- BUGFIX: Version 2.0.0 of the schema now allows the "special" `glean_.*` ping names for Glean-internal use again.
|
||||
- Remove support for JWE metric types.
|
||||
|
||||
## 2.5.0 (2021-02-23)
|
||||
|
||||
|
10
third_party/python/glean_parser/README.md
vendored
10
third_party/python/glean_parser/README.md
vendored
@ -4,13 +4,15 @@ Parser tools for Mozilla's Glean telemetry.
|
||||
|
||||
## Features
|
||||
|
||||
Parses the `metrics.yaml` files for the Glean telemetry SDK and produces
|
||||
output for various integrations.
|
||||
Contains various utilities for handling `metrics.yaml` and `pings.yaml` for [the
|
||||
Glean SDK](https://mozilla.github.io/glean). This includes producing generated
|
||||
code for various integrations, linting and coverage testing.
|
||||
|
||||
## Documentation
|
||||
|
||||
The full documentation is available
|
||||
[here](https://mozilla.github.io/glean_parser/).
|
||||
- [How to Contribute](https://github.com/mozilla/glean_parser/blob/main/CONTRIBUTING.md). Please file bugs in [bugzilla](https://bugzilla.mozilla.org/enter_bug.cgi?assigned_to=nobody%40mozilla.org&bug_ignored=0&bug_severity=normal&bug_status=NEW&cf_fission_milestone=---&cf_fx_iteration=---&cf_fx_points=---&cf_status_firefox65=---&cf_status_firefox66=---&cf_status_firefox67=---&cf_status_firefox_esr60=---&cf_status_thunderbird_esr60=---&cf_tracking_firefox65=---&cf_tracking_firefox66=---&cf_tracking_firefox67=---&cf_tracking_firefox_esr60=---&cf_tracking_firefox_relnote=---&cf_tracking_thunderbird_esr60=---&product=Data%20Platform%20and%20Tools&component=Glean%3A%20SDK&contenttypemethod=list&contenttypeselection=text%2Fplain&defined_groups=1&flag_type-203=X&flag_type-37=X&flag_type-41=X&flag_type-607=X&flag_type-721=X&flag_type-737=X&flag_type-787=X&flag_type-799=X&flag_type-800=X&flag_type-803=X&flag_type-835=X&flag_type-846=X&flag_type-855=X&flag_type-864=X&flag_type-916=X&flag_type-929=X&flag_type-930=X&flag_type-935=X&flag_type-936=X&flag_type-937=X&form_name=enter_bug&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=Unspecified&priority=P3&&rep_platform=Unspecified&status_whiteboard=%5Btelemetry%3Aglean-rs%3Am%3F%5D&target_milestone=---&version=unspecified).
|
||||
- [User documentation for Glean](https://mozilla.github.io/glean/).
|
||||
- [`glean_parser` developer documentation](https://mozilla.github.io/glean_parser/).
|
||||
|
||||
## Requirements
|
||||
|
||||
|
@ -11,7 +11,7 @@ Outputter to generate Javascript code for metrics.
|
||||
import enum
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Union # noqa
|
||||
from typing import Any, Dict, List, Optional, Union, Callable # noqa
|
||||
|
||||
from . import metrics
|
||||
from . import util
|
||||
@ -26,21 +26,40 @@ def javascript_datatypes_filter(value: util.JSONType) -> str:
|
||||
def iterencode(self, value):
|
||||
if isinstance(value, enum.Enum):
|
||||
yield from super().iterencode(util.camelize(value.name))
|
||||
elif isinstance(value, set):
|
||||
yield "["
|
||||
first = True
|
||||
for subvalue in sorted(list(value)):
|
||||
if not first:
|
||||
yield ", "
|
||||
yield from self.iterencode(subvalue)
|
||||
first = False
|
||||
yield "]"
|
||||
else:
|
||||
yield from super().iterencode(value)
|
||||
|
||||
return "".join(JavascriptEncoder().iterencode(value))
|
||||
|
||||
|
||||
def class_name_factory(platform: str, namespace: str) -> Callable[[str], str]:
|
||||
"""
|
||||
Returns a function that receives an obj_type and
|
||||
returns the correct class name for that time in the current platform.
|
||||
"""
|
||||
|
||||
def class_name(obj_type: str) -> str:
|
||||
"""
|
||||
Returns the Javascript class name for a given metric or ping type.
|
||||
"""
|
||||
if obj_type == "ping":
|
||||
class_name = "PingType"
|
||||
else:
|
||||
if obj_type.startswith("labeled_"):
|
||||
obj_type = obj_type[8:]
|
||||
class_name = util.Camelize(obj_type) + "MetricType"
|
||||
|
||||
if platform == "qt":
|
||||
return namespace + ".Glean.default._private." + class_name
|
||||
|
||||
return class_name
|
||||
|
||||
return class_name
|
||||
|
||||
|
||||
@ -51,7 +70,9 @@ def import_path(obj_type: str) -> str:
|
||||
if obj_type == "ping":
|
||||
import_path = "ping"
|
||||
else:
|
||||
import_path = "metrics/" + util.camelize(obj_type)
|
||||
if obj_type.startswith("labeled_"):
|
||||
obj_type = obj_type[8:]
|
||||
import_path = "metrics/" + obj_type
|
||||
|
||||
return import_path
|
||||
|
||||
@ -81,23 +102,23 @@ def output(
|
||||
:param output_dir: Path to an output directory to write to.
|
||||
:param options: options dictionary, with the following optional keys:
|
||||
|
||||
- `namespace`: The identifier of the global variable to assign to.
|
||||
- `namespace`: The identifier of the global variable Glean was assigned to.
|
||||
This will only have and effect for Qt and static web sites.
|
||||
Default is `gleanAssets`.
|
||||
- `glean_namespace`: Which version of the `@mozilla/glean` package to import,
|
||||
options are `webext` or `qt`. Default is `webext`.
|
||||
Default is `Glean`.
|
||||
- `platform`: Which platform are we building for. Options are `webext` and `qt`.
|
||||
Default is `webext`.
|
||||
"""
|
||||
|
||||
if options is None:
|
||||
options = {}
|
||||
|
||||
namespace = options.get("namespace", "gleanAssets")
|
||||
glean_namespace = options.get("glean_namespace", "webext")
|
||||
namespace = options.get("namespace", "Glean")
|
||||
platform = options.get("platform", "webext")
|
||||
|
||||
template = util.get_jinja2_template(
|
||||
"javascript.jinja2",
|
||||
filters=(
|
||||
("class_name", class_name),
|
||||
("class_name", class_name_factory(platform, namespace)),
|
||||
("import_path", import_path),
|
||||
("js", javascript_datatypes_filter),
|
||||
("args", args),
|
||||
@ -109,7 +130,21 @@ def output(
|
||||
filename = util.camelize(category_key) + extension
|
||||
filepath = output_dir / filename
|
||||
|
||||
types = set([util.camelize(obj.type) for obj in category_val.values()])
|
||||
types = set(
|
||||
[
|
||||
# This takes care of the regular metric type imports
|
||||
# as well as the labeled metric subtype imports,
|
||||
# thus the removal of the `labeled_` substring.
|
||||
#
|
||||
# The actual LabeledMetricType import is conditioned after
|
||||
# the `has_labeled_metrics` boolean.
|
||||
obj.type if not obj.type.startswith("labeled_") else obj.type[8:]
|
||||
for obj in category_val.values()
|
||||
]
|
||||
)
|
||||
has_labeled_metrics = any(
|
||||
getattr(metric, "labeled", False) for metric in category_val.values()
|
||||
)
|
||||
with filepath.open("w", encoding="utf-8") as fd:
|
||||
fd.write(
|
||||
template.render(
|
||||
@ -117,7 +152,8 @@ def output(
|
||||
objs=category_val,
|
||||
extra_args=util.extra_args,
|
||||
namespace=namespace,
|
||||
glean_namespace=glean_namespace,
|
||||
platform=platform,
|
||||
has_labeled_metrics=has_labeled_metrics,
|
||||
types=types,
|
||||
lang=lang,
|
||||
)
|
||||
@ -139,9 +175,9 @@ def output_javascript(
|
||||
|
||||
- `namespace`: The identifier of the global variable to assign to.
|
||||
This will only have and effect for Qt and static web sites.
|
||||
Default is `gleanAssets`.
|
||||
- `glean_namespace`: Which version of the `@mozilla/glean` package to import,
|
||||
options are `webext` or `qt`. Default is `webext`.
|
||||
Default is `Glean`.
|
||||
- `platform`: Which platform are we building for. Options are `webext` and `qt`.
|
||||
Default is `webext`.
|
||||
"""
|
||||
|
||||
output("javascript", objs, output_dir, options)
|
||||
@ -165,9 +201,9 @@ def output_typescript(
|
||||
|
||||
- `namespace`: The identifier of the global variable to assign to.
|
||||
This will only have and effect for Qt and static web sites.
|
||||
Default is `gleanAssets`.
|
||||
- `glean_namespace`: Which version of the `@mozilla/glean` package to import,
|
||||
options are `webext` or `qt`. Default is `webext`.
|
||||
Default is `Glean`.
|
||||
- `platform`: Which platform are we building for. Options are `webext` and `qt`.
|
||||
Default is `webext`.
|
||||
"""
|
||||
|
||||
output("typescript", objs, output_dir, options)
|
||||
|
@ -34,9 +34,6 @@ def extra_info(obj: Union[metrics.Metric, pings.Ping]) -> List[Tuple[str, str]]:
|
||||
for label in obj.ordered_labels:
|
||||
extra_info.append((label, None))
|
||||
|
||||
if isinstance(obj, metrics.Jwe):
|
||||
extra_info.append(("decrypted_name", obj.decrypted_name))
|
||||
|
||||
if isinstance(obj, metrics.Quantity):
|
||||
extra_info.append(("unit", obj.unit))
|
||||
|
||||
@ -237,6 +234,7 @@ def output_markdown(
|
||||
)
|
||||
|
||||
project_title = options.get("project_title", "this project")
|
||||
introduction_extra = options.get("introduction_extra")
|
||||
|
||||
template = util.get_jinja2_template(
|
||||
"markdown.jinja2",
|
||||
@ -264,7 +262,9 @@ def output_markdown(
|
||||
with filepath.open("w", encoding="utf-8") as fd:
|
||||
fd.write(
|
||||
template.render(
|
||||
metrics_by_pings=metrics_by_pings, project_title=project_title
|
||||
metrics_by_pings=metrics_by_pings,
|
||||
project_title=project_title,
|
||||
introduction_extra=introduction_extra,
|
||||
)
|
||||
)
|
||||
# Jinja2 squashes the final newline, so we explicitly add it
|
||||
|
@ -325,8 +325,10 @@ class Jwe(Metric):
|
||||
typename = "jwe"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.decrypted_name = kwargs.pop("decrypted_name")
|
||||
super().__init__(*args, **kwargs)
|
||||
raise ValueError(
|
||||
"JWE support was removed. "
|
||||
"If you require this send an email to glean-team@mozilla.com."
|
||||
)
|
||||
|
||||
|
||||
class Labeled(Metric):
|
||||
|
@ -107,6 +107,11 @@ definitions:
|
||||
properties: `range_min`, `range_max`, `bucket_count`,
|
||||
`histogram_type`.
|
||||
|
||||
- `rate`: Used to record the rate something happens relative to some
|
||||
other thing. For example, the number of HTTP connections that
|
||||
experience an error relative to the number of total HTTP
|
||||
connections made.
|
||||
|
||||
- Additionally, labeled versions of many metric types are supported.
|
||||
These support the `labels`_ parameter, allowing multiple instances
|
||||
of the metric to be stored at a given set of labels. The labeled
|
||||
|
@ -94,8 +94,6 @@ definitions:
|
||||
|
||||
- `uuid`: Record a UUID v4.
|
||||
|
||||
- `jwe`: Record a [JWE](https://tools.ietf.org/html/rfc7516) value.
|
||||
|
||||
- `memory_distribution`: A histogram for recording memory usage
|
||||
values. Additional properties: `memory_unit`.
|
||||
|
||||
@ -105,6 +103,11 @@ definitions:
|
||||
properties: `range_min`, `range_max`, `bucket_count`,
|
||||
`histogram_type`.
|
||||
|
||||
- `rate`: Used to record the rate something happens relative to some
|
||||
other thing. For example, the number of HTTP connections that
|
||||
experience an error relative to the number of total HTTP
|
||||
connections made.
|
||||
|
||||
- Additionally, labeled versions of many metric types are supported.
|
||||
These support the `labels`_ parameter, allowing multiple instances
|
||||
of the metric to be stored at a given set of labels. The labeled
|
||||
@ -177,7 +180,12 @@ definitions:
|
||||
in any ping.)
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/kebab_case"
|
||||
anyOf:
|
||||
- $ref: "#/definitions/kebab_case"
|
||||
# Allow "special" ping names that start with "glean_" used
|
||||
# internally by the Glean SDK
|
||||
- type: string
|
||||
pattern: "^glean_.*$"
|
||||
default:
|
||||
- default
|
||||
|
||||
@ -318,7 +326,7 @@ definitions:
|
||||
uniqueItems: true
|
||||
items:
|
||||
$ref: "#/definitions/labeled_metric_id"
|
||||
maxItems: 16
|
||||
maxItems: 100
|
||||
- type: "null"
|
||||
|
||||
extra_keys:
|
||||
@ -412,16 +420,6 @@ definitions:
|
||||
items:
|
||||
type: string
|
||||
|
||||
decrypted_name:
|
||||
title: Decrypted name
|
||||
description: |
|
||||
Name of the column where to persist the decrypted value
|
||||
stored in the JWE after processing.
|
||||
|
||||
Required when `type`_ is `jwe`.
|
||||
type: string
|
||||
pattern: "^[a-z_][a-z0-9_]{0,29}(\\.[a-z_][a-z0-9_]{0,29})*$"
|
||||
|
||||
data_sensitivity:
|
||||
title: The level of data sensitivity
|
||||
description: |
|
||||
@ -615,9 +613,10 @@ additionalProperties:
|
||||
const: jwe
|
||||
then:
|
||||
required:
|
||||
- decrypted_name
|
||||
- jwe_support_was_removed
|
||||
description: |
|
||||
`jwe` is missing required parameter `decrypted_name`.
|
||||
JWE support was removed.
|
||||
If you require this send an email to glean-team@mozilla.com.
|
||||
- if:
|
||||
not:
|
||||
properties:
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- mode: csharp -*-
|
||||
|
||||
/*
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
*/
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
@ -6,28 +6,42 @@ new {{ obj.type|class_name }}({
|
||||
{{ arg_name|camelize }}: {{ obj[arg_name]|js }},
|
||||
{% endfor %}
|
||||
}{% for arg_name in (obj.type|args).extra if obj[arg_name] is defined %}, {{ obj[arg_name]|js }}{% endfor %}){% endmacro %}
|
||||
{% macro labeled_obj_declaration(obj) %}
|
||||
new {{ "labeled"|class_name }}({
|
||||
{% for arg_name in (obj.type|args).common if obj[arg_name] is defined %}
|
||||
{{ arg_name|camelize }}: {{ obj[arg_name]|js }},
|
||||
{% endfor %}
|
||||
}, {{ obj.type|class_name }}{% if obj.labels is not none %}, {{ obj.labels|js }}{% endif %}){% endmacro %}
|
||||
{% if lang == "javascript" %}
|
||||
"use strict";
|
||||
|
||||
{% endif %}
|
||||
/* eslint-disable */
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
// AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
|
||||
{% for type in types %}
|
||||
import {{ type|class_name }} from "@mozilla/glean/{{ glean_namespace }}/private/{{ type|import_path }}";
|
||||
{% endfor %}
|
||||
{% if lang == "javascript" %}
|
||||
|
||||
"use strict"
|
||||
{% if platform != "qt" %}
|
||||
{% if has_labeled_metrics %}
|
||||
import LabeledMetricType from "@mozilla/glean/{{ platform }}/private/metrics/labeled";
|
||||
{% endif %}
|
||||
{% for type in types %}
|
||||
import {{ type|class_name }} from "@mozilla/glean/{{ platform }}/private/{{ type|import_path }}";
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% for obj in objs.values() %}
|
||||
/**
|
||||
* {{ obj.description|wordwrap() | replace("\n", "\n * ") }}
|
||||
*
|
||||
* Generated from `{{ obj.identifier() }}`.
|
||||
*/
|
||||
export const {{ obj.name|camelize }} = {{ obj_declaration(obj) }};
|
||||
{% if obj.labeled %}
|
||||
{% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ labeled_obj_declaration(obj) }};
|
||||
{% else %}
|
||||
{% if platform != "qt" %}export {% endif %}const {{ obj.name|camelize }} = {{ obj_declaration(obj) }};
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- mode: kotlin -*-
|
||||
|
||||
/*
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
*/
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- mode: kotlin -*-
|
||||
|
||||
/*
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
*/
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- mode: kotlin -*-
|
||||
|
||||
/*
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
* AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
*/
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
@ -7,6 +7,10 @@ Jinja2 template is not. Please file bugs! #}
|
||||
This document enumerates the metrics collected by {{ project_title }} using the [Glean SDK](https://mozilla.github.io/glean/book/index.html).
|
||||
This project may depend on other projects which also collect metrics.
|
||||
This means you might have to go searching through the dependency tree to get a full picture of everything collected by this project.
|
||||
{% if introduction_extra %}
|
||||
|
||||
{{ introduction_extra }}
|
||||
{% endif %}
|
||||
|
||||
# Pings
|
||||
|
||||
@ -89,6 +93,6 @@ This ping contains no metrics.
|
||||
{% endfor %}
|
||||
Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).
|
||||
|
||||
<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. -->
|
||||
<!-- AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT. -->
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- mode: Swift -*-
|
||||
|
||||
// AUTOGENERATED BY glean_parser. DO NOT EDIT.
|
||||
// AUTOGENERATED BY glean_parser. DO NOT EDIT. DO NOT COMMIT.
|
||||
{# The rendered markdown is autogenerated, but this
|
||||
Jinja2 template is not. Please file bugs! #}
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
black==20.8b1
|
||||
coverage==5.4
|
||||
flake8==3.8.4
|
||||
flake8-bugbear==20.11.1
|
||||
coverage==5.5
|
||||
flake8==3.9.1
|
||||
flake8-bugbear==21.4.3
|
||||
m2r==0.2.1
|
||||
mypy==0.812
|
||||
pip
|
||||
pytest-runner==5.3.0
|
||||
pytest==6.2.2
|
||||
pytest==6.2.3
|
||||
recommonmark==0.7.1
|
||||
Sphinx==3.5.1
|
||||
twine==3.3.0
|
||||
watchdog==2.0.1
|
||||
Sphinx==3.5.4
|
||||
twine==3.4.1
|
||||
watchdog==2.0.2
|
||||
wheel
|
||||
yamllint==1.25.0
|
||||
yamllint==1.26.1
|
||||
|
2
third_party/python/requirements.in
vendored
2
third_party/python/requirements.in
vendored
@ -26,7 +26,7 @@ ecdsa==0.15
|
||||
esprima==4.0.1
|
||||
fluent.migrate==0.11
|
||||
fluent.syntax==0.18.1
|
||||
glean_parser==2.5.0
|
||||
glean_parser==3.2.0
|
||||
jsmin==2.1.0
|
||||
json-e==2.7.0
|
||||
mozilla-version==0.3.4
|
||||
|
24
third_party/python/requirements.txt
vendored
24
third_party/python/requirements.txt
vendored
@ -103,22 +103,14 @@ fluent.syntax==0.18.1 \
|
||||
# -r requirements-mach-vendor-python.in
|
||||
# compare-locales
|
||||
# fluent.migrate
|
||||
glean_parser==2.5.0 \
|
||||
--hash=sha256:50d53cb23c7b2ecdfed497187c63ea03bff8f78a0bbfd32dbaffb0affa0b6d2d \
|
||||
--hash=sha256:b2c1b670b73e7df21de335de34e9ece457ef3996110567d7ad6f09fb546e6e5e
|
||||
glean_parser==3.2.0 \
|
||||
--hash=sha256:2959462531ac088bd598530453aea45f6f2980d6a3794aa9dcd8a8bfaf1ba8da \
|
||||
--hash=sha256:f6eb2259707155e18ee97c5b9c868011c4eebfcfe2c98c596f3e82a9d02af4dd
|
||||
# via -r requirements-mach-vendor-python.in
|
||||
idna==2.10 \
|
||||
--hash=sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6 \
|
||||
--hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0
|
||||
# via requests
|
||||
importlib-metadata==3.10.1 \
|
||||
--hash=sha256:2ec0faae539743ae6aaa84b49a169670a465f7f5d64e6add98388cc29fd1f2f6 \
|
||||
--hash=sha256:c9356b657de65c53744046fa8f7358afe0714a1af7d570c00c3835c2d724a7c1
|
||||
# via jsonschema
|
||||
iso8601==0.1.14 \
|
||||
--hash=sha256:8aafd56fa0290496c5edbb13c311f78fa3a241f0853540da09d9363eae3ebd79 \
|
||||
--hash=sha256:e7e1122f064d626e17d47cd5106bed2c620cb38fe464999e0ddae2b6d2de6004
|
||||
# via glean-parser
|
||||
jinja2==2.11.3 \
|
||||
--hash=sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419 \
|
||||
--hash=sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6
|
||||
@ -286,14 +278,8 @@ six==1.13.0 \
|
||||
# jsonschema
|
||||
# more-itertools
|
||||
# pathlib2
|
||||
# pyrsistent
|
||||
# pytest
|
||||
# responses
|
||||
typing-extensions==3.7.4.3 \
|
||||
--hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \
|
||||
--hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c \
|
||||
--hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f
|
||||
# via importlib-metadata
|
||||
urllib3==1.25.9 \
|
||||
--hash=sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527 \
|
||||
--hash=sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115
|
||||
@ -310,10 +296,6 @@ yamllint==1.23 \
|
||||
# via
|
||||
# -r requirements-mach-vendor-python.in
|
||||
# glean-parser
|
||||
zipp==3.4.1 \
|
||||
--hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \
|
||||
--hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098
|
||||
# via importlib-metadata
|
||||
|
||||
# WARNING: The following packages were not pinned, but pip requires them to be
|
||||
# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
|
||||
|
Loading…
x
Reference in New Issue
Block a user