Commit f666fb3d authored by Chris H-C's avatar Chris H-C
Browse files

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

parent f852ae33
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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

docs/metrics/index.md

0 → 100644
+6 −0
Original line number Diff line number Diff line
# 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/).
+2 −0
Original line number Diff line number Diff line
@@ -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")
+0 −40
Original line number Diff line number Diff line
# 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"))