Commit 26a7a1c3 authored by brizental's avatar brizental
Browse files

fixup! Tweaks to the build system

Fix linter issues. Related to using things that are not being imported
since we commented them out. Guess the linter doesnt care that the code
is unreacheable.
parent ee28882b
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ class SentryErrorReporter(ErrorReporter):
    """Reports errors using Sentry."""

    def report_exception(self, exception):
        return sentry_sdk.capture_exception(exception)
        pass
        # return sentry_sdk.capture_exception(exception)


class NoopErrorReporter(ErrorReporter):
@@ -61,10 +62,10 @@ def register_sentry(argv, settings, topsrcdir: Path):
    )
    _is_unmodified_mach_core_thread.start()

    sentry_sdk.init(
        _SENTRY_DSN, before_send=lambda event, _: _process_event(event, topsrcdir)
    )
    sentry_sdk.add_breadcrumb(message="./mach {}".format(" ".join(argv)))
    # sentry_sdk.init(
    #     _SENTRY_DSN, before_send=lambda event, _: _process_event(event, topsrcdir)
    # )
    # sentry_sdk.add_breadcrumb(message="./mach {}".format(" ".join(argv)))
    return SentryErrorReporter()


+0 −35
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import importlib.util
import os
import subprocess
import sys
import urllib.parse as urllib_parse
from pathlib import Path
from textwrap import dedent

@@ -129,40 +128,6 @@ def resolve_setting_from_arcconfig(topsrcdir: Path, setting):

def resolve_is_employee_by_credentials(topsrcdir: Path):
    return None
    try:
        phabricator_uri = resolve_setting_from_arcconfig(topsrcdir, "phabricator.uri")

        if not phabricator_uri:
            return None

        with arcrc_path().open() as arcrc_file:
            arcrc = json.load(arcrc_file)

        phabricator_token = (
            arcrc.get("hosts", {})
            .get(urllib_parse.urljoin(phabricator_uri, "api/"), {})
            .get("token")
        )

        if not phabricator_token:
            return None

        bmo_uri = (
            resolve_setting_from_arcconfig(topsrcdir, "bmo_url")
            or "https://bugzilla.mozilla.org"
        )
        bmo_api_url = urllib_parse.urljoin(bmo_uri, "rest/whoami")
        bmo_result = requests.get(
            bmo_api_url, headers={"X-PHABRICATOR-TOKEN": phabricator_token}
        )

        return "mozilla-employee-confidential" in bmo_result.json().get("groups", [])
    except (
        FileNotFoundError,
        json.JSONDecodeError,
        requests.exceptions.RequestException,
    ):
        return None


def resolve_is_employee_by_vcs(topsrcdir: Path):