Bug 1705403 - Replace FOG's Glean autodocs with link to Glean Dictionary r=janerik DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D114631
This commit is contained in:
Chris H-C 2021-05-10 13:33:09 +00:00
parent f852ae3348
commit f666fb3dc9
5 changed files with 8 additions and 51 deletions

View File

@ -31,12 +31,3 @@ glob:**/package*.json
# Read to set the version of the docs.
path:config/milestone.txt
# metrics.yaml and pings.yaml files (and their index) are needed to generate
# Glean autodocs
glob:**/metrics.yaml
glob:**/pings.yaml
path:toolkit/components/glean/metrics_index.py
# TODO(bug 1672716): Make it easier to use other file names
path:toolkit/components/glean/test_metrics.yaml
path:toolkit/components/glean/test_pings.yaml

View File

@ -28,7 +28,6 @@ EXTRA_PATHS = (
"third_party/python/futures",
"third_party/python/jsmin",
"third_party/python/which",
"toolkit/components/glean/sphinx",
)
sys.path[:0] = [os.path.join(topsrcdir, p) for p in EXTRA_PATHS]
@ -49,7 +48,6 @@ extensions = [
"sphinx_copybutton",
"sphinx_markdown_tables",
"sphinx_panels",
"glean",
]
# JSDoc must run successfully for dirs specified, so running

6
docs/metrics/index.md Normal file
View File

@ -0,0 +1,6 @@
# Metrics
The metrics collected by Firefox using the
[Glean SDK](https://mozilla.github.io/glean/book/index.html)
are documented in
[The Glean Dictionary](https://dictionary.telemetry.mozilla.org/apps/firefox_desktop/).

View File

@ -197,4 +197,6 @@ SPHINX_TREES["crash-reporting"] = "docs/crash-reporting"
SPHINX_TREES["performance"] = "docs/performance"
SPHINX_TREES["metrics"] = "docs/metrics"
include("build/templates.mozbuild")

View File

@ -1,40 +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/.
import os
from pathlib import Path
import sys
def setup(app):
from moztreedocs import manager
# Import the list of metrics and ping files
glean_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
sys.path.append(glean_dir)
from metrics_index import metrics_yamls, pings_yamls
# Import the custom version expiry code.
glean_parser_ext_dir = os.path.abspath(
Path(glean_dir) / "build_scripts" / "glean_parser_ext"
)
sys.path.append(glean_parser_ext_dir)
from run_glean_parser import get_parser_options
firefox_version = "4.0a1" # TODO: bug 1676416 - Get the real app version.
parser_config = get_parser_options(firefox_version)
input_files = [Path(os.path.join(manager.topsrcdir, x)) for x in metrics_yamls]
input_files += [Path(os.path.join(manager.topsrcdir, x)) for x in pings_yamls]
# Generate the autodocs.
from glean_parser import translate
out_path = Path(os.path.join(manager.staging_dir, "metrics"))
translate.translate(
input_files, "markdown", out_path, {"project_title": "Firefox"}, parser_config
)
# Rename the generated docfile to index so Sphinx finds it
os.rename(os.path.join(out_path, "metrics.md"), os.path.join(out_path, "index.md"))