From 3fd0460d54209a2502c22eaf744dd572015a0ece Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Sat, 1 Aug 2026 19:27:48 -0700 Subject: [PATCH] Fix focused release validation failures --- ...veresult_options_alter_snapshot_options_and_more.py | 7 ++++--- ...est_api_v1_cli_workflow_add_search_update_remove.py | 3 +++ archivebox/tests/test_cli_update.py | 9 +++++---- archivebox/tests/test_ui_live_progress.py | 4 +++- docs/codeblocks.toml | 10 +++++----- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/archivebox/core/migrations/0025_alter_archiveresult_options_alter_snapshot_options_and_more.py b/archivebox/core/migrations/0025_alter_archiveresult_options_alter_snapshot_options_and_more.py index 44dd0e19..c9681b55 100644 --- a/archivebox/core/migrations/0025_alter_archiveresult_options_alter_snapshot_options_and_more.py +++ b/archivebox/core/migrations/0025_alter_archiveresult_options_alter_snapshot_options_and_more.py @@ -55,11 +55,12 @@ def _pg_sync_schema(apps, schema_editor): # retry_at/status columns and archiveresult created_at/modified_at were # created on sqlite by 0023's raw rebuild, so here they are state-only). # On postgres those columns would never land, desyncing the real schema. - # Resync to this migration's final state (empty tables on pg). Snapshot is - # referenced by SnapshotTag and ArchiveResult, so rebuild those too. + # Resync to this migration's final state (empty tables on pg). Tag and + # Snapshot both gain state-only fields; Snapshot is referenced by + # SnapshotTag and ArchiveResult, so rebuild those too. from archivebox.misc.db import rebuild_models_from_migration_state - rebuild_models_from_migration_state(apps, schema_editor, "core", ["Snapshot", "SnapshotTag", "ArchiveResult"]) + rebuild_models_from_migration_state(apps, schema_editor, "core", ["Tag", "Snapshot", "SnapshotTag", "ArchiveResult"]) class Migration(migrations.Migration): diff --git a/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py b/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py index 1b108fcb..d5112af0 100644 --- a/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py +++ b/archivebox/tests/test_api_v1_cli_workflow_add_search_update_remove.py @@ -9,6 +9,7 @@ from .conftest import ( get_free_port, init_archive, live_api_request, + run_archivebox_cmd, start_archivebox_server, stop_server, wait_for_live_api, @@ -20,6 +21,8 @@ pytestmark = pytest.mark.django_db(transaction=True) @pytest.mark.timeout(180) def test_cli_api_add_search_update_remove_over_server(tmp_path): init_archive(tmp_path) + install_result = run_archivebox_cmd(["install", "search_backend_sonic"], cwd=tmp_path) + assert install_result.returncode == 0, install_result.stderr or install_result.stdout port = get_free_port() env = cli_env(port=port, server=True, PUBLIC_INDEX="True") diff --git a/archivebox/tests/test_cli_update.py b/archivebox/tests/test_cli_update.py index de625aaa..90b4c1ba 100644 --- a/archivebox/tests/test_cli_update.py +++ b/archivebox/tests/test_cli_update.py @@ -128,7 +128,7 @@ def test_update_preserves_snapshot_count(initialized_archive): def test_update_seals_migrated_snapshots(initialized_archive): - """Test that full update reconciles migrated snapshots without re-queuing them.""" + """Test that migrate-only update reconciles snapshots without search backfill.""" env = cli_env(disable_extractors=True) run_archivebox_cmd( @@ -138,16 +138,17 @@ def test_update_seals_migrated_snapshots(initialized_archive): ) run_queued_crawls(initialized_archive, env) - # Run update + # Run the documented upgrade path without scheduling normal maintenance jobs. result = run_archivebox_cmd( - ["update"], + ["update", "--migrate-only"], env=env, timeout=120, ) output = result.stdout + result.stderr assert result.returncode == 0, output - assert "No queued/interrupted crawl work found" in output + assert "Phase 2: Processing all database snapshots" in output + assert "Reindexing" not in output # Check that snapshot remains archived instead of being queued for a full re-crawl. with use_archivebox_db(initialized_archive): diff --git a/archivebox/tests/test_ui_live_progress.py b/archivebox/tests/test_ui_live_progress.py index e0914050..e265c9df 100644 --- a/archivebox/tests/test_ui_live_progress.py +++ b/archivebox/tests/test_ui_live_progress.py @@ -521,8 +521,10 @@ class TestLiveProgressView: process = real_second_snapshot_hook_process process.status = Process.StatusChoices.RUNNING process.pid = os.getpid() + process.exit_code = None + process.started_at = timezone.now() process.ended_at = None - process.save(update_fields=["status", "pid", "ended_at"]) + process.save(update_fields=["status", "pid", "exit_code", "started_at", "ended_at", "modified_at"]) client.force_login(admin_user) response = client.get(reverse("live_progress"), HTTP_HOST=ADMIN_TEST_HOST) diff --git a/docs/codeblocks.toml b/docs/codeblocks.toml index 299859d8..de80b599 100644 --- a/docs/codeblocks.toml +++ b/docs/codeblocks.toml @@ -230,10 +230,10 @@ version = 2 "03803c44e54399c4-1" = "illustration" # docs/Upgrading.md -"ff239d3d24a06b47-1" = "illustration" +"2b06ac7469637678-1" = "illustration" "e566c21263033134-1" = "illustration" -"5d39ef7a4a12e290-1" = "illustration" -"7dade7e037424d0c-1" = "illustration" +"093c9dd57ba523aa-1" = "illustration" +"611ff525e9208d7a-1" = "illustration" # docs/Usage.md "865eeba3c03d1e2d-1" = "run" @@ -250,7 +250,6 @@ version = 2 "85f531841ec3e169-1" = "run" [scenarios] -"5f7f9732e0ae5a62-1" = "system" "976dcb4e461d60bb-1" = "docker" "811eaaada5eb1861-1" = "system" "8e6f975ced292777-1" = "collection" @@ -293,6 +292,7 @@ version = 2 "b0032c4cfcac6915-1" = "docker" "c46afe2bbd31a239-1" = "docker" "4c9a12d2d0a26431-1" = "docker" +"5f7f9732e0ae5a62-1" = "system" "73f9f36a369f2398-1" = "system" "39d6e53c2e53ef77-1" = "system" "6a149b1a387f76cc-1" = "system" @@ -331,7 +331,6 @@ version = 2 "85f531841ec3e169-1" = "collection" [environments] -"5f7f9732e0ae5a62-1" = "macos" "976dcb4e461d60bb-1" = "docker" "811eaaada5eb1861-1" = "ubuntu" "8e6f975ced292777-1" = "ubuntu" @@ -374,6 +373,7 @@ version = 2 "b0032c4cfcac6915-1" = "docker" "c46afe2bbd31a239-1" = "docker" "4c9a12d2d0a26431-1" = "docker" +"5f7f9732e0ae5a62-1" = "macos" "73f9f36a369f2398-1" = "root" "39d6e53c2e53ef77-1" = "freebsd" "6a149b1a387f76cc-1" = "openbsd"