diff --git a/system/sentry.py b/system/sentry.py index e9605bf719..2f918ebc49 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -116,12 +116,8 @@ def get_properties() -> tuple[str, str, str]: def init(project: SentryProject) -> bool: build_metadata = get_build_metadata() - # forks like to mess with this, so double check - # comma_remote = build_metadata.openpilot.comma_remote and "commaai" in build_metadata.openpilot.git_origin - # if not comma_remote or not is_registered_device() or PC: - # return False - env = "release" if build_metadata.tested_channel else "master" + env = build_metadata.channel_type dongle_id, git_username, sunnylink_dongle_id = get_properties() integrations = [] diff --git a/system/version.py b/system/version.py index 2d8a387bf7..11c6ced2b7 100755 --- a/system/version.py +++ b/system/version.py @@ -10,8 +10,11 @@ from openpilot.common.basedir import BASEDIR from openpilot.common.swaglog import cloudlog from openpilot.common.git import get_commit, get_origin, get_branch, get_short_branch, get_commit_date -RELEASE_BRANCHES = ['release3-staging', 'release3', 'nightly'] -TESTED_BRANCHES = RELEASE_BRANCHES + ['devel', 'devel-staging', 'nightly-dev'] +RELEASE_SP_BRANCHES = ['release-c3'] +TESTED_SP_BRANCHES = ['staging-c3', 'staging-c3-new'] +MASTER_SP_BRANCHES = ['master', 'master-new'] +RELEASE_BRANCHES = ['release3-staging', 'release3', 'nightly'] + RELEASE_SP_BRANCHES +TESTED_BRANCHES = RELEASE_BRANCHES + ['devel', 'devel-staging', 'nightly-dev'] + TESTED_SP_BRANCHES BUILD_METADATA_FILENAME = "build.json" @@ -110,6 +113,23 @@ class BuildMetadata: def ui_description(self) -> str: return f"{self.openpilot.version} / {self.openpilot.git_commit[:6]} / {self.channel}" + @property + def master_channel(self) -> bool: + return self.channel in MASTER_SP_BRANCHES + + @property + def channel_type(self) -> str: + if self.channel.startswith("dev-"): + return "development" + elif self.channel.startswith("staging-"): + return "staging" + elif self.master_channel: + return "master" + elif self.tested_channel: + return "release" + else: + return "feature" + def build_metadata_from_dict(build_metadata: dict) -> BuildMetadata: channel = build_metadata.get("channel", "unknown")