Skip to content

Commit

Permalink
⚠️ Remove Test Branch Warning; Disable Updates; Remove Prime Ad
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
krkeegan committed Feb 23, 2022
1 parent c8a5e91 commit 11afa4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 30 deletions.
4 changes: 2 additions & 2 deletions selfdrive/car/car_helpers.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
26 changes: 1 addition & 25 deletions selfdrive/ui/qt/widgets/prime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<QString> bullets = {"Remote access", "14 days of storage", "Developer perks"};
for (auto &b: bullets) {
const QString check = "<b><font color='#465BEA'>✓</font></b> ";
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 {
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down
14 changes: 14 additions & 0 deletions selfdrive/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 11afa4c

Please sign in to comment.