From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- .../glean_parser-13.0.1.dist-info/AUTHORS.md | 17 - .../glean_parser-13.0.1.dist-info/LICENSE | 373 ---------- .../glean_parser-13.0.1.dist-info/METADATA | 790 -------------------- .../glean_parser-13.0.1.dist-info/RECORD | 48 -- .../glean_parser-13.0.1.dist-info/WHEEL | 5 - .../glean_parser-13.0.1.dist-info/entry_points.txt | 2 - .../glean_parser-13.0.1.dist-info/top_level.txt | 1 - .../glean_parser-14.0.1.dist-info/AUTHORS.md | 17 + .../glean_parser-14.0.1.dist-info/LICENSE | 373 ++++++++++ .../glean_parser-14.0.1.dist-info/METADATA | 799 +++++++++++++++++++++ .../glean_parser-14.0.1.dist-info/RECORD | 48 ++ .../glean_parser-14.0.1.dist-info/WHEEL | 5 + .../glean_parser-14.0.1.dist-info/entry_points.txt | 2 + .../glean_parser-14.0.1.dist-info/top_level.txt | 1 + .../glean_parser/glean_parser/javascript_server.py | 16 +- .../python/glean_parser/glean_parser/kotlin.py | 25 + .../python/glean_parser/glean_parser/parser.py | 24 +- .../python/glean_parser/glean_parser/pings.py | 6 + .../glean_parser/schemas/pings.2-0-0.schema.yaml | 22 + .../python/glean_parser/glean_parser/swift.py | 23 +- .../templates/javascript_server.jinja2 | 54 +- .../glean_parser/templates/kotlin.jinja2 | 66 +- .../glean_parser/templates/rust.jinja2 | 2 +- .../glean_parser/templates/swift.jinja2 | 49 +- .../python/glean_parser/glean_parser/util.py | 2 + 25 files changed, 1499 insertions(+), 1271 deletions(-) delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/AUTHORS.md delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/LICENSE delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/METADATA delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/RECORD delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/WHEEL delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/entry_points.txt delete mode 100644 third_party/python/glean_parser/glean_parser-13.0.1.dist-info/top_level.txt create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/AUTHORS.md create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/LICENSE create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/METADATA create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/RECORD create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/WHEEL create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/entry_points.txt create mode 100644 third_party/python/glean_parser/glean_parser-14.0.1.dist-info/top_level.txt (limited to 'third_party/python/glean_parser') diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/AUTHORS.md b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/AUTHORS.md deleted file mode 100644 index 525116ee7e..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/AUTHORS.md +++ /dev/null @@ -1,17 +0,0 @@ -# Credits - -## Development Lead - -- Jan-Erik Rediger -- Alessio Placitelli - -## Contributors - -See [the full list of contributors](https://github.com/mozilla/glean_parser/graphs/contributors). - -## Acknowledgements - -This package was created with -[Cookiecutter](https://github.com/audreyr/cookiecutter) and the -[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) -project template. diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/LICENSE b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/LICENSE deleted file mode 100644 index a612ad9813..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/LICENSE +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - 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/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/METADATA b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/METADATA deleted file mode 100644 index 0bab2150ba..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/METADATA +++ /dev/null @@ -1,790 +0,0 @@ -Metadata-Version: 2.1 -Name: glean-parser -Version: 13.0.1 -Summary: Parser tools for Mozilla's Glean telemetry -Home-page: https://github.com/mozilla/glean_parser -Author: The Glean Team -Author-email: glean-team@mozilla.com -Keywords: glean_parser -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: Natural Language :: English -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.8 -Classifier: Programming Language :: Python :: 3.9 -Classifier: Programming Language :: Python :: 3.10 -Classifier: Programming Language :: Python :: 3.11 -Classifier: Programming Language :: Python :: 3.12 -Description-Content-Type: text/markdown -License-File: LICENSE -License-File: AUTHORS.md -Requires-Dist: appdirs >=1.4 -Requires-Dist: Click >=7 -Requires-Dist: diskcache >=4 -Requires-Dist: Jinja2 >=2.10.1 -Requires-Dist: jsonschema >=3.0.2 -Requires-Dist: PyYAML >=5.3.1 - -# Glean Parser - -Parser tools for Mozilla's Glean telemetry. - -## Features - -Contains various utilities for handling `metrics.yaml` and `pings.yaml` for [the -Glean SDKs](https://mozilla.github.io/glean). This includes producing generated -code for various integrations, linting and coverage testing. - -## Documentation - -- [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 - -- Python 3.8 (or later) - -The following library requirements are installed automatically when -`glean_parser` is installed by `pip`. - -- appdirs -- Click -- diskcache -- Jinja2 -- jsonschema -- PyYAML - -## Usage - -```sh -$ glean_parser --help -``` - -Read in `metrics.yaml`, translate to Kotlin format, and -output to `output_dir`: - -```sh -$ glean_parser translate -o output_dir -f kotlin metrics.yaml -``` - -Check a Glean ping against the ping schema: - -```sh -$ glean_parser check < ping.json -``` - - -# Changelog - -## Unreleased - -## 13.0.1 - -- Use faster C yaml parser if available ([#677](https://github.com/mozilla/glean_parser/pull/677)) - -## 13.0.0 - -- BREAKING CHANGE: Support metadata field `include_info_sections` ([bug 1866559](https://bugzilla.mozilla.org/show_bug.cgi?id=1866559)) - -## 12.0.1 - -- Fix Rust codegen for object metric type ([#662](https://github.com/mozilla/glean_parser/pull/662)) - -## 12.0.0 - -- Add new metric type object (only Rust codegen support right now) ([#587](https://github.com/mozilla/glean_parser/pull/587)) - -## 11.1.0 - -- Add Go log outputter (`go_server`) ([#645](https://github.com/mozilla/glean_parser/pull/645)) -- Add Python log outputter (`python_server`) ([MPP-3642](https://mozilla-hub.atlassian.net/browse/MPP-3642)) - -## 11.0.1 - -- Fix javascript_server template to include non-event metric parameters in #record call for event metrics ([#643](https://github.com/mozilla/glean_parser/pull/643)) -- events: Increase extra key limit to 50 ([Bug 1869429](https://bugzilla.mozilla.org/show_bug.cgi?id=1869429)) - -## 11.0.0 - -- Add updated logging logic for Ruby Server ([#642](https://github.com/mozilla/glean_parser/pull/642)) -- Add support for event metric type in server-side JavaScript outputter ([DENG-1736](https://mozilla-hub.atlassian.net/browse/DENG-1736)) -- BREAKING CHANGE: Dropped support for Python 3.7 ([#638](https://github.com/mozilla/glean_parser/pull/638)) -- Add official support for Python 3.11+ ([#638](https://github.com/mozilla/glean_parser/pull/638)) - -## 10.0.3 - -- Warn about empty or TODO-tagged data reviews in the list ([#634](https://github.com/mozilla/glean_parser/pull/634)) -- Allow `unit` field on all metrics, but warn for all but quantity and custom distribution ([#636](https://github.com/mozilla/glean_parser/pull/636)) - -## 10.0.2 - -- Allow `unit` field for string again, but warn about it in the linter ([#634](https://github.com/mozilla/glean_parser/pull/634)) - -## 10.0.1 - -- Allow `unit` field for custom distribution again ([#633](https://github.com/mozilla/glean_parser/pull/633)) - -## 10.0.0 - -- Add Ruby log outputter (`ruby_server`) ([#620](https://github.com/mozilla/glean_parser/pull/620)) -- BREAKING CHANE: `ping` lifetime metrics on the events ping are now disallowed ([#625](https://github.com/mozilla/glean_parser/pull/625)) -- Disallow `unit` field for anything but quantity ([#630](https://github.com/mozilla/glean_parser/pull/630)). - Note that this was already considered the case, now the code enforces it. - -## 9.0.0 - -- BREAKING CHANGE: Dropped support for Python 3.6 ([#615](https://github.com/mozilla/glean_parser/issues/615)) -- Allow metadata to configure precise timestamps in pings ([#592](https://github.com/mozilla/glean_parser/pull/592)) - -## 8.1.1 - -- Small updates to the `javascript_server` tempalte to address lint warnings ([#598](https://github.com/mozilla/glean_parser/pull/598)) - -## 8.1.0 - -- Increased the maximum metric name length in version 2.0.0 schema ([#596](https://github.com/mozilla/glean_parser/pull/596)) - -## 8.0.0 - -- BREAKING CHANGE: Remove exposed `lint_yaml_files` function ([#580](https://github.com/mozilla/glean_parser/pull/580)) -- Rust: Removed `__glean_metric_maps` from the Rust Jinja template. This functionality is better placed downstream ([Bug 1816526](https://bugzilla.mozilla.org/show_bug.cgi?id=1816526)) -- New lint: check that all referenced pings are known ([#584](https://github.com/mozilla/glean_parser/pull/584)) -- Add experimental server-side JavaScript outputter ([FXA-7922](https://mozilla-hub.atlassian.net/browse/FXA-7922)) - -## 7.2.1 - -- Unbreak last minor release ([#579](https://github.com/mozilla/glean_parser/pull/579)) - -## 7.2.0 - -- Remove yamllint integration ([#578](https://github.com/mozilla/glean_parser/pull/578)) - -## 7.1.0 - -- ENHANCEMENT: Labels in `labels:` fields may now contain any printable ASCII characters ([bug 1672273](https://bugzilla.mozilla.org/show_bug.cgi?id=1672273)) -- BUGFIX: Enforce ordering of generation of Pings, Metrics and Tags such that order is deterministic ([bug 1820334](https://bugzilla.mozilla.org/show_bug.cgi?id=1820334)) - -## 7.0.0 - -- BUGFIX: Remove internal-only fields from serialized metrics data ([#550](https://github.com/mozilla/glean_parser/pull/550)) -- FEATURE: New subcommand: `dump` to dump the metrics data as JSON ([#550](https://github.com/mozilla/glean_parser/pull/550)) -- BUGFIX: Kotlin: Generate enums with the right generic bound for ping reason codes ([#551](https://github.com/mozilla/glean_parser/pull/551)). -- **BREAKING CHANGE:** Fully remove support for the old events API ([#549](https://github.com/mozilla/glean_parser/pull/549)) - Adds a new lint `OLD_EVENT_API` to warn about missing `type` attributes on event extra keys. - Note that the Glean SDK already dropped support for the old events API. - -## 6.4.0 - -- BUGFIX: Correct code generation for labeled metrics in Rust ([#533](https://github.com/mozilla/glean_parser/pull/533)) -- BUGFIX: Correctly serialize `Rates` for Rust code ([#530](https://github.com/mozilla/glean_parser/pull/530)) -- Feature: Wrap labeled metric's static labels list as CoW strings (requires updated Glean support) ([#534](https://github.com/mozilla/glean_parser/pull/534)) - -## 6.3.0 - -- events: Increase extras limit to 15 ([bug 1798713](https://bugzilla.mozilla.org/show_bug.cgi?id=1798713)) - -## 6.2.1 - -- Add support for Rate, Denominator and Numerator metrics for JavaScript. ([bug 1793777](https://bugzilla.mozilla.org/show_bug.cgi?id=1793777)) - -## 6.2.0 - -- [data-review] Use a template to generate the Data Review Request template ([bug 1772605](https://bugzilla.mozilla.org/show_bug.cgi?id=1772605)) -- Make tag and no\_lint order deterministic ([#518](https://github.com/mozilla/glean_parser/pull/518)) - -## 6.1.2 - -- Swift: Add a conditional `import Foundation` to support generating metrics when Glean is delivered via the AppServices iOS megazord - -## 6.1.1 - -- Rust: Use correct name for a ping in generated code. - -## 6.1.0 - -- [data-review] Include extra keys' names and descriptions in data review template ([bug 1767027](https://bugzilla.mozilla.org/show_bug.cgi?id=1767027)) -- Raise limit on number of statically-defined labels to 4096. ([bug 1772163](https://bugzilla.mozilla.org/show_bug.cgi?id=1772163)) -- Fix Rust code generation for new UniFFI interface ([#491](https://github.com/mozilla/glean_parser/pull/491), [#494](https://github.com/mozilla/glean_parser/pull/494), [#495](https://github.com/mozilla/glean_parser/pull/495)) - -## 6.0.1 - -- Relax version requirement for MarkupSafe. - Now works with MarkupSafe v1.1.1 to v2.0.1 inclusive again. - -## 6.0.0 - -- BUGFIX: Add missing `extra_args` to Rust constructor generation ([bug 1765855](https://bugzilla.mozilla.org/show_bug.cgi?id=1765855)) -- **Breaking change:** `glean_parser` now generates metrics compatible with the UniFFI-powered Glean SDK. - This is not backwards-compatible with previous versions. -- Generate Rate, Denominator and Numerator metrics for Kotlin and Swift -- Explicitly skip Rate, Denominator and Numerator metrics for JavaScript. - These will cause a build failure by default, but can be turned into warnings on request. - Use `-s fail_rates=false` to enable warning-only mode. - -## 5.1.2 - -- BUGFIX: Revert changes made on v5.1.1. - - The issues addressed by those changes, were non-issues and result of misuse of the APIs. - -## 5.1.1 - -- BUGFIX: Fix issues with Swift templates ([bug 1749494](https://bugzilla.mozilla.org/show_bug.cgi?id=1749494)) - - Make metrics and pings all `public` - - Make pings `static` - -## 5.1.0 - -- Add support for build info generation for JavaScript and Typescript targets ([bug 1749494](https://bugzilla.mozilla.org/show_bug.cgi?id=1749494)) - -## 5.0.1 - -- Fix the logic for the metric expiration by version ([bug 1753194](https://bugzilla.mozilla.org/show_bug.cgi?id=1753194)) - -## 5.0.0 - -- Remove C# support ([#436](https://github.com/mozilla/glean_parser/pull/436)). -- Add support for Rust code generation ([bug 1677434](https://bugzilla.mozilla.org/show_bug.cgi?id=1677434)) -- Report an error if no files are passed ([bug 1751730](https://bugzilla.mozilla.org/show_bug.cgi?id=1751730)) -- [data-review] Report an error if no metrics match provided bug number ([bug 1752576](https://bugzilla.mozilla.org/show_bug.cgi?id=1752576)) -- [data-review] Include notification_emails in list of those responsible ([bug 1752576](https://bugzilla.mozilla.org/show_bug.cgi?id=1752576)) -- Add support for expiring metrics by the provided major version ([bug 1753194](https://bugzilla.mozilla.org/show_bug.cgi?id=1753194)) - -## 4.4.0 - -- Support global file-level tags in metrics.yaml ([bug 1745283](https://bugzilla.mozilla.org/show_bug.cgi?id=1745283)) -- Glinter: Reject metric files if they use `unit` by mistake. It should be `time_unit` ([#432](https://github.com/mozilla/glean_parser/pull/432)). -- Automatically generate a build date when generating build info ([#431](https://github.com/mozilla/glean_parser/pull/431)). - Enabled for Kotlin and Swift. - This can be changed with the `build_date` command line option. - `build_date=0` will use a static unix epoch time. - `build_date=2022-01-03T17:30:00` will parse the ISO8601 string to use (as a UTC timestamp). - Other values will throw an error. - - Example: - - glean_parser translate --format kotlin --option build_date=2021-11-01T01:00:00 path/to/metrics.yaml - -## 4.3.1 - -- BUGFIX: Skip tags for code generation ([#409](https://github.com/mozilla/glean_parser/pull/409)) - -## 4.3.0 - -- Support tags in glean parser ([bug 1734011](https://bugzilla.mozilla.org/show_bug.cgi?id=1734011)) - -## 4.2.0 - -- Improve the schema validation error messages. They will no longer include `OrderedDict(...)` on Python 3.7 and later ([bug 1733395](https://bugzilla.mozilla.org/show_bug.cgi?id=1733395)) -- Officially support Python 3.10 - -## 4.1.1 (2021-09-28) - -- Update private import paths on Javascript / Typescript templates. ([bug 1702468](https://bugzilla.mozilla.org/show_bug.cgi?id=1702468)) - -## 4.1.0 (2021-09-16) - -- Add support for Node.js platform on Javascript / Typescript templates. ([bug 1728982](https://bugzilla.mozilla.org/show_bug.cgi?id=1728982)) - -## 4.0.0 (2021-08-20) - -- Add support for Text metric type ([#374](https://github.com/mozilla/glean_parser/pull/374)) -- Reserve the `default` ping name. It can't be used as a ping name, but it can be used in `send_in_pings` ([#376](https://github.com/mozilla/glean_parser/pull/376)) - -## 3.8.0 (2021-08-18) - -- Expose ping reasons enum on JavaScript / TypeScript templates. ([bug 1719136](https://bugzilla.mozilla.org/show_bug.cgi?id=1719136)) -- Define an interface with the allowed extras for each event on the TypeScript template. ([bug 1693487](https://bugzilla.mozilla.org/show_bug.cgi?id=1693487)) - -## 3.7.0 (2021-07-13) - -- New lint: Check for redundant words in ping names ([#355](https://github.com/mozilla/glean_parser/pull/355)) -- Add support for URL metric type ([#361](https://github.com/mozilla/glean_parser/pull/361)) - -## 3.6.0 (2021-06-11) - -- 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) - -- Transform generated folder into QML Module when building Javascript templates for the Qt platform. ([bug 1707896](https://bugzilla.mozilla.org/show_bug.cgi?id=1707896) - - Import the Glean QML module from inside each generated file, removing the requirement to import Glean before importing any of the generated files; - - Prodive a `qmldir` file exposing all generated files; - - Drop the `namespace` option for Javascript templates; - - Add a new `version` option for Javascript templates, required when building for Qt, which expected the Glean QML module version. - -## 3.4.0 (2021-05-28) - -- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/339)) -- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/339)) -- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/339)) -- For Kotlin skip generating `GleanBuildInfo.kt` when requested (with `with_buildinfo=false`) ([#341](https://github.com/mozilla/glean_parser/pull/341)) - -## 3.3.2 (2021-05-18) - -- Fix another bug in the Swift code generation when generating extra keys ([#334](https://github.com/mozilla/glean_parser/pull/334)) - -## 3.3.1 (2021-05-18) - -- Fix Swift code generation bug for pings ([#333](https://github.com/mozilla/glean_parser/pull/333)) - -## 3.3.0 (2021-05-18) - -- Generate new event API construct ([#321](https://github.com/mozilla/glean_parser/pull/321)) - -## 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) - -- Add parser and object model support for `rate` metric type. ([bug 1645166](https://bugzilla.mozilla.org/show_bug.cgi?id=1645166)) -- Add parser and object model support for telemetry_mirror property. ([bug 1685406](https://bugzilla.mozilla.org/show_bug.cgi?id=1685406)) -- Update the Javascript template to match Glean.js expectations. ([bug 1693516](https://bugzilla.mozilla.org/show_bug.cgi?id=1693516)) - - Glean.js has updated it's export strategy. It will now export each metric type as an independent module; - - Glean.js has dropped support for non ES6 modules. -- Add support for generating Typescript code. ([bug 1692157](https://bugzilla.mozilla.org/show_bug.cgi?id=1692157)) - - The templates added generate metrics and pings code for Glean.js. - -## 2.4.0 (2021-02-18) - -- **Experimental:** `glean_parser` has a new subcommand `coverage` to convert raw coverage reports - into something consumable by coverage tools, such as codecov.io -- The path to the file that each metric is defined in is now stored on the - `Metric` object in `defined_in["filepath"]`. - -## 2.3.0 (2021-02-17) - -- Leverage the `glean_namespace` to provide correct import when building for Javascript. - -## 2.2.0 (2021-02-11) - -- The Kotlin generator now generates static build information that can be passed - into `Glean.initialize` to avoid calling the package manager at runtime. - -## 2.1.0 (2021-02-10) - -- Add support for generating Javascript code. - - The templates added generate metrics and pings code for Glean.js. - -## 2.0.0 (2021-02-05) - -- New versions 2.0.0 of the `metrics.yaml` and `pings.yaml` schemas now ship - with `glean_parser`. These schemas are different from version 1.0.0 in the - following ways: - - - Bugs must be specified as URLs. Bug numbers are disallowed. - - The legacy ping names containing underscores are no longer allowed. These - included `deletion_request`, `bookmarks_sync`, `history_sync`, - `session_end`, `all_pings`, `glean_*`). In these cases, the `_` should be - replaced with `-`. - - To upgrade your app or library to use the new schema, replace the version in - the `$schema` value with `2-0-0`. - -- **Breaking change:** It is now an error to use bug numbers (rather than URLs) - in ping definitions. - -- Add the line number that metrics and pings were originally defined in the yaml - files. - -## 1.29.1 (2020-12-17) - -- BUGFIX: Linter output can now be redirected correctly (1675771). - -## 1.29.0 (2020-10-07) - -- **Breaking change:** `glean_parser` will now return an error code when any of - the input files do not exist (unless the `--allow-missing-files` flag is - passed). -- Generated code now includes a comment next to each metric containing the name - of the metric in its original `snake_case` form. -- When metrics don't provide a `unit` parameter, it is not included in the - output (as provided by probe-scraper). - -## 1.28.6 (2020-09-24) - -- BUGFIX: Ensure Kotlin arguments are deterministically ordered - -## 1.28.5 (2020-09-14) - -- Fix deploy step to update pip before deploying to pypi. - -## 1.28.4 (2020-09-14) - -- The `SUPERFLUOUS_NO_LINT` warning has been removed from the glinter. - It likely did more harm than good, and makes it hard to make - `metrics.yaml` files that pass across different versions of - `glean_parser`. -- Expired metrics will now produce a linter warning, `EXPIRED_METRIC`. -- Expiry dates that are more than 730 days (\~2 years) in the future - will produce a linter warning, `EXPIRATION_DATE_TOO_FAR`. -- Allow using the Quantity metric type outside of Gecko. -- New parser configs `custom_is_expired` and `custom_validate_expires` - added. These are both functions that take the `expires` value of the - metric and return a bool. (See `Metric.is_expired` and - `Metric.validate_expires`). These will allow FOG to provide custom - validation for its version-based `expires` values. - -## 1.28.3 (2020-07-28) - -- BUGFIX: Support HashSet and Dictionary in the C\## generated code. - -## 1.28.2 (2020-07-28) - -- BUGFIX: Generate valid C\## code when using Labeled metric types. - -## 1.28.1 (2020-07-24) - -- BUGFIX: Add missing column to correctly render markdown tables in generated - documentation. - -## 1.28.0 (2020-07-23) - -- **Breaking change:** The internal ping `deletion-request` was misnamed in - pings.py causing the linter to not allow use of the correctly named ping for - adding legacy ids to. Consuming apps will need to update their metrics.yaml if - they are using `deletion_request` in any `send_in_pings` to `deletion-request` - after updating. - -## 1.27.0 (2020-07-21) - -- Rename the `data_category` field to `data_sensitivity` to be clearer. - -## 1.26.0 (2020-07-21) - -- Add support for JWE metric types. -- Add a `data_sensitivity` field to all metrics for specifying the type of data - collected in the field. - -## 1.25.0 (2020-07-17) - -- Add support for generating C\## code. -- BUGFIX: The memory unit is now correctly passed to the MemoryDistribution - metric type in Swift. - -## 1.24.0 (2020-06-30) - -- BUGFIX: look for metrics in send\_if\_empty pings. Metrics for these kinds of - pings were being ignored. - -## 1.23.0 (2020-06-27) - -- Support for Python 3.5 has been dropped. -- BUGFIX: The ordering of event extra keys will now match with their enum, - fixing a serious bug where keys of extras may not match the correct values in - the data payload. See . - -## 1.22.0 (2020-05-28) - -- **Breaking change:** (Swift only) Combine all metrics and pings into a single - generated file `Metrics.swift`. - -## 1.21.0 (2020-05-25) - -- `glinter` messages have been improved with more details and to be more - actionable. -- A maximum of 10 `extra_keys` is now enforced for `event` metric types. -- BUGFIX: the `Lifetime` enum values now match the values of the implementation - in mozilla/glean. - -## 1.20.4 (2020-05-07) - -- BUGFIX: yamllint errors are now reported using the correct file name. - -## 1.20.3 (2020-05-06) - -- Support for using `timing_distribution`'s `time_unit` parameter to control - the range of acceptable values is documented. The default unit for this use - case is `nanosecond` to avoid creating a breaking change. See [bug - 1630997](https://bugzilla.mozilla.org/show_bug.cgi?id=1630997) for more - information. - -## 1.20.2 (2020-04-24) - -- Dependencies that depend on the version of Python being used are now specified - using the [Declaring platform specific dependencies syntax in - setuptools](https://setuptools.readthedocs.io/en/latest/setuptools.html##declaring-platform-specific-dependencies). - This means that more recent versions of dependencies are likely to be - installed on Python 3.6 and later, and unnecessary backport libraries won't - be installed on more recent Python versions. - -## 1.20.1 (2020-04-21) - -- The minimum version of the runtime dependencies has been lowered to increase - compatibility with other tools. These minimum versions are now tested in CI, - in addition to testing the latest versions of the dependencies that was - already happening in CI. - -## 1.20.0 (2020-04-15) - -- **Breaking change:** glinter errors found during the `translate` command will - now return an error code. glinter warnings will be displayed, but not return - an error code. -- `glean_parser` now produces a linter warning when `user` lifetime metrics are - set to expire. See [bug - 1604854](https://bugzilla.mozilla.org/show_bug.cgi?id=1604854) for additional - context. - -## 1.19.0 (2020-03-18) - -- **Breaking change:** The regular expression used to validate labels is - stricter and more correct. -- Add more information about pings to markdown documentation: - - State whether the ping includes client id; - - Add list of data review links; - - Add list of related bugs links. -- `glean_parser` now makes it easier to write external translation - functions for different language targets. -- BUGFIX: `glean_parser` now works on 32-bit Windows. - -## 1.18.3 (2020-02-24) - -- Dropped the `inflection` dependency. -- Constrained the `zipp` and `MarkupSafe` transitive dependencies to versions - that support Python 3.5. - -## 1.18.2 (2020-02-14) - -- BUGFIX: Fix rendering of first element of reason list. - -## 1.18.1 (2020-02-14) - -- BUGFIX: Reason codes are displayed in markdown output for built-in - pings as well. -- BUGFIX: Reason descriptions are indented correctly in markdown - output. -- BUGFIX: To avoid a compiler error, the `@JvmName` annotation isn't - added to private members. - -## 1.18.0 (2020-02-13) - -- **Breaking Change (Java API)** Have the metrics names in Java match the names - in Kotlin. See [Bug - 1588060](https://bugzilla.mozilla.org/show_bug.cgi?id=1588060). -- The reasons a ping are sent are now included in the generated markdown - documentation. - -## 1.17.3 (2020-02-05) - -- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no - longer supports Python 3.5. - -## 1.17.2 (2020-02-05) - -- BUGFIX: Fixes an import error in generated Kotlin code. - -## 1.17.1 (2020-02-05) - -- BUGFIX: Generated Swift code now includes `import Glean`, unless generating - for a Glean-internal build. - -## 1.17.0 (2020-02-03) - -- Remove default schema URL from `validate_ping` -- Make `schema` argument required for CLI -- BUGFIX: Avoid default import in Swift code for Glean itself -- BUGFIX: Restore order of fields in generated Swift code - -## 1.16.0 (2020-01-15) - -- Support for `reason` codes on pings was added. - -## 1.15.6 (2020-02-06) - -- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no - longer supports Python 3.5 (backported from 1.17.3). - -## 1.15.5 (2019-12-19) - -- BUGFIX: Also allow the legacy name `all_pings` for `send_in_pings` parameter - on metrics - -## 1.15.4 (2019-12-19) - -- BUGFIX: Also allow the legacy name `all_pings` - -## 1.15.3 (2019-12-13) - -- Add project title to markdown template. -- Remove "Sorry about that" from markdown template. -- BUGFIX: Replace dashes in variable names to force proper naming - -## 1.15.2 (2019-12-12) - -- BUGFIX: Use a pure Python library for iso8601 so there is no compilation - required. - -## 1.15.1 (2019-12-12) - -- BUGFIX: Add some additional ping names to the non-kebab-case allow list. - -## 1.15.0 (2019-12-12) - -- Restrict new pings names to be kebab-case and change `all_pings` to - `all-pings` - -## 1.14.0 (2019-12-06) - -- `glean_parser` now supports Python versions 3.5, 3.6, 3.7 and 3.8. - -## 1.13.0 (2019-12-04) - -- The `translate` command will no longer clear extra files in the output - directory. -- BUGFIX: Ensure all newlines in comments are prefixed with comment markers -- BUGFIX: Escape Swift keywords in variable names in generated code -- Generate documentation for pings that are sent if empty - -## 1.12.0 (2019-11-27) - -- Reserve the `deletion_request` ping name -- Added a new flag `send_if_empty` for pings - -## 1.11.0 (2019-11-13) - -- The `glinter` command now performs `yamllint` validation on registry files. - -## 1.10.0 (2019-11-11) - -- The Kotlin linter `detekt` is now run during CI, and for local - testing if installed. -- Python 3.8 is now tested in CI (in addition to Python 3.7). Using - `tox` for this doesn't work in modern versions of CircleCI, so the - `tox` configuration has been removed. -- `yamllint` has been added to test the YAML files on CI. -- ⚠ Metric types that don't yet have implementations in glean-core - have been removed. This includes `enumeration`, `rate`, `usage`, and - `use_counter`, as well as many labeled metrics that don't exist. - -## 1.9.5 (2019-10-22) - -- Allow a Swift lint for generated code -- New lint: Restrict what metric can go into the `baseline` ping -- New lint: Warn for slight misspellings in ping names -- BUGFIX: change Labeled types labels from lists to sets. - -## 1.9.4 (2019-10-16) - -- Use lists instead of sets in Labeled types labels to ensure that the order of - the labels passed to the `metrics.yaml` is kept. -- `glinter` will now check for duplicate labels and error if there are any. - -## 1.9.3 (2019-10-09) - -- Add labels from Labeled types to the Extra column in the Markdown template. - -## 1.9.2 (2019-10-08) - -- BUGFIX: Don't call `is_internal_metric` on `Ping` objects. - -## 1.9.1 (2019-10-07) - -- Don't include Glean internal metrics in the generated markdown. - -## 1.9.0 (2019-10-04) - -- Glinter now warns when bug numbers (rather than URLs) are used. -- BUGFIX: add `HistogramType` and `MemoryUnit` imports in Kotlin generated code. - -## 1.8.4 (2019-10-02) - -- Removed unsupported labeled metric types. - -## 1.8.3 (2019-10-02) - -- Fix indentation for generated Swift code - -## 1.8.2 (2019-10-01) - -- Created labeled metrics and events in Swift code and wrap it in a - configured namespace - -## 1.8.1 (2019-09-27) - -- BUGFIX: `memory_unit` is now passed to the Kotlin generator. - -## 1.8.0 (2019-09-26) - -- A new parser config, `do_not_disable_expired`, was added to turn off the - feature that expired metrics are automatically disabled. This is useful if you - want to retain the disabled value that is explicitly in the `metrics.yaml` - file. -- `glinter` will now report about superfluous `no_lint` entries. - -## 1.7.0 (2019-09-24) - -- A `glinter` tool is now included to find common mistakes in metric naming - and setup. This check is run during `translate` and warnings will be - displayed. ⚠ These warnings will be treated as errors in a future revision. - -## 1.6.1 (2019-09-17) - -- BUGFIX: `GleanGeckoMetricsMapping` must include `LabeledMetricType` - and `CounterMetricType`. - -## 1.6.0 (2019-09-17) - -- NEW: Support for outputting metrics in Swift. -- BUGFIX: Provides a helpful error message when `geckoview_datapoint` is used on - an metric type that doesn't support GeckoView exfiltration. -- Generate a lookup table for Gecko categorical histograms in - `GleanGeckoMetricsMapping`. -- Introduce a 'Swift' output generator. - -## 1.4.1 (2019-08-28) - -- Documentation only. - -## 1.4.0 (2019-08-27) - -- Added support for generating markdown documentation from `metrics.yaml` files. - -## 1.3.0 (2019-08-22) - -- `quantity` metric type has been added. - -## 1.2.1 (2019-08-13) - -- BUGFIX: `includeClientId` was not being output for PingType. - -## 1.2.0 (2019-08-13) - -- `memory_distribution` metric type has been added. -- `custom_distribution` metric type has been added. -- `labeled_timespan` is no longer an allowed metric type. - -## 1.1.0 (2019-08-05) - -- Add a special `all_pings` value to `send_in_pings`. - -## 1.0.0 (2019-07-29) - -- First release to start following strict semver. - -## 0.1.0 (2018-10-15) - -- First release on PyPI. diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/RECORD deleted file mode 100644 index 8ebf523fd7..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/RECORD +++ /dev/null @@ -1,48 +0,0 @@ -glean_parser/__init__.py,sha256=bJljD052_0y-efcBhYpllICVCXOMHLcXRLNyrvfgt5A,533 -glean_parser/__main__.py,sha256=Rw0PpuQtAvdHJMK1YLozeZkc6x1yjeNZwidu4faovdk,8633 -glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 -glean_parser/data_review.py,sha256=BweeeTkNNS6HrIDkztawhbDByrk_-Avxpg7YeST3VAs,2152 -glean_parser/go_server.py,sha256=s6lxK9IAFY55pNl3Rv4MHlV-nQwSoyhO9ppTQE9VCik,5346 -glean_parser/javascript.py,sha256=w4ZhNBHBKWYk0h3t7G0Ud2tR__hRqzn9dlEXNKLdQrA,11230 -glean_parser/javascript_server.py,sha256=x75JfOaveEkPQe3ozYXdtDb1Zks-PxzncDOizsJbYos,7972 -glean_parser/kotlin.py,sha256=5z8_74xlqvHDsedwZhGf1_qb7swPEgIZumkJIuj3ef8,12598 -glean_parser/lint.py,sha256=STqdgyOhR4Q3fHivSizgn9bOOyqrNHhzjaqyJxz6qzI,19948 -glean_parser/markdown.py,sha256=GkCr1CrV6mnRQseT6FO1-JJ7Eup8X3lxUfRMBTxXpe4,9066 -glean_parser/metrics.py,sha256=YAO8wPuRHTLkdT9M4zh9ZwoFI1_VS8O9oQqwZNYyDp0,14612 -glean_parser/parser.py,sha256=cUOnvSXKfEBg8YTpRcWiPcMwpFpK1TTqsVO_zjUtpR4,15309 -glean_parser/pings.py,sha256=AQ-fBmIx2GKQv6J2NyTFfHHZzSnApZZoC770LlstkoI,3180 -glean_parser/python_server.py,sha256=ERpYcbSwF19xKFagxX0mZAvlR1y6D7Ah5DSvW8LipCY,4791 -glean_parser/ruby_server.py,sha256=e5lkfcLQAUMUBQDCjqNU82LkdUzT5x-G6HOnsUInbsU,5190 -glean_parser/rust.py,sha256=UEHeIZlToxCBelfec5sl_l_uLZfk8f_OUXqa_ZoEvnk,7330 -glean_parser/swift.py,sha256=T1BSGahd9wUd6VDeNC89SdN6M34jKXDlydMpSI0QLOs,8379 -glean_parser/tags.py,sha256=bemKYvcbMO4JrghiNSe-A4BNNDtx_FlUPkgrPPJy84Y,1391 -glean_parser/translate.py,sha256=luKQoraARZ2tjenHs0SVtCxflnYaMkzPYFfKEdKdSqQ,8403 -glean_parser/translation_options.py,sha256=Lxzr6G7MP0tC_ZYlZXftS4j0SLiqO-5mGVTEc7ggXis,2037 -glean_parser/util.py,sha256=v81watw5nSPGRlFNNpTb7iUv9NZObiFIbyyg2oZ6EnY,16149 -glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 -glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 -glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=wx1q0L4C0-Vcwk1SPU6t8OfjDEQvgrwwEG6xfSHO1MI,26365 -glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 -glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=vDyvFT8KwAwaqyWHG4y6pFNrsc3NO7OyDDagA2eTeqM,5415 -glean_parser/schemas/tags.1-0-0.schema.yaml,sha256=OGXIJlvvVW1vaqB_NVZnwKeZ-sLlfH57vjBSHbj6DNI,1231 -glean_parser/templates/data_review.jinja2,sha256=jeYU29T1zLSyu9fKBBFu5BFPfIw8_hmOUXw8RXhRXK8,3287 -glean_parser/templates/go_server.jinja2,sha256=Jy1e0uQqr_WZNoj-AWnygRmygX2jyj_GQMMV8mSah2k,6825 -glean_parser/templates/javascript.buildinfo.jinja2,sha256=4mXiZCQIk9if4lxlA05kpSIL4a95IdwGwqle2OqqNAs,474 -glean_parser/templates/javascript.jinja2,sha256=cT_bG-jC6m4afECXmcsqHwiiHjRuVtJnfv90OD2Mwxw,2669 -glean_parser/templates/javascript_server.jinja2,sha256=H991yQOKJMwSgM0bLEA-Q5Z15LWsfEPh6bTYz_owSCU,9423 -glean_parser/templates/kotlin.buildinfo.jinja2,sha256=X0lk2SNu5OIIj2i6mUyF9CWFQIonLgfqkgT5fA-5G6c,920 -glean_parser/templates/kotlin.geckoview.jinja2,sha256=MJOgtoDXmBjE9pwk-G6T89y36RZuMbDWM_-DBN_gFJo,5099 -glean_parser/templates/kotlin.jinja2,sha256=3DqUMXJRkmTvSp_5IRyvGmw5iXYWdox7coMFe3YDxcc,5247 -glean_parser/templates/markdown.jinja2,sha256=vAHHGGm28HRDPd3zO_wQMAUZIuxE9uQ7hl3NpXxcKV4,3425 -glean_parser/templates/python_server.jinja2,sha256=gu2C1rkn760IqBCG2SWaK7o32T1ify94wDEsudLPUg8,7260 -glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 -glean_parser/templates/ruby_server.jinja2,sha256=vm4BEenOqzomQNTLFfMOzlWHARnsWUjTBbnR-v2cadI,6247 -glean_parser/templates/rust.jinja2,sha256=wlV0OZvV3Mk2ulrqFkN1vGjdsahsupEy2TQvWxQKzww,5439 -glean_parser/templates/swift.jinja2,sha256=xkvVsTpfK0QK3tI32wGqzxm2hqFNaBQ6Y71rKIsCmAI,4944 -glean_parser-13.0.1.dist-info/AUTHORS.md,sha256=yxgj8MioO4wUnrh0gmfb8l3DJJrf-l4HmmEDbQsbbNI,455 -glean_parser-13.0.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 -glean_parser-13.0.1.dist-info/METADATA,sha256=UYz6ZRXyv3ODi3yl2vRQHZVdm0XGerFp8pIOGWGwOKw,31604 -glean_parser-13.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92 -glean_parser-13.0.1.dist-info/entry_points.txt,sha256=mf9d3sv8BwSjjR58x9KDnpVkONCnv3fPQC2NjJl15Xg,68 -glean_parser-13.0.1.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 -glean_parser-13.0.1.dist-info/RECORD,, diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/WHEEL b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/WHEEL deleted file mode 100644 index bab98d6758..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/WHEEL +++ /dev/null @@ -1,5 +0,0 @@ -Wheel-Version: 1.0 -Generator: bdist_wheel (0.43.0) -Root-Is-Purelib: true -Tag: py3-none-any - diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/entry_points.txt b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/entry_points.txt deleted file mode 100644 index 08fde9d655..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/entry_points.txt +++ /dev/null @@ -1,2 +0,0 @@ -[console_scripts] -glean_parser = glean_parser.__main__:main_wrapper diff --git a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/top_level.txt b/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/top_level.txt deleted file mode 100644 index a7f3a37918..0000000000 --- a/third_party/python/glean_parser/glean_parser-13.0.1.dist-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -glean_parser diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/AUTHORS.md b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/AUTHORS.md new file mode 100644 index 0000000000..525116ee7e --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/AUTHORS.md @@ -0,0 +1,17 @@ +# Credits + +## Development Lead + +- Jan-Erik Rediger +- Alessio Placitelli + +## Contributors + +See [the full list of contributors](https://github.com/mozilla/glean_parser/graphs/contributors). + +## Acknowledgements + +This package was created with +[Cookiecutter](https://github.com/audreyr/cookiecutter) and the +[audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) +project template. diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/LICENSE b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/LICENSE new file mode 100644 index 0000000000..a612ad9813 --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + 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/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/METADATA b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/METADATA new file mode 100644 index 0000000000..65030fd86b --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/METADATA @@ -0,0 +1,799 @@ +Metadata-Version: 2.1 +Name: glean_parser +Version: 14.0.1 +Summary: Parser tools for Mozilla's Glean telemetry +Home-page: https://github.com/mozilla/glean_parser +Author: The Glean Team +Author-email: glean-team@mozilla.com +Keywords: glean_parser +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Natural Language :: English +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Description-Content-Type: text/markdown +License-File: LICENSE +License-File: AUTHORS.md +Requires-Dist: appdirs >=1.4 +Requires-Dist: Click >=7 +Requires-Dist: diskcache >=4 +Requires-Dist: Jinja2 >=2.10.1 +Requires-Dist: jsonschema >=3.0.2 +Requires-Dist: PyYAML >=5.3.1 + +# Glean Parser + +Parser tools for Mozilla's Glean telemetry. + +## Features + +Contains various utilities for handling `metrics.yaml` and `pings.yaml` for [the +Glean SDKs](https://mozilla.github.io/glean). This includes producing generated +code for various integrations, linting and coverage testing. + +## Documentation + +- [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 + +- Python 3.8 (or later) + +The following library requirements are installed automatically when +`glean_parser` is installed by `pip`. + +- appdirs +- Click +- diskcache +- Jinja2 +- jsonschema +- PyYAML + +## Usage + +```sh +$ glean_parser --help +``` + +Read in `metrics.yaml`, translate to Kotlin format, and +output to `output_dir`: + +```sh +$ glean_parser translate -o output_dir -f kotlin metrics.yaml +``` + +Check a Glean ping against the ping schema: + +```sh +$ glean_parser check < ping.json +``` + + +# Changelog + +## 14.0.1 + +- BUGFIX: Fix missing `ping_arg` in util.py ([#687](https://github.com/mozilla/glean_parser/pull/687)) + +## 14.0.0 + +- BREAKING CHANGE: Expose the optional `enabled` property on pings, defaulting to `enabled: true` ([#681](https://github.com/mozilla/glean_parser/pull/681)) +- BREAKING CHANGE: Support metadata field `ping_schedule` for pings ([bug 1804711](https://bugzilla.mozilla.org/show_bug.cgi?id=1804711)) +- Add support for event metric type in server JavaScript outputter ([DENG-2407](https://mozilla-hub.atlassian.net/browse/DENG-2407)) +- Add Swift and Kotlin codegen support for the object metric type object ([#685](https://github.com/mozilla/glean_parser/pull/685)) + +## 13.0.1 + +- Use faster C yaml parser if available ([#677](https://github.com/mozilla/glean_parser/pull/677)) + +## 13.0.0 + +- BREAKING CHANGE: Support metadata field `include_info_sections` ([bug 1866559](https://bugzilla.mozilla.org/show_bug.cgi?id=1866559)) + +## 12.0.1 + +- Fix Rust codegen for object metric type ([#662](https://github.com/mozilla/glean_parser/pull/662)) + +## 12.0.0 + +- Add new metric type object (only Rust codegen support right now) ([#587](https://github.com/mozilla/glean_parser/pull/587)) + +## 11.1.0 + +- Add Go log outputter (`go_server`) ([#645](https://github.com/mozilla/glean_parser/pull/645)) +- Add Python log outputter (`python_server`) ([MPP-3642](https://mozilla-hub.atlassian.net/browse/MPP-3642)) + +## 11.0.1 + +- Fix javascript_server template to include non-event metric parameters in #record call for event metrics ([#643](https://github.com/mozilla/glean_parser/pull/643)) +- events: Increase extra key limit to 50 ([Bug 1869429](https://bugzilla.mozilla.org/show_bug.cgi?id=1869429)) + +## 11.0.0 + +- Add updated logging logic for Ruby Server ([#642](https://github.com/mozilla/glean_parser/pull/642)) +- Add support for event metric type in server-side JavaScript outputter ([DENG-1736](https://mozilla-hub.atlassian.net/browse/DENG-1736)) +- BREAKING CHANGE: Dropped support for Python 3.7 ([#638](https://github.com/mozilla/glean_parser/pull/638)) +- Add official support for Python 3.11+ ([#638](https://github.com/mozilla/glean_parser/pull/638)) + +## 10.0.3 + +- Warn about empty or TODO-tagged data reviews in the list ([#634](https://github.com/mozilla/glean_parser/pull/634)) +- Allow `unit` field on all metrics, but warn for all but quantity and custom distribution ([#636](https://github.com/mozilla/glean_parser/pull/636)) + +## 10.0.2 + +- Allow `unit` field for string again, but warn about it in the linter ([#634](https://github.com/mozilla/glean_parser/pull/634)) + +## 10.0.1 + +- Allow `unit` field for custom distribution again ([#633](https://github.com/mozilla/glean_parser/pull/633)) + +## 10.0.0 + +- Add Ruby log outputter (`ruby_server`) ([#620](https://github.com/mozilla/glean_parser/pull/620)) +- BREAKING CHANE: `ping` lifetime metrics on the events ping are now disallowed ([#625](https://github.com/mozilla/glean_parser/pull/625)) +- Disallow `unit` field for anything but quantity ([#630](https://github.com/mozilla/glean_parser/pull/630)). + Note that this was already considered the case, now the code enforces it. + +## 9.0.0 + +- BREAKING CHANGE: Dropped support for Python 3.6 ([#615](https://github.com/mozilla/glean_parser/issues/615)) +- Allow metadata to configure precise timestamps in pings ([#592](https://github.com/mozilla/glean_parser/pull/592)) + +## 8.1.1 + +- Small updates to the `javascript_server` tempalte to address lint warnings ([#598](https://github.com/mozilla/glean_parser/pull/598)) + +## 8.1.0 + +- Increased the maximum metric name length in version 2.0.0 schema ([#596](https://github.com/mozilla/glean_parser/pull/596)) + +## 8.0.0 + +- BREAKING CHANGE: Remove exposed `lint_yaml_files` function ([#580](https://github.com/mozilla/glean_parser/pull/580)) +- Rust: Removed `__glean_metric_maps` from the Rust Jinja template. This functionality is better placed downstream ([Bug 1816526](https://bugzilla.mozilla.org/show_bug.cgi?id=1816526)) +- New lint: check that all referenced pings are known ([#584](https://github.com/mozilla/glean_parser/pull/584)) +- Add experimental server-side JavaScript outputter ([FXA-7922](https://mozilla-hub.atlassian.net/browse/FXA-7922)) + +## 7.2.1 + +- Unbreak last minor release ([#579](https://github.com/mozilla/glean_parser/pull/579)) + +## 7.2.0 + +- Remove yamllint integration ([#578](https://github.com/mozilla/glean_parser/pull/578)) + +## 7.1.0 + +- ENHANCEMENT: Labels in `labels:` fields may now contain any printable ASCII characters ([bug 1672273](https://bugzilla.mozilla.org/show_bug.cgi?id=1672273)) +- BUGFIX: Enforce ordering of generation of Pings, Metrics and Tags such that order is deterministic ([bug 1820334](https://bugzilla.mozilla.org/show_bug.cgi?id=1820334)) + +## 7.0.0 + +- BUGFIX: Remove internal-only fields from serialized metrics data ([#550](https://github.com/mozilla/glean_parser/pull/550)) +- FEATURE: New subcommand: `dump` to dump the metrics data as JSON ([#550](https://github.com/mozilla/glean_parser/pull/550)) +- BUGFIX: Kotlin: Generate enums with the right generic bound for ping reason codes ([#551](https://github.com/mozilla/glean_parser/pull/551)). +- **BREAKING CHANGE:** Fully remove support for the old events API ([#549](https://github.com/mozilla/glean_parser/pull/549)) + Adds a new lint `OLD_EVENT_API` to warn about missing `type` attributes on event extra keys. + Note that the Glean SDK already dropped support for the old events API. + +## 6.4.0 + +- BUGFIX: Correct code generation for labeled metrics in Rust ([#533](https://github.com/mozilla/glean_parser/pull/533)) +- BUGFIX: Correctly serialize `Rates` for Rust code ([#530](https://github.com/mozilla/glean_parser/pull/530)) +- Feature: Wrap labeled metric's static labels list as CoW strings (requires updated Glean support) ([#534](https://github.com/mozilla/glean_parser/pull/534)) + +## 6.3.0 + +- events: Increase extras limit to 15 ([bug 1798713](https://bugzilla.mozilla.org/show_bug.cgi?id=1798713)) + +## 6.2.1 + +- Add support for Rate, Denominator and Numerator metrics for JavaScript. ([bug 1793777](https://bugzilla.mozilla.org/show_bug.cgi?id=1793777)) + +## 6.2.0 + +- [data-review] Use a template to generate the Data Review Request template ([bug 1772605](https://bugzilla.mozilla.org/show_bug.cgi?id=1772605)) +- Make tag and no\_lint order deterministic ([#518](https://github.com/mozilla/glean_parser/pull/518)) + +## 6.1.2 + +- Swift: Add a conditional `import Foundation` to support generating metrics when Glean is delivered via the AppServices iOS megazord + +## 6.1.1 + +- Rust: Use correct name for a ping in generated code. + +## 6.1.0 + +- [data-review] Include extra keys' names and descriptions in data review template ([bug 1767027](https://bugzilla.mozilla.org/show_bug.cgi?id=1767027)) +- Raise limit on number of statically-defined labels to 4096. ([bug 1772163](https://bugzilla.mozilla.org/show_bug.cgi?id=1772163)) +- Fix Rust code generation for new UniFFI interface ([#491](https://github.com/mozilla/glean_parser/pull/491), [#494](https://github.com/mozilla/glean_parser/pull/494), [#495](https://github.com/mozilla/glean_parser/pull/495)) + +## 6.0.1 + +- Relax version requirement for MarkupSafe. + Now works with MarkupSafe v1.1.1 to v2.0.1 inclusive again. + +## 6.0.0 + +- BUGFIX: Add missing `extra_args` to Rust constructor generation ([bug 1765855](https://bugzilla.mozilla.org/show_bug.cgi?id=1765855)) +- **Breaking change:** `glean_parser` now generates metrics compatible with the UniFFI-powered Glean SDK. + This is not backwards-compatible with previous versions. +- Generate Rate, Denominator and Numerator metrics for Kotlin and Swift +- Explicitly skip Rate, Denominator and Numerator metrics for JavaScript. + These will cause a build failure by default, but can be turned into warnings on request. + Use `-s fail_rates=false` to enable warning-only mode. + +## 5.1.2 + +- BUGFIX: Revert changes made on v5.1.1. + - The issues addressed by those changes, were non-issues and result of misuse of the APIs. + +## 5.1.1 + +- BUGFIX: Fix issues with Swift templates ([bug 1749494](https://bugzilla.mozilla.org/show_bug.cgi?id=1749494)) + - Make metrics and pings all `public` + - Make pings `static` + +## 5.1.0 + +- Add support for build info generation for JavaScript and Typescript targets ([bug 1749494](https://bugzilla.mozilla.org/show_bug.cgi?id=1749494)) + +## 5.0.1 + +- Fix the logic for the metric expiration by version ([bug 1753194](https://bugzilla.mozilla.org/show_bug.cgi?id=1753194)) + +## 5.0.0 + +- Remove C# support ([#436](https://github.com/mozilla/glean_parser/pull/436)). +- Add support for Rust code generation ([bug 1677434](https://bugzilla.mozilla.org/show_bug.cgi?id=1677434)) +- Report an error if no files are passed ([bug 1751730](https://bugzilla.mozilla.org/show_bug.cgi?id=1751730)) +- [data-review] Report an error if no metrics match provided bug number ([bug 1752576](https://bugzilla.mozilla.org/show_bug.cgi?id=1752576)) +- [data-review] Include notification_emails in list of those responsible ([bug 1752576](https://bugzilla.mozilla.org/show_bug.cgi?id=1752576)) +- Add support for expiring metrics by the provided major version ([bug 1753194](https://bugzilla.mozilla.org/show_bug.cgi?id=1753194)) + +## 4.4.0 + +- Support global file-level tags in metrics.yaml ([bug 1745283](https://bugzilla.mozilla.org/show_bug.cgi?id=1745283)) +- Glinter: Reject metric files if they use `unit` by mistake. It should be `time_unit` ([#432](https://github.com/mozilla/glean_parser/pull/432)). +- Automatically generate a build date when generating build info ([#431](https://github.com/mozilla/glean_parser/pull/431)). + Enabled for Kotlin and Swift. + This can be changed with the `build_date` command line option. + `build_date=0` will use a static unix epoch time. + `build_date=2022-01-03T17:30:00` will parse the ISO8601 string to use (as a UTC timestamp). + Other values will throw an error. + + Example: + + glean_parser translate --format kotlin --option build_date=2021-11-01T01:00:00 path/to/metrics.yaml + +## 4.3.1 + +- BUGFIX: Skip tags for code generation ([#409](https://github.com/mozilla/glean_parser/pull/409)) + +## 4.3.0 + +- Support tags in glean parser ([bug 1734011](https://bugzilla.mozilla.org/show_bug.cgi?id=1734011)) + +## 4.2.0 + +- Improve the schema validation error messages. They will no longer include `OrderedDict(...)` on Python 3.7 and later ([bug 1733395](https://bugzilla.mozilla.org/show_bug.cgi?id=1733395)) +- Officially support Python 3.10 + +## 4.1.1 (2021-09-28) + +- Update private import paths on Javascript / Typescript templates. ([bug 1702468](https://bugzilla.mozilla.org/show_bug.cgi?id=1702468)) + +## 4.1.0 (2021-09-16) + +- Add support for Node.js platform on Javascript / Typescript templates. ([bug 1728982](https://bugzilla.mozilla.org/show_bug.cgi?id=1728982)) + +## 4.0.0 (2021-08-20) + +- Add support for Text metric type ([#374](https://github.com/mozilla/glean_parser/pull/374)) +- Reserve the `default` ping name. It can't be used as a ping name, but it can be used in `send_in_pings` ([#376](https://github.com/mozilla/glean_parser/pull/376)) + +## 3.8.0 (2021-08-18) + +- Expose ping reasons enum on JavaScript / TypeScript templates. ([bug 1719136](https://bugzilla.mozilla.org/show_bug.cgi?id=1719136)) +- Define an interface with the allowed extras for each event on the TypeScript template. ([bug 1693487](https://bugzilla.mozilla.org/show_bug.cgi?id=1693487)) + +## 3.7.0 (2021-07-13) + +- New lint: Check for redundant words in ping names ([#355](https://github.com/mozilla/glean_parser/pull/355)) +- Add support for URL metric type ([#361](https://github.com/mozilla/glean_parser/pull/361)) + +## 3.6.0 (2021-06-11) + +- 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) + +- Transform generated folder into QML Module when building Javascript templates for the Qt platform. ([bug 1707896](https://bugzilla.mozilla.org/show_bug.cgi?id=1707896) + - Import the Glean QML module from inside each generated file, removing the requirement to import Glean before importing any of the generated files; + - Prodive a `qmldir` file exposing all generated files; + - Drop the `namespace` option for Javascript templates; + - Add a new `version` option for Javascript templates, required when building for Qt, which expected the Glean QML module version. + +## 3.4.0 (2021-05-28) + +- Add missing import for Kotlin code ([#339](https://github.com/mozilla/glean_parser/pull/339)) +- Use a plain Kotlin type in the generated interface implementation ([#339](https://github.com/mozilla/glean_parser/pull/339)) +- Generate additional generics for event metrics ([#339](https://github.com/mozilla/glean_parser/pull/339)) +- For Kotlin skip generating `GleanBuildInfo.kt` when requested (with `with_buildinfo=false`) ([#341](https://github.com/mozilla/glean_parser/pull/341)) + +## 3.3.2 (2021-05-18) + +- Fix another bug in the Swift code generation when generating extra keys ([#334](https://github.com/mozilla/glean_parser/pull/334)) + +## 3.3.1 (2021-05-18) + +- Fix Swift code generation bug for pings ([#333](https://github.com/mozilla/glean_parser/pull/333)) + +## 3.3.0 (2021-05-18) + +- Generate new event API construct ([#321](https://github.com/mozilla/glean_parser/pull/321)) + +## 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) + +- Add parser and object model support for `rate` metric type. ([bug 1645166](https://bugzilla.mozilla.org/show_bug.cgi?id=1645166)) +- Add parser and object model support for telemetry_mirror property. ([bug 1685406](https://bugzilla.mozilla.org/show_bug.cgi?id=1685406)) +- Update the Javascript template to match Glean.js expectations. ([bug 1693516](https://bugzilla.mozilla.org/show_bug.cgi?id=1693516)) + - Glean.js has updated it's export strategy. It will now export each metric type as an independent module; + - Glean.js has dropped support for non ES6 modules. +- Add support for generating Typescript code. ([bug 1692157](https://bugzilla.mozilla.org/show_bug.cgi?id=1692157)) + - The templates added generate metrics and pings code for Glean.js. + +## 2.4.0 (2021-02-18) + +- **Experimental:** `glean_parser` has a new subcommand `coverage` to convert raw coverage reports + into something consumable by coverage tools, such as codecov.io +- The path to the file that each metric is defined in is now stored on the + `Metric` object in `defined_in["filepath"]`. + +## 2.3.0 (2021-02-17) + +- Leverage the `glean_namespace` to provide correct import when building for Javascript. + +## 2.2.0 (2021-02-11) + +- The Kotlin generator now generates static build information that can be passed + into `Glean.initialize` to avoid calling the package manager at runtime. + +## 2.1.0 (2021-02-10) + +- Add support for generating Javascript code. + - The templates added generate metrics and pings code for Glean.js. + +## 2.0.0 (2021-02-05) + +- New versions 2.0.0 of the `metrics.yaml` and `pings.yaml` schemas now ship + with `glean_parser`. These schemas are different from version 1.0.0 in the + following ways: + + - Bugs must be specified as URLs. Bug numbers are disallowed. + - The legacy ping names containing underscores are no longer allowed. These + included `deletion_request`, `bookmarks_sync`, `history_sync`, + `session_end`, `all_pings`, `glean_*`). In these cases, the `_` should be + replaced with `-`. + + To upgrade your app or library to use the new schema, replace the version in + the `$schema` value with `2-0-0`. + +- **Breaking change:** It is now an error to use bug numbers (rather than URLs) + in ping definitions. + +- Add the line number that metrics and pings were originally defined in the yaml + files. + +## 1.29.1 (2020-12-17) + +- BUGFIX: Linter output can now be redirected correctly (1675771). + +## 1.29.0 (2020-10-07) + +- **Breaking change:** `glean_parser` will now return an error code when any of + the input files do not exist (unless the `--allow-missing-files` flag is + passed). +- Generated code now includes a comment next to each metric containing the name + of the metric in its original `snake_case` form. +- When metrics don't provide a `unit` parameter, it is not included in the + output (as provided by probe-scraper). + +## 1.28.6 (2020-09-24) + +- BUGFIX: Ensure Kotlin arguments are deterministically ordered + +## 1.28.5 (2020-09-14) + +- Fix deploy step to update pip before deploying to pypi. + +## 1.28.4 (2020-09-14) + +- The `SUPERFLUOUS_NO_LINT` warning has been removed from the glinter. + It likely did more harm than good, and makes it hard to make + `metrics.yaml` files that pass across different versions of + `glean_parser`. +- Expired metrics will now produce a linter warning, `EXPIRED_METRIC`. +- Expiry dates that are more than 730 days (\~2 years) in the future + will produce a linter warning, `EXPIRATION_DATE_TOO_FAR`. +- Allow using the Quantity metric type outside of Gecko. +- New parser configs `custom_is_expired` and `custom_validate_expires` + added. These are both functions that take the `expires` value of the + metric and return a bool. (See `Metric.is_expired` and + `Metric.validate_expires`). These will allow FOG to provide custom + validation for its version-based `expires` values. + +## 1.28.3 (2020-07-28) + +- BUGFIX: Support HashSet and Dictionary in the C\## generated code. + +## 1.28.2 (2020-07-28) + +- BUGFIX: Generate valid C\## code when using Labeled metric types. + +## 1.28.1 (2020-07-24) + +- BUGFIX: Add missing column to correctly render markdown tables in generated + documentation. + +## 1.28.0 (2020-07-23) + +- **Breaking change:** The internal ping `deletion-request` was misnamed in + pings.py causing the linter to not allow use of the correctly named ping for + adding legacy ids to. Consuming apps will need to update their metrics.yaml if + they are using `deletion_request` in any `send_in_pings` to `deletion-request` + after updating. + +## 1.27.0 (2020-07-21) + +- Rename the `data_category` field to `data_sensitivity` to be clearer. + +## 1.26.0 (2020-07-21) + +- Add support for JWE metric types. +- Add a `data_sensitivity` field to all metrics for specifying the type of data + collected in the field. + +## 1.25.0 (2020-07-17) + +- Add support for generating C\## code. +- BUGFIX: The memory unit is now correctly passed to the MemoryDistribution + metric type in Swift. + +## 1.24.0 (2020-06-30) + +- BUGFIX: look for metrics in send\_if\_empty pings. Metrics for these kinds of + pings were being ignored. + +## 1.23.0 (2020-06-27) + +- Support for Python 3.5 has been dropped. +- BUGFIX: The ordering of event extra keys will now match with their enum, + fixing a serious bug where keys of extras may not match the correct values in + the data payload. See . + +## 1.22.0 (2020-05-28) + +- **Breaking change:** (Swift only) Combine all metrics and pings into a single + generated file `Metrics.swift`. + +## 1.21.0 (2020-05-25) + +- `glinter` messages have been improved with more details and to be more + actionable. +- A maximum of 10 `extra_keys` is now enforced for `event` metric types. +- BUGFIX: the `Lifetime` enum values now match the values of the implementation + in mozilla/glean. + +## 1.20.4 (2020-05-07) + +- BUGFIX: yamllint errors are now reported using the correct file name. + +## 1.20.3 (2020-05-06) + +- Support for using `timing_distribution`'s `time_unit` parameter to control + the range of acceptable values is documented. The default unit for this use + case is `nanosecond` to avoid creating a breaking change. See [bug + 1630997](https://bugzilla.mozilla.org/show_bug.cgi?id=1630997) for more + information. + +## 1.20.2 (2020-04-24) + +- Dependencies that depend on the version of Python being used are now specified + using the [Declaring platform specific dependencies syntax in + setuptools](https://setuptools.readthedocs.io/en/latest/setuptools.html##declaring-platform-specific-dependencies). + This means that more recent versions of dependencies are likely to be + installed on Python 3.6 and later, and unnecessary backport libraries won't + be installed on more recent Python versions. + +## 1.20.1 (2020-04-21) + +- The minimum version of the runtime dependencies has been lowered to increase + compatibility with other tools. These minimum versions are now tested in CI, + in addition to testing the latest versions of the dependencies that was + already happening in CI. + +## 1.20.0 (2020-04-15) + +- **Breaking change:** glinter errors found during the `translate` command will + now return an error code. glinter warnings will be displayed, but not return + an error code. +- `glean_parser` now produces a linter warning when `user` lifetime metrics are + set to expire. See [bug + 1604854](https://bugzilla.mozilla.org/show_bug.cgi?id=1604854) for additional + context. + +## 1.19.0 (2020-03-18) + +- **Breaking change:** The regular expression used to validate labels is + stricter and more correct. +- Add more information about pings to markdown documentation: + - State whether the ping includes client id; + - Add list of data review links; + - Add list of related bugs links. +- `glean_parser` now makes it easier to write external translation + functions for different language targets. +- BUGFIX: `glean_parser` now works on 32-bit Windows. + +## 1.18.3 (2020-02-24) + +- Dropped the `inflection` dependency. +- Constrained the `zipp` and `MarkupSafe` transitive dependencies to versions + that support Python 3.5. + +## 1.18.2 (2020-02-14) + +- BUGFIX: Fix rendering of first element of reason list. + +## 1.18.1 (2020-02-14) + +- BUGFIX: Reason codes are displayed in markdown output for built-in + pings as well. +- BUGFIX: Reason descriptions are indented correctly in markdown + output. +- BUGFIX: To avoid a compiler error, the `@JvmName` annotation isn't + added to private members. + +## 1.18.0 (2020-02-13) + +- **Breaking Change (Java API)** Have the metrics names in Java match the names + in Kotlin. See [Bug + 1588060](https://bugzilla.mozilla.org/show_bug.cgi?id=1588060). +- The reasons a ping are sent are now included in the generated markdown + documentation. + +## 1.17.3 (2020-02-05) + +- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no + longer supports Python 3.5. + +## 1.17.2 (2020-02-05) + +- BUGFIX: Fixes an import error in generated Kotlin code. + +## 1.17.1 (2020-02-05) + +- BUGFIX: Generated Swift code now includes `import Glean`, unless generating + for a Glean-internal build. + +## 1.17.0 (2020-02-03) + +- Remove default schema URL from `validate_ping` +- Make `schema` argument required for CLI +- BUGFIX: Avoid default import in Swift code for Glean itself +- BUGFIX: Restore order of fields in generated Swift code + +## 1.16.0 (2020-01-15) + +- Support for `reason` codes on pings was added. + +## 1.15.6 (2020-02-06) + +- BUGFIX: The version of Jinja2 now specifies < 3.0, since that version no + longer supports Python 3.5 (backported from 1.17.3). + +## 1.15.5 (2019-12-19) + +- BUGFIX: Also allow the legacy name `all_pings` for `send_in_pings` parameter + on metrics + +## 1.15.4 (2019-12-19) + +- BUGFIX: Also allow the legacy name `all_pings` + +## 1.15.3 (2019-12-13) + +- Add project title to markdown template. +- Remove "Sorry about that" from markdown template. +- BUGFIX: Replace dashes in variable names to force proper naming + +## 1.15.2 (2019-12-12) + +- BUGFIX: Use a pure Python library for iso8601 so there is no compilation + required. + +## 1.15.1 (2019-12-12) + +- BUGFIX: Add some additional ping names to the non-kebab-case allow list. + +## 1.15.0 (2019-12-12) + +- Restrict new pings names to be kebab-case and change `all_pings` to + `all-pings` + +## 1.14.0 (2019-12-06) + +- `glean_parser` now supports Python versions 3.5, 3.6, 3.7 and 3.8. + +## 1.13.0 (2019-12-04) + +- The `translate` command will no longer clear extra files in the output + directory. +- BUGFIX: Ensure all newlines in comments are prefixed with comment markers +- BUGFIX: Escape Swift keywords in variable names in generated code +- Generate documentation for pings that are sent if empty + +## 1.12.0 (2019-11-27) + +- Reserve the `deletion_request` ping name +- Added a new flag `send_if_empty` for pings + +## 1.11.0 (2019-11-13) + +- The `glinter` command now performs `yamllint` validation on registry files. + +## 1.10.0 (2019-11-11) + +- The Kotlin linter `detekt` is now run during CI, and for local + testing if installed. +- Python 3.8 is now tested in CI (in addition to Python 3.7). Using + `tox` for this doesn't work in modern versions of CircleCI, so the + `tox` configuration has been removed. +- `yamllint` has been added to test the YAML files on CI. +- ⚠ Metric types that don't yet have implementations in glean-core + have been removed. This includes `enumeration`, `rate`, `usage`, and + `use_counter`, as well as many labeled metrics that don't exist. + +## 1.9.5 (2019-10-22) + +- Allow a Swift lint for generated code +- New lint: Restrict what metric can go into the `baseline` ping +- New lint: Warn for slight misspellings in ping names +- BUGFIX: change Labeled types labels from lists to sets. + +## 1.9.4 (2019-10-16) + +- Use lists instead of sets in Labeled types labels to ensure that the order of + the labels passed to the `metrics.yaml` is kept. +- `glinter` will now check for duplicate labels and error if there are any. + +## 1.9.3 (2019-10-09) + +- Add labels from Labeled types to the Extra column in the Markdown template. + +## 1.9.2 (2019-10-08) + +- BUGFIX: Don't call `is_internal_metric` on `Ping` objects. + +## 1.9.1 (2019-10-07) + +- Don't include Glean internal metrics in the generated markdown. + +## 1.9.0 (2019-10-04) + +- Glinter now warns when bug numbers (rather than URLs) are used. +- BUGFIX: add `HistogramType` and `MemoryUnit` imports in Kotlin generated code. + +## 1.8.4 (2019-10-02) + +- Removed unsupported labeled metric types. + +## 1.8.3 (2019-10-02) + +- Fix indentation for generated Swift code + +## 1.8.2 (2019-10-01) + +- Created labeled metrics and events in Swift code and wrap it in a + configured namespace + +## 1.8.1 (2019-09-27) + +- BUGFIX: `memory_unit` is now passed to the Kotlin generator. + +## 1.8.0 (2019-09-26) + +- A new parser config, `do_not_disable_expired`, was added to turn off the + feature that expired metrics are automatically disabled. This is useful if you + want to retain the disabled value that is explicitly in the `metrics.yaml` + file. +- `glinter` will now report about superfluous `no_lint` entries. + +## 1.7.0 (2019-09-24) + +- A `glinter` tool is now included to find common mistakes in metric naming + and setup. This check is run during `translate` and warnings will be + displayed. ⚠ These warnings will be treated as errors in a future revision. + +## 1.6.1 (2019-09-17) + +- BUGFIX: `GleanGeckoMetricsMapping` must include `LabeledMetricType` + and `CounterMetricType`. + +## 1.6.0 (2019-09-17) + +- NEW: Support for outputting metrics in Swift. +- BUGFIX: Provides a helpful error message when `geckoview_datapoint` is used on + an metric type that doesn't support GeckoView exfiltration. +- Generate a lookup table for Gecko categorical histograms in + `GleanGeckoMetricsMapping`. +- Introduce a 'Swift' output generator. + +## 1.4.1 (2019-08-28) + +- Documentation only. + +## 1.4.0 (2019-08-27) + +- Added support for generating markdown documentation from `metrics.yaml` files. + +## 1.3.0 (2019-08-22) + +- `quantity` metric type has been added. + +## 1.2.1 (2019-08-13) + +- BUGFIX: `includeClientId` was not being output for PingType. + +## 1.2.0 (2019-08-13) + +- `memory_distribution` metric type has been added. +- `custom_distribution` metric type has been added. +- `labeled_timespan` is no longer an allowed metric type. + +## 1.1.0 (2019-08-05) + +- Add a special `all_pings` value to `send_in_pings`. + +## 1.0.0 (2019-07-29) + +- First release to start following strict semver. + +## 0.1.0 (2018-10-15) + +- First release on PyPI. diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/RECORD new file mode 100644 index 0000000000..700ca80797 --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/RECORD @@ -0,0 +1,48 @@ +glean_parser/__init__.py,sha256=bJljD052_0y-efcBhYpllICVCXOMHLcXRLNyrvfgt5A,533 +glean_parser/__main__.py,sha256=Rw0PpuQtAvdHJMK1YLozeZkc6x1yjeNZwidu4faovdk,8633 +glean_parser/coverage.py,sha256=2IwC4XMDtDamMkBFoYilmqJzW4gyypq65YVCur8SNas,4405 +glean_parser/data_review.py,sha256=BweeeTkNNS6HrIDkztawhbDByrk_-Avxpg7YeST3VAs,2152 +glean_parser/go_server.py,sha256=s6lxK9IAFY55pNl3Rv4MHlV-nQwSoyhO9ppTQE9VCik,5346 +glean_parser/javascript.py,sha256=w4ZhNBHBKWYk0h3t7G0Ud2tR__hRqzn9dlEXNKLdQrA,11230 +glean_parser/javascript_server.py,sha256=PZSTl63TR3cY8Y99jXMOLu-8rzgQarymzjnHJm9aYK0,8389 +glean_parser/kotlin.py,sha256=5nXnen4s2YOj503Z77HVTUgDHWdulB8BMl8vOie38o4,13365 +glean_parser/lint.py,sha256=STqdgyOhR4Q3fHivSizgn9bOOyqrNHhzjaqyJxz6qzI,19948 +glean_parser/markdown.py,sha256=GkCr1CrV6mnRQseT6FO1-JJ7Eup8X3lxUfRMBTxXpe4,9066 +glean_parser/metrics.py,sha256=YAO8wPuRHTLkdT9M4zh9ZwoFI1_VS8O9oQqwZNYyDp0,14612 +glean_parser/parser.py,sha256=3-uF-Hi5LlvdFc1NxZOKX0EoEyekZGnZV094eTIJut0,16361 +glean_parser/pings.py,sha256=-CIiMBVOTFULmNybV8YTFI7vmfOYOGQ5TD9hEfYPUII,3435 +glean_parser/python_server.py,sha256=ERpYcbSwF19xKFagxX0mZAvlR1y6D7Ah5DSvW8LipCY,4791 +glean_parser/ruby_server.py,sha256=e5lkfcLQAUMUBQDCjqNU82LkdUzT5x-G6HOnsUInbsU,5190 +glean_parser/rust.py,sha256=UEHeIZlToxCBelfec5sl_l_uLZfk8f_OUXqa_ZoEvnk,7330 +glean_parser/swift.py,sha256=paUzF6tItdktFwIQYCKsYpqXfn8zxR2coU_jMYrmwlc,8957 +glean_parser/tags.py,sha256=bemKYvcbMO4JrghiNSe-A4BNNDtx_FlUPkgrPPJy84Y,1391 +glean_parser/translate.py,sha256=luKQoraARZ2tjenHs0SVtCxflnYaMkzPYFfKEdKdSqQ,8403 +glean_parser/translation_options.py,sha256=Lxzr6G7MP0tC_ZYlZXftS4j0SLiqO-5mGVTEc7ggXis,2037 +glean_parser/util.py,sha256=wftmoWBUQM_o7pUwdhBp3HuDCVHIBw1PXtrfxwPLD0Q,16187 +glean_parser/validate_ping.py,sha256=0TNvILH6dtzJDys3W8Kqorw6kk03me73OCUDtpoHcXU,2118 +glean_parser/schemas/metrics.1-0-0.schema.yaml,sha256=cND3cvi6iBfPUVmtfIBQfGJV9AALpbvN7nu8E33_J-o,19566 +glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=wx1q0L4C0-Vcwk1SPU6t8OfjDEQvgrwwEG6xfSHO1MI,26365 +glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 +glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=f8PClAlMoLTmX6ANq8Ai0CpiE74i3LOgU5SoTJpoh0M,6149 +glean_parser/schemas/tags.1-0-0.schema.yaml,sha256=OGXIJlvvVW1vaqB_NVZnwKeZ-sLlfH57vjBSHbj6DNI,1231 +glean_parser/templates/data_review.jinja2,sha256=jeYU29T1zLSyu9fKBBFu5BFPfIw8_hmOUXw8RXhRXK8,3287 +glean_parser/templates/go_server.jinja2,sha256=Jy1e0uQqr_WZNoj-AWnygRmygX2jyj_GQMMV8mSah2k,6825 +glean_parser/templates/javascript.buildinfo.jinja2,sha256=4mXiZCQIk9if4lxlA05kpSIL4a95IdwGwqle2OqqNAs,474 +glean_parser/templates/javascript.jinja2,sha256=cT_bG-jC6m4afECXmcsqHwiiHjRuVtJnfv90OD2Mwxw,2669 +glean_parser/templates/javascript_server.jinja2,sha256=k-XI3QIhHQ1vbIPqSMTmCu93b1oZhm7KLmx9LfO3IJ0,9472 +glean_parser/templates/kotlin.buildinfo.jinja2,sha256=X0lk2SNu5OIIj2i6mUyF9CWFQIonLgfqkgT5fA-5G6c,920 +glean_parser/templates/kotlin.geckoview.jinja2,sha256=MJOgtoDXmBjE9pwk-G6T89y36RZuMbDWM_-DBN_gFJo,5099 +glean_parser/templates/kotlin.jinja2,sha256=npMgDdWD9OItOZQ-dyLQZn_IKgnzee2EdJynhUa1ig8,7690 +glean_parser/templates/markdown.jinja2,sha256=vAHHGGm28HRDPd3zO_wQMAUZIuxE9uQ7hl3NpXxcKV4,3425 +glean_parser/templates/python_server.jinja2,sha256=gu2C1rkn760IqBCG2SWaK7o32T1ify94wDEsudLPUg8,7260 +glean_parser/templates/qmldir.jinja2,sha256=m6IGsp-tgTiOfQ7VN8XW6GqX0gJqJkt3B6Pkaul6FVo,156 +glean_parser/templates/ruby_server.jinja2,sha256=vm4BEenOqzomQNTLFfMOzlWHARnsWUjTBbnR-v2cadI,6247 +glean_parser/templates/rust.jinja2,sha256=Ir_JqWRIUs1KLoYNDolgTRjWfWdzzBfouCP-YeTJa-c,5495 +glean_parser/templates/swift.jinja2,sha256=4f993l_zZk_Tz1efiz3nbvDK1H3Uq3dWQ2T6glT9XQ4,6695 +glean_parser-14.0.1.dist-info/AUTHORS.md,sha256=yxgj8MioO4wUnrh0gmfb8l3DJJrf-l4HmmEDbQsbbNI,455 +glean_parser-14.0.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 +glean_parser-14.0.1.dist-info/METADATA,sha256=Ghvw-Y7woQUJ38P8TYT5TFt8sL61GJoZPBajaB0WLeQ,32276 +glean_parser-14.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92 +glean_parser-14.0.1.dist-info/entry_points.txt,sha256=mf9d3sv8BwSjjR58x9KDnpVkONCnv3fPQC2NjJl15Xg,68 +glean_parser-14.0.1.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 +glean_parser-14.0.1.dist-info/RECORD,, diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/WHEEL b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/WHEEL new file mode 100644 index 0000000000..bab98d6758 --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.43.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/entry_points.txt b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/entry_points.txt new file mode 100644 index 0000000000..08fde9d655 --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +glean_parser = glean_parser.__main__:main_wrapper diff --git a/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/top_level.txt b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/top_level.txt new file mode 100644 index 0000000000..a7f3a37918 --- /dev/null +++ b/third_party/python/glean_parser/glean_parser-14.0.1.dist-info/top_level.txt @@ -0,0 +1 @@ +glean_parser diff --git a/third_party/python/glean_parser/glean_parser/javascript_server.py b/third_party/python/glean_parser/glean_parser/javascript_server.py index f5099d2660..060575f38c 100644 --- a/third_party/python/glean_parser/glean_parser/javascript_server.py +++ b/third_party/python/glean_parser/glean_parser/javascript_server.py @@ -42,9 +42,12 @@ from . import util SUPPORTED_METRIC_TYPES = ["string", "event"] -def event_class_name(ping_name: str, event_metric_exists: bool) -> str: +def event_class_name( + ping_name: str, metrics_by_type: Dict[str, List[metrics.Metric]] +) -> str: # For compatibility with FxA codebase we don't want to add "Logger" suffix # when custom pings without event metrics are used. + event_metric_exists = "event" in metrics_by_type suffix = "Logger" if event_metric_exists else "" return util.Camelize(ping_name) + "ServerEvent" + suffix @@ -61,10 +64,13 @@ def generate_js_metric_type(metric: metrics.Metric) -> str: return metric.type -def generate_ping_factory_method(ping: str, event_metric_exists: bool) -> str: +def generate_ping_factory_method( + ping: str, metrics_by_type: Dict[str, List[metrics.Metric]] +) -> str: # `ServerEventLogger` better describes role of the class that this factory # method generates, but for compatibility with existing FxA codebase # we use `Event` suffix if no event metrics are defined. + event_metric_exists = "event" in metrics_by_type suffix = "ServerEventLogger" if event_metric_exists else "Event" return f"create{util.Camelize(ping)}{suffix}" @@ -136,6 +142,12 @@ def output( metrics_list = metrics_by_type.setdefault(metric.type, []) metrics_list.append(metric) + # Order pings_to_metrics for backwards compatibility with the existing FxA codebase. + # Put pings without `event` type metrics first. + ping_to_metrics = dict( + sorted(ping_to_metrics.items(), key=lambda item: "event" in item[1]) + ) + PING_METRIC_ERROR_MSG = ( " Server-side environment is simplified and this" + " parser doesn't generate individual metric files. Make sure to pass all" diff --git a/third_party/python/glean_parser/glean_parser/kotlin.py b/third_party/python/glean_parser/glean_parser/kotlin.py index 82cc63d237..6d9ea8dcf8 100644 --- a/third_party/python/glean_parser/glean_parser/kotlin.py +++ b/third_party/python/glean_parser/glean_parser/kotlin.py @@ -107,6 +107,11 @@ def type_name(obj: Union[metrics.Metric, pings.Ping]) -> str: return "{}<{}>".format(class_name(obj.type), generic) + generate_structure = getattr(obj, "_generate_structure", []) + if len(generate_structure): + generic = util.Camelize(obj.name) + "Object" + return "{}<{}>".format(class_name(obj.type), generic) + return class_name(obj.type) @@ -125,6 +130,21 @@ def extra_type_name(typ: str) -> str: return "UNSUPPORTED" +def structure_type_name(typ: str) -> str: + """ + Returns the corresponding Kotlin type for structure items. + """ + + if typ == "boolean": + return "Boolean" + elif typ == "string": + return "String" + elif typ == "number": + return "Int" + else: + return "UNSUPPORTED" + + def class_name(obj_type: str) -> str: """ Returns the Kotlin class name for a given metric or ping type. @@ -320,6 +340,7 @@ def output_kotlin( ("type_name", type_name), ("extra_type_name", extra_type_name), ("class_name", class_name), + ("structure_type_name", structure_type_name), ), ) @@ -333,6 +354,9 @@ def output_kotlin( has_labeled_metrics = any( getattr(metric, "labeled", False) for metric in category_val.values() ) + has_object_metrics = any( + isinstance(metric, metrics.Object) for metric in category_val.values() + ) with filepath.open("w", encoding="utf-8") as fd: fd.write( @@ -346,6 +370,7 @@ def output_kotlin( ping_args=util.ping_args, namespace=namespace, has_labeled_metrics=has_labeled_metrics, + has_object_metrics=has_object_metrics, glean_namespace=glean_namespace, ) ) diff --git a/third_party/python/glean_parser/glean_parser/parser.py b/third_party/python/glean_parser/glean_parser/parser.py index 5ca584ac1e..158676be73 100644 --- a/third_party/python/glean_parser/glean_parser/parser.py +++ b/third_party/python/glean_parser/glean_parser/parser.py @@ -11,7 +11,7 @@ Code for parsing metrics.yaml files. import functools from pathlib import Path import textwrap -from typing import Any, Dict, Generator, Iterable, Optional, Tuple, Union +from typing import Any, cast, Dict, Generator, Iterable, Optional, Set, Tuple, Union import jsonschema # type: ignore from jsonschema.exceptions import ValidationError # type: ignore @@ -267,6 +267,7 @@ def _instantiate_pings( """ global_no_lint = content.get("no_lint", []) assert isinstance(global_no_lint, list) + ping_schedule_reverse_map: Dict[str, Set[str]] = dict() for ping_key, ping_val in sorted(content.items()): if ping_key.startswith("$"): @@ -284,6 +285,22 @@ def _instantiate_pings( if not isinstance(ping_val, dict): raise TypeError(f"Invalid content for ping {ping_key}") ping_val["name"] = ping_key + + if "metadata" in ping_val and "ping_schedule" in ping_val["metadata"]: + if ping_key in ping_val["metadata"]["ping_schedule"]: + yield util.format_error( + filepath, + f"For ping '{ping_key}'", + "ping_schedule contains its own ping name", + ) + continue + for ping_schedule in ping_val["metadata"]["ping_schedule"]: + if ping_schedule not in ping_schedule_reverse_map: + ping_schedule_reverse_map[ping_schedule] = set() + ping_schedule_reverse_map[ping_schedule].add(ping_key) + + del ping_val["metadata"]["ping_schedule"] + try: ping_obj = Ping( defined_in=getattr(ping_val, "defined_in", None), @@ -313,6 +330,11 @@ def _instantiate_pings( all_objects.setdefault("pings", {})[ping_key] = ping_obj sources[ping_key] = filepath + for scheduler, scheduled in ping_schedule_reverse_map.items(): + if isinstance(all_objects["pings"][scheduler], Ping): + scheduler_obj: Ping = cast(Ping, all_objects["pings"][scheduler]) + scheduler_obj.schedules_pings = sorted(list(scheduled)) + def _instantiate_tags( all_objects: ObjectTree, diff --git a/third_party/python/glean_parser/glean_parser/pings.py b/third_party/python/glean_parser/glean_parser/pings.py index b4145ea68d..b3f2476c9a 100644 --- a/third_party/python/glean_parser/glean_parser/pings.py +++ b/third_party/python/glean_parser/glean_parser/pings.py @@ -31,6 +31,7 @@ class Ping: reasons: Optional[Dict[str, str]] = None, defined_in: Optional[Dict] = None, no_lint: Optional[List[str]] = None, + enabled: Optional[bool] = None, _validated: bool = False, ): # Avoid cyclical import @@ -46,6 +47,10 @@ class Ping: self.metadata = metadata self.precise_timestamps = self.metadata.get("precise_timestamps", True) self.include_info_sections = self.metadata.get("include_info_sections", True) + if enabled is None: + enabled = True + self.enabled = enabled + self.schedules_pings: List[str] = [] if data_reviews is None: data_reviews = [] self.data_reviews = data_reviews @@ -94,6 +99,7 @@ class Ping: modified_dict = util.remove_output_params( modified_dict, "include_info_sections" ) + modified_dict = util.remove_output_params(modified_dict, "schedules_pings") return modified_dict def identifier(self) -> str: diff --git a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml index 6679a8066b..345812c805 100644 --- a/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml +++ b/third_party/python/glean_parser/glean_parser/schemas/pings.2-0-0.schema.yaml @@ -96,6 +96,16 @@ additionalProperties: Interaction with `include_client_id`: `include_client_id` only takes effect when `metadata.include_info_sections` is `true`. type: boolean + ping_schedule: + title: Ping Schedule + description: | + An optional array of ping names. When one of the listed pings is + sent, then this ping will also be sent. A ping cannot list its own + name in `ping_schedule`. + type: array + items: + type: string + maxLength: 30 default: {} @@ -175,6 +185,18 @@ additionalProperties: additionalProperties: type: string + enabled: + title: Whether or not this ping is enabled + description: | + **Optional.** + + When `true`, the ping will be sent as usual. + When `false`, the ping will not be sent, but the data will continue to + be collected but will not be cleared when the ping is submitted. + + Defaults to `true` if omitted. + type: boolean + no_lint: title: Lint checks to skip description: | diff --git a/third_party/python/glean_parser/glean_parser/swift.py b/third_party/python/glean_parser/glean_parser/swift.py index c745c4d9ac..b121933b0f 100644 --- a/third_party/python/glean_parser/glean_parser/swift.py +++ b/third_party/python/glean_parser/glean_parser/swift.py @@ -106,12 +106,17 @@ def type_name(obj: Union[metrics.Metric, pings.Ping]) -> str: return "{}<{}>".format(class_name(obj.type), generic) + generate_structure = getattr(obj, "_generate_structure", []) + if len(generate_structure): + generic = util.Camelize(obj.name) + "Object" + return "{}<{}>".format(class_name(obj.type), generic) + return class_name(obj.type) def extra_type_name(typ: str) -> str: """ - Returns the corresponding Kotlin type for event's extra key types. + Returns the corresponding Swift type for event's extra key types. """ if typ == "boolean": @@ -124,6 +129,21 @@ def extra_type_name(typ: str) -> str: return "UNSUPPORTED" +def structure_type_name(typ: str) -> str: + """ + Returns the corresponding Swift type for structure items. + """ + + if typ == "boolean": + return "Bool" + elif typ == "string": + return "String" + elif typ == "number": + return "Int64" + else: + return "UNSUPPORTED" + + def class_name(obj_type: str) -> str: """ Returns the Swift class name for a given metric or ping type. @@ -215,6 +235,7 @@ def output_swift( ("class_name", class_name), ("variable_name", variable_name), ("extra_type_name", extra_type_name), + ("structure_type_name", structure_type_name), ), ) diff --git a/third_party/python/glean_parser/glean_parser/templates/javascript_server.jinja2 b/third_party/python/glean_parser/glean_parser/templates/javascript_server.jinja2 index 0a89f081f6..9df299fd2b 100644 --- a/third_party/python/glean_parser/glean_parser/templates/javascript_server.jinja2 +++ b/third_party/python/glean_parser/glean_parser/templates/javascript_server.jinja2 @@ -21,7 +21,7 @@ type LoggerOptions = { app: string; fmt?: 'heka' }; type Event = { category: string; name: string; - extra: Record; + extra?: Record; timestamp?: number; }; {% endif %} @@ -30,14 +30,14 @@ type Event = { let _logger{% if lang == "typescript" %}: Logger{% endif %}; {% for ping, metrics_by_type in pings.items() %} -class {{ ping|event_class_name(event_metric_exists) }} { +class {{ ping|event_class_name(metrics_by_type) }} { {% if lang == "typescript" %} _applicationId: string; _appDisplayVersion: string; _channel: string; {% endif %} /** - * Create {{ ping|event_class_name(event_metric_exists) }} instance. + * Create {{ ping|event_class_name(metrics_by_type) }} instance. * * @param {string} applicationId - The application ID. * @param {string} appDisplayVersion - The application display version. @@ -72,7 +72,7 @@ class {{ ping|event_class_name(event_metric_exists) }} { {% endif %} } } - {% if event_metric_exists %} + {% if 'event' in metrics_by_type %} #record({ {% else %} /** @@ -99,28 +99,28 @@ class {{ ping|event_class_name(event_metric_exists) }} { {% endfor %} {% endif %} {% endfor %} - {% if event_metric_exists %} + {% if 'event' in metrics_by_type %} event, {% endif %} {% if lang == "typescript" %} }: { - user_agent: string, - ip_address: string, + user_agent: string; + ip_address: string; {% for metric_type, metrics in metrics_by_type.items() %} {% if metric_type != 'event' %} {% for metric in metrics %} - {{ metric|metric_argument_name }}: {{ metric|js_metric_type }}, + {{ metric|metric_argument_name }}: {{ metric|js_metric_type }}; {% endfor %} {% endif %} {% endfor %} - {% if event_metric_exists %} - event: Event + {% if 'event' in metrics_by_type %} + event: Event; {% endif %} {% endif %} }) { const now = new Date(); const timestamp = now.toISOString(); - {% if event_metric_exists %} + {% if 'event' in metrics_by_type %} event.timestamp = now.getTime(); {% endif %} const eventPayload = { @@ -135,7 +135,7 @@ class {{ ping|event_class_name(event_metric_exists) }} { {% endif %} {% endfor %} }, - {% if event_metric_exists %} + {% if 'event' in metrics_by_type %} events: [event], {% endif %} ping_info: { @@ -171,7 +171,7 @@ class {{ ping|event_class_name(event_metric_exists) }} { // this is similar to how FxA currently logs with mozlog: https://github.com/mozilla/fxa/blob/4c5c702a7fcbf6f8c6b1f175e9172cdd21471eac/packages/fxa-auth-server/lib/log.js#L289 _logger.info(GLEAN_EVENT_MOZLOG_TYPE, ping); } - {% if event_metric_exists %} + {% if 'event' in metrics_by_type %} {% for event in metrics_by_type["event"] %} /** * Record and submit a {{ event.category }}_{{ event.name }} event: @@ -209,27 +209,27 @@ class {{ ping|event_class_name(event_metric_exists) }} { {% endfor %} {% if lang == "typescript" %} }: { - user_agent: string, - ip_address: string, + user_agent: string; + ip_address: string; {% for metric_type, metrics in metrics_by_type.items() %} {% if metric_type != 'event' %} {% for metric in metrics %} - {{ metric|metric_argument_name }}: {{ metric|js_metric_type }}, + {{ metric|metric_argument_name }}: {{ metric|js_metric_type }}; {% endfor %} {% endif %} {% endfor %} {% for extra, metadata in event.extra_keys.items() %} - {{ extra }}: {{metadata.type}}, + {{ extra }}: {{metadata.type}}; {% endfor %} {% endif %} }) { - let event = { - 'category': '{{ event.category }}', - 'name': '{{ event.name }}', + const event = { + category: '{{ event.category }}', + name: '{{ event.name }}', {% if event.extra_keys %} - 'extra': { + extra: { {% for extra, metadata in event.extra_keys.items() %} - '{{ extra }}': {{ extra }}, + {{ extra }}: {{ extra }}, {% endfor %} }, {% endif %} @@ -244,14 +244,14 @@ class {{ ping|event_class_name(event_metric_exists) }} { {% endfor %} {% endif %} {% endfor %} - event + event, }); } {% endfor %} {% endif %} } {% endfor %} -{% for ping in pings %} +{% for ping, metrics_by_type in pings.items() %} /** * Factory function that creates an instance of Glean Server Event Logger to @@ -262,11 +262,11 @@ class {{ ping|event_class_name(event_metric_exists) }} { * @param {Object} logger_options - The logger options. * @returns {EventsServerEventLogger} An instance of EventsServerEventLogger. */ -export const {{ ping|factory_method(event_metric_exists) }} = function ({ +export const {{ ping|factory_method(metrics_by_type) }} = function ({ applicationId, appDisplayVersion, channel, - logger_options + logger_options, {% if lang == "typescript" %} }: { applicationId: string; @@ -275,7 +275,7 @@ export const {{ ping|factory_method(event_metric_exists) }} = function ({ logger_options: LoggerOptions; {% endif %} }) { - return new {{ ping|event_class_name(event_metric_exists) }}( + return new {{ ping|event_class_name(metrics_by_type) }}( applicationId, appDisplayVersion, channel, diff --git a/third_party/python/glean_parser/glean_parser/templates/kotlin.jinja2 b/third_party/python/glean_parser/glean_parser/templates/kotlin.jinja2 index bd800af01d..71ba386a4c 100644 --- a/third_party/python/glean_parser/glean_parser/templates/kotlin.jinja2 +++ b/third_party/python/glean_parser/glean_parser/templates/kotlin.jinja2 @@ -66,6 +66,61 @@ data class {{ obj.name|Camelize }}{{ suffix }}( } {%- endmacro -%} +{%- macro generate_structure(name, struct) %} +{%- if struct.type == "array" -%} + @Serializable + data class {{ name }}(var items: MutableList<{{ name }}Item> = mutableListOf()) : ObjectSerialize { + fun add(elem: {{ name }}Item) = items.add(elem) + + fun addAll(elements: Collection<{{ name }}Item>) = items.addAll(elements) + + fun clear() = items.clear() + + fun remove(element: {{ name }}Item) = items.remove(element) + fun removeAll(elements: Collection<{{ name }}Item>) = items.removeAll(elements) + fun removeAt(index: Int) = items.removeAt(index) + + fun set(index: Int, element: {{ name }}Item) = items.set(index, element) + + override fun intoSerializedObject(): String { + return Json.encodeToString(items) + } + } + + {{ generate_structure(name ~ "Item", struct["items"]) }} + +{%- elif struct.type == "object" -%} + @Serializable + data class {{ name }}( + {% for itemname, val in struct.properties.items() %} + {% if val.type == "object" %} + var {{itemname|camelize}}: {{ name ~ "Item" ~ itemname|Camelize ~ "Object" }}? = null, + {% elif val.type == "array" %} + var {{itemname|camelize}}: {{ name ~ "Item" ~ itemname|Camelize }} = {{ name ~ "Item" ~ itemname|Camelize }}(), + {% else %} + var {{itemname|camelize}}: {{val.type|structure_type_name}}? = null, + {% endif %} + {% endfor %} + ): ObjectSerialize { + override fun intoSerializedObject(): String { + return Json.encodeToString(this) + } + } + + {% for itemname, val in struct.properties.items() %} + {% if val.type == "array" %} + {% set nested_name = name ~ "Item" ~ itemname|Camelize %} + {{ generate_structure(nested_name, val) }} + {% elif val.type == "object" %} + {% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %} + {{ generate_structure(nested_name, val) }} + {% endif %} + {% endfor %} + +{% endif %} + +{% endmacro %} + /* ktlint-disable no-blank-line-before-rbrace */ @file:Suppress("PackageNaming", "MaxLineLength") package {{ namespace }} @@ -76,8 +131,9 @@ import {{ glean_namespace }}.private.HistogramType // ktlint-disable import-orde import {{ glean_namespace }}.private.Lifetime // ktlint-disable import-ordering no-unused-imports import {{ glean_namespace }}.private.MemoryUnit // ktlint-disable import-ordering no-unused-imports import {{ glean_namespace }}.private.NoExtras // ktlint-disable import-ordering no-unused-imports -import {{ glean_namespace }}.private.ReasonCode // ktlint-disable import-ordering no-unused-imports import {{ glean_namespace }}.private.NoReasonCodes // ktlint-disable import-ordering no-unused-imports +import {{ glean_namespace }}.private.ObjectSerialize // ktlint-disable import-ordering no-unused-imports +import {{ glean_namespace }}.private.ReasonCode // ktlint-disable import-ordering no-unused-imports import {{ glean_namespace }}.private.TimeUnit // ktlint-disable import-ordering no-unused-imports {% for obj_type in obj_types %} import {{ glean_namespace }}.private.{{ obj_type }} // ktlint-disable import-ordering @@ -85,6 +141,11 @@ import {{ glean_namespace }}.private.{{ obj_type }} // ktlint-disable import-ord {% if has_labeled_metrics %} import {{ glean_namespace }}.private.LabeledMetricType // ktlint-disable import-ordering {% endif %} +{% if has_object_metrics %} +import kotlinx.serialization.Serializable +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +{% endif %} internal object {{ category_name|Camelize }} { {% for obj in objs.values() %} @@ -97,6 +158,9 @@ internal object {{ category_name|Camelize }} { {% endfor %} {% endif %} {% else %} + {% if obj|attr("_generate_structure") %} + {{ generate_structure(obj.name|Camelize ~ "Object", obj._generate_structure) }} + {%- endif %} {% if obj|attr("_generate_enums") %} {% for name, suffix in obj["_generate_enums"] %} {% if obj|attr(name)|length %} diff --git a/third_party/python/glean_parser/glean_parser/templates/rust.jinja2 b/third_party/python/glean_parser/glean_parser/templates/rust.jinja2 index 4c54dd2b2c..269a007ac5 100644 --- a/third_party/python/glean_parser/glean_parser/templates/rust.jinja2 +++ b/third_party/python/glean_parser/glean_parser/templates/rust.jinja2 @@ -87,7 +87,7 @@ impl ExtraKeys for {{ obj.name|Camelize }}{{ suffix }} { /// {{ obj.description|wordwrap() | replace('\n', '\n/// ') }} #[rustfmt::skip] pub static {{ obj.name|snake_case }}: ::glean::private::__export::Lazy<::glean::private::PingType> = - ::glean::private::__export::Lazy::new(|| ::glean::private::PingType::new("{{ obj.name }}", {{ obj.include_client_id|rust }}, {{ obj.send_if_empty|rust }}, {{ obj.precise_timestamps|rust }}, {{ obj.include_info_sections|rust }}, {{ obj.reason_codes|rust }})); + ::glean::private::__export::Lazy::new(|| ::glean::private::PingType::new("{{ obj.name }}", {{ obj.include_client_id|rust }}, {{ obj.send_if_empty|rust }}, {{ obj.precise_timestamps|rust }}, {{ obj.include_info_sections|rust }}, {{ obj.enabled|rust }}, {{ obj.schedules_pings|rust }}, {{ obj.reason_codes|rust }})); {% endfor %} {% else %} pub mod {{ category.name|snake_case }} { diff --git a/third_party/python/glean_parser/glean_parser/templates/swift.jinja2 b/third_party/python/glean_parser/glean_parser/templates/swift.jinja2 index 714bf20ec2..fe51a078bc 100644 --- a/third_party/python/glean_parser/glean_parser/templates/swift.jinja2 +++ b/third_party/python/glean_parser/glean_parser/templates/swift.jinja2 @@ -11,7 +11,7 @@ Jinja2 template is not. Please file bugs! #} /* 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/. */ -{% macro obj_declaration(obj, suffix='', access='') %} +{%- macro obj_declaration(obj, suffix='', access='') %} {{ access }}static let {{ obj.name|camelize|variable_name }}{{ suffix }} = {{ obj|type_name }}( // generated from {{ obj.identifier() }} CommonMetricData( {% for arg_name in common_metric_args if obj[arg_name] is defined %} @@ -24,7 +24,7 @@ Jinja2 template is not. Please file bugs! #} ) {% endmacro %} -{% macro struct_decl(obj, name, suffix) %} +{%- macro struct_decl(obj, name, suffix) %} struct {{ obj.name|Camelize }}{{ suffix }}: EventExtras { {% for item, typ in obj|attr(name) %} var {{ item|camelize|variable_name }}: {{typ|extra_type_name}}? @@ -44,6 +44,46 @@ struct {{ obj.name|Camelize }}{{ suffix }}: EventExtras { } {% endmacro %} +{%- macro generate_structure(name, struct) %} +{%- if struct.type == "array" -%} + typealias {{ name }} = [{{ name }}Item] + + {{ generate_structure(name ~ "Item", struct["items"]) }} + +{%- elif struct.type == "object" -%} + struct {{ name }}: Codable, Equatable, ObjectSerialize { + {% for itemname, val in struct.properties.items() %} + {% if val.type == "object" %} + var {{itemname|camelize|variable_name}}: {{ name ~ "Item" ~ itemname|Camelize ~ "Object" }}? + {% elif val.type == "array" %} + var {{itemname|camelize|variable_name}}: {{ name ~ "Item" ~ itemname|Camelize }} + {% else %} + var {{itemname|camelize|variable_name}}: {{val.type|structure_type_name}}? + {% endif %} + {% endfor %} + + func intoSerializedObject() -> String { + let jsonEncoder = JSONEncoder() + let jsonData = try! jsonEncoder.encode(self) + let json = String(data: jsonData, encoding: String.Encoding.utf8)! + return json + } + } + + {% for itemname, val in struct.properties.items() %} + {% if val.type == "array" %} + {% set nested_name = name ~ "Item" ~ itemname|Camelize %} + {{ generate_structure(nested_name, val) }} + {% elif val.type == "object" %} + {% set nested_name = name ~ "Item" ~ itemname|Camelize ~ "Object" %} + {{ generate_structure(nested_name, val) }} + {% endif %} + {% endfor %} + +{%- endif -%} + +{% endmacro %} + {% if not allow_reserved %} import {{ glean_namespace }} @@ -97,6 +137,8 @@ extension {{ namespace }} { sendIfEmpty: {{obj.send_if_empty|swift}}, preciseTimestamps: {{obj.precise_timestamps|swift}}, includeInfoSections: {{obj.include_info_sections|swift}}, + enabled: {{obj.enabled|swift}}, + schedulesPings: {{obj.schedules_pings|swift}}, reasonCodes: {{obj.reason_codes|swift}} ) @@ -106,6 +148,9 @@ extension {{ namespace }} { {% else %} enum {{ category.name|Camelize }} { {% for obj in category.objs.values() %} + {% if obj|attr("_generate_structure") %} + {{ generate_structure(obj.name|Camelize ~ "Object", obj._generate_structure) }} + {%- endif %} {% if obj|attr("_generate_enums") %} {% for name, suffix in obj["_generate_enums"] %} {% if obj|attr(name)|length %} diff --git a/third_party/python/glean_parser/glean_parser/util.py b/third_party/python/glean_parser/glean_parser/util.py index f8bc7d4f53..a61e318dbe 100644 --- a/third_party/python/glean_parser/glean_parser/util.py +++ b/third_party/python/glean_parser/glean_parser/util.py @@ -531,6 +531,8 @@ ping_args = [ "send_if_empty", "precise_timestamps", "include_info_sections", + "enabled", + "schedules_pings", "reason_codes", ] -- cgit v1.2.3