fix normailzed

pull/31941/head
Justin Newberry 1 year ago
parent 75b9b7b577
commit ce8dac9b4d
  1. 4
      selfdrive/manager/manager.py
  2. 2
      selfdrive/statsd.py
  3. 14
      system/version.py

@ -79,7 +79,7 @@ def manager_init() -> None:
serial = params.get("HardwareSerial")
raise Exception(f"Registration failed for device {serial}")
os.environ['DONGLE_ID'] = dongle_id # Needed for swaglog
os.environ['GIT_ORIGIN'] = build_metadata.openpilot.git_origin # Needed for swaglog
os.environ['GIT_ORIGIN'] = build_metadata.openpilot.git_normalized_origin # Needed for swaglog
os.environ['GIT_BRANCH'] = build_metadata.channel # Needed for swaglog
os.environ['GIT_COMMIT'] = build_metadata.openpilot.git_commit # Needed for swaglog
@ -90,7 +90,7 @@ def manager_init() -> None:
sentry.init(sentry.SentryProject.SELFDRIVE)
cloudlog.bind_global(dongle_id=dongle_id,
version=build_metadata.openpilot.version,
origin=build_metadata.openpilot.git_origin,
origin=build_metadata.openpilot.git_normalized_origin,
branch=build_metadata.channel,
commit=build_metadata.openpilot.git_commit,
dirty=build_metadata.openpilot.git_dirty,

@ -94,7 +94,7 @@ def main() -> NoReturn:
'version': build_metadata.openpilot.version,
'branch': build_metadata.channel,
'dirty': build_metadata.openpilot.git_dirty,
'origin': build_metadata.openpilot.git_origin,
'origin': build_metadata.openpilot.git_normalized_origin,
'deviceType': HARDWARE.get_device_type(),
}

@ -9,7 +9,7 @@ import subprocess
from openpilot.common.basedir import BASEDIR
from openpilot.common.swaglog import cloudlog
from openpilot.common.utils import cache
from openpilot.common.git import get_commit, get_origin, get_branch, get_short_branch, get_normalized_origin, get_commit_date
from openpilot.common.git import get_commit, get_origin, get_branch, get_short_branch, get_commit_date
RELEASE_BRANCHES = ['release3-staging', 'release3', 'nightly']
@ -79,7 +79,15 @@ class OpenpilotMetadata:
def comma_remote(self) -> bool:
# note to fork maintainers, this is used for release metrics. please do not
# touch this to get rid of the orange startup alert. there's better ways to do that
return self.git_origin == "github.com/commaai/openpilot"
return self.git_normalized_origin == "github.com/commaai/openpilot"
@property
def git_normalized_origin(self) -> str:
return self.git_origin \
.replace("git@", "", 1) \
.replace(".git", "", 1) \
.replace("https://", "", 1) \
.replace(":", "/", 1)
@dataclass(frozen=True)
@ -123,7 +131,7 @@ def get_build_metadata(path: str = BASEDIR) -> BuildMetadata:
if git_folder.exists():
return BuildMetadata(get_short_branch(path), OpenpilotMetadata(get_version(path), get_release_notes(path), get_commit(path), \
get_normalized_origin(path), get_commit_date(path), is_dirty(path)))
get_origin(path), get_commit_date(path), is_dirty(path)))
cloudlog.exception("unable to get build metadata")
raise Exception("invalid build metadata")

Loading…
Cancel
Save