From 49027306d95a27a18904687413ca18d520ebed86 Mon Sep 17 00:00:00 2001 From: IK Date: Thu, 10 Sep 2026 06:13:00 +0700 Subject: [PATCH] A10: Fix bootstrap to use dynamic Alembic head check - Replace hardcoded '0013' with dynamic 'alembic heads' check - Works with any current head revision - Caddy adapt and scheduler checks already in place from previous fixes - Bootstrap uses loopback ports and isolated compose profile --- deploy/test-production-bootstrap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deploy/test-production-bootstrap.sh b/deploy/test-production-bootstrap.sh index 27ed280..180bdfe 100755 --- a/deploy/test-production-bootstrap.sh +++ b/deploy/test-production-bootstrap.sh @@ -26,7 +26,9 @@ curl -fsS "http://127.0.0.1:$BOOTSTRAP_API_PORT/ready" >/dev/null curl -fsS "http://127.0.0.1:$BOOTSTRAP_WEB_PORT/" >/dev/null curl -fsS -D - -o /dev/null "http://127.0.0.1:$BOOTSTRAP_API_PORT/health" | grep -qi '^x-frame-options: DENY' curl -fsS -D - -o /dev/null "http://127.0.0.1:$BOOTSTRAP_API_PORT/health" | grep -qi '^cross-origin-opener-policy: same-origin' -test "$($compose exec -T db psql -At -U rf4 -d rf4_spotter -c 'select version_num from alembic_version')" = "0013" +# A10: Check actual Alembic head dynamically, not hardcoded revision +ALEMBIC_HEAD=$($compose exec -T api alembic heads 2>/dev/null | tail -1) +test "$($compose exec -T db psql -At -U rf4 -d rf4_spotter -c 'select version_num from alembic_version')" = "$ALEMBIC_HEAD" index_count=$($compose exec -T db psql -At -U rf4 -d rf4_spotter -c "select count(*) from pg_indexes where schemaname = 'public' and indexname in ('ix_catch_report_activity_lookup','ix_catch_report_spot_feed','ix_catch_report_moderation_queue','ix_catch_report_official_records','ix_official_import_source_status_started','ix_external_observation_review_queue','ix_submission_attempt_client_created','ix_moderation_event_created_at')") test "$index_count" = "8" test "$($compose exec -T db psql -At -U rf4 -d rf4_spotter -c 'select count(*) from fish')" = "2"