From b9f349c72df375d0d7eac7dce8364c05e7d5477b Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 25 Nov 2026 07:57:58 -0800 Subject: [PATCH] Show Fork name in Warning --- openpilot/starpilot/galaxy/log_relay_stage.py | 8 ++++++-- openpilot/starpilot/galaxy/starport_send.py | 9 +++++++-- openpilot/starpilot/galaxy/tests/test_log_relay_stage.py | 2 ++ openpilot/starpilot/galaxy/web/js/log-help.js | 9 +++++++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/openpilot/starpilot/galaxy/log_relay_stage.py b/openpilot/starpilot/galaxy/log_relay_stage.py index 50c9bcd197..619ee7cbfd 100644 --- a/openpilot/starpilot/galaxy/log_relay_stage.py +++ b/openpilot/starpilot/galaxy/log_relay_stage.py @@ -10,7 +10,7 @@ from io import BytesIO from urllib.parse import quote from zipfile import BadZipFile, ZipFile -from openpilot.starpilot.galaxy.starport_send import DISCORD_FILE_LIMIT, official_install +from openpilot.starpilot.galaxy.starport_send import DISCORD_FILE_LIMIT, install_repo, official_install STAGE_URL = "https://starpilot-log-relay.nathan-g-hubbard.workers.dev/report/galaxy/stage" CLAIM_RE = re.compile(r"^https://starpilot-log-relay\.nathan-g-hubbard\.workers\.dev/report/galaxy/claim/[a-f0-9]{64}$") @@ -123,18 +123,20 @@ class LogRelayStager: post=None, stage_url: Callable[[], str] | str = STAGE_URL, official: Callable[[], bool] = official_install, + repo: Callable[[], str] = install_repo, ): self._starport_bundle = starport_bundle self._connection_zip = connection_zip self._controller_zip = controller_zip self._post = post self._stage_url: Callable[[], str] | str = stage_url - self._official = official + self._official, self._repo_source = official, repo self._lock = threading.Lock() self._thread: threading.Thread | None = None self._state = {"state": "idle", "message": "", "claimUrl": "", "kind": ""} self._session = None self._fork: bool | None = None + self._repo = "" def _url(self) -> str: stage_url = self._stage_url @@ -144,10 +146,12 @@ class LogRelayStager: with self._lock: if self._fork is None: self._fork = not self._official() + self._repo = self._repo_source() if self._fork else "" return { **(self._state if session == self._session else {"state": "idle", "message": "", "claimUrl": "", "kind": ""}), "available": bool(self._url()), "fork": self._fork, + "repo": self._repo, "noteLimit": NOTE_LIMIT, "modelLimit": MODEL_LIMIT, } diff --git a/openpilot/starpilot/galaxy/starport_send.py b/openpilot/starpilot/galaxy/starport_send.py index e66f2c3dca..792be23e50 100644 --- a/openpilot/starpilot/galaxy/starport_send.py +++ b/openpilot/starpilot/galaxy/starport_send.py @@ -38,9 +38,14 @@ class SendBusy(Exception): pass +def install_repo() -> str: + from openpilot.starpilot.system.starport.bugsink_transport import device_metadata + return device_metadata().get("repo", "") + + def official_install() -> bool: - from openpilot.starpilot.system.starport.bugsink_transport import device_metadata, is_official_repo - return is_official_repo(device_metadata().get("repo")) + from openpilot.starpilot.system.starport.bugsink_transport import is_official_repo + return is_official_repo(install_repo()) def webhook_url(override_path: Path = WEBHOOK_OVERRIDE_PATH) -> str: diff --git a/openpilot/starpilot/galaxy/tests/test_log_relay_stage.py b/openpilot/starpilot/galaxy/tests/test_log_relay_stage.py index b96001a79c..86315d4ed5 100644 --- a/openpilot/starpilot/galaxy/tests/test_log_relay_stage.py +++ b/openpilot/starpilot/galaxy/tests/test_log_relay_stage.py @@ -98,11 +98,13 @@ class LogRelayStagerTest(unittest.TestCase): lambda: b"controller-zip", post=fake_post, official=lambda: False, + repo=lambda: "dirwin31/openpilot", ) initial = stager.status() self.assertEqual(initial["state"], "idle") self.assertTrue(initial["available"]) self.assertTrue(initial["fork"]) + self.assertEqual(initial["repo"], "dirwin31/openpilot") self.assertEqual(initial["noteLimit"], NOTE_LIMIT) self.assertEqual(initial["modelLimit"], MODEL_LIMIT) diff --git a/openpilot/starpilot/galaxy/web/js/log-help.js b/openpilot/starpilot/galaxy/web/js/log-help.js index 3a547a3280..0450d52039 100644 --- a/openpilot/starpilot/galaxy/web/js/log-help.js +++ b/openpilot/starpilot/galaxy/web/js/log-help.js @@ -114,6 +114,7 @@ export class LogStageClient { kind, available: body.available !== false, fork: body.fork === true, + repo: typeof body.repo === "string" ? body.repo : "", noteLimit: body.noteLimit || NOTE_LIMIT, modelLimit: body.modelLimit || MODEL_LIMIT, error: "", @@ -254,7 +255,7 @@ export const LogHelp = { data() { return { selected: KINDS.includes(this.topic) ? this.topic : "starport", - stage: { state: "idle", message: "", claimUrl: "", kind: "", available: true, fork: false, noteLimit: NOTE_LIMIT, modelLimit: MODEL_LIMIT, error: "" }, + stage: { state: "idle", message: "", claimUrl: "", kind: "", available: true, fork: false, repo: "", noteLimit: NOTE_LIMIT, modelLimit: MODEL_LIMIT, error: "" }, starportLogs: { sessions: [], others: [], status: "idle", error: "" }, sessionsOpen: false, bluetooth: bluetoothConnection(), @@ -279,6 +280,10 @@ export const LogHelp = { claimReady() { return this.stage.state === "ready" && !!this.stage.claimUrl && this.stage.kind === this.selected }, + forkTitle() { + const repo = this.stage.repo.includes("/") ? this.stage.repo : "" + return "This device is running a StarPilot fork" + (repo ? " (" + repo + ")" : "") + }, missingHint() { if (this.selected === "controller") return "Enter your controller model and a short note above to send." return "Add a short note about what happened above to send." @@ -406,7 +411,7 @@ export const LogHelp = {

Connect to your comma to send or download diagnostic logs.