diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /toolkit/components/glean/build_scripts/mach_commands.py | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/glean/build_scripts/mach_commands.py')
-rw-r--r-- | toolkit/components/glean/build_scripts/mach_commands.py | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/toolkit/components/glean/build_scripts/mach_commands.py b/toolkit/components/glean/build_scripts/mach_commands.py index 4a0f6dbc68..b8d270c088 100644 --- a/toolkit/components/glean/build_scripts/mach_commands.py +++ b/toolkit/components/glean/build_scripts/mach_commands.py @@ -167,9 +167,18 @@ def update_glean(command_context, version): topsrcdir = Path(command_context.topsrcdir) replace_in_file_or_die( - topsrcdir / "build.gradle", - r'gleanVersion = "[0-9.]+"', - f'gleanVersion = "{version}"', + topsrcdir + / "mobile" + / "android" + / "android-components" + / "plugins" + / "dependencies" + / "src" + / "main" + / "java" + / "DependenciesPlugin.kt", + r'mozilla_glean = "[0-9.]+"', + f'mozilla_glean = "{version}"', ) replace_in_file_or_die( topsrcdir / "toolkit" / "components" / "glean" / "Cargo.toml", @@ -226,3 +235,47 @@ def update_glean(command_context, version): """ print(textwrap.dedent(instructions)) + + +@Command( + "event-into-legacy", + category="misc", + description="Create a Legacy Telemetry compatible event definition from an existing Glean Event metric.", +) +@CommandArgument( + "--append", + "-a", + action="store_true", + help="Append to toolkit/components/telemetry/Events.yaml (note: verify and make any necessary modifications before landing).", +) +@CommandArgument("event", default=None, nargs="?", type=str, help="Event name.") +def event_into_legacy(command_context, event=None, append=False): + # Get the metrics_index's list of metrics indices + # by loading the index as a module. + import sys + from os import path + + sys.path.append(path.join(path.dirname(__file__), path.pardir)) + + from metrics_index import metrics_yamls + + sys.path.append(path.dirname(__file__)) + + from pathlib import Path + + from translate_events import translate_event + + legacy_yaml_path = path.join( + Path(command_context.topsrcdir), + "toolkit", + "components", + "telemetry", + "Events.yaml", + ) + + return translate_event( + event, + append, + [Path(command_context.topsrcdir) / x for x in metrics_yamls], + legacy_yaml_path, + ) |