glean-parser 10.0.2__tar.gz → 11.0.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-10.0.2 → glean_parser-11.0.0}/.circleci/config.yml +39 -25
- {glean_parser-10.0.2 → glean_parser-11.0.0}/CHANGELOG.md +12 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/CONTRIBUTING.md +1 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/Makefile +4 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/PKG-INFO +15 -3
- {glean_parser-10.0.2 → glean_parser-11.0.0}/README.md +1 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/contributing.md +1 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/history.md +12 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/readme.md +1 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/javascript_server.py +65 -23
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/lint.py +24 -6
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/metrics.py +4 -10
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/javascript_server.jinja2 +119 -7
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/ruby_server.jinja2 +1 -23
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/PKG-INFO +15 -3
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/SOURCES.txt +4 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/requirements_dev.txt +2 -2
- {glean_parser-10.0.2 → glean_parser-11.0.0}/setup.py +3 -3
- glean_parser-11.0.0/tests/conftest.py +42 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/server_events_compare.rb +1 -23
- glean_parser-11.0.0/tests/test-js/package.json +10 -0
- glean_parser-11.0.0/tests/test-js/test.js.tmpl +23 -0
- glean_parser-11.0.0/tests/test-rb/test.rb.tmpl +9 -0
- glean_parser-11.0.0/tests/test_javascript_server.py +199 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_lint.py +74 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_metrics.py +1 -1
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_parser.py +0 -61
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_ruby_server.py +73 -2
- glean_parser-10.0.2/tests/conftest.py +0 -19
- glean_parser-10.0.2/tests/test_javascript_server.py +0 -69
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.editorconfig +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.github/ISSUE_TEMPLATE.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.github/dependabot.yml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.github/pull_request_template.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.gitignore +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/.swiftlint.yml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/AUTHORS.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/CODE_OF_CONDUCT.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/LICENSE +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/MANIFEST.in +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/Makefile +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/_static/glean.jpeg +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/authors.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/conf.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/index.rst +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/installation.md +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/make.bat +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/metrics-yaml.rst +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/pings-yaml.rst +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/docs/tags-yaml.rst +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/__init__.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/__main__.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/coverage.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/data_review.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/javascript.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/kotlin.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/markdown.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/parser.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/pings.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/ruby_server.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/rust.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/schemas/metrics.1-0-0.schema.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/schemas/metrics.2-0-0.schema.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/schemas/pings.1-0-0.schema.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/schemas/pings.2-0-0.schema.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/schemas/tags.1-0-0.schema.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/swift.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/tags.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/data_review.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/javascript.buildinfo.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/javascript.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/kotlin.buildinfo.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/kotlin.geckoview.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/kotlin.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/markdown.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/qmldir.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/rust.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/templates/swift.jinja2 +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/translate.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/translation_options.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/util.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser/validate_ping.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/dependency_links.txt +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/entry_points.txt +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/not-zip-safe +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/requires.txt +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/glean_parser.egg-info/top_level.txt +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/pytest.ini +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/setup.cfg +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/all_metrics.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/all_pings.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/bad_ping.yamlx +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/core.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/duplicate_labeled.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/duplicate_send_in_ping.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/empty.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/event_key_ordering.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/events_with_types.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/fxa-server-metrics.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/fxa-server-pings.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/gecko.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/invalid-ping-names.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/invalid.yamlx +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/jwe.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/metric-with-tags.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/mixed-expirations.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/old_event_api.yamlx +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/ordering.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/pings.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/rate.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/ruby_server_metrics_unsupported.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/ruby_server_no_events.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/ruby_server_pings.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/ruby_server_pings_unsupported.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/schema-violation.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/send_if_empty_with_metrics.yaml +0 -0
- /glean_parser-10.0.2/tests/data/ruby_server_metrics.yaml → /glean_parser-11.0.0/tests/data/server_metrics_with_event.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/single_labeled.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/smaller.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/tags.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/telemetry_mirror.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/text.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/text_invalid.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/unknown_ping_used.yaml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/wrong_key.yamlx +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/data/yaml_nits.yamlx +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/detekt.yml +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_cli.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_javascript.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_kotlin.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_markdown.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_pings.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_rust.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_swift.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_tags.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_translate.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_utils.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/test_validate_ping.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tests/util.py +0 -0
- {glean_parser-10.0.2 → glean_parser-11.0.0}/tools/extract_data_categories.py +0 -0
|
@@ -37,15 +37,18 @@ commands:
|
|
|
37
37
|
default: "requirements_dev.txt"
|
|
38
38
|
steps:
|
|
39
39
|
- run:
|
|
40
|
-
name:
|
|
40
|
+
name: Install required native dependencies
|
|
41
41
|
command: |
|
|
42
42
|
pip install --progress-bar off --user -U -r <<parameters.requirements-file>>
|
|
43
43
|
sudo apt update -q
|
|
44
44
|
sudo apt upgrade -q
|
|
45
|
-
sudo apt install
|
|
45
|
+
sudo apt install \
|
|
46
|
+
--yes --no-install-recommends \
|
|
47
|
+
openjdk-11-jdk-headless \
|
|
48
|
+
ruby
|
|
46
49
|
make install-kotlin-linters
|
|
47
50
|
- run:
|
|
48
|
-
name:
|
|
51
|
+
name: Install glean_parser
|
|
49
52
|
# Set CC to something that isn't a working compiler so we
|
|
50
53
|
# can detect if any of the dependencies require a compiler
|
|
51
54
|
# to be installed. We can't count on a working compiler
|
|
@@ -55,7 +58,7 @@ commands:
|
|
|
55
58
|
command: CC=broken_compiler pip install . --user
|
|
56
59
|
- run:
|
|
57
60
|
name: test
|
|
58
|
-
command: make test
|
|
61
|
+
command: make test-full
|
|
59
62
|
|
|
60
63
|
lint:
|
|
61
64
|
parameters:
|
|
@@ -92,23 +95,16 @@ commands:
|
|
|
92
95
|
pip-licenses --fail-on 'GNU General Public License v3 (GPLv3)'
|
|
93
96
|
|
|
94
97
|
jobs:
|
|
95
|
-
build-37:
|
|
96
|
-
docker:
|
|
97
|
-
- image: cimg/python:3.7
|
|
98
|
-
steps:
|
|
99
|
-
- test-start
|
|
100
|
-
- test-python-version
|
|
101
|
-
|
|
102
98
|
build-38:
|
|
103
99
|
docker:
|
|
104
|
-
- image: cimg/python:3.8
|
|
100
|
+
- image: cimg/python:3.8-node
|
|
105
101
|
steps:
|
|
106
102
|
- test-start
|
|
107
103
|
- test-python-version
|
|
108
104
|
|
|
109
105
|
build-38-min:
|
|
110
106
|
docker:
|
|
111
|
-
- image: cimg/python:3.8
|
|
107
|
+
- image: cimg/python:3.8-node
|
|
112
108
|
steps:
|
|
113
109
|
- test-start
|
|
114
110
|
- test-min-requirements
|
|
@@ -116,14 +112,14 @@ jobs:
|
|
|
116
112
|
|
|
117
113
|
build-39:
|
|
118
114
|
docker:
|
|
119
|
-
- image: cimg/python:3.9
|
|
115
|
+
- image: cimg/python:3.9-node
|
|
120
116
|
steps:
|
|
121
117
|
- test-start
|
|
122
118
|
- test-python-version
|
|
123
119
|
|
|
124
120
|
build-310:
|
|
125
121
|
docker:
|
|
126
|
-
- image: cimg/python:3.10
|
|
122
|
+
- image: cimg/python:3.10-node
|
|
127
123
|
steps:
|
|
128
124
|
- test-start
|
|
129
125
|
- test-python-version
|
|
@@ -136,16 +132,30 @@ jobs:
|
|
|
136
132
|
root: docs/_build
|
|
137
133
|
paths: html
|
|
138
134
|
|
|
135
|
+
build-311:
|
|
136
|
+
docker:
|
|
137
|
+
- image: cimg/python:3.11-node
|
|
138
|
+
steps:
|
|
139
|
+
- test-start
|
|
140
|
+
- test-python-version
|
|
141
|
+
|
|
142
|
+
build-312:
|
|
143
|
+
docker:
|
|
144
|
+
- image: cimg/python:3.12-node
|
|
145
|
+
steps:
|
|
146
|
+
- test-start
|
|
147
|
+
- test-python-version
|
|
148
|
+
|
|
139
149
|
lint:
|
|
140
150
|
docker:
|
|
141
|
-
- image: cimg/python:3.
|
|
151
|
+
- image: cimg/python:3.12
|
|
142
152
|
steps:
|
|
143
153
|
- test-start
|
|
144
154
|
- lint
|
|
145
155
|
|
|
146
156
|
license-check:
|
|
147
157
|
docker:
|
|
148
|
-
- image: cimg/python:3.
|
|
158
|
+
- image: cimg/python:3.12
|
|
149
159
|
steps:
|
|
150
160
|
- test-start
|
|
151
161
|
- license-check
|
|
@@ -161,7 +171,7 @@ jobs:
|
|
|
161
171
|
- attach_workspace:
|
|
162
172
|
at: docs/_build
|
|
163
173
|
- run:
|
|
164
|
-
name: install
|
|
174
|
+
name: install gh-pages
|
|
165
175
|
command: |
|
|
166
176
|
npm install -g --silent gh-pages@2.0.1
|
|
167
177
|
git config user.email "glean-ci@nowhere.com"
|
|
@@ -173,7 +183,7 @@ jobs:
|
|
|
173
183
|
|
|
174
184
|
pypi-deploy:
|
|
175
185
|
docker:
|
|
176
|
-
- image: cimg/python:3.
|
|
186
|
+
- image: cimg/python:3.8
|
|
177
187
|
steps:
|
|
178
188
|
- checkout
|
|
179
189
|
- run:
|
|
@@ -185,7 +195,7 @@ jobs:
|
|
|
185
195
|
command: |
|
|
186
196
|
pip install --upgrade --user pip
|
|
187
197
|
- run:
|
|
188
|
-
name: install
|
|
198
|
+
name: install Python dependencies
|
|
189
199
|
command: |
|
|
190
200
|
pip install --user -U -r requirements_dev.txt
|
|
191
201
|
- run:
|
|
@@ -207,10 +217,6 @@ workflows:
|
|
|
207
217
|
filters:
|
|
208
218
|
tags:
|
|
209
219
|
only: /.*/
|
|
210
|
-
- build-37:
|
|
211
|
-
filters:
|
|
212
|
-
tags:
|
|
213
|
-
only: /.*/
|
|
214
220
|
- build-38:
|
|
215
221
|
filters:
|
|
216
222
|
tags:
|
|
@@ -227,6 +233,14 @@ workflows:
|
|
|
227
233
|
filters:
|
|
228
234
|
tags:
|
|
229
235
|
only: /.*/
|
|
236
|
+
- build-311:
|
|
237
|
+
filters:
|
|
238
|
+
tags:
|
|
239
|
+
only: /.*/
|
|
240
|
+
- build-312:
|
|
241
|
+
filters:
|
|
242
|
+
tags:
|
|
243
|
+
only: /.*/
|
|
230
244
|
- docs-deploy:
|
|
231
245
|
requires:
|
|
232
246
|
- build-310
|
|
@@ -235,7 +249,7 @@ workflows:
|
|
|
235
249
|
only: main
|
|
236
250
|
- pypi-deploy:
|
|
237
251
|
requires:
|
|
238
|
-
- build-
|
|
252
|
+
- build-38
|
|
239
253
|
filters:
|
|
240
254
|
branches:
|
|
241
255
|
ignore: /.*/
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 11.0.0
|
|
6
|
+
|
|
7
|
+
- Add updated logging logic for Ruby Server ([#642](https://github.com/mozilla/glean_parser/pull/642))
|
|
8
|
+
- Add support for event metric type in server-side JavaScript outputter ([DENG-1736](https://mozilla-hub.atlassian.net/browse/DENG-1736))
|
|
9
|
+
- BREAKING CHANGE: Dropped support for Python 3.7 ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
10
|
+
- Add official support for Python 3.11+ ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
11
|
+
|
|
12
|
+
## 10.0.3
|
|
13
|
+
|
|
14
|
+
- Warn about empty or TODO-tagged data reviews in the list ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
15
|
+
- Allow `unit` field on all metrics, but warn for all but quantity and custom distribution ([#636](https://github.com/mozilla/glean_parser/pull/636))
|
|
16
|
+
|
|
5
17
|
## 10.0.2
|
|
6
18
|
|
|
7
19
|
- Allow `unit` field for string again, but warn about it in the linter ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
@@ -116,7 +116,7 @@ Before you submit a pull request, check that it meets these guidelines:
|
|
|
116
116
|
2. If the pull request adds functionality, the docs should be updated. Put your
|
|
117
117
|
new functionality into a function with a docstring, and describe
|
|
118
118
|
public-facing features in the docs.
|
|
119
|
-
3. The pull request should work for Python 3.
|
|
119
|
+
3. The pull request should work for Python 3.8+ (The CI system
|
|
120
120
|
will take care of testing all of these Python versions).
|
|
121
121
|
4. The pull request should update the changelog in `CHANGELOG.md`.
|
|
122
122
|
|
|
@@ -44,7 +44,10 @@ fmt: ## autoformat files
|
|
|
44
44
|
python3 -m black glean_parser tests setup.py
|
|
45
45
|
|
|
46
46
|
test: ## run tests quickly with the default Python
|
|
47
|
-
py.test
|
|
47
|
+
py.test
|
|
48
|
+
|
|
49
|
+
test-full: ## run tests, including those with additional dependencies
|
|
50
|
+
py.test --run-web-tests --run-node-tests --run-ruby-tests
|
|
48
51
|
|
|
49
52
|
coverage: ## check code coverage quickly with the default Python
|
|
50
53
|
coverage run --source glean_parser -m pytest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: glean_parser
|
|
3
|
-
Version:
|
|
3
|
+
Version: 11.0.0
|
|
4
4
|
Summary: Parser tools for Mozilla's Glean telemetry
|
|
5
5
|
Home-page: https://github.com/mozilla/glean_parser
|
|
6
6
|
Author: The Glean Team
|
|
@@ -10,11 +10,11 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: Natural Language :: English
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
License-File: AUTHORS.md
|
|
@@ -37,7 +37,7 @@ code for various integrations, linting and coverage testing.
|
|
|
37
37
|
|
|
38
38
|
## Requirements
|
|
39
39
|
|
|
40
|
-
- Python 3.
|
|
40
|
+
- Python 3.8 (or later)
|
|
41
41
|
|
|
42
42
|
The following library requirements are installed automatically when
|
|
43
43
|
`glean_parser` is installed by `pip`.
|
|
@@ -73,6 +73,18 @@ $ glean_parser check < ping.json
|
|
|
73
73
|
|
|
74
74
|
## Unreleased
|
|
75
75
|
|
|
76
|
+
## 11.0.0
|
|
77
|
+
|
|
78
|
+
- Add updated logging logic for Ruby Server ([#642](https://github.com/mozilla/glean_parser/pull/642))
|
|
79
|
+
- Add support for event metric type in server-side JavaScript outputter ([DENG-1736](https://mozilla-hub.atlassian.net/browse/DENG-1736))
|
|
80
|
+
- BREAKING CHANGE: Dropped support for Python 3.7 ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
81
|
+
- Add official support for Python 3.11+ ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
82
|
+
|
|
83
|
+
## 10.0.3
|
|
84
|
+
|
|
85
|
+
- Warn about empty or TODO-tagged data reviews in the list ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
86
|
+
- Allow `unit` field on all metrics, but warn for all but quantity and custom distribution ([#636](https://github.com/mozilla/glean_parser/pull/636))
|
|
87
|
+
|
|
76
88
|
## 10.0.2
|
|
77
89
|
|
|
78
90
|
- Allow `unit` field for string again, but warn about it in the linter ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
@@ -116,7 +116,7 @@ Before you submit a pull request, check that it meets these guidelines:
|
|
|
116
116
|
2. If the pull request adds functionality, the docs should be updated. Put your
|
|
117
117
|
new functionality into a function with a docstring, and describe
|
|
118
118
|
public-facing features in the docs.
|
|
119
|
-
3. The pull request should work for Python 3.
|
|
119
|
+
3. The pull request should work for Python 3.8+ (The CI system
|
|
120
120
|
will take care of testing all of these Python versions).
|
|
121
121
|
4. The pull request should update the changelog in `CHANGELOG.md`.
|
|
122
122
|
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 11.0.0
|
|
6
|
+
|
|
7
|
+
- Add updated logging logic for Ruby Server ([#642](https://github.com/mozilla/glean_parser/pull/642))
|
|
8
|
+
- Add support for event metric type in server-side JavaScript outputter ([DENG-1736](https://mozilla-hub.atlassian.net/browse/DENG-1736))
|
|
9
|
+
- BREAKING CHANGE: Dropped support for Python 3.7 ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
10
|
+
- Add official support for Python 3.11+ ([#638](https://github.com/mozilla/glean_parser/pull/638))
|
|
11
|
+
|
|
12
|
+
## 10.0.3
|
|
13
|
+
|
|
14
|
+
- Warn about empty or TODO-tagged data reviews in the list ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
15
|
+
- Allow `unit` field on all metrics, but warn for all but quantity and custom distribution ([#636](https://github.com/mozilla/glean_parser/pull/636))
|
|
16
|
+
|
|
5
17
|
## 10.0.2
|
|
6
18
|
|
|
7
19
|
- Allow `unit` field for string again, but warn about it in the linter ([#634](https://github.com/mozilla/glean_parser/pull/634))
|
|
@@ -9,14 +9,24 @@ Outputter to generate server Javascript code for collecting events.
|
|
|
9
9
|
|
|
10
10
|
This outputter is different from the rest of the outputters in that the code it
|
|
11
11
|
generates does not use the Glean SDK. It is meant to be used to collect events
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
in server-side environments. In these environments SDK assumptions to measurement
|
|
13
|
+
window and connectivity don't hold.
|
|
14
14
|
Generated code takes care of assembling pings with metrics, serializing to messages
|
|
15
15
|
conforming to Glean schema, and logging with mozlog. Then it's the role of the ingestion
|
|
16
16
|
pipeline to pick the messages up and process.
|
|
17
17
|
|
|
18
18
|
Warning: this outputter supports limited set of metrics,
|
|
19
19
|
see `SUPPORTED_METRIC_TYPES` below.
|
|
20
|
+
|
|
21
|
+
There are two patterns for event structure supported in this environment:
|
|
22
|
+
* Events as `Event` metric type, where we generate a single class per ping with
|
|
23
|
+
`record{event_name}` method for each event metric. This is recommended to use for new
|
|
24
|
+
applications as it allows to fully leverage standard Data Platform tools
|
|
25
|
+
post-ingestion.
|
|
26
|
+
* Custom pings-as-events, where for each ping we generate a class with a single `record`
|
|
27
|
+
method, usually with an `event_name` string metric.
|
|
28
|
+
|
|
29
|
+
Therefore, unlike in other outputters, here we don't generate classes for each metric.
|
|
20
30
|
"""
|
|
21
31
|
from collections import defaultdict
|
|
22
32
|
from pathlib import Path
|
|
@@ -28,11 +38,14 @@ from . import util
|
|
|
28
38
|
|
|
29
39
|
# Adding a metric here will require updating the `generate_js_metric_type` function
|
|
30
40
|
# and might require changes to the template.
|
|
31
|
-
SUPPORTED_METRIC_TYPES = ["string"]
|
|
41
|
+
SUPPORTED_METRIC_TYPES = ["string", "event"]
|
|
32
42
|
|
|
33
43
|
|
|
34
|
-
def event_class_name(
|
|
35
|
-
|
|
44
|
+
def event_class_name(ping_name: str, event_metric_exists: bool) -> str:
|
|
45
|
+
# For compatibility with FxA codebase we don't want to add "Logger" suffix
|
|
46
|
+
# when custom pings without event metrics are used.
|
|
47
|
+
suffix = "Logger" if event_metric_exists else ""
|
|
48
|
+
return util.Camelize(ping_name) + "ServerEvent" + suffix
|
|
36
49
|
|
|
37
50
|
|
|
38
51
|
def generate_metric_name(metric: metrics.Metric) -> str:
|
|
@@ -47,12 +60,20 @@ def generate_js_metric_type(metric: metrics.Metric) -> str:
|
|
|
47
60
|
return metric.type
|
|
48
61
|
|
|
49
62
|
|
|
50
|
-
def
|
|
51
|
-
|
|
63
|
+
def generate_ping_factory_method(ping: str, event_metric_exists: bool) -> str:
|
|
64
|
+
# `ServerEventLogger` better describes role of the class that this factory
|
|
65
|
+
# method generates, but for compatibility with existing FxA codebase
|
|
66
|
+
# we use `Event` suffix if no event metrics are defined.
|
|
67
|
+
suffix = "ServerEventLogger" if event_metric_exists else "Event"
|
|
68
|
+
return f"create{util.Camelize(ping)}{suffix}"
|
|
69
|
+
|
|
52
70
|
|
|
71
|
+
def generate_event_metric_record_function_name(metric: metrics.Metric) -> str:
|
|
72
|
+
return f"record{util.Camelize(metric.category)}{util.Camelize(metric.name)}"
|
|
53
73
|
|
|
54
|
-
|
|
55
|
-
|
|
74
|
+
|
|
75
|
+
def clean_string(s: str) -> str:
|
|
76
|
+
return s.replace("\n", " ").rstrip()
|
|
56
77
|
|
|
57
78
|
|
|
58
79
|
def output(
|
|
@@ -79,24 +100,16 @@ def output(
|
|
|
79
100
|
("metric_name", generate_metric_name),
|
|
80
101
|
("metric_argument_name", generate_metric_argument_name),
|
|
81
102
|
("js_metric_type", generate_js_metric_type),
|
|
82
|
-
("metric_argument_description", generate_metric_argument_description),
|
|
83
103
|
("factory_method", generate_ping_factory_method),
|
|
104
|
+
(
|
|
105
|
+
"event_metric_record_function_name",
|
|
106
|
+
generate_event_metric_record_function_name,
|
|
107
|
+
),
|
|
108
|
+
("clean_string", clean_string),
|
|
84
109
|
),
|
|
85
110
|
)
|
|
86
111
|
|
|
87
|
-
|
|
88
|
-
# metrics. Only "events as pings" are supported.
|
|
89
|
-
# For each ping we generate code which contains all the logic for assembling it
|
|
90
|
-
# with metrics, serializing, and submitting. Therefore we don't generate classes for
|
|
91
|
-
# each metric as in standard outputters.
|
|
92
|
-
PING_METRIC_ERROR_MSG = (
|
|
93
|
-
" Server-side environment is simplified and this"
|
|
94
|
-
+ " parser doesn't generate individual metric files. Make sure to pass all"
|
|
95
|
-
+ " your ping and metric definitions in a single invocation of the parser."
|
|
96
|
-
)
|
|
97
|
-
if "pings" not in objs:
|
|
98
|
-
print("❌ No ping definition found." + PING_METRIC_ERROR_MSG)
|
|
99
|
-
return
|
|
112
|
+
event_metric_exists = False
|
|
100
113
|
|
|
101
114
|
# Go through all metrics in objs and build a map of
|
|
102
115
|
# ping->list of metric categories->list of metrics
|
|
@@ -113,11 +126,39 @@ def output(
|
|
|
113
126
|
+ " metric type."
|
|
114
127
|
)
|
|
115
128
|
continue
|
|
129
|
+
if metric.type == "event":
|
|
130
|
+
# This is used in the template - generated code is slightly
|
|
131
|
+
# different when event metric type is used.
|
|
132
|
+
event_metric_exists = True
|
|
116
133
|
for ping in metric.send_in_pings:
|
|
117
134
|
metrics_by_type = ping_to_metrics[ping]
|
|
118
135
|
metrics_list = metrics_by_type.setdefault(metric.type, [])
|
|
119
136
|
metrics_list.append(metric)
|
|
120
137
|
|
|
138
|
+
PING_METRIC_ERROR_MSG = (
|
|
139
|
+
" Server-side environment is simplified and this"
|
|
140
|
+
+ " parser doesn't generate individual metric files. Make sure to pass all"
|
|
141
|
+
+ " your ping and metric definitions in a single invocation of the parser."
|
|
142
|
+
)
|
|
143
|
+
if "pings" not in objs:
|
|
144
|
+
# If events are meant to be sent in custom pings, we need to make sure they
|
|
145
|
+
# are defined. Otherwise we won't have destination tables defined and
|
|
146
|
+
# submissions won't pass validation at ingestion.
|
|
147
|
+
if event_metric_exists:
|
|
148
|
+
if "events" not in ping_to_metrics:
|
|
149
|
+
# Event metrics can be sent in standard `events` ping
|
|
150
|
+
# or in custom pings.
|
|
151
|
+
print(
|
|
152
|
+
"❌ "
|
|
153
|
+
+ PING_METRIC_ERROR_MSG
|
|
154
|
+
+ "\n You need to either send your event metrics in standard"
|
|
155
|
+
+ " `events` ping or define a custom one."
|
|
156
|
+
)
|
|
157
|
+
return
|
|
158
|
+
else:
|
|
159
|
+
print("❌ No ping definition found." + PING_METRIC_ERROR_MSG)
|
|
160
|
+
return
|
|
161
|
+
|
|
121
162
|
if not ping_to_metrics:
|
|
122
163
|
print("❌ No pings with metrics found." + PING_METRIC_ERROR_MSG)
|
|
123
164
|
return
|
|
@@ -129,6 +170,7 @@ def output(
|
|
|
129
170
|
template.render(
|
|
130
171
|
parser_version=__version__,
|
|
131
172
|
pings=ping_to_metrics,
|
|
173
|
+
event_metric_exists=event_metric_exists,
|
|
132
174
|
lang=lang,
|
|
133
175
|
)
|
|
134
176
|
)
|
|
@@ -303,13 +303,30 @@ def check_metric_on_events_lifetime(
|
|
|
303
303
|
)
|
|
304
304
|
|
|
305
305
|
|
|
306
|
-
def
|
|
306
|
+
def check_unexpected_unit(
|
|
307
307
|
metric: metrics.Metric, parser_config: Dict[str, Any]
|
|
308
308
|
) -> LintGenerator:
|
|
309
|
-
"""
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
"""
|
|
310
|
+
`unit` was allowed on all metrics and recently disallowed.
|
|
311
|
+
We now warn about its use on all but quantity and custom distribution
|
|
312
|
+
metrics.
|
|
313
|
+
"""
|
|
314
|
+
allowed_types = [metrics.Quantity, metrics.CustomDistribution]
|
|
315
|
+
if not any([isinstance(metric, ty) for ty in allowed_types]) and metric.unit:
|
|
316
|
+
yield (
|
|
317
|
+
"The `unit` property is only allowed for quantity "
|
|
318
|
+
+ "and custom distribution metrics."
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def check_empty_datareview(
|
|
323
|
+
metric: metrics.Metric, parser_config: Dict[str, Any]
|
|
324
|
+
) -> LintGenerator:
|
|
325
|
+
disallowed_datareview = ["", "todo"]
|
|
326
|
+
data_reviews = [dr.lower() in disallowed_datareview for dr in metric.data_reviews]
|
|
327
|
+
|
|
328
|
+
if any(data_reviews):
|
|
329
|
+
yield "List of data reviews should not contain empty strings or TODO markers."
|
|
313
330
|
|
|
314
331
|
|
|
315
332
|
def check_redundant_ping(
|
|
@@ -393,7 +410,8 @@ METRIC_CHECKS: Dict[
|
|
|
393
410
|
"EXPIRED": (check_expired_metric, CheckType.warning),
|
|
394
411
|
"OLD_EVENT_API": (check_old_event_api, CheckType.warning),
|
|
395
412
|
"METRIC_ON_EVENTS_LIFETIME": (check_metric_on_events_lifetime, CheckType.error),
|
|
396
|
-
"
|
|
413
|
+
"UNEXPECTED_UNIT": (check_unexpected_unit, CheckType.warning),
|
|
414
|
+
"EMPTY_DATAREVIEW": (check_empty_datareview, CheckType.warning),
|
|
397
415
|
}
|
|
398
416
|
|
|
399
417
|
|
|
@@ -55,6 +55,7 @@ class Metric:
|
|
|
55
55
|
disabled: bool = False,
|
|
56
56
|
lifetime: str = "ping",
|
|
57
57
|
send_in_pings: Optional[List[str]] = None,
|
|
58
|
+
unit: Optional[str] = None,
|
|
58
59
|
gecko_datapoint: str = "",
|
|
59
60
|
no_lint: Optional[List[str]] = None,
|
|
60
61
|
data_sensitivity: Optional[List[str]] = None,
|
|
@@ -85,6 +86,7 @@ class Metric:
|
|
|
85
86
|
if send_in_pings is None:
|
|
86
87
|
send_in_pings = ["default"]
|
|
87
88
|
self.send_in_pings = send_in_pings
|
|
89
|
+
self.unit = unit
|
|
88
90
|
self.gecko_datapoint = gecko_datapoint
|
|
89
91
|
if no_lint is None:
|
|
90
92
|
no_lint = []
|
|
@@ -175,6 +177,8 @@ class Metric:
|
|
|
175
177
|
d[key] = [x.name for x in val]
|
|
176
178
|
del d["name"]
|
|
177
179
|
del d["category"]
|
|
180
|
+
if not d["unit"]:
|
|
181
|
+
d.pop("unit")
|
|
178
182
|
d.pop("_config", None)
|
|
179
183
|
d.pop("_generate_enums", None)
|
|
180
184
|
return d
|
|
@@ -222,11 +226,6 @@ class Boolean(Metric):
|
|
|
222
226
|
class String(Metric):
|
|
223
227
|
typename = "string"
|
|
224
228
|
|
|
225
|
-
def __init__(self, *args, **kwargs):
|
|
226
|
-
# Deprecated. Kept here to unbreak stuff.
|
|
227
|
-
self.unit = kwargs.pop("unit", None)
|
|
228
|
-
Metric.__init__(self, *args, **kwargs)
|
|
229
|
-
|
|
230
229
|
|
|
231
230
|
class StringList(Metric):
|
|
232
231
|
typename = "string_list"
|
|
@@ -239,10 +238,6 @@ class Counter(Metric):
|
|
|
239
238
|
class Quantity(Metric):
|
|
240
239
|
typename = "quantity"
|
|
241
240
|
|
|
242
|
-
def __init__(self, *args, **kwargs):
|
|
243
|
-
self.unit = kwargs.pop("unit")
|
|
244
|
-
Metric.__init__(self, *args, **kwargs)
|
|
245
|
-
|
|
246
241
|
|
|
247
242
|
class TimeUnit(enum.Enum):
|
|
248
243
|
nanosecond = 0
|
|
@@ -302,7 +297,6 @@ class CustomDistribution(Metric):
|
|
|
302
297
|
self.histogram_type = getattr(
|
|
303
298
|
HistogramType, kwargs.pop("histogram_type", "exponential")
|
|
304
299
|
)
|
|
305
|
-
self.unit = kwargs.pop("unit", None)
|
|
306
300
|
super().__init__(*args, **kwargs)
|
|
307
301
|
|
|
308
302
|
|