From 11afa4c286115029023c77c9edeafd84d7ab6992 Mon Sep 17 00:00:00 2001 From: KRKeegan Date: Fri, 29 Oct 2021 15:43:36 -0700 Subject: [PATCH] :warning: Remove Test Branch Warning; Disable Updates; Remove Prime Ad Disabling of not tested branch warning should only affect users with ssh access to repo (me) and only the main Rav4-TSS2 branch. Disabled in a way that hopefully doesn't harm comma's metrics. --- selfdrive/car/car_helpers.py | 4 ++-- selfdrive/ui/qt/widgets/prime.cc | 26 +------------------------- selfdrive/updated.py | 6 +++--- selfdrive/version.py | 14 ++++++++++++++ 4 files changed, 20 insertions(+), 30 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 90bfdd8a93a048..e8ef70737b3059 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -1,7 +1,7 @@ import os from common.params import Params from common.basedir import BASEDIR -from selfdrive.version import is_comma_remote, is_tested_branch +from selfdrive.version import is_comma_remote, is_tested_branch, is_krk_remote, is_krk_branch from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from selfdrive.car.vin import get_vin, VIN_UNKNOWN from selfdrive.car.fw_versions import get_fw_versions, match_fw_to_car @@ -14,7 +14,7 @@ def get_startup_event(car_recognized, controller_available, fw_seen): - if is_comma_remote() and is_tested_branch(): + if (is_comma_remote() and is_tested_branch()) or (is_krk_remote() and is_krk_branch()): event = EventName.startup else: event = EventName.startupMaster diff --git a/selfdrive/ui/qt/widgets/prime.cc b/selfdrive/ui/qt/widgets/prime.cc index 27d472535b2204..bc12aff835e473 100644 --- a/selfdrive/ui/qt/widgets/prime.cc +++ b/selfdrive/ui/qt/widgets/prime.cc @@ -181,31 +181,7 @@ PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QFrame(parent) { main_layout->setContentsMargins(80, 90, 80, 60); main_layout->setSpacing(0); - QLabel *upgrade = new QLabel("Upgrade Now"); - upgrade->setStyleSheet("font-size: 75px; font-weight: bold;"); - main_layout->addWidget(upgrade, 0, Qt::AlignTop); - main_layout->addSpacing(50); - - QLabel *description = new QLabel("Become a comma prime member at connect.comma.ai"); - description->setStyleSheet("font-size: 60px; font-weight: light; color: white;"); - description->setWordWrap(true); - main_layout->addWidget(description, 0, Qt::AlignTop); - - main_layout->addStretch(); - - QLabel *features = new QLabel("PRIME FEATURES:"); - features->setStyleSheet("font-size: 41px; font-weight: bold; color: #E5E5E5;"); - main_layout->addWidget(features, 0, Qt::AlignBottom); - main_layout->addSpacing(30); - - QVector bullets = {"Remote access", "14 days of storage", "Developer perks"}; - for (auto &b: bullets) { - const QString check = " "; - QLabel *l = new QLabel(check + b); - l->setAlignment(Qt::AlignLeft); - l->setStyleSheet("font-size: 50px; margin-bottom: 15px;"); - main_layout->addWidget(l, 0, Qt::AlignBottom); - } + // KRKeegan Remove Prime Ad setStyleSheet(R"( PrimeAdWidget { diff --git a/selfdrive/updated.py b/selfdrive/updated.py index 1a87798619a05c..2df56b6c3280ce 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -52,8 +52,8 @@ OVERLAY_MERGED = os.path.join(STAGING_ROOT, "merged") FINALIZED = os.path.join(STAGING_ROOT, "finalized") -DAYS_NO_CONNECTIVITY_MAX = 14 # do not allow to engage after this many days -DAYS_NO_CONNECTIVITY_PROMPT = 10 # send an offroad prompt after this many days +DAYS_NO_CONNECTIVITY_MAX = 36500 # do not allow to engage after this many days // KRKeegan disable connect warning +DAYS_NO_CONNECTIVITY_PROMPT = 36500 # send an offroad prompt after this many days // KRKeegan disable connect warning class WaitTimeHelper: def __init__(self, proc): @@ -373,7 +373,7 @@ def fetch_update(wait_helper: WaitTimeHelper) -> bool: def main() -> None: params = Params() - if params.get_bool("DisableUpdates"): + if params.get_bool("DisableUpdates") or True: # KRKeegan disable updates cloudlog.warning("updates are disabled by the DisableUpdates param") exit(0) diff --git a/selfdrive/version.py b/selfdrive/version.py index f2570cd305677f..1e6c95b5080c8a 100644 --- a/selfdrive/version.py +++ b/selfdrive/version.py @@ -8,6 +8,7 @@ from selfdrive.swaglog import cloudlog TESTED_BRANCHES = ['devel', 'release2-staging', 'release3-staging', 'dashcam-staging', 'release2', 'release3', 'dashcam'] +KRK_BRANCHES = ['Rav4-TSS2'] training_version: bytes = b"0.2.0" terms_version: bytes = b"2" @@ -93,6 +94,19 @@ def is_tested_branch() -> bool: return get_short_branch() in TESTED_BRANCHES +@cache +def is_krk_remote() -> bool: + origin = get_origin() + if origin is None: + return False + return origin.startswith('git@github.com:krkeegan') + + +@cache +def is_krk_branch() -> bool: + return get_short_branch() in KRK_BRANCHES + + @cache def is_dirty() -> bool: origin = get_origin()