From 280680c5c455ccb18ecf3615dc3b72ec549bae63 Mon Sep 17 00:00:00 2001 From: smolnar Date: Thu, 17 Apr 2025 17:53:46 +0300 Subject: [PATCH] Backed out 5 changesets (bug 1955429) for causing mochitest failures @ widget/tests/test_bug343416.xhtml CLOSED TREE Backed out changeset 3fd7b7cba0ff (bug 1955429) Backed out changeset d771f40c809c (bug 1955429) Backed out changeset 98fe0042de25 (bug 1955429) Backed out changeset f239ffd8098f (bug 1955429) Backed out changeset a49202330c21 (bug 1955429) --- Cargo.lock | 8 +- Cargo.toml | 2 +- browser/components/attribution/metrics.yaml | 102 ------------- gfx/wr/Cargo.lock | 8 +- gfx/wr/Cargo.toml | 2 +- gradle/libs.versions.toml | 2 +- python/sites/mach.txt | 2 +- supply-chain/audits.toml | 40 +++++ supply-chain/config.toml | 4 + supply-chain/imports.lock | 22 ++- .../AUTHORS.md | 0 .../LICENSE | 0 .../METADATA | 6 +- .../RECORD | 20 +-- .../WHEEL | 0 .../entry_points.txt | 0 .../top_level.txt | 0 .../python/glean_parser/glean_parser/lint.py | 9 ++ .../glean_parser/glean_parser/parser.py | 75 ++++------ .../schemas/metrics.2-0-0.schema.yaml | 2 +- third_party/python/pyproject.toml | 2 +- third_party/python/requirements.txt | 6 +- third_party/python/uv.lock | 8 +- third_party/python/uv.lock.hash | 2 +- .../rust/glean-core/.cargo-checksum.json | 2 +- third_party/rust/glean-core/Cargo.toml | 4 +- third_party/rust/glean-core/src/core/mod.rs | 77 +--------- .../rust/glean-core/src/core_metrics.rs | 111 -------------- third_party/rust/glean-core/src/glean.udl | 24 --- .../rust/glean-core/src/internal_metrics.rs | 60 -------- third_party/rust/glean-core/src/lib.rs | 74 +--------- .../rust/glean-core/src/lib_unit_tests.rs | 52 ------- .../rust/glean-core/src/metrics/labeled.rs | 4 +- third_party/rust/glean-core/src/ping/mod.rs | 32 +--- .../rust/glean-core/src/traits/labeled.rs | 2 +- third_party/rust/glean-core/tests/labeled.rs | 2 +- .../rust/glean-core/tests/ping_maker.rs | 68 --------- third_party/rust/glean/.cargo-checksum.json | 2 +- third_party/rust/glean/Cargo.lock | 10 +- third_party/rust/glean/Cargo.toml | 4 +- third_party/rust/glean/src/lib.rs | 30 +--- third_party/rust/glean/src/test.rs | 46 ------ .../glean/api/src/private/labeled.rs | 2 +- .../glean/bindings/private/Labeled.h | 6 +- toolkit/components/glean/metrics_index.py | 1 - toolkit/components/glean/src/lib.rs | 94 ------------ .../tests/browser/browser_labeled_gifft.js | 3 +- .../components/glean/tests/gtest/TestFog.cpp | 3 +- .../xpcshell/test_AttributionDistribution.js | 69 --------- .../glean/tests/xpcshell/test_GIFFT.js | 9 +- .../glean/tests/xpcshell/test_GIFFTIPC.js | 11 +- .../glean/tests/xpcshell/test_Glean.js | 12 +- .../glean/tests/xpcshell/test_GleanIPC.js | 2 +- .../glean/tests/xpcshell/test_JOG.js | 12 +- .../glean/tests/xpcshell/test_JOGIPC.js | 4 +- .../glean/tests/xpcshell/xpcshell.toml | 3 - toolkit/components/glean/xpcom/FOG.cpp | 137 ------------------ toolkit/components/glean/xpcom/nsIFOG.idl | 43 ------ .../app/TelemetryEnvironment.sys.mjs | 27 +--- .../unit/TelemetryEnvironmentTesting.sys.mjs | 32 ---- 60 files changed, 195 insertions(+), 1201 deletions(-) delete mode 100644 browser/components/attribution/metrics.yaml rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/AUTHORS.md (100%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/LICENSE (100%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/METADATA (99%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/RECORD (83%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/WHEEL (100%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/entry_points.txt (100%) rename third_party/python/glean_parser/{glean_parser-17.1.0.dist-info => glean_parser-17.0.1.dist-info}/top_level.txt (100%) delete mode 100644 toolkit/components/glean/tests/xpcshell/test_AttributionDistribution.js diff --git a/Cargo.lock b/Cargo.lock index 690d7857604c..fb4db867c7ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2580,9 +2580,9 @@ dependencies = [ [[package]] name = "glean" -version = "64.1.1" +version = "64.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95024f4707705270208e36983976cbac235dd7fc33c9f1cb0dee396ec1ce295d" +checksum = "251b9cb685554b96dcf785dba69ce90447006dd6d9229db783336c981c3777e1" dependencies = [ "crossbeam-channel", "glean-core", @@ -2594,9 +2594,9 @@ dependencies = [ [[package]] name = "glean-core" -version = "64.1.1" +version = "64.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0df94fb37669287b77e8aa300913ad1d14426d7f9e443b0ce1185349c817e" +checksum = "a49d1d62648ddeed8cb996373046ea45de93f1d1ff956aba054b9304bc305753" dependencies = [ "android_logger", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 557e21ee004b..d92dd0187ea7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,7 @@ uniffi_bindgen = "0.29.1" # Shared across multiple application-services consumers. rusqlite = "0.33.0" # Shared across multiple glean consumers. -glean = "=64.1.1" +glean = "=64.0.1" # Explicitly specify what our profiles use. The opt-level setting here is # a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the diff --git a/browser/components/attribution/metrics.yaml b/browser/components/attribution/metrics.yaml deleted file mode 100644 index 13eb8d5edc95..000000000000 --- a/browser/components/attribution/metrics.yaml +++ /dev/null @@ -1,102 +0,0 @@ -# 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/. - -# Adding a new metric? We have docs for that! -# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html - ---- -$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0 -$tags: - - 'Toolkit :: Telemetry' - -glean.attribution: - ext: - type: object - lifetime: user - # Permit long description lines - # yamllint disable - description: | - Extended attribution information. - Mapped to client_info.attribution.ext in datasets. - * `experiment`: name/id of the enrolled funnel experiment - * `variation`: name/id of the variation cohort used in the enrolled funnel experiment - * `ua`: identifier derived from the user agent downloading the installer - e.g. chrome, Google Chrome 123 - * `dltoken`: Unique token created at Firefox download time. - e.g. c18f86a3-f228-4d98-91bb-f90135c0aa9c - * `msstoresignedin`: only present if the installation was done through the Microsoft Store, - and was able to retrieve the "campaign ID" it was first installed with. - This value is "true" if the user was signed into the Microsoft Store - when they first installed, and false otherwise. - * `dlsource`: identifier that indicate where installations of Firefox originate - # yamllint enable - bugs: - - https://bugzilla.mozilla.org/1955429 - data_reviews: - - https://bugzilla.mozilla.org/1955429 - notification_emails: - - chutten@mozilla.com - send_in_pings: - - metrics - - baseline - - events - expires: never - no_lint: - - BASELINE_PING - structure: - type: object - properties: - experiment: - type: string - variation: - type: string - ua: - type: string - dltoken: - type: string - msstoresignedin: - type: boolean - dlsource: - type: string - -glean.distribution: - ext: - type: object - lifetime: user - description: | - Extended distribution information. - Mapped to client_info.distribution.ext in datasets. - * `distributionVersion`: pref `distribution.version`, `null` on failure - * `partnerId`: pref `mozilla.partner.id`, `null` on failure - * `distributor`: pref `app.distributor`, `null` on failure - * `distributorChannel`: pref `app.distributor.channel`, `null` on failure - * `partnerNames`: list from prefs `app.partner.=` - bugs: - - https://bugzilla.mozilla.org/1955429 - data_reviews: - - https://bugzilla.mozilla.org/1955429 - notification_emails: - - chutten@mozilla.com - send_in_pings: - - metrics - - baseline - - events - expires: never - no_lint: - - BASELINE_PING - structure: - type: object - properties: - distributionVersion: - type: string - partnerId: - type: string - distributor: - type: string - distributorChannel: - type: string - partnerNames: - type: array - items: - type: string diff --git a/gfx/wr/Cargo.lock b/gfx/wr/Cargo.lock index 0b038c8f6dee..37a89488c33a 100644 --- a/gfx/wr/Cargo.lock +++ b/gfx/wr/Cargo.lock @@ -982,9 +982,9 @@ dependencies = [ [[package]] name = "glean" -version = "64.1.1" +version = "64.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95024f4707705270208e36983976cbac235dd7fc33c9f1cb0dee396ec1ce295d" +checksum = "251b9cb685554b96dcf785dba69ce90447006dd6d9229db783336c981c3777e1" dependencies = [ "crossbeam-channel", "glean-core", @@ -996,9 +996,9 @@ dependencies = [ [[package]] name = "glean-core" -version = "64.1.1" +version = "64.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0df94fb37669287b77e8aa300913ad1d14426d7f9e443b0ce1185349c817e" +checksum = "a49d1d62648ddeed8cb996373046ea45de93f1d1ff956aba054b9304bc305753" dependencies = [ "android_logger", "bincode", diff --git a/gfx/wr/Cargo.toml b/gfx/wr/Cargo.toml index dbb574a052bd..f3a710877f2c 100644 --- a/gfx/wr/Cargo.toml +++ b/gfx/wr/Cargo.toml @@ -9,7 +9,7 @@ members = [ resolver = "2" [workspace.dependencies] -glean = "=64.1.1" +glean = "=64.0.1" [profile.release] debug = true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0895720c32b8..93d1a77e3427 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -81,7 +81,7 @@ serialization = "1.8.1" # Mozilla versions apilint = "0.5.4" -mozilla-glean = "64.1.1" +mozilla-glean = "64.0.1" # Testing versions androidx-test = "1.6.1" diff --git a/python/sites/mach.txt b/python/sites/mach.txt index 3c2027df965c..1c855856d1b3 100644 --- a/python/sites/mach.txt +++ b/python/sites/mach.txt @@ -104,7 +104,7 @@ vendored:third_party/python/wheel vendored:third_party/python/zipp # glean-sdk may not be installable if a wheel isn't available # and it has to be built from source. -pypi-optional:glean-sdk==64.1.1:telemetry will not be collected +pypi-optional:glean-sdk==64.0.1:telemetry will not be collected # Mach gracefully handles the case where `psutil` is unavailable. # We aren't (yet) able to pin packages in automation, so we have to # support down to the oldest locally-installed version (5.4.2). diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index ca883a42c0bb..6f007ea441d2 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -3690,6 +3690,16 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "23.1.0 -> 24.0.0" +[[audits.naga]] +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", + "Jim Blandy ", +] +criteria = "safe-to-deploy" +delta = "24.0.0 -> 24.0.0@git:a0dbe5ebc6fa24422fb84b2e0fea1cc94dee5109" +importable = false + [[audits.naga]] who = "Erich Gubler " criteria = "safe-to-deploy" @@ -5956,6 +5966,16 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "23.0.1 -> 24.0.0" +[[audits.wgpu-core]] +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", + "Jim Blandy ", +] +criteria = "safe-to-deploy" +delta = "24.0.0 -> 24.0.0@git:a0dbe5ebc6fa24422fb84b2e0fea1cc94dee5109" +importable = false + [[audits.wgpu-core]] who = "Erich Gubler " criteria = "safe-to-deploy" @@ -6067,6 +6087,16 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "23.0.1 -> 24.0.0" +[[audits.wgpu-hal]] +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", + "Jim Blandy ", +] +criteria = "safe-to-deploy" +delta = "24.0.0 -> 24.0.0@git:a0dbe5ebc6fa24422fb84b2e0fea1cc94dee5109" +importable = false + [[audits.wgpu-hal]] who = "Erich Gubler " criteria = "safe-to-deploy" @@ -6151,6 +6181,16 @@ who = "Erich Gubler " criteria = "safe-to-deploy" delta = "23.0.0 -> 24.0.0" +[[audits.wgpu-types]] +who = [ + "Teodor Tanasoaia ", + "Erich Gubler ", + "Jim Blandy ", +] +criteria = "safe-to-deploy" +delta = "24.0.0 -> 24.0.0@git:a0dbe5ebc6fa24422fb84b2e0fea1cc94dee5109" +importable = false + [[audits.wgpu-types]] who = "Erich Gubler " criteria = "safe-to-deploy" diff --git a/supply-chain/config.toml b/supply-chain/config.toml index cb611b3e22c4..7a358353316b 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -289,6 +289,10 @@ notes = "Local override of the crates.io crate that uses a non-vendored local co [policy.wr_malloc_size_of] audit-as-crates-io = false +[[exemptions.ahash]] +version = "0.7.6" +criteria = "safe-to-deploy" + [[exemptions.alsa]] version = "0.4.3" criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 240b684c18eb..9d879445268e 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -258,15 +258,15 @@ user-login = "jrmuizel" user-name = "Jeff Muizelaar" [[publisher.glean]] -version = "64.1.1" -when = "2025-04-10" +version = "64.0.1" +when = "2025-04-01" user-id = 48 user-login = "badboy" user-name = "Jan-Erik Rediger" [[publisher.glean-core]] -version = "64.1.1" -when = "2025-04-10" +version = "64.0.1" +when = "2025-04-01" user-id = 48 user-login = "badboy" user-name = "Jan-Erik Rediger" @@ -970,6 +970,20 @@ criteria = "safe-to-deploy" version = "1.0.2" notes = "This is a small crate which forbids unsafe code and is a straightforward implementation of the adler hashing algorithm." +[[audits.bytecode-alliance.audits.ahash]] +who = "Chris Fallin " +criteria = "safe-to-deploy" +delta = "0.7.6 -> 0.8.2" + +[[audits.bytecode-alliance.audits.ahash]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +delta = "0.8.2 -> 0.8.7" +notes = """ +Shuffling of features in this update and while there are updates to `unsafe` +code it's no different than before and the usage remains the same. +""" + [[audits.bytecode-alliance.audits.allocator-api2]] who = "Chris Fallin " criteria = "safe-to-deploy" diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/AUTHORS.md b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/AUTHORS.md similarity index 100% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/AUTHORS.md rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/AUTHORS.md diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/LICENSE b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/LICENSE similarity index 100% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/LICENSE rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/LICENSE diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/METADATA b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/METADATA similarity index 99% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/METADATA rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/METADATA index bac1de49109b..d85a935efa81 100644 --- a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/METADATA +++ b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: glean_parser -Version: 17.1.0 +Version: 17.0.1 Summary: Parser tools for Mozilla's Glean telemetry Home-page: https://github.com/mozilla/glean_parser Author: The Glean Team @@ -79,10 +79,6 @@ $ glean_parser check < ping.json ## Unreleased -## 17.1.0 - -- Permit object metrics named 'glean.attribution.ext' or 'glean.distribution.ext' even if allow_reserved is false ([bug 1955428](https://bugzilla.mozilla.org/show_bug.cgi?id=1955428)) - ## 17.0.1 - BUGFIX: Fix missing `ping_arg` "`uploader_capabilities`" in util.py ([#786](https://github.com/mozilla/glean_parser/pull/786)) diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/RECORD b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/RECORD similarity index 83% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/RECORD rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/RECORD index 4b7a9840bc87..f5c5be12b7d9 100644 --- a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/RECORD +++ b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/RECORD @@ -6,10 +6,10 @@ glean_parser/go_server.py,sha256=NOx66OpNDVIos6n3ejoJeFM5Dk4u7E3u86XV2G54tww,558 glean_parser/javascript.py,sha256=w4ZhNBHBKWYk0h3t7G0Ud2tR__hRqzn9dlEXNKLdQrA,11230 glean_parser/javascript_server.py,sha256=BJpVFuKG3tKFP0_xVyrR9Pn0UrvhumObCEgLeE0Lxhk,9028 glean_parser/kotlin.py,sha256=X2YNmx4boQ6Yb5CPoCIyRFDADrXPKIcIC-AyjkaSLtM,9519 -glean_parser/lint.py,sha256=XqNsb_Km6I1AlAdJuIcaoykoL7bGPXTQoz62icIPHNY,20827 +glean_parser/lint.py,sha256=ktdkR2GjR0wuR4IpLTiZ-q17vI4dk_Nebp4XU3pqzsk,21103 glean_parser/markdown.py,sha256=GkCr1CrV6mnRQseT6FO1-JJ7Eup8X3lxUfRMBTxXpe4,9066 glean_parser/metrics.py,sha256=3_ERPI63CsH_QvXVKNBVKIQTv4KWir2SfSbtn6J8a9Q,15842 -glean_parser/parser.py,sha256=IsDMTOLpt_H5GRPXX3G0HQdjeRIPeYFs3TGpVjH1ubA,19383 +glean_parser/parser.py,sha256=3bJwUGYhnzIHYJ7UBdO63Oi0_n1_Twvr2IOUUe_koME,18132 glean_parser/pings.py,sha256=l4hKmnKigS46vlHFI4aWueKVHcZQL36QfhK0VC8OiFA,3924 glean_parser/python_server.py,sha256=ERpYcbSwF19xKFagxX0mZAvlR1y6D7Ah5DSvW8LipCY,4791 glean_parser/ruby_server.py,sha256=e5lkfcLQAUMUBQDCjqNU82LkdUzT5x-G6HOnsUInbsU,5190 @@ -22,7 +22,7 @@ glean_parser/translation_options.py,sha256=Lxzr6G7MP0tC_ZYlZXftS4j0SLiqO-5mGVTEc glean_parser/util.py,sha256=yTx_-Q8w8rNNSZ_xbno0B90WR7pZZptG2bUWU0sCHZk,16580 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=7BrN0qON_j8x9xm4TubGOluViGTG-gIqPyEmYPtKgf4,26716 +glean_parser/schemas/metrics.2-0-0.schema.yaml,sha256=ieFMxezBuySCvUorx8eGqXRUcoeTql4Z9FxkbkG9XFQ,26715 glean_parser/schemas/pings.1-0-0.schema.yaml,sha256=hwCnsKpEysmrmVp-QHGBArEkVY3vaU1rVsxlTwhAzws,4315 glean_parser/schemas/pings.2-0-0.schema.yaml,sha256=FQBsEt8Eg_ypBUnhJ1THZWXIgtuiYfyXcp_J9pGJUnE,7001 glean_parser/schemas/tags.1-0-0.schema.yaml,sha256=OGXIJlvvVW1vaqB_NVZnwKeZ-sLlfH57vjBSHbj6DNI,1231 @@ -40,10 +40,10 @@ glean_parser/templates/ruby_server.jinja2,sha256=B0pbuld3j_0s7uMjoaCo8_6ehJUZeTX glean_parser/templates/rust.jinja2,sha256=hX8p5HXQNEeVz_sF6SDIyUNus6CcaCG9KWLl6uQLiOU,7285 glean_parser/templates/rust_server.jinja2,sha256=JJdeU5jiWx9aWpF0qiXIYztJ14OQKxV3VFdAbCrtR_0,12841 glean_parser/templates/swift.jinja2,sha256=L_JpwGLVzmOf1FYLoCzFu_RnGTExCIDup7iR1tWzD3o,6912 -glean_parser-17.1.0.dist-info/AUTHORS.md,sha256=yxgj8MioO4wUnrh0gmfb8l3DJJrf-l4HmmEDbQsbbNI,455 -glean_parser-17.1.0.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 -glean_parser-17.1.0.dist-info/METADATA,sha256=8JtbrOR7bidnVKiBahDVVmNSQj1cLb-wyKicTA2U4hw,36957 -glean_parser-17.1.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91 -glean_parser-17.1.0.dist-info/entry_points.txt,sha256=mf9d3sv8BwSjjR58x9KDnpVkONCnv3fPQC2NjJl15Xg,68 -glean_parser-17.1.0.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 -glean_parser-17.1.0.dist-info/RECORD,, +glean_parser-17.0.1.dist-info/AUTHORS.md,sha256=yxgj8MioO4wUnrh0gmfb8l3DJJrf-l4HmmEDbQsbbNI,455 +glean_parser-17.0.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725 +glean_parser-17.0.1.dist-info/METADATA,sha256=fX3p807Z0tgo8pjTGNX4Fxw3gPXT6dJrW_Cw7lnAE_4,36761 +glean_parser-17.0.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91 +glean_parser-17.0.1.dist-info/entry_points.txt,sha256=mf9d3sv8BwSjjR58x9KDnpVkONCnv3fPQC2NjJl15Xg,68 +glean_parser-17.0.1.dist-info/top_level.txt,sha256=q7T3duD-9tYZFyDry6Wv2LcdMsK2jGnzdDFhxWcT2Z8,13 +glean_parser-17.0.1.dist-info/RECORD,, diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/WHEEL b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/WHEEL similarity index 100% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/WHEEL rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/WHEEL diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/entry_points.txt b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/entry_points.txt similarity index 100% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/entry_points.txt rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/entry_points.txt diff --git a/third_party/python/glean_parser/glean_parser-17.1.0.dist-info/top_level.txt b/third_party/python/glean_parser/glean_parser-17.0.1.dist-info/top_level.txt similarity index 100% rename from third_party/python/glean_parser/glean_parser-17.1.0.dist-info/top_level.txt rename to third_party/python/glean_parser/glean_parser-17.0.1.dist-info/top_level.txt diff --git a/third_party/python/glean_parser/glean_parser/lint.py b/third_party/python/glean_parser/glean_parser/lint.py index 3605618eeec9..4449d660a310 100644 --- a/third_party/python/glean_parser/glean_parser/lint.py +++ b/third_party/python/glean_parser/glean_parser/lint.py @@ -134,6 +134,7 @@ def check_unit_in_name( time_unit = getattr(metric, "time_unit", None) memory_unit = getattr(metric, "memory_unit", None) + unit = getattr(metric, "unit", None) if time_unit is not None: if ( @@ -174,6 +175,14 @@ def check_unit_in_name( "Confirm the unit is correct and only include memory_unit." ) + elif unit is not None: + if unit_in_name == unit: + yield ( + f"Suffix '{unit_in_name}' is redundant with unit param " + f"'{unit}'. " + "Only include unit." + ) + def check_category_generic( category_name: str, metrics: Iterable[metrics.Metric] diff --git a/third_party/python/glean_parser/glean_parser/parser.py b/third_party/python/glean_parser/glean_parser/parser.py index c4f8ab07ea64..3f0536a5e9b7 100644 --- a/third_party/python/glean_parser/glean_parser/parser.py +++ b/third_party/python/glean_parser/glean_parser/parser.py @@ -188,32 +188,19 @@ def _instantiate_metrics( if category_key == "no_lint": continue if not config.get("allow_reserved") and category_key.split(".")[0] == "glean": - if category_key not in ("glean.attribution", "glean.distribution"): - yield util.format_error( - filepath, - f"For category '{category_key}'", - "Categories beginning with 'glean' are reserved for " - "Glean internal use.", - ) - continue + yield util.format_error( + filepath, + f"For category '{category_key}'", + "Categories beginning with 'glean' are reserved for " + "Glean internal use.", + ) + continue all_objects.setdefault(category_key, DictWrapper()) if not isinstance(category_val, dict): raise TypeError(f"Invalid content for {category_key}") for metric_key, metric_val in sorted(category_val.items()): - if ( - not config.get("allow_reserved") - and category_key in ("glean.attribution", "glean.distribution") - and metric_key != "ext" - ): - yield util.format_error( - filepath, - f"For {category_key}.{metric_key}", - f"May only use semi-reserved category {category_key} with metric name 'ext'", - metric_val.defined_in["line"], - ) - continue try: metric_obj = Metric.make_metric( category_key, metric_key, metric_val, validated=True, config=config @@ -227,28 +214,18 @@ def _instantiate_metrics( ) metric_obj = None else: - if not config.get("allow_reserved"): - if "all-pings" in metric_obj.send_in_pings: - yield util.format_error( - filepath, - f"On instance {category_key}.{metric_key}", - 'Only internal metrics may specify "all-pings" ' - 'in "send_in_pings"', - metric_val.defined_in["line"], - ) - metric_obj = None - elif ( - metric_obj.identifier() - in ("glean.attribution.ext", "glean.distribution.ext") - and metric_obj.type != "object" - ): - yield util.format_error( - filepath, - f"On instance {category_key}.{metric_key}", - "Extended attribution/distribution metrics must be of type 'object'", - metric_val.defined_in["line"], - ) - metric_obj = None + if ( + not config.get("allow_reserved") + and "all-pings" in metric_obj.send_in_pings + ): + yield util.format_error( + filepath, + f"On instance {category_key}.{metric_key}", + 'Only internal metrics may specify "all-pings" ' + 'in "send_in_pings"', + metric_val.defined_in["line"], + ) + metric_obj = None if metric_obj is not None: metric_obj.no_lint = sorted(set(metric_obj.no_lint + global_no_lint)) @@ -504,16 +481,16 @@ def parse_objects( raise TypeError(f"Invalid content for {filepath}") for category_key, category_val in sorted(content.items()): - if category_key.startswith("$"): - continue + if category_key.startswith("$"): + continue - interesting_metrics_dict.setdefault(category_key, DictWrapper()) + interesting_metrics_dict.setdefault(category_key, DictWrapper()) - if not isinstance(category_val, dict): - raise TypeError(f"Invalid category_val for {category_key}") + if not isinstance(category_val, dict): + raise TypeError(f"Invalid category_val for {category_key}") - for metric_key, metric_val in sorted(category_val.items()): - interesting_metrics_dict[category_key][metric_key] = metric_val + for metric_key, metric_val in sorted(category_val.items()): + interesting_metrics_dict[category_key][metric_key] = metric_val for category_key, category_val in all_objects.items(): if category_key == "tags": diff --git a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml index 66ba46d0a4d6..3af3c5d5cfaa 100644 --- a/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml +++ b/third_party/python/glean_parser/glean_parser/schemas/metrics.2-0-0.schema.yaml @@ -565,7 +565,7 @@ definitions: Use is limited to Firefox Desktop only. Has no effect when used with non-FOG outputters. See FOG's documentation on mirroring for details - - https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/gifft.html + https://firefox-source-docs.mozilla.org/toolkit/components/glean/mirroring.html type: string minLength: 6 diff --git a/third_party/python/pyproject.toml b/third_party/python/pyproject.toml index 575a3ddd829a..489a71851a3f 100644 --- a/third_party/python/pyproject.toml +++ b/third_party/python/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "filelock~=3.6", "fluent-migrate==0.13.2", "fluent-syntax==0.19.0", - "glean-parser==17.1.0", + "glean-parser==17.0.1", "importlib-metadata==6.0.0", # Required for compatibility with Flask >= 2 in tools/tryselect/selectors/chooser "jinja2==3.1.2", diff --git a/third_party/python/requirements.txt b/third_party/python/requirements.txt index cb7883021a4c..0b98e3099cc5 100644 --- a/third_party/python/requirements.txt +++ b/third_party/python/requirements.txt @@ -358,9 +358,9 @@ gitignorant==0.3.1 \ giturlparse==0.12.0 \ --hash=sha256:c0fff7c21acc435491b1779566e038757a205c1ffdcb47e4f81ea52ad8c3859a \ --hash=sha256:412b74f2855f1da2fefa89fd8dde62df48476077a72fc19b62039554d27360eb -glean-parser==17.1.0 \ - --hash=sha256:a59ab66dd734a8bea7d7a2cb632276602dd899411ee1c1cb89f439a833ba1598 \ - --hash=sha256:d353c7eae4f369f6ec198cb61432e7c24d1d06b14aecc05b367f6c498053defc +glean-parser==17.0.1 \ + --hash=sha256:764a3b5aaa22d6100100d97a6ce58515687f4e0d06660180024e3101a507f580 \ + --hash=sha256:922b75be353461875802a50dfd052215414dbc2965d153b95ff31d85081c40b7 idna==3.10 \ --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 diff --git a/third_party/python/uv.lock b/third_party/python/uv.lock index 9d719f590b84..506c752a66fa 100644 --- a/third_party/python/uv.lock +++ b/third_party/python/uv.lock @@ -598,7 +598,7 @@ wheels = [ [[package]] name = "glean-parser" -version = "17.1.0" +version = "17.0.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, @@ -608,9 +608,9 @@ dependencies = [ { name = "platformdirs" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5c/5e/a2c499e871398869372361a733dc612bb108079c3113ea35f67b6846e58d/glean_parser-17.1.0.tar.gz", hash = "sha256:a59ab66dd734a8bea7d7a2cb632276602dd899411ee1c1cb89f439a833ba1598", size = 291725 } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fd/895160c0fbc1ced0803bd19a2c2473f537efd8e6afa38aae2af12d5535b9/glean_parser-17.0.1.tar.gz", hash = "sha256:764a3b5aaa22d6100100d97a6ce58515687f4e0d06660180024e3101a507f580", size = 290273 } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/bd/be94c7243ff7666ee6c3170fc52791323b0b4d70d9522a9da1911dbbe40d/glean_parser-17.1.0-py3-none-any.whl", hash = "sha256:d353c7eae4f369f6ec198cb61432e7c24d1d06b14aecc05b367f6c498053defc", size = 124309 }, + { url = "https://files.pythonhosted.org/packages/2d/02/dcc2f155ef74fb2c83d51b7170236f4648adb49f645bac4e5786dc3ac77c/glean_parser-17.0.1-py3-none-any.whl", hash = "sha256:922b75be353461875802a50dfd052215414dbc2965d153b95ff31d85081c40b7", size = 124106 }, ] [[package]] @@ -925,7 +925,7 @@ requires-dist = [ { name = "filelock", specifier = "~=3.6" }, { name = "fluent-migrate", specifier = "==0.13.2" }, { name = "fluent-syntax", specifier = "==0.19.0" }, - { name = "glean-parser", specifier = "==17.1.0" }, + { name = "glean-parser", specifier = "==17.0.1" }, { name = "importlib-metadata", specifier = "==6.0.0" }, { name = "jinja2", specifier = "==3.1.2" }, { name = "jsmin", specifier = "==3.0.0" }, diff --git a/third_party/python/uv.lock.hash b/third_party/python/uv.lock.hash index 481932e3d936..54259ca4172b 100644 --- a/third_party/python/uv.lock.hash +++ b/third_party/python/uv.lock.hash @@ -1 +1 @@ -bef15c648652b3186718606fe950f1a885a86c4abb19b28d8a95f2ad60e2e039 \ No newline at end of file +6811e7a47781ee2d8b491fa59de0ad7a40375d04beeab0f203d5e423f0db5e48 \ No newline at end of file diff --git a/third_party/rust/glean-core/.cargo-checksum.json b/third_party/rust/glean-core/.cargo-checksum.json index 146abf79a3d3..85a4d137a37d 100644 --- a/third_party/rust/glean-core/.cargo-checksum.json +++ b/third_party/rust/glean-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"ffc8000a6fb68eb9465dff661e40e43b95fef93cf874a03bc8c4bc9642c6e766","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","build.rs":"4857bea99c6b8c08db8818efa9d3738716f52d3acb68159323957ae52892a3eb","src/common_metric_data.rs":"02dd1628fed6587621c089952dd0cb80bed3c352cdacfb33be7e218ad1d847e9","src/core/mod.rs":"e749d51f05fcfc9651e4021cd90682dafc107e58db0083e1b48f8df277d4581c","src/core_metrics.rs":"fb9707a4df04113d84e7608a15a7a4fd6a826a97b9aad73ec3438a8cad92b4b0","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"d9c01ecf92b69a0fe826abf1abf81569ab0dbe61d7f3d8c41201f3a21ac1b13b","src/debug.rs":"7bd9e199d0d5c8170f6dbb9a725a18eaca1df34309d32b02081574962a86816e","src/dispatcher/global.rs":"17493b1a5e926ca1e9c1cda2ee031773402a19183911eb80048630d60266d89e","src/dispatcher/mod.rs":"391310269947452d7e0de24c848c183110c60149d75e345ba6d5d146f222dace","src/error.rs":"b93c7d3e243b21bb9eafc95f17860aba1a942b2f2b0a7f43307690f05fece516","src/error_recording.rs":"32c1f58ff080cb22184bca37e356faadbfe846386880fb0898b773adb3a97d8c","src/event_database/mod.rs":"33519a9f648b6b8a014c23a47c8aa74420511027b9c6984e0c77a4e6192c02c6","src/fd_logger.rs":"0c9def6fa53db1a2ab93c85795f8a7df57797bcfd3978146923e151752e291a6","src/glean.udl":"74a2334177724f571eb6986015aa5514766472fccf1686e888baaa909881d6f2","src/glean_metrics.rs":"9414fb1453d19f6832df33e4c6ef7383d62203e47026bf5bc9552b083101ddd1","src/histogram/exponential.rs":"0f2c0857782d6910754a01438b1b4cd77bf0d3b847fd9ef969ba4da3705c5f5b","src/histogram/functional.rs":"22b2e64c3c1930e055beeebb832e3212e22b65b28e2ebb94c6bb3aff7ca31ba3","src/histogram/linear.rs":"bc33060cbbbb9c777539074cf5f788ab0f1a4ccecce0bf2cae2a697dd5089ea0","src/histogram/mod.rs":"c5eca9f6b0e1e309a7b41c2427d4c1da9c30e832d358d65ba347ba522abfd9c7","src/internal_metrics.rs":"54228cf409b4dd634fe0983f2619d2e0922efdd5fbce0f85a92454488967c854","src/internal_pings.rs":"3957a9fe256977a05d8d9e3beeec4c1fd08029db1c516fec4f6b59888e46ef39","src/lib.rs":"ac31e3136bd0077c33fe32554b39a0528a44396e4bb61d5a38b2978ffa52872b","src/lib_unit_tests.rs":"82ea06a5d6a8894c1670f99d0c236d8fa75eb9947fc8a1a53061a5e4c26b0b1d","src/metrics/boolean.rs":"2b9ef57e3582c9bd8b2cca8ab94c962a4871ecc00e837b913c9b0349ba9dff08","src/metrics/counter.rs":"b4a52a8167fb0edd6354f952525e59f3eadb4261de3483374f03c94449d30b92","src/metrics/custom_distribution.rs":"1ec4fd2ecebf547bef0ed28ae6854f641be447bcbf4066a8580f6af16a23e37f","src/metrics/datetime.rs":"e4405762fc71718299fa1b208e3d5fda654bd1b82fe908c884c284e3530de2ec","src/metrics/denominator.rs":"95e8442f90bad97f80fc74b146782f215344b52c5f3825ae0a8baffdc001a714","src/metrics/event.rs":"cd52e200d313e2e6f31707419d4a7fe1cab34916ee145f8136440d6da34aaad4","src/metrics/experiment.rs":"5f9278cca4e133eb8df33bbfe36d1fe0ef3eade8c09f1b46db3c4d0790515412","src/metrics/labeled.rs":"79acae98b7bd8536edcde5150c1402ed8560a8eb0ad5c04b79b7c67743d0aa71","src/metrics/memory_distribution.rs":"d3f02a6a78ed103024a2479975cd7617153e3f082e20f8f45c8e7afd052cec45","src/metrics/memory_unit.rs":"ee32e020cb303dd631457374048a3ed53a2e7cbacc29c54d17d836fb15507538","src/metrics/mod.rs":"777f89015c1642ed73536b07edc0763d179dbf608e2a0394439fe002cbc2fb53","src/metrics/numerator.rs":"937dfd583b797ac798a525cedca95c5a36262356760a89670d8113983c263154","src/metrics/object.rs":"2a1f1cc31973b576e55ba464b35c41b9420f62471eebba51273bca6856459538","src/metrics/ping.rs":"3b4524e8d17d55fe993746061636fb7d9566b51ac511765e173e7247907f0493","src/metrics/quantity.rs":"1315ae3216ebeec5b5a5baab88d63f88469875f538501e8320716516ef82bddf","src/metrics/rate.rs":"603cc45c149c7a27c93b6a80146bf43f8ce70d9655f905bb5be6bc2c15bcb22b","src/metrics/recorded_experiment.rs":"33958abee79d8b55dec4cb5d20742640423713010f76314075cefde18b5c118a","src/metrics/remote_settings_config.rs":"c85af9f9fef87ddfc578af4f2637c9bdcae18fbc6735ccc87a13a9b0ee0319ab","src/metrics/string.rs":"88beb1a847e5df9898b72ca7ed8ced3b7d2b40d83ff3670baf66f83a3e6cb005","src/metrics/string_list.rs":"ed53a095184c3e8224d0511809b5d7601ba3166505a39b0570f24ebeb0a5b97c","src/metrics/text.rs":"757f6919124d74e0512faa5bb9751a729b6bbc63ebe4d16ca81e9087f5595eaf","src/metrics/time_unit.rs":"4704703e19e799933aec3f39e3d3a125058756d7c7ba04f8729885c7843df447","src/metrics/timespan.rs":"e239c618f459c34f2799c73a4da3e3c6c0b2089ba42d584c2ddd12ed067586e6","src/metrics/timing_distribution.rs":"c61a2cd32a54e018b4b0bb60f030bada40fcbe68d6e6346eac8212cf416e14a3","src/metrics/url.rs":"589ae1f8047367ad8c19b57a48ca8130d5f36cf3ce5954124150f0eb89c620ea","src/metrics/uuid.rs":"cacffd95ab30ed327ec2fa5feaf1359e667706746401f1e2c1195ad9553c4b54","src/ping/mod.rs":"a4cc6b37443392aed79957a1b5d6943307e14bd3ead9fa9880c20aee48472ae2","src/scheduler.rs":"eb8131ed075e2d92bf0dc0a2c2a7e67c73bb61042d574c21965b1699cd1239aa","src/storage/mod.rs":"91f02556f113799e0d88d732ab342bda443f43461369e8b41c424c074d742591","src/system.rs":"e3d1b54e1d39cafe6f4dc7ff5021b08c879733f909951b0e1332b3efa9ed97bd","src/traits/boolean.rs":"be0e130f8043215705becc956d45b126c340568f1b24a396c0af9b4334a41ced","src/traits/counter.rs":"c686d26e131d854cd7a7df83c900ca7c17a03c663a30cf58ab48c7259476ce85","src/traits/custom_distribution.rs":"0bd1d425e4c059cca6af2dfb13c78e5e4c6c07fb46c7e31489ad0c5959854833","src/traits/datetime.rs":"636ac1456b1b042e38cf5ae6193c5b232ea0b80df62f583a2097891baef9641b","src/traits/event.rs":"a02235aae630aba7a45a3166b756927252b397af3ecdfab7236931e62725ac49","src/traits/labeled.rs":"1b2f8eea8d59e1635f64993936d880084a5e3f65cfd7a26ddf6968366890187d","src/traits/memory_distribution.rs":"55bb8f45e948319fbba9d28a50d8742da134b066a42e480887db7c7e435f4096","src/traits/mod.rs":"3560fdf3b81dceabbac9d97b0356aa8f883e477dcb787c81a09529047fda7161","src/traits/numerator.rs":"6e4f236bdc448f1bde7a8c249dcd086204c2c69990d3f444e746290929226ed3","src/traits/object.rs":"c03bad670ec7affbc578247f9e1904e898c1870b9bf25750c5094113f995623f","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"6ffe25c913bef4315573d747308c182de740b2a4e02ba22cd21d0c33ba521f31","src/traits/rate.rs":"f000790440e0f389f0b160526a9a9a266e58d1405915ae56ac550f482858222c","src/traits/string.rs":"0c3c88382ff2e8eba89c7cfe129c4b84e31140af717819533c14919541ad790c","src/traits/string_list.rs":"14e56b62c2c2be1dd8013f12001f235b084abd2a0d5aa2f7932843877af49ac0","src/traits/text.rs":"8af7d3a0c87cfd8c6d33d6ad47532b431055bbdd395f9110da5630222c23cf93","src/traits/timespan.rs":"52be325a9c061916f34c5b638a07a93b4a14aa89fe365783103d2e06b998f547","src/traits/timing_distribution.rs":"0d35acddd9e35a7f8859cf007162460b5fd0bf06d205cd195ed1c857bbe58c42","src/traits/url.rs":"c27f7add23214ff051078b65b88120b620560d2841a1056c7214d5237e86b9e4","src/traits/uuid.rs":"81322e71c7e847bacaf827a2cd58f6193bdc208355524207f7f38db039da6aa8","src/upload/directory.rs":"363ddc345845c2d543f833a5a63f1c778455e68b36ac77ffce605cef29f0d5cb","src/upload/mod.rs":"edae31e4c2172fb1e8e8b2c5542812b1e29c3bfa2f1c7b08227cb7cc4260dd48","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"de5532fc3d18e773330c05fe000643d87b9c4912a2d838099b8783538c5033ed","src/upload/result.rs":"c956266c54595d27d5e8b11abffe28fad5fea82995922618805b66cfdcc21d54","src/util.rs":"ee7500434d9758a320dd410f18d7e18da956591e19d2555db87eef9623e4b916","tests/boolean.rs":"76d6014ff108cb6514d9bceb1b2b14749a55b09921f4595a5e30f1bd3546e9f0","tests/collection_enabled.rs":"85f4b2eb49ac23437ae225ae2c44f354c952c24b7c806e2f2ee5dbe78e02c8db","tests/common/mod.rs":"a8f74c906dccfe747d5cf9dd83dd6e4d1ef25d0402d39a2d74105cddab80e54c","tests/counter.rs":"4c59def10e64de0d7a0241dde0267fd02c828b38be8cc67fba90a76004ca6721","tests/custom_distribution.rs":"41c593a0b4561e21f29d1a5b948de964a866253c58ca76ffefebe370fca150e0","tests/datetime.rs":"ec3c9760e70bb2cbc61ab23281c891bc1ec493c5c545466c29fd13e4f05c2c96","tests/event.rs":"5db675dad1bcbcee0451bfe5e93f05f28d7ef8098d19cd302c8bac262567cf0c","tests/labeled.rs":"3efddb05556e92a372f50a19b025ecf4ccd818c7c477250058db0706eb992079","tests/memory_distribution.rs":"3d9a5b8f99e03f783e3396e4320ee4dc974c895cfef2cec0b14d2a9a9f9b736f","tests/object.rs":"8c35676e04f6ccf54a28764700915e753fc0355bfa5d7804d72caba66fd564cd","tests/ping.rs":"eff68d3b47b04c58d8123214dd66e8d06d11f82ed3fd4f703224f84effb319bb","tests/ping_maker.rs":"64900bb24642127df559fa6ace4c7f0a4a4bf858321874c9b3758039df0ffa04","tests/quantity.rs":"55e7dca346fd1d27f0974b78ca3fb12427cb5da2ee637afc08a54f360f947361","tests/rate.rs":"94a3a7d0ccafea02a991ed9dd038cbfab8a534695b374b1ce6ed81285616e9f6","tests/storage.rs":"990dd1d13b9ffa8af0686977a6ac3502c6befb9eaa83649587e2660f51c596c9","tests/string.rs":"397fcfd27c25f0e81e2a40db3265b0d7dc0dd56b190319c1f86cb1c2c0ed4f9d","tests/string_list.rs":"34efa2afe3e89e6635f21ec9c80650d5816e35e9cb85163d894d600a5b3a4e3a","tests/text.rs":"1d43f6b90a43124311cacf0a6ee16f9e1e9263bcd11fee8b996d6efd81633638","tests/timespan.rs":"3d05739a93f3e0ea7264e8fdea876bd948714e5b44e82b8fd7c0218fdb597bb3","tests/timing_distribution.rs":"072ad950b2162e503150e411119b9a000573538bd2cff93c1c1a3616d1589ef4","tests/uuid.rs":"e0e58614319f5e973126f5b4e68d9289ccd6d65e428aca215bf7dcc8a0504889","uniffi.toml":"6ddc98b686b0925a81abd9d1c769e5c98ac29771b210a1c535931a46dec9a8e3"},"package":"5ca0df94fb37669287b77e8aa300913ad1d14426d7f9e443b0ce1185349c817e"} \ No newline at end of file +{"files":{"Cargo.toml":"0359eee0959129d95bc83af3048a2830b7d1f5e87befdf66631da955485a62f8","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"026495898699b54608eb4ec16074ffafc57920d80ccb59961c501a1ea28c9985","build.rs":"4857bea99c6b8c08db8818efa9d3738716f52d3acb68159323957ae52892a3eb","src/common_metric_data.rs":"02dd1628fed6587621c089952dd0cb80bed3c352cdacfb33be7e218ad1d847e9","src/core/mod.rs":"cc723d90c1738bec63b7522793eddfbd4c6d14c792bea49a60cbb361faaa84a1","src/core_metrics.rs":"a877e42e0f8b932adb52a5681ad76fd977808cb48c7eeb29b1e4bbe804f1ea96","src/coverage.rs":"49613fd310bd24d779472720975fbe6c97ec370a95eb55f10afa43f67539c942","src/database/mod.rs":"d9c01ecf92b69a0fe826abf1abf81569ab0dbe61d7f3d8c41201f3a21ac1b13b","src/debug.rs":"7bd9e199d0d5c8170f6dbb9a725a18eaca1df34309d32b02081574962a86816e","src/dispatcher/global.rs":"17493b1a5e926ca1e9c1cda2ee031773402a19183911eb80048630d60266d89e","src/dispatcher/mod.rs":"391310269947452d7e0de24c848c183110c60149d75e345ba6d5d146f222dace","src/error.rs":"b93c7d3e243b21bb9eafc95f17860aba1a942b2f2b0a7f43307690f05fece516","src/error_recording.rs":"32c1f58ff080cb22184bca37e356faadbfe846386880fb0898b773adb3a97d8c","src/event_database/mod.rs":"33519a9f648b6b8a014c23a47c8aa74420511027b9c6984e0c77a4e6192c02c6","src/fd_logger.rs":"0c9def6fa53db1a2ab93c85795f8a7df57797bcfd3978146923e151752e291a6","src/glean.udl":"413784d0c8ef2f0ee34e7535fb10d2f31058dfd558d0121d5ad77d9f00aded96","src/glean_metrics.rs":"9414fb1453d19f6832df33e4c6ef7383d62203e47026bf5bc9552b083101ddd1","src/histogram/exponential.rs":"0f2c0857782d6910754a01438b1b4cd77bf0d3b847fd9ef969ba4da3705c5f5b","src/histogram/functional.rs":"22b2e64c3c1930e055beeebb832e3212e22b65b28e2ebb94c6bb3aff7ca31ba3","src/histogram/linear.rs":"bc33060cbbbb9c777539074cf5f788ab0f1a4ccecce0bf2cae2a697dd5089ea0","src/histogram/mod.rs":"c5eca9f6b0e1e309a7b41c2427d4c1da9c30e832d358d65ba347ba522abfd9c7","src/internal_metrics.rs":"b07018078a09c46ab3416818ddab6bd31a4d5beeeaf677ed6edba10b2b524326","src/internal_pings.rs":"3957a9fe256977a05d8d9e3beeec4c1fd08029db1c516fec4f6b59888e46ef39","src/lib.rs":"b9d89f63cde771d31fea5659ed534478df5f63595254e6a4648ba7c9ad7f8d85","src/lib_unit_tests.rs":"470dca51a00acf316e7afd30d337731724116308553c8596db1890ea8d127388","src/metrics/boolean.rs":"2b9ef57e3582c9bd8b2cca8ab94c962a4871ecc00e837b913c9b0349ba9dff08","src/metrics/counter.rs":"b4a52a8167fb0edd6354f952525e59f3eadb4261de3483374f03c94449d30b92","src/metrics/custom_distribution.rs":"1ec4fd2ecebf547bef0ed28ae6854f641be447bcbf4066a8580f6af16a23e37f","src/metrics/datetime.rs":"e4405762fc71718299fa1b208e3d5fda654bd1b82fe908c884c284e3530de2ec","src/metrics/denominator.rs":"95e8442f90bad97f80fc74b146782f215344b52c5f3825ae0a8baffdc001a714","src/metrics/event.rs":"cd52e200d313e2e6f31707419d4a7fe1cab34916ee145f8136440d6da34aaad4","src/metrics/experiment.rs":"5f9278cca4e133eb8df33bbfe36d1fe0ef3eade8c09f1b46db3c4d0790515412","src/metrics/labeled.rs":"e6afd55c7f7632c962c84de842b302b53df11660ed59b586f85e6e92808a23d8","src/metrics/memory_distribution.rs":"d3f02a6a78ed103024a2479975cd7617153e3f082e20f8f45c8e7afd052cec45","src/metrics/memory_unit.rs":"ee32e020cb303dd631457374048a3ed53a2e7cbacc29c54d17d836fb15507538","src/metrics/mod.rs":"777f89015c1642ed73536b07edc0763d179dbf608e2a0394439fe002cbc2fb53","src/metrics/numerator.rs":"937dfd583b797ac798a525cedca95c5a36262356760a89670d8113983c263154","src/metrics/object.rs":"2a1f1cc31973b576e55ba464b35c41b9420f62471eebba51273bca6856459538","src/metrics/ping.rs":"3b4524e8d17d55fe993746061636fb7d9566b51ac511765e173e7247907f0493","src/metrics/quantity.rs":"1315ae3216ebeec5b5a5baab88d63f88469875f538501e8320716516ef82bddf","src/metrics/rate.rs":"603cc45c149c7a27c93b6a80146bf43f8ce70d9655f905bb5be6bc2c15bcb22b","src/metrics/recorded_experiment.rs":"33958abee79d8b55dec4cb5d20742640423713010f76314075cefde18b5c118a","src/metrics/remote_settings_config.rs":"c85af9f9fef87ddfc578af4f2637c9bdcae18fbc6735ccc87a13a9b0ee0319ab","src/metrics/string.rs":"88beb1a847e5df9898b72ca7ed8ced3b7d2b40d83ff3670baf66f83a3e6cb005","src/metrics/string_list.rs":"ed53a095184c3e8224d0511809b5d7601ba3166505a39b0570f24ebeb0a5b97c","src/metrics/text.rs":"757f6919124d74e0512faa5bb9751a729b6bbc63ebe4d16ca81e9087f5595eaf","src/metrics/time_unit.rs":"4704703e19e799933aec3f39e3d3a125058756d7c7ba04f8729885c7843df447","src/metrics/timespan.rs":"e239c618f459c34f2799c73a4da3e3c6c0b2089ba42d584c2ddd12ed067586e6","src/metrics/timing_distribution.rs":"c61a2cd32a54e018b4b0bb60f030bada40fcbe68d6e6346eac8212cf416e14a3","src/metrics/url.rs":"589ae1f8047367ad8c19b57a48ca8130d5f36cf3ce5954124150f0eb89c620ea","src/metrics/uuid.rs":"cacffd95ab30ed327ec2fa5feaf1359e667706746401f1e2c1195ad9553c4b54","src/ping/mod.rs":"70c6f4966d760e95d450d60bc9e720dec4576febfc487de3634fefacd9f2d8e7","src/scheduler.rs":"eb8131ed075e2d92bf0dc0a2c2a7e67c73bb61042d574c21965b1699cd1239aa","src/storage/mod.rs":"91f02556f113799e0d88d732ab342bda443f43461369e8b41c424c074d742591","src/system.rs":"e3d1b54e1d39cafe6f4dc7ff5021b08c879733f909951b0e1332b3efa9ed97bd","src/traits/boolean.rs":"be0e130f8043215705becc956d45b126c340568f1b24a396c0af9b4334a41ced","src/traits/counter.rs":"c686d26e131d854cd7a7df83c900ca7c17a03c663a30cf58ab48c7259476ce85","src/traits/custom_distribution.rs":"0bd1d425e4c059cca6af2dfb13c78e5e4c6c07fb46c7e31489ad0c5959854833","src/traits/datetime.rs":"636ac1456b1b042e38cf5ae6193c5b232ea0b80df62f583a2097891baef9641b","src/traits/event.rs":"a02235aae630aba7a45a3166b756927252b397af3ecdfab7236931e62725ac49","src/traits/labeled.rs":"c633c68e70a44e73f8aff88aaab1029c0faded3cad08d822590ed8838f24b4fd","src/traits/memory_distribution.rs":"55bb8f45e948319fbba9d28a50d8742da134b066a42e480887db7c7e435f4096","src/traits/mod.rs":"3560fdf3b81dceabbac9d97b0356aa8f883e477dcb787c81a09529047fda7161","src/traits/numerator.rs":"6e4f236bdc448f1bde7a8c249dcd086204c2c69990d3f444e746290929226ed3","src/traits/object.rs":"c03bad670ec7affbc578247f9e1904e898c1870b9bf25750c5094113f995623f","src/traits/ping.rs":"8831c106c03afeb458b0b028fa1ce61f056ebf8e82bc0a171a1bff255d920748","src/traits/quantity.rs":"6ffe25c913bef4315573d747308c182de740b2a4e02ba22cd21d0c33ba521f31","src/traits/rate.rs":"f000790440e0f389f0b160526a9a9a266e58d1405915ae56ac550f482858222c","src/traits/string.rs":"0c3c88382ff2e8eba89c7cfe129c4b84e31140af717819533c14919541ad790c","src/traits/string_list.rs":"14e56b62c2c2be1dd8013f12001f235b084abd2a0d5aa2f7932843877af49ac0","src/traits/text.rs":"8af7d3a0c87cfd8c6d33d6ad47532b431055bbdd395f9110da5630222c23cf93","src/traits/timespan.rs":"52be325a9c061916f34c5b638a07a93b4a14aa89fe365783103d2e06b998f547","src/traits/timing_distribution.rs":"0d35acddd9e35a7f8859cf007162460b5fd0bf06d205cd195ed1c857bbe58c42","src/traits/url.rs":"c27f7add23214ff051078b65b88120b620560d2841a1056c7214d5237e86b9e4","src/traits/uuid.rs":"81322e71c7e847bacaf827a2cd58f6193bdc208355524207f7f38db039da6aa8","src/upload/directory.rs":"363ddc345845c2d543f833a5a63f1c778455e68b36ac77ffce605cef29f0d5cb","src/upload/mod.rs":"edae31e4c2172fb1e8e8b2c5542812b1e29c3bfa2f1c7b08227cb7cc4260dd48","src/upload/policy.rs":"c250957a37783e74af8002cd80ba06ef9780a389fb0f61b8b665b79688f0a360","src/upload/request.rs":"de5532fc3d18e773330c05fe000643d87b9c4912a2d838099b8783538c5033ed","src/upload/result.rs":"c956266c54595d27d5e8b11abffe28fad5fea82995922618805b66cfdcc21d54","src/util.rs":"ee7500434d9758a320dd410f18d7e18da956591e19d2555db87eef9623e4b916","tests/boolean.rs":"76d6014ff108cb6514d9bceb1b2b14749a55b09921f4595a5e30f1bd3546e9f0","tests/collection_enabled.rs":"85f4b2eb49ac23437ae225ae2c44f354c952c24b7c806e2f2ee5dbe78e02c8db","tests/common/mod.rs":"a8f74c906dccfe747d5cf9dd83dd6e4d1ef25d0402d39a2d74105cddab80e54c","tests/counter.rs":"4c59def10e64de0d7a0241dde0267fd02c828b38be8cc67fba90a76004ca6721","tests/custom_distribution.rs":"41c593a0b4561e21f29d1a5b948de964a866253c58ca76ffefebe370fca150e0","tests/datetime.rs":"ec3c9760e70bb2cbc61ab23281c891bc1ec493c5c545466c29fd13e4f05c2c96","tests/event.rs":"5db675dad1bcbcee0451bfe5e93f05f28d7ef8098d19cd302c8bac262567cf0c","tests/labeled.rs":"6f2c6489bcb297b2b64740712b4902e4997fb5c0ba9cb3552a5f6c1fddd45d2f","tests/memory_distribution.rs":"3d9a5b8f99e03f783e3396e4320ee4dc974c895cfef2cec0b14d2a9a9f9b736f","tests/object.rs":"8c35676e04f6ccf54a28764700915e753fc0355bfa5d7804d72caba66fd564cd","tests/ping.rs":"eff68d3b47b04c58d8123214dd66e8d06d11f82ed3fd4f703224f84effb319bb","tests/ping_maker.rs":"20954903888798f63ca83a03ba4703f60ee7ba40dce13f225e8d8e73425d3605","tests/quantity.rs":"55e7dca346fd1d27f0974b78ca3fb12427cb5da2ee637afc08a54f360f947361","tests/rate.rs":"94a3a7d0ccafea02a991ed9dd038cbfab8a534695b374b1ce6ed81285616e9f6","tests/storage.rs":"990dd1d13b9ffa8af0686977a6ac3502c6befb9eaa83649587e2660f51c596c9","tests/string.rs":"397fcfd27c25f0e81e2a40db3265b0d7dc0dd56b190319c1f86cb1c2c0ed4f9d","tests/string_list.rs":"34efa2afe3e89e6635f21ec9c80650d5816e35e9cb85163d894d600a5b3a4e3a","tests/text.rs":"1d43f6b90a43124311cacf0a6ee16f9e1e9263bcd11fee8b996d6efd81633638","tests/timespan.rs":"3d05739a93f3e0ea7264e8fdea876bd948714e5b44e82b8fd7c0218fdb597bb3","tests/timing_distribution.rs":"072ad950b2162e503150e411119b9a000573538bd2cff93c1c1a3616d1589ef4","tests/uuid.rs":"e0e58614319f5e973126f5b4e68d9289ccd6d65e428aca215bf7dcc8a0504889","uniffi.toml":"6ddc98b686b0925a81abd9d1c769e5c98ac29771b210a1c535931a46dec9a8e3"},"package":"a49d1d62648ddeed8cb996373046ea45de93f1d1ff956aba054b9304bc305753"} \ No newline at end of file diff --git a/third_party/rust/glean-core/Cargo.toml b/third_party/rust/glean-core/Cargo.toml index 32ff1696c184..f4a8c1f6e9cd 100644 --- a/third_party/rust/glean-core/Cargo.toml +++ b/third_party/rust/glean-core/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.82" name = "glean-core" -version = "64.1.1" +version = "64.0.1" authors = [ "Jan-Erik Rediger ", "The Glean Team ", @@ -40,7 +40,7 @@ license = "MPL-2.0" repository = "https://github.com/mozilla/glean" [package.metadata.glean] -glean-parser = "17.1.0" +glean-parser = "17.0.1" [lib] name = "glean_core" diff --git a/third_party/rust/glean-core/src/core/mod.rs b/third_party/rust/glean-core/src/core/mod.rs index d60af5363dc9..302f90d134e5 100644 --- a/third_party/rust/glean-core/src/core/mod.rs +++ b/third_party/rust/glean-core/src/core/mod.rs @@ -24,9 +24,8 @@ use crate::storage::{StorageManager, INTERNAL_STORAGE}; use crate::upload::{PingUploadManager, PingUploadTask, UploadResult, UploadTaskAction}; use crate::util::{local_now_with_offset, sanitize_application_id}; use crate::{ - scheduler, system, AttributionMetrics, CommonMetricData, DistributionMetrics, ErrorKind, - InternalConfiguration, Lifetime, PingRateLimit, Result, DEFAULT_MAX_EVENTS, - GLEAN_SCHEMA_VERSION, GLEAN_VERSION, KNOWN_CLIENT_ID, + scheduler, system, CommonMetricData, ErrorKind, InternalConfiguration, Lifetime, PingRateLimit, + Result, DEFAULT_MAX_EVENTS, GLEAN_SCHEMA_VERSION, GLEAN_VERSION, KNOWN_CLIENT_ID, }; static GLEAN: OnceCell> = OnceCell::new(); @@ -1085,76 +1084,4 @@ impl Glean { scheduler::schedule(self); } } - - /// Updates attribution fields with new values. - /// AttributionMetrics fields with `None` values will not overwrite older values. - pub fn update_attribution(&self, attribution: AttributionMetrics) { - if let Some(source) = attribution.source { - self.core_metrics.attribution_source.set_sync(self, source); - } - if let Some(medium) = attribution.medium { - self.core_metrics.attribution_medium.set_sync(self, medium); - } - if let Some(campaign) = attribution.campaign { - self.core_metrics - .attribution_campaign - .set_sync(self, campaign); - } - if let Some(term) = attribution.term { - self.core_metrics.attribution_term.set_sync(self, term); - } - if let Some(content) = attribution.content { - self.core_metrics - .attribution_content - .set_sync(self, content); - } - } - - /// **TEST-ONLY Method** - /// - /// Returns the current attribution metrics. - pub fn test_get_attribution(&self) -> AttributionMetrics { - AttributionMetrics { - source: self - .core_metrics - .attribution_source - .get_value(self, Some("glean_client_info")), - medium: self - .core_metrics - .attribution_medium - .get_value(self, Some("glean_client_info")), - campaign: self - .core_metrics - .attribution_campaign - .get_value(self, Some("glean_client_info")), - term: self - .core_metrics - .attribution_term - .get_value(self, Some("glean_client_info")), - content: self - .core_metrics - .attribution_content - .get_value(self, Some("glean_client_info")), - } - } - - /// Updates distribution fields with new values. - /// DistributionMetrics fields with `None` values will not overwrite older values. - pub fn update_distribution(&self, distribution: DistributionMetrics) { - if let Some(name) = distribution.name { - self.core_metrics.distribution_name.set_sync(self, name); - } - } - - /// **TEST-ONLY Method** - /// - /// Returns the current distribution metrics. - pub fn test_get_distribution(&self) -> DistributionMetrics { - DistributionMetrics { - name: self - .core_metrics - .distribution_name - .get_value(self, Some("glean_client_info")), - } - } } diff --git a/third_party/rust/glean-core/src/core_metrics.rs b/third_party/rust/glean-core/src/core_metrics.rs index c3ed9f2ec458..baa2b8515bca 100644 --- a/third_party/rust/glean-core/src/core_metrics.rs +++ b/third_party/rust/glean-core/src/core_metrics.rs @@ -42,58 +42,6 @@ pub struct ClientInfoMetrics { pub locale: Option, } -/// Optional product attribution metrics carried in `client_info.attribution`. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct AttributionMetrics { - /// The attribution source (e.g. "google-play"). - pub source: Option, - /// The attribution medium (e.g. "organic" for a search engine). - pub medium: Option, - /// The attribution campaign (e.g. "mozilla-org"). - pub campaign: Option, - /// The attribution term (e.g. "browser with developer tools for android"). - pub term: Option, - /// The attribution content (e.g. "firefoxview"). - pub content: Option, -} - -impl AttributionMetrics { - /// Update self with any non-`None` fields from `other`. - pub fn update(&mut self, other: AttributionMetrics) { - if let Some(source) = other.source { - self.source = Some(source); - } - if let Some(medium) = other.medium { - self.medium = Some(medium); - } - if let Some(campaign) = other.campaign { - self.campaign = Some(campaign); - } - if let Some(term) = other.term { - self.term = Some(term); - } - if let Some(content) = other.content { - self.content = Some(content); - } - } -} - -/// Optional product distribution metrics carried in `client_info.distribution`. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct DistributionMetrics { - /// The distribution name (e.g. "MozillaOnline"). - pub name: Option, -} - -impl DistributionMetrics { - /// Update self with any non-`None` fields from `other`. - pub fn update(&mut self, other: DistributionMetrics) { - if let Some(name) = other.name { - self.name = Some(name); - } - } -} - /// Metrics included in every ping as `client_info`. impl ClientInfoMetrics { /// Creates the client info with dummy values for all. @@ -256,62 +204,3 @@ pub mod internal_metrics { ) }); } - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn update_attribution() { - let mut attr: AttributionMetrics = Default::default(); - let empty: AttributionMetrics = Default::default(); - - // Ensure the identity operation works. - attr.update(empty.clone()); - assert_eq!(None, attr.source); - - // Ensure simple updates work. - attr.update(AttributionMetrics { - source: Some("a source".into()), - ..Default::default() - }); - assert_eq!(Some("a source".into()), attr.source); - - // Ensure None doesn't overwrite. - attr.update(empty); - assert_eq!(Some("a source".into()), attr.source); - - // Ensure updates of Some work. - attr.update(AttributionMetrics { - source: Some("another source".into()), - ..Default::default() - }); - assert_eq!(Some("another source".into()), attr.source); - } - - #[test] - fn update_distribution() { - let mut dist: DistributionMetrics = Default::default(); - let empty: DistributionMetrics = Default::default(); - - // Ensure the identity operation works. - dist.update(empty.clone()); - assert_eq!(None, dist.name); - - // Ensure simple updates work. - dist.update(DistributionMetrics { - name: Some("a name".into()), - }); - assert_eq!(Some("a name".into()), dist.name); - - // Ensure None doesn't overwrite. - dist.update(empty); - assert_eq!(Some("a name".into()), dist.name); - - // Ensure updates of Some work. - dist.update(DistributionMetrics { - name: Some("another name".into()), - }); - assert_eq!(Some("another name".into()), dist.name); - } -} diff --git a/third_party/rust/glean-core/src/glean.udl b/third_party/rust/glean-core/src/glean.udl index fb7cdfe69e2d..d8f3aa179052 100644 --- a/third_party/rust/glean-core/src/glean.udl +++ b/third_party/rust/glean-core/src/glean.udl @@ -71,18 +71,6 @@ namespace glean { PingUploadTask glean_get_upload_task(); UploadTaskAction glean_process_ping_upload_response(string uuid, UploadResult result); - - // Updates attribution fields with new values. - // AttributionMetrics fields with no values will not overwrite older values. - void glean_update_attribution(AttributionMetrics attribution); - // Returns the current attribution metrics, if any. - AttributionMetrics glean_test_get_attribution(); - - // Updates distribution fields with new values. - // DistributionMetrics fields with no values will not overwrite older values. - void glean_update_distribution(DistributionMetrics distribution); - // Returns the current distribution metrics, if any. - DistributionMetrics glean_test_get_distribution(); }; // A `Cow<'static, str>`, but really it's always the owned part. @@ -150,18 +138,6 @@ dictionary ClientInfoMetrics { i64? windows_build_number = null; }; -dictionary AttributionMetrics { - string? source = null; - string? medium = null; - string? campaign = null; - string? term = null; - string? content = null; -}; - -dictionary DistributionMetrics { - string? name = null; -}; - [Error] enum CallbackError { "UnexpectedError", diff --git a/third_party/rust/glean-core/src/internal_metrics.rs b/third_party/rust/glean-core/src/internal_metrics.rs index 372ec32a9ad5..7c0f697eed6c 100644 --- a/third_party/rust/glean-core/src/internal_metrics.rs +++ b/third_party/rust/glean-core/src/internal_metrics.rs @@ -11,12 +11,6 @@ pub struct CoreMetrics { pub client_id: UuidMetric, pub first_run_date: DatetimeMetric, pub os: StringMetric, - pub attribution_source: StringMetric, - pub attribution_medium: StringMetric, - pub attribution_campaign: StringMetric, - pub attribution_term: StringMetric, - pub attribution_content: StringMetric, - pub distribution_name: StringMetric, } #[derive(Debug)] @@ -71,60 +65,6 @@ impl CoreMetrics { disabled: false, dynamic_label: None, }), - - attribution_source: StringMetric::new(CommonMetricData { - name: "source".into(), - category: "attribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), - - attribution_medium: StringMetric::new(CommonMetricData { - name: "medium".into(), - category: "attribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), - - attribution_campaign: StringMetric::new(CommonMetricData { - name: "campaign".into(), - category: "attribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), - - attribution_term: StringMetric::new(CommonMetricData { - name: "term".into(), - category: "attribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), - - attribution_content: StringMetric::new(CommonMetricData { - name: "content".into(), - category: "attribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), - - distribution_name: StringMetric::new(CommonMetricData { - name: "name".into(), - category: "distribution".into(), - send_in_pings: vec!["glean_client_info".into()], - lifetime: Lifetime::User, - disabled: false, - dynamic_label: None, - }), } } } diff --git a/third_party/rust/glean-core/src/lib.rs b/third_party/rust/glean-core/src/lib.rs index 50da8bb8dfaf..aac594e20992 100644 --- a/third_party/rust/glean-core/src/lib.rs +++ b/third_party/rust/glean-core/src/lib.rs @@ -59,7 +59,7 @@ mod fd_logger; pub use crate::common_metric_data::{CommonMetricData, Lifetime}; pub use crate::core::Glean; -pub use crate::core_metrics::{AttributionMetrics, ClientInfoMetrics, DistributionMetrics}; +pub use crate::core_metrics::ClientInfoMetrics; pub use crate::error::{Error, ErrorKind, Result}; pub use crate::error_recording::{test_get_num_recorded_errors, ErrorType}; pub use crate::histogram::HistogramType; @@ -102,10 +102,6 @@ static PRE_INIT_SOURCE_TAGS: Mutex> = Mutex::new(Vec::new()); static PRE_INIT_PING_REGISTRATION: Mutex> = Mutex::new(Vec::new()); static PRE_INIT_PING_ENABLED: Mutex> = Mutex::new(Vec::new()); -/// Keep track of attribution and distribution supplied before Glean is initialized. -static PRE_INIT_ATTRIBUTION: Mutex> = Mutex::new(None); -static PRE_INIT_DISTRIBUTION: Mutex> = Mutex::new(None); - /// Global singleton of the handles of the glean.init threads. /// For joining. For tests. /// (Why a Vec? There might be more than one concurrent call to initialize.) @@ -452,15 +448,6 @@ fn initialize_inner( glean.set_ping_enabled(ping, *enabled); } - // The attribution and distribution might have been set before initialize, - // take the cached values and set them. - if let Some(attribution) = PRE_INIT_ATTRIBUTION.lock().unwrap().take() { - glean.update_attribution(attribution); - } - if let Some(distribution) = PRE_INIT_DISTRIBUTION.lock().unwrap().take() { - glean.update_distribution(distribution); - } - // If this is the first time ever the Glean SDK runs, make sure to set // some initial core metrics in case we need to generate early pings. // The next times we start, we would have them around already. @@ -887,7 +874,7 @@ pub fn glean_set_collection_enabled(enabled: bool) { /// and all pending pings of that type to be deleted. pub fn set_ping_enabled(ping: &PingType, enabled: bool) { let ping = ping.clone(); - if was_initialize_called() && core::global_glean().is_some() { + if was_initialize_called() { crate::launch_with_glean_mut(move |glean| glean.set_ping_enabled(&ping, enabled)); } else { let m = &PRE_INIT_PING_ENABLED; @@ -902,7 +889,7 @@ pub(crate) fn register_ping_type(ping: &PingType) { // we dispatch ping registration on the thread pool. // Registering a ping should not block the application. // Submission itself is also dispatched, so it will always come after the registration. - if was_initialize_called() && core::global_glean().is_some() { + if was_initialize_called() { let ping = ping.clone(); crate::launch_with_glean_mut(move |glean| { glean.register_ping_type(&ping); @@ -1016,7 +1003,7 @@ pub fn glean_apply_server_knobs_config(json: String) { /// This will return `false` in case `tag` is not a valid tag and `true` otherwise. /// If called before Glean is initialized it will always return `true`. pub fn glean_set_debug_view_tag(tag: String) -> bool { - if was_initialize_called() && core::global_glean().is_some() { + if was_initialize_called() { crate::launch_with_glean_mut(move |glean| { glean.set_debug_view_tag(&tag); }); @@ -1054,7 +1041,7 @@ pub fn glean_get_debug_view_tag() -> Option { /// * `tags` - A vector of at most 5 valid HTTP header values. Individual /// tags must match the regex: "[a-zA-Z0-9-]{1,20}". pub fn glean_set_source_tags(tags: Vec) -> bool { - if was_initialize_called() && core::global_glean().is_some() { + if was_initialize_called() { crate::launch_with_glean_mut(|glean| { glean.set_source_tags(tags); }); @@ -1079,7 +1066,7 @@ pub fn glean_set_source_tags(tags: Vec) -> bool { /// /// * `value` - The value of the log pings option pub fn glean_set_log_pings(value: bool) { - if was_initialize_called() && core::global_glean().is_some() { + if was_initialize_called() { crate::launch_with_glean_mut(move |glean| { glean.set_log_pings(value); }); @@ -1176,8 +1163,7 @@ pub fn glean_submit_ping_by_name_sync(ping_name: String, reason: Option) return false; } - core::with_opt_glean(|glean| glean.submit_ping_by_name(&ping_name, reason.as_deref())) - .unwrap_or(false) + core::with_glean(|glean| glean.submit_ping_by_name(&ping_name, reason.as_deref())) } /// EXPERIMENTAL: Register a listener object to recieve notifications of event recordings. @@ -1269,52 +1255,6 @@ pub fn glean_set_dirty_flag(new_value: bool) { core::with_glean(|glean| glean.set_dirty_flag(new_value)) } -/// Updates attribution fields with new values. -/// AttributionMetrics fields with `None` values will not overwrite older values. -pub fn glean_update_attribution(attribution: AttributionMetrics) { - if was_initialize_called() && core::global_glean().is_some() { - core::with_glean(|glean| glean.update_attribution(attribution)); - } else { - PRE_INIT_ATTRIBUTION - .lock() - .unwrap() - .get_or_insert(Default::default()) - .update(attribution); - } -} - -/// **TEST-ONLY Method** -/// -/// Returns the current attribution metrics. -/// Panics if called before init. -pub fn glean_test_get_attribution() -> AttributionMetrics { - join_init(); - core::with_glean(|glean| glean.test_get_attribution()) -} - -/// Updates distribution fields with new values. -/// DistributionMetrics fields with `None` values will not overwrite older values. -pub fn glean_update_distribution(distribution: DistributionMetrics) { - if was_initialize_called() && core::global_glean().is_some() { - core::with_glean(|glean| glean.update_distribution(distribution)); - } else { - PRE_INIT_DISTRIBUTION - .lock() - .unwrap() - .get_or_insert(Default::default()) - .update(distribution); - } -} - -/// **TEST-ONLY Method** -/// -/// Returns the current distribution metrics. -/// Panics if called before init. -pub fn glean_test_get_distribution() -> DistributionMetrics { - join_init(); - core::with_glean(|glean| glean.test_get_distribution()) -} - #[cfg(all(not(target_os = "android"), not(target_os = "ios")))] static FD_LOGGER: OnceCell = OnceCell::new(); diff --git a/third_party/rust/glean-core/src/lib_unit_tests.rs b/third_party/rust/glean-core/src/lib_unit_tests.rs index 5b17597f3e46..005cf92b4165 100644 --- a/third_party/rust/glean-core/src/lib_unit_tests.rs +++ b/third_party/rust/glean-core/src/lib_unit_tests.rs @@ -396,58 +396,6 @@ fn client_id_is_set_to_random_value_when_uploading_enabled_at_start() { assert_ne!(*KNOWN_CLIENT_ID, current_client_id.unwrap()); } -#[test] -fn attribution_and_distribution_are_correctly_stored() { - let dir = tempfile::tempdir().unwrap(); - let tmpname = dir.path().display().to_string(); - let glean = Glean::with_options(&tmpname, GLOBAL_APPLICATION_ID, true, true); - - // On a fresh Glean, no attribution or distribution information is set. - assert_eq!( - ::default(), - glean.test_get_attribution() - ); - assert_eq!( - ::default(), - glean.test_get_distribution() - ); - - let mut attribution = AttributionMetrics { - source: Some("source".into()), - medium: Some("medium".into()), - campaign: Some("campaign".into()), - term: Some("term".into()), - content: Some("content".into()), - }; - let distribution = DistributionMetrics { - name: Some("name".into()), - }; - - // Set them all at once. - glean.update_attribution(attribution.clone()); - glean.update_distribution(distribution.clone()); - - assert_eq!(attribution, glean.test_get_attribution()); - assert_eq!(distribution, glean.test_get_distribution()); - - let attribution_update = AttributionMetrics { - campaign: Some("new campaign".into()), - ..Default::default() - }; - let distribution_update = DistributionMetrics { - name: Some("new name".into()), - }; - - // Perform updates. - glean.update_attribution(attribution_update); - glean.update_distribution(distribution_update.clone()); - - // Ensure only the updated fields took over - attribution.campaign = Some("new campaign".into()); - assert_eq!(attribution, glean.test_get_attribution()); - assert_eq!(distribution_update, glean.test_get_distribution()); -} - #[test] fn enabling_when_already_enabled_is_a_noop() { let dir = tempfile::tempdir().unwrap(); diff --git a/third_party/rust/glean-core/src/metrics/labeled.rs b/third_party/rust/glean-core/src/metrics/labeled.rs index fd15e4c18b84..4824a6999d00 100644 --- a/third_party/rust/glean-core/src/metrics/labeled.rs +++ b/third_party/rust/glean-core/src/metrics/labeled.rs @@ -17,7 +17,7 @@ use crate::Glean; const MAX_LABELS: usize = 16; const OTHER_LABEL: &str = "__other__"; -const MAX_LABEL_LENGTH: usize = 111; +const MAX_LABEL_LENGTH: usize = 71; /// A labeled counter. pub type LabeledCounter = LabeledMetric; @@ -265,7 +265,7 @@ where /// only the first 16 unique labels will be used. /// After that, any additional labels will be recorded under the special `OTHER_LABEL` label. /// - /// Labels must have a maximum of 111 characters, and may comprise any printable ASCII characters. + /// Labels must be `snake_case` and less than 30 characters. /// If an invalid label is used, the metric will be recorded in the special `OTHER_LABEL` label. pub fn get>(&self, label: S) -> Arc { let label = label.as_ref(); diff --git a/third_party/rust/glean-core/src/ping/mod.rs b/third_party/rust/glean-core/src/ping/mod.rs index cd52427c4747..089c38d8caf0 100644 --- a/third_party/rust/glean-core/src/ping/mod.rs +++ b/third_party/rust/glean-core/src/ping/mod.rs @@ -176,36 +176,8 @@ impl PingMaker { StorageManager.snapshot_as_json(glean.storage(), "glean_client_info", true) { let client_info_obj = client_info.as_object().unwrap(); // safe unwrap, snapshot always returns an object. - for (_metric_type, metrics) in client_info_obj { - merge(&mut map, metrics); - } - let map = map.as_object_mut().unwrap(); // safe unwrap, we created the object above. - let mut attribution = serde_json::Map::new(); - let mut distribution = serde_json::Map::new(); - map.retain(|name, value| { - // Only works because we ensure no client_info metric categories contain '.'. - let mut split = name.split('.'); - let category = split.next(); - let name = split.next(); - if let (Some(category), Some(name)) = (category, name) { - if category == "attribution" { - attribution.insert(name.into(), value.take()); - false - } else if category == "distribution" { - distribution.insert(name.into(), value.take()); - false - } else { - true - } - } else { - true - } - }); - if !attribution.is_empty() { - map.insert("attribution".into(), serde_json::Value::from(attribution)); - } - if !distribution.is_empty() { - map.insert("distribution".into(), serde_json::Value::from(distribution)); + for (_key, value) in client_info_obj { + merge(&mut map, value); } } else { log::warn!("Empty client info data."); diff --git a/third_party/rust/glean-core/src/traits/labeled.rs b/third_party/rust/glean-core/src/traits/labeled.rs index 54f937a23866..2979ee2ee901 100644 --- a/third_party/rust/glean-core/src/traits/labeled.rs +++ b/third_party/rust/glean-core/src/traits/labeled.rs @@ -21,7 +21,7 @@ where /// only the first 16 unique labels will be used. /// After that, any additional labels will be recorded under the special `OTHER_LABEL` label. /// - /// Labels must have a maximum of 111 characters, and may comprise any printable ASCII characters. + /// Labels must be `snake_case` and less than 30 characters. /// If an invalid label is used, the metric will be recorded in the special `OTHER_LABEL` label. fn get(&self, label: &str) -> T; diff --git a/third_party/rust/glean-core/tests/labeled.rs b/third_party/rust/glean-core/tests/labeled.rs index bd999c4d5151..69687d3737fb 100644 --- a/third_party/rust/glean-core/tests/labeled.rs +++ b/third_party/rust/glean-core/tests/labeled.rs @@ -387,7 +387,7 @@ fn dynamic_labels_too_long() { None, ); - let metric = labeled.get("1".repeat(112)); + let metric = labeled.get("1".repeat(72)); metric.add_sync(&glean, 1); let snapshot = StorageManager diff --git a/third_party/rust/glean-core/tests/ping_maker.rs b/third_party/rust/glean-core/tests/ping_maker.rs index 6cd15b62f475..2d51f648b4de 100644 --- a/third_party/rust/glean-core/tests/ping_maker.rs +++ b/third_party/rust/glean-core/tests/ping_maker.rs @@ -4,8 +4,6 @@ mod common; use crate::common::*; -use glean_core::{AttributionMetrics, DistributionMetrics}; -use serde_json::json; use glean_core::metrics::*; use glean_core::ping::PingMaker; @@ -308,69 +306,3 @@ fn metadata_is_correctly_added_when_necessary() { let headers = metadata.as_ref().unwrap().get("headers").unwrap(); assert_eq!(headers.get("X-Debug-ID").unwrap(), "valid-tag"); } - -#[test] -fn attribution_and_distribution_appear_in_client_info() { - let (glean, ping_maker, ping_type, _t) = set_up_basic_ping(); - - let attribution = AttributionMetrics { - source: Some("source".into()), - medium: Some("medium".into()), - campaign: Some("campaign".into()), - term: Some("term".into()), - content: Some("content".into()), - }; - let distribution = DistributionMetrics { - name: Some("name".into()), - }; - glean.update_attribution(attribution); - glean.update_distribution(distribution); - - let ping = ping_maker - .collect(&glean, &ping_type, None, "", "") - .unwrap(); - let client_info = ping.content["client_info"].as_object().unwrap(); - - assert_eq!(json!({"name": "name"}), client_info["distribution"]); - assert_eq!( - json!({ - "source": "source", - "medium": "medium", - "campaign": "campaign", - "term": "term", - "content": "content", - }), - client_info["attribution"] - ); - - // Now let's test updated values. - let attribution_update = AttributionMetrics { - content: Some("what a boring word".into()), - ..Default::default() - }; - let distribution_update = DistributionMetrics { - name: Some("what's in a name".into()), - }; - glean.update_attribution(attribution_update); - glean.update_distribution(distribution_update); - - let ping = ping_maker - .collect(&glean, &ping_type, None, "", "") - .unwrap(); - let client_info = ping.content["client_info"].as_object().unwrap(); - - assert_eq!( - json!({"name": "what's in a name"}), - client_info["distribution"] - ); - assert_eq!( - json!({ - "source": "source", - "medium": "medium", - "campaign": "campaign", - "term": "term", - "content": "what a boring word", - }), - client_info["attribution"] - ); -} diff --git a/third_party/rust/glean/.cargo-checksum.json b/third_party/rust/glean/.cargo-checksum.json index ad172ae53bd1..794bfa5e8c90 100644 --- a/third_party/rust/glean/.cargo-checksum.json +++ b/third_party/rust/glean/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.lock":"add20d32d164cac0a56ddac41468eaf0b23b9616f32e94a8434f5841d14b3a97","Cargo.toml":"99107d6ac4ef4ff33e2d206e8498875df879001e4621ba94e9d4ccf14267f39c","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"c86cccfb7da1506cfed29cb2ee13d839b7ac7cffdfd70793c9665bb44e0b684f","src/configuration.rs":"de65ab99a26b4547be20803bc195cb50a6ab40b1a3f49a2e6230fed5a9d7a8d8","src/core_metrics.rs":"fef8fb4e5fa57c179836c6eb2cf59278fe3b8b036dbe57b0ff02971b4acd822f","src/lib.rs":"998359d04ba0f71aaa360b8999c716f22c9efaf1ff4e1fdce80f1d3af5e584b0","src/net/http_uploader.rs":"0a94ac3cd87cb021529dee46d537765ab8d923e0f4ac7615225e878d3739e6dc","src/net/mod.rs":"09ba010b03d045fd8a2ccbe4f205c5275bb622bceb34cb81a0aa8f7d33804e2e","src/private/event.rs":"f299c79e4e2acb657f06004f3038bd8909e287719458566bc7f96262d8665e62","src/private/mod.rs":"66e90c41de74d1e80c5d3f49b8f1a86b8396be0b8c4a80f1a28903fe6d105ecf","src/private/object.rs":"7f17a7a658e8f7aa19a6bedf70f60f3f42713316d5d60298d682bb045caaafb7","src/private/ping.rs":"d2fb45e9e178ff6b17aa9c1b5258dfcd2ed91a2b43b44dec826de256ef5e8520","src/system.rs":"d602804a72258bfd65e51c571946631732ee27d81342d8aa406e47fdd241bbfa","src/test.rs":"8ff4d5072d23d9fbf5444e474d21b41a31e86a37e2a25fc2f2a92976e7642cbb","tests/collection_enabled.rs":"3327a949dbdeec493d661261abda68ffa71acc50ab24cba4fde5302749e6f16b","tests/collection_enabled_bin.rs":"d3a6458b84012a447e5cb792f2292a06951ed252fad803b9166b437bacba542c","tests/common/mod.rs":"2fd391c5eb45f56fdfa3261dd631406c67ed36b10b0d5432febe2483da5c9d89","tests/custom_distribution_buffered.rs":"47c13d1f39adf3881e10caa19e0c08235f08958809e234bf37a79d37d7322cd5","tests/init_fails.rs":"ca7fa1b3dd6a21a9e005b7a4f0a18664c4bceb952dd463db8316500f72280d5b","tests/interruptible_shutdown.rs":"3d954bbe47d4f5fd103c51a4ff99f151662143c25c826da9734a00cd215909b9","tests/memory_distribution_buffered.rs":"db487475a5cf17a0864ccf150984ebdd28bf616573772cf678246cc1bdbcbc0f","tests/metric_metadata.rs":"05c947d3decf0a3281378dbb108080a05319ad8f130af5b07f9b049b80e5f04f","tests/near-empty-c0ffee-db.safe.bin":"89afb3bb8fc94430fb0ed0fe55f85f3f8bcc8fd0fed69a9df13cc560294ec9f5","tests/never_init.rs":"51fff5618f6603bc0945d70131698d10a1c6275f43bbc22a2de5807f8a79229f","tests/no_time_to_init.rs":"2ede23df6618ff1cb5ae3b7bbf95900ad0fd92072afa2e0319bf147b4f75cefc","tests/overflowing_preinit.rs":"985e140460a100986fd051ce901b787a3a7a9747a856cd06066b740ac7d2381c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"23b49005402b914e55a0c5c155f30c2662c609f79be78d1385ec25b3600b3547","tests/simple.rs":"15c76a1b5a336fd6abfbdebafc971f5c6a9b75107ddbca65f0031cde3e2886da","tests/test-delayed-ping-data.sh":"4a6db98b4df6b77898ace6a8b4e8b4c60d3e5c44873bbf38c62e83583e27a3ff","tests/test-enabled-pings.sh":"06656e38f63e65475006b107dd6bd179b0cbaa1fad1470de38e679e91a9315a3","tests/test-pending-gets-removed.sh":"e335f2f00fa97a61b6d94e0005fb3b9de8c8db8076111a67ca47d85392039ea9","tests/test-ping-lifetime-flush.sh":"e8f118ea2f6fd973809e38d5e828a03cfccfe0b0f497ccde5ec92d6d1380c071","tests/test-shutdown-blocking.sh":"a44d8d4bbe2ee3ede9e48121150ae7a5386025160c5cef2181ca142232c5fb27","tests/test-thread-crashing.sh":"f3cd0cc8a7b4fe82bef0fe6fbfbbe45fbad6da3afe0f82578bc5cfb2d6527ac6","tests/timing_distribution_buffered.rs":"501f7289c0c28f0ab83838c88b058999b19436d0f2b693be0787513d7b67e06d","tests/timing_distribution_single_sample.rs":"4f9498b6ef29913da0356027efe5f572c81d2f426e8538c068b54a1cfa33c1b8","tests/upload_timing.rs":"b3b9db197bc2ec41556388969a6bf289e7ef19e05b9019bc2bd98c823fcf6ea3","tests/uploader_capabilities.rs":"347f19e534a50a211ea179d6818631270d1b4ec468098e6b6abcde1e4a6a9bca"},"package":"95024f4707705270208e36983976cbac235dd7fc33c9f1cb0dee396ec1ce295d"} \ No newline at end of file +{"files":{"Cargo.lock":"61c7d6620026e84a7bb067305d92ffb8c51a59261c339d3ef6a8406d03bbfd92","Cargo.toml":"bec966c61ac0670d367556c54f9156aad7b2cd72dce2d09c783fdf421f49c563","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"c86cccfb7da1506cfed29cb2ee13d839b7ac7cffdfd70793c9665bb44e0b684f","src/configuration.rs":"de65ab99a26b4547be20803bc195cb50a6ab40b1a3f49a2e6230fed5a9d7a8d8","src/core_metrics.rs":"fef8fb4e5fa57c179836c6eb2cf59278fe3b8b036dbe57b0ff02971b4acd822f","src/lib.rs":"61b56a35c2bc6cd60bba2225b399881512d4b9a7d8cadca7fbed37ee6959d74c","src/net/http_uploader.rs":"0a94ac3cd87cb021529dee46d537765ab8d923e0f4ac7615225e878d3739e6dc","src/net/mod.rs":"09ba010b03d045fd8a2ccbe4f205c5275bb622bceb34cb81a0aa8f7d33804e2e","src/private/event.rs":"f299c79e4e2acb657f06004f3038bd8909e287719458566bc7f96262d8665e62","src/private/mod.rs":"66e90c41de74d1e80c5d3f49b8f1a86b8396be0b8c4a80f1a28903fe6d105ecf","src/private/object.rs":"7f17a7a658e8f7aa19a6bedf70f60f3f42713316d5d60298d682bb045caaafb7","src/private/ping.rs":"d2fb45e9e178ff6b17aa9c1b5258dfcd2ed91a2b43b44dec826de256ef5e8520","src/system.rs":"d602804a72258bfd65e51c571946631732ee27d81342d8aa406e47fdd241bbfa","src/test.rs":"bfbea9416dfdc96ebc1f9af5005b5b23f2285b74ef82c74cdab11635322ea3e3","tests/collection_enabled.rs":"3327a949dbdeec493d661261abda68ffa71acc50ab24cba4fde5302749e6f16b","tests/collection_enabled_bin.rs":"d3a6458b84012a447e5cb792f2292a06951ed252fad803b9166b437bacba542c","tests/common/mod.rs":"2fd391c5eb45f56fdfa3261dd631406c67ed36b10b0d5432febe2483da5c9d89","tests/custom_distribution_buffered.rs":"47c13d1f39adf3881e10caa19e0c08235f08958809e234bf37a79d37d7322cd5","tests/init_fails.rs":"ca7fa1b3dd6a21a9e005b7a4f0a18664c4bceb952dd463db8316500f72280d5b","tests/interruptible_shutdown.rs":"3d954bbe47d4f5fd103c51a4ff99f151662143c25c826da9734a00cd215909b9","tests/memory_distribution_buffered.rs":"db487475a5cf17a0864ccf150984ebdd28bf616573772cf678246cc1bdbcbc0f","tests/metric_metadata.rs":"05c947d3decf0a3281378dbb108080a05319ad8f130af5b07f9b049b80e5f04f","tests/near-empty-c0ffee-db.safe.bin":"89afb3bb8fc94430fb0ed0fe55f85f3f8bcc8fd0fed69a9df13cc560294ec9f5","tests/never_init.rs":"51fff5618f6603bc0945d70131698d10a1c6275f43bbc22a2de5807f8a79229f","tests/no_time_to_init.rs":"2ede23df6618ff1cb5ae3b7bbf95900ad0fd92072afa2e0319bf147b4f75cefc","tests/overflowing_preinit.rs":"985e140460a100986fd051ce901b787a3a7a9747a856cd06066b740ac7d2381c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"23b49005402b914e55a0c5c155f30c2662c609f79be78d1385ec25b3600b3547","tests/simple.rs":"15c76a1b5a336fd6abfbdebafc971f5c6a9b75107ddbca65f0031cde3e2886da","tests/test-delayed-ping-data.sh":"4a6db98b4df6b77898ace6a8b4e8b4c60d3e5c44873bbf38c62e83583e27a3ff","tests/test-enabled-pings.sh":"06656e38f63e65475006b107dd6bd179b0cbaa1fad1470de38e679e91a9315a3","tests/test-pending-gets-removed.sh":"e335f2f00fa97a61b6d94e0005fb3b9de8c8db8076111a67ca47d85392039ea9","tests/test-ping-lifetime-flush.sh":"e8f118ea2f6fd973809e38d5e828a03cfccfe0b0f497ccde5ec92d6d1380c071","tests/test-shutdown-blocking.sh":"a44d8d4bbe2ee3ede9e48121150ae7a5386025160c5cef2181ca142232c5fb27","tests/test-thread-crashing.sh":"f3cd0cc8a7b4fe82bef0fe6fbfbbe45fbad6da3afe0f82578bc5cfb2d6527ac6","tests/timing_distribution_buffered.rs":"501f7289c0c28f0ab83838c88b058999b19436d0f2b693be0787513d7b67e06d","tests/timing_distribution_single_sample.rs":"4f9498b6ef29913da0356027efe5f572c81d2f426e8538c068b54a1cfa33c1b8","tests/upload_timing.rs":"b3b9db197bc2ec41556388969a6bf289e7ef19e05b9019bc2bd98c823fcf6ea3","tests/uploader_capabilities.rs":"347f19e534a50a211ea179d6818631270d1b4ec468098e6b6abcde1e4a6a9bca"},"package":"251b9cb685554b96dcf785dba69ce90447006dd6d9229db783336c981c3777e1"} \ No newline at end of file diff --git a/third_party/rust/glean/Cargo.lock b/third_party/rust/glean/Cargo.lock index 012b87a0b217..728b31a6e9d5 100644 --- a/third_party/rust/glean/Cargo.lock +++ b/third_party/rust/glean/Cargo.lock @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "glean" -version = "64.1.1" +version = "64.0.1" dependencies = [ "crossbeam-channel", "env_logger", @@ -260,9 +260,9 @@ dependencies = [ [[package]] name = "glean-core" -version = "64.1.1" +version = "64.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0df94fb37669287b77e8aa300913ad1d14426d7f9e443b0ce1185349c817e" +checksum = "a49d1d62648ddeed8cb996373046ea45de93f1d1ff956aba054b9304bc305753" dependencies = [ "android_logger", "bincode", diff --git a/third_party/rust/glean/Cargo.toml b/third_party/rust/glean/Cargo.toml index 4af49a88becf..7b7c3937b8fe 100644 --- a/third_party/rust/glean/Cargo.toml +++ b/third_party/rust/glean/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.82" name = "glean" -version = "64.1.1" +version = "64.0.1" authors = [ "Jan-Erik Rediger ", "The Glean Team ", @@ -115,7 +115,7 @@ path = "tests/uploader_capabilities.rs" version = "0.5" [dependencies.glean-core] -version = "64.1.1" +version = "64.0.1" [dependencies.inherent] version = "1" diff --git a/third_party/rust/glean/src/lib.rs b/third_party/rust/glean/src/lib.rs index 62ec3204014f..d0fd006dbf35 100644 --- a/third_party/rust/glean/src/lib.rs +++ b/third_party/rust/glean/src/lib.rs @@ -39,8 +39,8 @@ pub use glean_core::{ Datetime, DistributionData, MemoryUnit, MetricIdentifier, Rate, RecordedEvent, TimeUnit, TimerId, }, - traits, AttributionMetrics, CommonMetricData, DistributionMetrics, Error, ErrorType, Glean, - HistogramType, LabeledMetricData, Lifetime, PingRateLimit, RecordedExperiment, Result, + traits, CommonMetricData, Error, ErrorType, Glean, HistogramType, LabeledMetricData, Lifetime, + PingRateLimit, RecordedExperiment, Result, }; mod configuration; @@ -356,31 +356,5 @@ pub fn get_registered_ping_names() -> Vec { glean_core::glean_get_registered_ping_names() } -/// Updates attribution fields with new values. -/// AttributionMetrics fields with `None` values will not overwrite older values. -pub fn update_attribution(attribution: AttributionMetrics) { - glean_core::glean_update_attribution(attribution); -} - -/// **TEST-ONLY Method** -/// -/// Returns the current attribution metrics. -pub fn test_get_attribution() -> AttributionMetrics { - glean_core::glean_test_get_attribution() -} - -/// Updates distribution fields with new values. -/// DistributionMetrics fields with `None` values will not overwrite older values. -pub fn update_distribution(distribution: DistributionMetrics) { - glean_core::glean_update_distribution(distribution); -} - -/// **TEST-ONLY Method** -/// -/// Returns the current distribution metrics. -pub fn test_get_distribution() -> DistributionMetrics { - glean_core::glean_test_get_distribution() -} - #[cfg(test)] mod test; diff --git a/third_party/rust/glean/src/test.rs b/third_party/rust/glean/src/test.rs index 72e766d68a60..d7e1c668c12b 100644 --- a/third_party/rust/glean/src/test.rs +++ b/third_party/rust/glean/src/test.rs @@ -1501,49 +1501,3 @@ fn pings_ride_along_builtin_pings() { let url = r.recv().unwrap(); assert!(url.contains("ride-along")); } - -#[test] -fn test_attribution_and_distribution_updates_before_glean_inits() { - let _lock = lock_test(); - let dir = tempfile::tempdir().unwrap(); - let tmpname = dir.path().to_path_buf(); - - destroy_glean(true, &tmpname); - - // No Glean, let's set and update some attribution + distribution. - let mut attribution = AttributionMetrics { - source: Some("source".into()), - medium: Some("medium".into()), - campaign: Some("campaign".into()), - term: Some("term".into()), - content: Some("content".into()), - }; - let distribution = DistributionMetrics { - name: Some("name".into()), - }; - update_attribution(attribution.clone()); - update_distribution(distribution); - - let attribution_update = AttributionMetrics { - term: Some("new term".into()), - ..Default::default() - }; - let distribution_update = DistributionMetrics { - name: Some("different name".into()), - }; - update_attribution(attribution_update); - update_distribution(distribution_update.clone()); - - test_reset_glean( - ConfigurationBuilder::new(true, tmpname, GLOBAL_APPLICATION_ID) - .with_server_endpoint("invalid-test-host") - .build(), - ClientInfoMetrics::unknown(), - false, - ); - - // Ensure the updated attribution + distribution are correctly stored. - attribution.term = Some("new term".into()); - assert_eq!(attribution, test_get_attribution()); - assert_eq!(distribution_update, test_get_distribution()); -} diff --git a/toolkit/components/glean/api/src/private/labeled.rs b/toolkit/components/glean/api/src/private/labeled.rs index 662a32ce65ec..c1b32933fd5e 100644 --- a/toolkit/components/glean/api/src/private/labeled.rs +++ b/toolkit/components/glean/api/src/private/labeled.rs @@ -587,7 +587,7 @@ mod test { None, ); - metric.get(&"1".repeat(112)).set(true); + metric.get(&"1".repeat(72)).set(true); assert_eq!( 1, diff --git a/toolkit/components/glean/bindings/private/Labeled.h b/toolkit/components/glean/bindings/private/Labeled.h index 8602f541c95c..05e9e602abec 100644 --- a/toolkit/components/glean/bindings/private/Labeled.h +++ b/toolkit/components/glean/bindings/private/Labeled.h @@ -407,11 +407,11 @@ class Labeled { TimingDistributionMetric MaybeTruncateAndGet(const nsACString& aLabel) const { // bug 1959765 is for incorporating this behaviour into the SDK. - if (aLabel.Length() < 112) { + if (aLabel.Length() < 72) { // bug 1959696 will up this to 112. return Get(aLabel); } - nsAutoCStringN<111> truncated; - truncated.Append(aLabel.BeginReading(), 108); + nsAutoCStringN<71> truncated; // bug 1959696 will up this to 111. + truncated.Append(aLabel.BeginReading(), 68); truncated += "..."; return Get(truncated); } diff --git a/toolkit/components/glean/metrics_index.py b/toolkit/components/glean/metrics_index.py index 95c8d9e2c003..b33ffa41b9bb 100644 --- a/toolkit/components/glean/metrics_index.py +++ b/toolkit/components/glean/metrics_index.py @@ -112,7 +112,6 @@ gecko_metrics = [ firefox_desktop_metrics = [ "browser/actors/metrics.yaml", "browser/components/asrouter/metrics.yaml", - "browser/components/attribution/metrics.yaml", "browser/components/backup/metrics.yaml", "browser/components/doh/metrics.yaml", "browser/components/downloads/metrics.yaml", diff --git a/toolkit/components/glean/src/lib.rs b/toolkit/components/glean/src/lib.rs index 69e6df7f1631..f14155c184d6 100644 --- a/toolkit/components/glean/src/lib.rs +++ b/toolkit/components/glean/src/lib.rs @@ -36,8 +36,6 @@ mod init; pub use init::fog_init; -use glean::{AttributionMetrics, DistributionMetrics}; - #[no_mangle] pub extern "C" fn fog_shutdown() { glean::shutdown(); @@ -270,95 +268,3 @@ pub extern "C" fn fog_apply_serverknobs(serverknobs_path: &nsAString) -> bool { true } - -#[repr(C)] -pub struct FogAttributionMetrics { - source: nsCString, - medium: nsCString, - campaign: nsCString, - term: nsCString, - content: nsCString, -} - -impl FogAttributionMetrics { - fn take(&mut self, other: AttributionMetrics) { - if let Some(source) = other.source { - self.source = source.into(); - } - if let Some(medium) = other.medium { - self.medium = medium.into(); - } - if let Some(campaign) = other.campaign { - self.campaign = campaign.into(); - } - if let Some(term) = other.term { - self.term = term.into(); - } - if let Some(content) = other.content { - self.content = content.into(); - } - } -} - -impl From<&FogAttributionMetrics> for AttributionMetrics { - fn from(value: &FogAttributionMetrics) -> Self { - let to_opt_string = |s: &nsCString| { - if s.is_empty() { - None - } else { - Some(s.to_utf8().into_owned()) - } - }; - - AttributionMetrics { - source: to_opt_string(&value.source), - medium: to_opt_string(&value.medium), - campaign: to_opt_string(&value.campaign), - term: to_opt_string(&value.term), - content: to_opt_string(&value.content), - } - } -} - -#[repr(C)] -pub struct FogDistributionMetrics { - name: nsCString, -} - -impl FogDistributionMetrics { - fn take(&mut self, other: DistributionMetrics) { - if let Some(name) = other.name { - self.name = name.into(); - } - } -} - -impl From<&FogDistributionMetrics> for DistributionMetrics { - fn from(value: &FogDistributionMetrics) -> Self { - let name = if value.name.is_empty() { - None - } else { - Some(value.name.to_utf8().into_owned()) - }; - DistributionMetrics { name } - } -} -#[no_mangle] -pub extern "C" fn fog_update_attribution(attr: &FogAttributionMetrics) { - glean::update_attribution(attr.into()); -} - -#[no_mangle] -pub extern "C" fn fog_test_get_attribution(value: &mut FogAttributionMetrics) { - value.take(glean::test_get_attribution()); -} - -#[no_mangle] -pub extern "C" fn fog_update_distribution(dist: &FogDistributionMetrics) { - glean::update_distribution(dist.into()); -} - -#[no_mangle] -pub extern "C" fn fog_test_get_distribution(value: &mut FogDistributionMetrics) { - value.take(glean::test_get_distribution()); -} diff --git a/toolkit/components/glean/tests/browser/browser_labeled_gifft.js b/toolkit/components/glean/tests/browser/browser_labeled_gifft.js index bf6d45ed8690..a6b5761c9805 100644 --- a/toolkit/components/glean/tests/browser/browser_labeled_gifft.js +++ b/toolkit/components/glean/tests/browser/browser_labeled_gifft.js @@ -30,7 +30,7 @@ add_task(async () => { undefined, Glean.testOnlyIpc.aLabeledCounter.__other__.testGetValue() ); - Glean.testOnlyIpc.aLabeledCounter["1".repeat(112)].add(3); + Glean.testOnlyIpc.aLabeledCounter["1".repeat(72)].add(3); Assert.throws( () => Glean.testOnlyIpc.aLabeledCounter.__other__.testGetValue(), /DataError/, @@ -44,6 +44,7 @@ add_task(async () => { { a_label: 1, another_label: 2, + ["1".repeat(72)]: 3, }, value ); diff --git a/toolkit/components/glean/tests/gtest/TestFog.cpp b/toolkit/components/glean/tests/gtest/TestFog.cpp index a1be564e77d9..62b95acf63c9 100644 --- a/toolkit/components/glean/tests/gtest/TestFog.cpp +++ b/toolkit/components/glean/tests/gtest/TestFog.cpp @@ -609,8 +609,9 @@ TEST_F(FOGFixture, TestLabeledTimingDistWorks) { } TEST_F(FOGFixture, TestLabeledTimingDistTruncateGet) { + // Note that bug 1959696 will up this limit to 111. auto longKey = - "this is a label that is longer than the new label limit of 111 characters introduced in bug 1959696 in April of 2025."_ns; + "this is a key that is longer than the present limit of 71 characters ok?"_ns; auto sec = TimeDuration::FromMilliseconds(1); test_only::where_has_the_time_gone.MaybeTruncateAndGet(longKey) diff --git a/toolkit/components/glean/tests/xpcshell/test_AttributionDistribution.js b/toolkit/components/glean/tests/xpcshell/test_AttributionDistribution.js deleted file mode 100644 index 9e152fd624e9..000000000000 --- a/toolkit/components/glean/tests/xpcshell/test_AttributionDistribution.js +++ /dev/null @@ -1,69 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -const { AppConstants } = ChromeUtils.importESModule( - "resource://gre/modules/AppConstants.sys.mjs" -); - -add_setup( - /* on Android FOG is set up through head.js */ - { skip_if: () => AppConstants.platform == "android" }, - function test_setup() { - // FOG needs a profile directory to put its data in. - do_get_profile(); - - // We need to initialize it once, otherwise operations will be stuck in the pre-init queue. - Services.fog.initializeFOG(); - } -); - -add_task(function test_attribution_works() { - // Ensure we aren't racing Glean init. - // (Remove upon vendoring of a fix to bug 1959515). - Glean.testOnly.balloons.testGetValue(); - - let attr = Services.fog.testGetAttribution(); - Assert.deepEqual( - attr, - { - source: null, - medium: null, - campaign: null, - term: null, - content: null, - }, - "Initial attribution should be empty." - ); - - Services.fog.updateAttribution("source", null, "campaign", null, "content"); - - let expected = { - source: "source", - medium: null, - campaign: "campaign", - term: null, - content: "content", - }; - attr = Services.fog.testGetAttribution(); - Assert.deepEqual(attr, expected, "Must give what it got."); -}); - -add_task(function test_distribution_works() { - // Ensure we aren't racing Glean init. - // (Remove upon vendoring of a fix to bug 1959515). - Glean.testOnly.balloons.testGetValue(); - - let dist = Services.fog.testGetDistribution(); - Assert.deepEqual( - dist, - { name: null }, - "Initial distribution should be empty." - ); - - Services.fog.updateDistribution("name"); - - dist = Services.fog.testGetDistribution(); - Assert.deepEqual(dist, { name: "name" }, "Must give what it got."); -}); diff --git a/toolkit/components/glean/tests/xpcshell/test_GIFFT.js b/toolkit/components/glean/tests/xpcshell/test_GIFFT.js index 004d83a5fdca..cd12c2cc21e2 100644 --- a/toolkit/components/glean/tests/xpcshell/test_GIFFT.js +++ b/toolkit/components/glean/tests/xpcshell/test_GIFFT.js @@ -318,7 +318,7 @@ add_task(function test_gifft_labeled_counter() { undefined, Glean.testOnlyIpc.aLabeledCounter.__other__.testGetValue() ); - Glean.testOnlyIpc.aLabeledCounter["1".repeat(112)].add(3); + Glean.testOnlyIpc.aLabeledCounter["1".repeat(72)].add(3); Assert.throws( () => Glean.testOnlyIpc.aLabeledCounter.__other__.testGetValue(), /DataError/, @@ -332,6 +332,7 @@ add_task(function test_gifft_labeled_counter() { { a_label: 4, another_label: 2, + ["1".repeat(72)]: 3, }, value ); @@ -496,7 +497,7 @@ add_task(async function test_gifft_labeled_boolean() { undefined, Glean.testOnly.mirrorsForLabeledBools.__other__.testGetValue() ); - Glean.testOnly.mirrorsForLabeledBools["1".repeat(112)].set(true); + Glean.testOnly.mirrorsForLabeledBools["1".repeat(72)].set(true); Assert.throws( () => Glean.testOnly.mirrorsForLabeledBools.__other__.testGetValue(), /DataError/, @@ -509,6 +510,7 @@ add_task(async function test_gifft_labeled_boolean() { { a_label: true, another_label: false, + ["1".repeat(72)]: true, }, value ); @@ -807,7 +809,7 @@ add_task(async function test_gifft_labeled_quantity() { Assert.equal(1, Glean.testOnly.buttonJars.whoseGot.testGetValue()); // What about invalid/__other__? Assert.equal(undefined, Glean.testOnly.buttonJars.__other__.testGetValue()); - Glean.testOnly.buttonJars["1".repeat(112)].set(9000); + Glean.testOnly.buttonJars["1".repeat(72)].set(9000); Assert.throws( () => Glean.testOnly.buttonJars.__other__.testGetValue(), /DataError/, @@ -821,6 +823,7 @@ add_task(async function test_gifft_labeled_quantity() { { pants: 42, whoseGot: 1, + ["1".repeat(72)]: 9000, }, value ); diff --git a/toolkit/components/glean/tests/xpcshell/test_GIFFTIPC.js b/toolkit/components/glean/tests/xpcshell/test_GIFFTIPC.js index dff784fc2b55..f6621ac1cda0 100644 --- a/toolkit/components/glean/tests/xpcshell/test_GIFFTIPC.js +++ b/toolkit/components/glean/tests/xpcshell/test_GIFFTIPC.js @@ -103,9 +103,7 @@ add_task({ skip_if: () => runningInParent }, async function run_child_stuff() { // Has to be different from aLabeledCounter so the error we record doesn't // get in the way. - Glean.testOnlyIpc.anotherLabeledCounter["1".repeat(112)].add( - INVALID_COUNTERS - ); + Glean.testOnlyIpc.anotherLabeledCounter["1".repeat(72)].add(INVALID_COUNTERS); Glean.testOnlyIpc.aLabeledCounterForHgram.true.add(1); Glean.testOnlyIpc.aLabeledCounterForHgram.false.add(1); @@ -279,7 +277,12 @@ add_task( "telemetry.test.mirror_for_labeled_counter", "content" ); - Assert.deepEqual(undefined, value); + Assert.deepEqual( + { + ["1".repeat(72)]: INVALID_COUNTERS, + }, + value + ); const boolHgramCounters = Glean.testOnlyIpc.aLabeledCounterForHgram; Assert.equal(boolHgramCounters.true.testGetValue(), 1); diff --git a/toolkit/components/glean/tests/xpcshell/test_Glean.js b/toolkit/components/glean/tests/xpcshell/test_Glean.js index cc05538a3411..927939839267 100644 --- a/toolkit/components/glean/tests/xpcshell/test_Glean.js +++ b/toolkit/components/glean/tests/xpcshell/test_Glean.js @@ -321,7 +321,7 @@ add_task(async function test_fog_labels_conform() { "wednesday", Glean.testOnly.mabelsLabelMaker.camelCase.testGetValue() ); - const veryLong = "1".repeat(112); + const veryLong = "1".repeat(72); Glean.testOnly.mabelsLabelMaker[veryLong].set("seventy-two"); Assert.throws( () => Glean.testOnly.mabelsLabelMaker[veryLong].testGetValue(), @@ -358,7 +358,7 @@ add_task(async function test_fog_labeled_boolean_works() { undefined, Glean.testOnly.mabelsLikeBalloons.__other__.testGetValue() ); - Glean.testOnly.mabelsLikeBalloons["1".repeat(112)].set(true); + Glean.testOnly.mabelsLikeBalloons["1".repeat(72)].set(true); Assert.throws( () => Glean.testOnly.mabelsLikeBalloons.__other__.testGetValue(), /DataError/, @@ -387,7 +387,7 @@ add_task(async function test_fog_labeled_counter_works() { undefined, Glean.testOnly.mabelsKitchenCounters.__other__.testGetValue() ); - Glean.testOnly.mabelsKitchenCounters["1".repeat(112)].add(1); + Glean.testOnly.mabelsKitchenCounters["1".repeat(72)].add(1); Assert.throws( () => Glean.testOnly.mabelsKitchenCounters.__other__.testGetValue(), /DataError/, @@ -416,7 +416,7 @@ add_task(async function test_fog_labeled_string_works() { undefined, Glean.testOnly.mabelsBalloonStrings.__other__.testGetValue() ); - Glean.testOnly.mabelsBalloonStrings["1".repeat(112)].set("valid"); + Glean.testOnly.mabelsBalloonStrings["1".repeat(72)].set("valid"); Assert.throws( () => Glean.testOnly.mabelsBalloonStrings.__other__.testGetValue(), /DataError/ @@ -715,7 +715,7 @@ add_task(async function test_fog_labeled_custom_distribution_works() { Glean.testOnly.mabelsCustomLabelLengths.__other__.testGetValue() ); Glean.testOnly.mabelsCustomLabelLengths[ - "1".repeat(112) + "1".repeat(72) ].accumulateSingleSample(3); Assert.throws( () => Glean.testOnly.mabelsCustomLabelLengths.__other__.testGetValue(), @@ -786,7 +786,7 @@ add_task(async function test_fog_labeled_quantity_works() { Assert.equal(0, Glean.testOnly.buttonJars.curling.testGetValue()); // What about invalid/__other__? Assert.equal(undefined, Glean.testOnly.buttonJars.__other__.testGetValue()); - Glean.testOnly.buttonJars["1".repeat(112)].set(0); + Glean.testOnly.buttonJars["1".repeat(72)].set(0); Assert.throws( () => Glean.testOnly.buttonJars.__other__.testGetValue(), /DataError/, diff --git a/toolkit/components/glean/tests/xpcshell/test_GleanIPC.js b/toolkit/components/glean/tests/xpcshell/test_GleanIPC.js index 691ef017e613..7090d2027f73 100644 --- a/toolkit/components/glean/tests/xpcshell/test_GleanIPC.js +++ b/toolkit/components/glean/tests/xpcshell/test_GleanIPC.js @@ -72,7 +72,7 @@ add_task({ skip_if: () => runningInParent }, async function run_child_stuff() { COUNTERS_WITH_JUNK_ON_THEM ); - Glean.testOnly.mabelsBathroomCounters["1".repeat(112)].add(INVALID_COUNTERS); + Glean.testOnly.mabelsBathroomCounters["1".repeat(72)].add(INVALID_COUNTERS); Glean.testOnlyIpc.irate.addToNumerator(44); Glean.testOnlyIpc.irate.addToDenominator(14); diff --git a/toolkit/components/glean/tests/xpcshell/test_JOG.js b/toolkit/components/glean/tests/xpcshell/test_JOG.js index 48fc04b7d1c9..610bb7bab9e1 100644 --- a/toolkit/components/glean/tests/xpcshell/test_JOG.js +++ b/toolkit/components/glean/tests/xpcshell/test_JOG.js @@ -379,7 +379,7 @@ add_task(async function test_jog_labeled_boolean_works() { Assert.equal(undefined, Glean.jogCat.jogLabeledBool.__other__.testGetValue()); Glean.jogCat.jogLabeledBool.NowValidLabel.set(true); Assert.ok(Glean.jogCat.jogLabeledBool.NowValidLabel.testGetValue()); - Glean.jogCat.jogLabeledBool["1".repeat(112)].set(true); + Glean.jogCat.jogLabeledBool["1".repeat(72)].set(true); Assert.throws( () => Glean.jogCat.jogLabeledBool.__other__.testGetValue(), /DataError/, @@ -448,7 +448,7 @@ add_task(async function test_jog_labeled_counter_works() { undefined, Glean.jogCat.jogLabeledCounter.__other__.testGetValue() ); - Glean.jogCat.jogLabeledCounter["1".repeat(112)].add(1); + Glean.jogCat.jogLabeledCounter["1".repeat(72)].add(1); Assert.throws( () => Glean.jogCat.jogLabeledCounter.__other__.testGetValue(), /DataError/, @@ -486,7 +486,7 @@ add_task(async function test_jog_labeled_counter_with_static_labels_works() { undefined, Glean.jogCat.jogLabeledCounterWithLabels.__other__.testGetValue() ); - Glean.jogCat.jogLabeledCounterWithLabels["1".repeat(112)].add(1); + Glean.jogCat.jogLabeledCounterWithLabels["1".repeat(72)].add(1); // TODO:(bug 1766515) - This should throw. /*Assert.throws( () => Glean.jogCat.jogLabeledCounterWithLabels.__other__.testGetValue(), @@ -522,7 +522,7 @@ add_task(async function test_jog_labeled_string_works() { undefined, Glean.jogCat.jogLabeledString.__other__.testGetValue() ); - Glean.jogCat.jogLabeledString["1".repeat(112)].set("valid"); + Glean.jogCat.jogLabeledString["1".repeat(72)].set("valid"); Assert.throws( () => Glean.jogCat.jogLabeledString.__other__.testGetValue(), /DataError/ @@ -559,7 +559,7 @@ add_task(async function test_jog_labeled_string_with_labels_works() { undefined, Glean.jogCat.jogLabeledStringWithLabels.__other__.testGetValue() ); - Glean.jogCat.jogLabeledStringWithLabels["1".repeat(112)].set("valid"); + Glean.jogCat.jogLabeledStringWithLabels["1".repeat(72)].set("valid"); // TODO:(bug 1766515) - This should throw. /*Assert.throws( () => Glean.jogCat.jogLabeledStringWithLabels.__other__.testGetValue(), @@ -898,7 +898,7 @@ add_task(async function test_jog_labeled_quantity_works() { 100, Glean.jogCat.jogLabeledQuantity.NowValidLabel.testGetValue() ); - Glean.jogCat.jogLabeledQuantity["1".repeat(112)].set(true); + Glean.jogCat.jogLabeledQuantity["1".repeat(72)].set(true); Assert.throws( () => Glean.jogCat.jogLabeledQuantity.__other__.testGetValue(), /DataError/, diff --git a/toolkit/components/glean/tests/xpcshell/test_JOGIPC.js b/toolkit/components/glean/tests/xpcshell/test_JOGIPC.js index 233edad4924f..f8954ac8a12a 100644 --- a/toolkit/components/glean/tests/xpcshell/test_JOGIPC.js +++ b/toolkit/components/glean/tests/xpcshell/test_JOGIPC.js @@ -207,12 +207,12 @@ add_task({ skip_if: () => runningInParent }, async function run_child_stuff() { Glean.jogIpc.jogLabeledCounter.label_1.add(COUNTERS_1); Glean.jogIpc.jogLabeledCounter.label_2.add(COUNTERS_2); - Glean.jogIpc.jogLabeledCounterErr["1".repeat(112)].add(INVALID_COUNTERS); + Glean.jogIpc.jogLabeledCounterErr["1".repeat(72)].add(INVALID_COUNTERS); Glean.jogIpc.jogLabeledCounterWithLabels.label_1.add(COUNTERS_1); Glean.jogIpc.jogLabeledCounterWithLabels.label_2.add(COUNTERS_2); - Glean.jogIpc.jogLabeledCounterWithLabelsErr["1".repeat(112)].add( + Glean.jogIpc.jogLabeledCounterWithLabelsErr["1".repeat(72)].add( INVALID_COUNTERS ); diff --git a/toolkit/components/glean/tests/xpcshell/xpcshell.toml b/toolkit/components/glean/tests/xpcshell/xpcshell.toml index 509572bf856d..ccb7e8fcbb6d 100644 --- a/toolkit/components/glean/tests/xpcshell/xpcshell.toml +++ b/toolkit/components/glean/tests/xpcshell/xpcshell.toml @@ -2,9 +2,6 @@ firefox-appdir = "browser" head = "head.js" -["test_AttributionDistribution.js"] -skip-if = ["os == 'android'"] # FOG isn't responsible for attribution/distribution on Android. - ["test_FOGIPCLimit.js"] ["test_FOGInit.js"] diff --git a/toolkit/components/glean/xpcom/FOG.cpp b/toolkit/components/glean/xpcom/FOG.cpp index 1c5253c07951..cebfe247f3f6 100644 --- a/toolkit/components/glean/xpcom/FOG.cpp +++ b/toolkit/components/glean/xpcom/FOG.cpp @@ -76,11 +76,6 @@ already_AddRefed FOG::GetSingleton() { nsresult rv; nsCOMPtr idleService = do_GetService("@mozilla.org/widget/useridleservice;1", &rv); - if (NS_FAILED(rv) && xpc::IsInAutomation()) { - // bug 1955429: In some tests the idle service is unavailable. - // They aren't even testing FOG, so let it slide. - return do_AddRef(gFOG); - } NS_ENSURE_SUCCESS(rv, nullptr); MOZ_ASSERT(idleService); if (NS_WARN_IF(NS_FAILED(idleService->AddIdleObserver(gFOG, kIdleSecs)))) { @@ -493,138 +488,6 @@ FOG::TestRegisterRuntimePing( return NS_OK; } -NS_IMETHODIMP -FOG::UpdateAttribution(const nsACString& aSource, const nsACString& aMedium, - const nsACString& aCampaign, const nsACString& aTerm, - const nsACString& aContent) { - MOZ_ASSERT(XRE_IsParentProcess()); - glean::impl::FogAttributionMetrics attr{.source = nsCString(aSource), - .medium = nsCString(aMedium), - .campaign = nsCString(aCampaign), - .term = nsCString(aTerm), - .content = nsCString(aContent)}; - glean::impl::fog_update_attribution(&attr); - return NS_OK; -} - -NS_IMETHODIMP -FOG::TestGetAttribution(JSContext* aCx, JS::MutableHandleValue aResult) { -#ifdef MOZ_GLEAN_ANDROID - NS_WARNING("Don't test attribution from Gecko in Android. Throwing."); - aResult.set(JS::UndefinedValue()); - return NS_ERROR_FAILURE; -#else - MOZ_ASSERT(XRE_IsParentProcess()); - glean::impl::FogAttributionMetrics attr; - glean::impl::fog_test_get_attribution(&attr); - - JS::RootedObject jsAttr(aCx, JS_NewPlainObject(aCx)); - NS_ENSURE_TRUE(jsAttr, NS_ERROR_FAILURE); - - JS::RootedValue jsSource(aCx); - if (attr.source.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsAttr, "source", JS::NullHandleValue, - JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, attr.source, &jsSource) || - !JS_DefineProperty(aCx, jsAttr, "source", jsSource, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define attribution.source."); - return NS_ERROR_FAILURE; - } - - JS::RootedValue jsMedium(aCx); - if (attr.medium.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsAttr, "medium", JS::NullHandleValue, - JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, attr.medium, &jsMedium) || - !JS_DefineProperty(aCx, jsAttr, "medium", jsMedium, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define attribution.medium."); - return NS_ERROR_FAILURE; - } - - JS::RootedValue jsCampaign(aCx); - if (attr.campaign.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsAttr, "campaign", - JS::NullHandleValue, JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, attr.campaign, &jsCampaign) || - !JS_DefineProperty(aCx, jsAttr, "campaign", jsCampaign, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define attribution.campaign."); - return NS_ERROR_FAILURE; - } - - JS::RootedValue jsTerm(aCx); - if (attr.term.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsAttr, "term", JS::NullHandleValue, - JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, attr.term, &jsTerm) || - !JS_DefineProperty(aCx, jsAttr, "term", jsTerm, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define attribution.term."); - return NS_ERROR_FAILURE; - } - - JS::RootedValue jsContent(aCx); - if (attr.content.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsAttr, "content", - JS::NullHandleValue, JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, attr.content, &jsContent) || - !JS_DefineProperty(aCx, jsAttr, "content", jsContent, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define attribution.content."); - return NS_ERROR_FAILURE; - } - - aResult.setObject(*jsAttr); - return NS_OK; -#endif // MOZ_GLEAN_ANDROID -} - -NS_IMETHODIMP -FOG::UpdateDistribution(const nsACString& aName) { - MOZ_ASSERT(XRE_IsParentProcess()); - glean::impl::FogDistributionMetrics dist{.name = nsCString(aName)}; - glean::impl::fog_update_distribution(&dist); - return NS_OK; -} - -NS_IMETHODIMP -FOG::TestGetDistribution(JSContext* aCx, JS::MutableHandleValue aResult) { -#ifdef MOZ_GLEAN_ANDROID - NS_WARNING("Don't test distribution from Gecko in Android. Throwing."); - aResult.set(JS::UndefinedValue()); - return NS_ERROR_FAILURE; -#else - MOZ_ASSERT(XRE_IsParentProcess()); - glean::impl::FogDistributionMetrics dist; - glean::impl::fog_test_get_distribution(&dist); - - JS::RootedObject jsDist(aCx, JS_NewPlainObject(aCx)); - NS_ENSURE_TRUE(jsDist, NS_ERROR_FAILURE); - - JS::RootedValue jsName(aCx); - if (dist.name.IsEmpty()) { - NS_ENSURE_TRUE(JS_DefineProperty(aCx, jsDist, "name", JS::NullHandleValue, - JSPROP_ENUMERATE), - NS_ERROR_FAILURE); - } else if (!dom::ToJSValue(aCx, dist.name, &jsName) || - !JS_DefineProperty(aCx, jsDist, "name", jsName, - JSPROP_ENUMERATE)) { - NS_WARNING("Failed to define distribution.name."); - return NS_ERROR_FAILURE; - } - - aResult.setObject(*jsDist); - return NS_OK; -#endif // MOZ_GLEAN_ANDROID -} - void FOG::InitMemoryReporter() { RegisterWeakMemoryReporter(this); } MOZ_DEFINE_MALLOC_SIZE_OF(FOGMallocSizeOf) diff --git a/toolkit/components/glean/xpcom/nsIFOG.idl b/toolkit/components/glean/xpcom/nsIFOG.idl index 5c37aae4a29b..6cf2b09733a9 100644 --- a/toolkit/components/glean/xpcom/nsIFOG.idl +++ b/toolkit/components/glean/xpcom/nsIFOG.idl @@ -197,47 +197,4 @@ interface nsIFOG : nsISupports in Array aReasonCodes, in boolean aFollowsCollectionEnabled, in Array aUploaderCapabilities); - - /** - * Update the core attribution metrics in Glean. - * - * @param aSource - The product's attribution source (e.g. "google-play"). - * @param aMedium - The product's attribution medium (e.g. "organic" for a search engine). - * @param aCampaign - The product's attribution campaign (e.g. "mozilla-org"). - * @param aTerm - The product's attribution term (e.g. "browser with developer tools for android"). - * @param aContent - The product's attribution content (e.g. "firefoxview"). - */ - void updateAttribution(in ACString aSource, - in ACString aMedium, - in ACString aCampaign, - in ACString aTerm, - in ACString aContent); - - /** - * ** Test-only Method ** - * - * Returns the core attribution data from Glean. - * - * @returns the core attribution data from Glean in the form - * `{source, medium, campaign, term, content}`. - */ - [implicit_jscontext] - jsval testGetAttribution(); - - /** - * Update the core distribution metrics in Glean. - * - * @param aName - The product's distribution name (e.g. "MozillaOnline"). - */ - void updateDistribution(in ACString aName); - - /** - * ** Test-only Method ** - * - * Returns the core distribution data from Glean. - * - * @returns the core distribution data from Glean in the form `{name}`. - */ - [implicit_jscontext] - jsval testGetDistribution(); }; diff --git a/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs b/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs index 57882dc8e456..ffa772fdc38e 100644 --- a/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs +++ b/toolkit/components/telemetry/app/TelemetryEnvironment.sys.mjs @@ -83,7 +83,7 @@ var gActiveExperimentStartupBuffer = new Map(); // For Powering arewegleanyet.com (See bug 1944592) // Legacy Count: 114 -// Glean Count: 48 +// Glean Count: 32 var gGlobalEnvironment; function getGlobal() { @@ -1789,22 +1789,6 @@ EnvironmentCache.prototype = { : data[key]; } this._currentEnvironment.settings.attribution = attributionData; - let extAttribution = { - experiment: attributionData.experiment, - variation: attributionData.variation, - ua: attributionData.ua, - dltoken: attributionData.dltoken, - msstoresignedin: attributionData.msstoresignedin, - dlsource: attributionData.dlsource, - }; - Services.fog.updateAttribution( - attributionData.source, - attributionData.medium, - attributionData.campaign, - attributionData.term, - attributionData.content - ); - Glean.gleanAttribution.ext.set(extAttribution); }, /** @@ -1910,15 +1894,6 @@ EnvironmentCache.prototype = { ); partnerData.partnerNames = partnerBranch.getChildList(""); - Services.fog.updateDistribution(partnerData.distributionId); - Glean.gleanDistribution.ext.set({ - distributionVersion: partnerData.distributionVersion, - partnerId: partnerData.partnerId, - distributor: partnerData.distributor, - distributorChannel: partnerData.distributorChannel, - partnerNames: partnerData.partnerNames, - }); - return partnerData; }, diff --git a/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs b/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs index 94526ce9ae18..128cc8c35762 100644 --- a/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs +++ b/toolkit/components/telemetry/tests/unit/TelemetryEnvironmentTesting.sys.mjs @@ -379,18 +379,6 @@ export var TelemetryEnvironmentTesting = { lazy.Assert.equal(typeof data.settings.attribution, "object"); lazy.Assert.equal(data.settings.attribution.source, "google.com"); lazy.Assert.equal(data.settings.attribution.dlsource, "unittest"); - let attr = Services.fog.testGetAttribution(); - lazy.Assert.equal( - attr.source, - "google.com", - "Must have correct attribution.source." - ); - let attrExt = Glean.gleanAttribution.ext.testGetValue(); - lazy.Assert.equal( - attrExt.dlsource, - "unittest", - "Must have correct dlsource." - ); } this.checkIntlSettings(data.settings); @@ -456,8 +444,6 @@ export var TelemetryEnvironmentTesting = { "There must be a partner section in Environment." ); - let dist = Services.fog.testGetDistribution(); - let distExt = Glean.gleanDistribution.ext.testGetValue(); for (let f in EXPECTED_FIELDS) { let expected = isInitial ? null : EXPECTED_FIELDS[f]; lazy.Assert.strictEqual( @@ -465,32 +451,14 @@ export var TelemetryEnvironmentTesting = { expected, f + " must have the correct value." ); - if (f == "distributionId") { - lazy.Assert.strictEqual( - dist.name, - expected, - "Core Glean distribution must be correct." - ); - } else { - lazy.Assert.equal( - distExt[f], - expected, - `Extended Glean distribution field "${f}" must be correct.` - ); - } } // Check that "partnerNames" exists and contains the correct element. lazy.Assert.ok(Array.isArray(data.partner.partnerNames)); if (isInitial) { lazy.Assert.equal(data.partner.partnerNames.length, 0); - lazy.Assert.equal(distExt.partnerNames, null); } else { lazy.Assert.ok(data.partner.partnerNames.includes(PARTNER_NAME)); - lazy.Assert.ok( - distExt.partnerNames.includes(PARTNER_NAME), - "Glean partner names contain expected partner name." - ); } },