diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index f4c32c65b9..231ffa3ece 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -73,7 +73,7 @@ function update_is_ready { # every boot before swapping trees, including manual reboots. # Keep this in sync with TRUSTED_LEGACY_RELEASES in updated.py. TRUSTED_LEGACY_STARPILOT_COMMIT="c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6" -TRUSTED_LEGACY_STABLE_MIGRATION="0758072c767719dd63d133f78c6738b90505cb4e" +TRUSTED_LEGACY_STABLE_MIGRATION="7ab42497b4590153c88560c7e2c2f3ff8317c6d4" function trusted_legacy_commit { [ "$1" = "$TRUSTED_LEGACY_STARPILOT_COMMIT" ] || [ "$1" = "$TRUSTED_LEGACY_STABLE_MIGRATION" ] diff --git a/openpilot/system/updated/tests/test_vendored_update.py b/openpilot/system/updated/tests/test_vendored_update.py index 787dc79e07..68b7724527 100644 --- a/openpilot/system/updated/tests/test_vendored_update.py +++ b/openpilot/system/updated/tests/test_vendored_update.py @@ -302,8 +302,8 @@ class TestVendoredUpdate(unittest.TestCase): self.updated.validate_update_revision(str(self.source), target, 'StarPilot') audited = load_updater().TRUSTED_LEGACY_RELEASES self.assertEqual(audited, { - 'StarPilot': frozenset({'c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6', '0758072c767719dd63d133f78c6738b90505cb4e'}), - 'stable': frozenset({'0758072c767719dd63d133f78c6738b90505cb4e'}), + 'StarPilot': frozenset({'c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6', '7ab42497b4590153c88560c7e2c2f3ff8317c6d4'}), + 'stable': frozenset({'7ab42497b4590153c88560c7e2c2f3ff8317c6d4'}), }) def test_reserved_readiness_marker_rejected_in_modern_and_legacy_trees(self): diff --git a/openpilot/system/updated/updated.py b/openpilot/system/updated/updated.py index a6956575a9..06a9b4b973 100755 --- a/openpilot/system/updated/updated.py +++ b/openpilot/system/updated/updated.py @@ -266,8 +266,8 @@ def init_overlay() -> None: # Audited legacy release, pinned by Git commit identity. Other releases must # satisfy the modern source manifest contract. TRUSTED_LEGACY_RELEASES = { - 'StarPilot': frozenset({'c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6', '0758072c767719dd63d133f78c6738b90505cb4e'}), - 'stable': frozenset({'0758072c767719dd63d133f78c6738b90505cb4e'}), + 'StarPilot': frozenset({'c2e5e469ee8fefc3cffb514dc2e1a1fb82a421d6', '7ab42497b4590153c88560c7e2c2f3ff8317c6d4'}), + 'stable': frozenset({'7ab42497b4590153c88560c7e2c2f3ff8317c6d4'}), } LEGACY_OS_MARKER = '.git/starpilot-retain-agnos' diff --git a/prebuilt.json b/prebuilt.json index a3beff8c25..8ed17cb96b 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "e50af3c3ccbc4df5d97292180f6972f63009659ab1a5e6e020f1bad9857e64e9", "schema_version": 1} +{"protected_inventory_sha256": "b4d8568468769c810d1a248395406c8c159cc0ca4da5943ab840048e2fef1a23", "schema_version": 1} diff --git a/scripts/branch_migration.py b/scripts/branch_migration.py index bb75a14af2..ea679dd700 100644 --- a/scripts/branch_migration.py +++ b/scripts/branch_migration.py @@ -82,7 +82,7 @@ def migrate(repo, params, checkpoint=lambda step: None): return 'manual branch selection' target = params / 'UpdaterTargetBranch' saved = target.read_bytes() if target.exists() else b'' - if saved not in (b'', plan['source'].encode(), plan['destination'].encode()): + if pending.exists() and saved not in (b'', plan['source'].encode(), plan['destination'].encode()): return 'manual updater selection' if not params.is_dir() or target.is_symlink(): raise ValueError('Updater Params directory is unavailable or unsafe') diff --git a/scripts/tests/test_branch_migration.py b/scripts/tests/test_branch_migration.py index b0e3157020..1531f171e5 100644 --- a/scripts/tests/test_branch_migration.py +++ b/scripts/tests/test_branch_migration.py @@ -148,12 +148,23 @@ class BranchMigrationTest(unittest.TestCase): self.assertEqual(runtime.migrate(repo, params), 'not migration release') self.assertEqual(self.git(repo, 'symbolic-ref', '--short', 'HEAD'), 'StarPilot') - def test_manual_updater_target_is_preserved(self): + def test_fresh_source_install_replaces_a_stale_previous_channel_target(self): _, repo, params, _ = self.fixture() + (params / 'UpdaterTargetBranch').write_text('StarPilot') + self.assertEqual(runtime.migrate(repo, params), 'migrated to testing') + self.assertEqual((params / 'UpdaterTargetBranch').read_text(), 'testing') + self.assertEqual(self.git(repo, 'symbolic-ref', '--short', 'HEAD'), 'testing') + + def test_manual_target_selected_after_an_interruption_is_preserved(self): + _, repo, params, _ = self.fixture() + def stop(step): + if step == 'pending': + raise RuntimeError('interrupted') + with self.assertRaises(RuntimeError): + runtime.migrate(repo, params, stop) (params / 'UpdaterTargetBranch').write_text('dev') self.assertEqual(runtime.migrate(repo, params), 'manual updater selection') self.assertEqual((params / 'UpdaterTargetBranch').read_text(), 'dev') - self.assertEqual(self.git(repo, 'symbolic-ref', '--short', 'HEAD'), 'Dom') def test_existing_different_destination_is_not_overwritten(self): _, repo, params, migration = self.fixture()