From 24f65c6febf2b7c35de494bbc23a30a7aee8d26a Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Mon, 23 Nov 2026 12:12:06 -0600 Subject: [PATCH] Recognize official StarPilot startup channels --- .../common/tests/test_startup_channel.py | 25 +++++++++++++++++++ openpilot/common/version.py | 7 ++++++ openpilot/selfdrive/selfdrived/selfdrived.py | 5 +--- prebuilt.json | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 openpilot/common/tests/test_startup_channel.py diff --git a/openpilot/common/tests/test_startup_channel.py b/openpilot/common/tests/test_startup_channel.py new file mode 100644 index 0000000000..42ee08b19b --- /dev/null +++ b/openpilot/common/tests/test_startup_channel.py @@ -0,0 +1,25 @@ +import pytest + +from openpilot.common.version import build_metadata_from_dict + + +@pytest.mark.parametrize("origin, channel, expected", [ + ("https://github.com/StarPilotHQ/StarPilot.git", "stable", True), + ("https://github.com/StarPilotHQ/StarPilot.git", "testing", True), + ("https://github.com/firestar5683/StarPilot.git", "stable", True), + ("git@github.com:firestar5683/StarPilot.git", "testing", True), + ("https://github.com/StarPilotHQ/StarPilot.git", "StarPilot", True), + ("https://github.com/StarPilotHQ/StarPilot.git", "Dom", True), + ("https://github.com/firestar5683/StarPilot.git", "StarPilot", True), + ("https://github.com/firestar5683/StarPilot.git", "Dom", True), + ("https://github.com/StarPilotHQ/StarPilot.git", "feature", False), + ("https://github.com/StarPilotHQ/StarPilot.git", "HEAD", False), + ("https://github.com/other/StarPilot.git", "stable", False), + ("https://github.com/other/StarPilot.git", "testing", False), + ("https://github.com/commaai/openpilot.git", "release-tizi", True), + ("https://github.com/commaai/openpilot.git", "master", False), + ("https://github.com/StarPilotHQ/StarPilot.git", "replay", False), +]) +def test_standard_startup(origin, channel, expected): + metadata = build_metadata_from_dict({"channel": channel, "openpilot": {"git_origin": origin}}) + assert metadata.standard_startup is expected diff --git a/openpilot/common/version.py b/openpilot/common/version.py index b6f0bc9d3f..102561ae9c 100755 --- a/openpilot/common/version.py +++ b/openpilot/common/version.py @@ -99,6 +99,13 @@ class BuildMetadata: def tested_channel(self) -> bool: return self.channel in TESTED_BRANCHES + @property + def standard_startup(self) -> bool: + starpilot_origins = ('github.com/starpilothq/starpilot', 'github.com/firestar5683/starpilot') + if self.openpilot.git_normalized_origin.lower() in starpilot_origins: + return self.channel in ('stable', 'StarPilot', 'Dom', 'testing') + return self.openpilot.comma_remote and self.tested_channel + @property def release_channel(self) -> bool: return self.channel in RELEASE_BRANCHES diff --git a/openpilot/selfdrive/selfdrived/selfdrived.py b/openpilot/selfdrive/selfdrived/selfdrived.py index 468a9197b8..55824a7d38 100755 --- a/openpilot/selfdrive/selfdrived/selfdrived.py +++ b/openpilot/selfdrive/selfdrived/selfdrived.py @@ -261,10 +261,7 @@ class SelfdriveD: # Observational only. Do not cache this qualification for authority decisions. # Determine startup event - official_starpilot = (build_metadata.openpilot.git_normalized_origin.lower() == 'github.com/starpilothq/starpilot' and - build_metadata.channel in ('stable', 'testing')) - standard_startup = official_starpilot or (build_metadata.openpilot.comma_remote and build_metadata.tested_channel) - self.startup_event = EventName.startup if standard_startup else EventName.startupMaster + self.startup_event = EventName.startup if build_metadata.standard_startup else EventName.startupMaster if HARDWARE.get_device_type() == 'mici': self.startup_event = None if not car_recognized: diff --git a/prebuilt.json b/prebuilt.json index 708085f7d0..6a9242728a 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "fc856d30347f32f773ce6ff3230dcc19449de8b99248cd1efc92bbfe67f709d6", "schema_version": 1} +{"protected_inventory_sha256": "2ec6b85b75a5c9e05df8c0051340802186d2a8b03b2536d03d6e5cb0d44289f7", "schema_version": 1}