зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8f84cc961e80 (bug 1790046
) for multiple failures on a CLOSED TREE
This commit is contained in:
Родитель
4753a3a777
Коммит
e865bcb13c
|
@ -54,16 +54,11 @@ If you add a new definitions file, be sure to edit
|
||||||
`toolkit/components/glean/metrics_index.py`,
|
`toolkit/components/glean/metrics_index.py`,
|
||||||
adding your definitions files to the Python lists therein.
|
adding your definitions files to the Python lists therein.
|
||||||
If you don't, no API will be generated for your metrics and your build will fail.
|
If you don't, no API will be generated for your metrics and your build will fail.
|
||||||
You will have to decide which products your metrics will be used in.
|
|
||||||
For code that's also used in other Gecko-based products (Firefox Desktop, Firefox for Android, Focus for Android), use `gecko_metrics`.
|
|
||||||
For Desktop-only instrumentation use `firefox_desktop_metrics`.
|
|
||||||
For other products use their respective lists.
|
|
||||||
|
|
||||||
Changes to `metrics_index.py` are automatically reflected in the data pipeline once a day
|
In addition, do not forget to file a bug in `Data Platform and Tools :: General`
|
||||||
using the [fog-updater automation in probe-scraper](https://github.com/mozilla/probe-scraper/tree/main/fog-updater).
|
asking for your definitions files to be added to the others for `firefox_desktop`.
|
||||||
Data will not show up in datasets and tools until this happens.
|
If you don't, your metrics will not show up in datasets and tools
|
||||||
If something is unclear or data is not showing up in time you will need to file a bug in
|
because the pipeline won't know that they exist.
|
||||||
`Data Platform and Tools :: General`.
|
|
||||||
|
|
||||||
If you have any questions, be sure to ask on
|
If you have any questions, be sure to ask on
|
||||||
[the #glean channel](https://chat.mozilla.org/#/room/#glean:mozilla.org).
|
[the #glean channel](https://chat.mozilla.org/#/room/#glean:mozilla.org).
|
||||||
|
|
|
@ -4,89 +4,46 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
# ATTENTION: Changes to this file will need to be reflected in probe-scraper[1].
|
# ATTENTION: If you make changes to this file you will need to file a bug in
|
||||||
# This should happen automatically once a day.
|
# Data Platform and Tools :: General asking for the changes to be reflected
|
||||||
# If something is unclear or data is not showing up in time
|
# in the data pipeline. Otherwise bad things will happen to good people:
|
||||||
# you will need to file a bug in Data Platform and Tools :: General.
|
# any new metrics files' metrics will not get columns in any datasets.
|
||||||
#
|
|
||||||
# [1] https://github.com/mozilla/probe-scraper
|
|
||||||
|
|
||||||
# Metrics that are sent by Gecko and everyone using Gecko
|
# The list of all Glean metrics.yaml files, relative to the top src dir.
|
||||||
# (Firefox Desktop, Firefox for Android, Focus for Android, etc.).
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
||||||
gecko_metrics = [
|
metrics_yamls = [
|
||||||
"browser/base/content/metrics.yaml",
|
"browser/base/content/metrics.yaml",
|
||||||
|
"browser/components/metrics.yaml",
|
||||||
|
"browser/components/newtab/metrics.yaml",
|
||||||
|
"browser/components/search/metrics.yaml",
|
||||||
|
"browser/modules/metrics.yaml",
|
||||||
"dom/media/metrics.yaml",
|
"dom/media/metrics.yaml",
|
||||||
"dom/metrics.yaml",
|
"dom/metrics.yaml",
|
||||||
"gfx/metrics.yaml",
|
"gfx/metrics.yaml",
|
||||||
"netwerk/metrics.yaml",
|
"netwerk/metrics.yaml",
|
||||||
"netwerk/protocol/http/metrics.yaml",
|
"netwerk/protocol/http/metrics.yaml",
|
||||||
"toolkit/components/glean/metrics.yaml",
|
|
||||||
"toolkit/components/processtools/metrics.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Metrics that are sent by Firefox Desktop
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
firefox_desktop_metrics = [
|
|
||||||
"browser/components/metrics.yaml",
|
|
||||||
"browser/components/newtab/metrics.yaml",
|
|
||||||
"browser/components/search/metrics.yaml",
|
|
||||||
"browser/modules/metrics.yaml",
|
|
||||||
"toolkit/components/extensions/metrics.yaml",
|
"toolkit/components/extensions/metrics.yaml",
|
||||||
|
"toolkit/components/glean/metrics.yaml",
|
||||||
|
"toolkit/components/glean/tests/test_metrics.yaml",
|
||||||
"toolkit/components/nimbus/metrics.yaml",
|
"toolkit/components/nimbus/metrics.yaml",
|
||||||
"toolkit/components/pdfjs/metrics.yaml",
|
"toolkit/components/pdfjs/metrics.yaml",
|
||||||
|
"toolkit/components/processtools/metrics.yaml",
|
||||||
|
"toolkit/components/search/metrics.yaml",
|
||||||
"toolkit/components/telemetry/metrics.yaml",
|
"toolkit/components/telemetry/metrics.yaml",
|
||||||
|
"toolkit/mozapps/update/metrics.yaml",
|
||||||
"toolkit/xre/metrics.yaml",
|
"toolkit/xre/metrics.yaml",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Metrics that are sent by the Firefox Desktop Background Update Task
|
# The list of all Glean pings.yaml files, relative to the top src dir.
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
||||||
background_update_metrics = [
|
pings_yamls = [
|
||||||
"toolkit/mozapps/update/metrics.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Test metrics
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
test_metrics = [
|
|
||||||
"toolkit/components/glean/tests/test_metrics.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
# The list of all Glean metrics.yaml files, relative to the top src dir.
|
|
||||||
# ONLY TO BE MODIFIED BY FOG PEERS!
|
|
||||||
metrics_yamls = (
|
|
||||||
gecko_metrics + firefox_desktop_metrics + background_update_metrics + test_metrics
|
|
||||||
)
|
|
||||||
|
|
||||||
# Pings that are sent by Gecko and everyone using Gecko
|
|
||||||
# (Firefox Desktop, Firefox for Android, Focus for Android, etc.).
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
gecko_pings = [
|
|
||||||
"toolkit/components/telemetry/pings.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Pings that are sent by Firefox Desktop.
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
firefox_desktop_pings = [
|
|
||||||
"browser/components/newtab/pings.yaml",
|
"browser/components/newtab/pings.yaml",
|
||||||
"toolkit/components/glean/pings.yaml",
|
"toolkit/components/glean/pings.yaml",
|
||||||
]
|
"toolkit/components/glean/tests/test_pings.yaml",
|
||||||
|
"toolkit/components/telemetry/pings.yaml",
|
||||||
# Pings that are sent by the Firefox Desktop Background Update Task
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
background_update_pings = [
|
|
||||||
"toolkit/mozapps/update/pings.yaml",
|
"toolkit/mozapps/update/pings.yaml",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Test pings
|
|
||||||
# Order is lexicographical, enforced by t/c/glean/tests/pytest/test_yaml_indices.py
|
|
||||||
test_pings = [
|
|
||||||
"toolkit/components/glean/tests/test_pings.yaml",
|
|
||||||
]
|
|
||||||
|
|
||||||
# The list of all Glean pings.yaml files, relative to the top src dir.
|
|
||||||
# ONLY TO BE MODIFIED BY FOG PEERS!
|
|
||||||
pings_yamls = gecko_pings + firefox_desktop_pings + background_update_pings + test_pings
|
|
||||||
|
|
||||||
# The list of tags that are allowed in the above to files, and their
|
# The list of tags that are allowed in the above to files, and their
|
||||||
# descriptions. Currently we restrict to a set scraped from bugzilla
|
# descriptions. Currently we restrict to a set scraped from bugzilla
|
||||||
# (via `./mach update-glean-tags`)
|
# (via `./mach update-glean-tags`)
|
||||||
|
|
|
@ -11,26 +11,15 @@ FOG_ROOT_PATH = path.abspath(
|
||||||
path.join(path.dirname(__file__), path.pardir, path.pardir)
|
path.join(path.dirname(__file__), path.pardir, path.pardir)
|
||||||
)
|
)
|
||||||
sys.path.append(FOG_ROOT_PATH)
|
sys.path.append(FOG_ROOT_PATH)
|
||||||
import metrics_index
|
from metrics_index import metrics_yamls, pings_yamls, tags_yamls
|
||||||
|
|
||||||
|
|
||||||
def test_yamls_sorted():
|
def test_yamls_sorted(yamls_to_test=[metrics_yamls, pings_yamls, tags_yamls]):
|
||||||
"""
|
"""
|
||||||
Ensure the yamls indices are sorted lexicographically.
|
Ensure the yamls indices are sorted lexicographically.
|
||||||
"""
|
"""
|
||||||
# Ignore lists that are the concatenation of others.
|
for yamls in yamls_to_test:
|
||||||
to_ignore = ["metrics_yamls", "pings_yamls"]
|
assert sorted(yamls) == yamls, "FOG YAMLs must be lexicographically sorted"
|
||||||
|
|
||||||
# Fetch names of all variables defined in the `metrics_index` module.
|
|
||||||
yaml_lists = [item for item in dir(metrics_index) if not item.startswith("__")]
|
|
||||||
for name in yaml_lists:
|
|
||||||
if name in to_ignore:
|
|
||||||
continue
|
|
||||||
|
|
||||||
yamls_to_test = metrics_index.__dict__[name]
|
|
||||||
assert (
|
|
||||||
sorted(yamls_to_test) == yamls_to_test
|
|
||||||
), f"{name} must be be lexicographically sorted."
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Загрузка…
Ссылка в новой задаче