fix(ci): improve migration error handling and validation logs
Validators (Pushes and Pull Requests) / Security & Secrets (push) Failing after 6s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 21s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Workflow Lint & Validation / Validate Secrets Contract (push) Failing after 6s
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Workflow Lint & Validation / Lint All Workflow Files (push) Failing after 11s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 9s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Failing after 7s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 6s
Workflow Lint & Validation / Notify Lint Results (push) Failing after 1s
Validators (Pushes and Pull Requests) / Security & Secrets (push) Failing after 6s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 21s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Workflow Lint & Validation / Validate Secrets Contract (push) Failing after 6s
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Workflow Lint & Validation / Lint All Workflow Files (push) Failing after 11s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 9s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Failing after 7s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 6s
Workflow Lint & Validation / Notify Lint Results (push) Failing after 1s
Enhanced CI diagnostics for Phase 0 migration execution: Changes: ✓ Add database connection pre-check (SELECT version()) ✓ Improved migration error reporting ✓ Detailed table verification after migration ✓ Better debugging output for failure scenarios ✓ Clearer success message with audit table count This addresses the migration execution failures in runs #2585 and #2587. Retry: Phase 0 Week 1 - CI Performance Baseline (Attempt 2) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
+16
-10
@@ -70,25 +70,31 @@ jobs:
|
||||
PGPORT: 5432
|
||||
run: |
|
||||
which psql || (sudo apt-get update -qq && sudo apt-get install -y -qq postgresql-client)
|
||||
|
||||
echo "=== Database Connection Check ==="
|
||||
psql -U quantengine_ci -d quantenginedb -c "SELECT version();" || exit 1
|
||||
|
||||
echo "=== Applying Migrations ==="
|
||||
for f in $(ls src/dotnet/QuantEngine.Infrastructure/Migrations/V*.sql | sort -V); do
|
||||
echo "Applying $f"
|
||||
psql -U quantengine_ci -d quantenginedb -v ON_ERROR_STOP=1 -f "$f"
|
||||
echo "Applying: $f"
|
||||
psql -U quantengine_ci -d quantenginedb -v ON_ERROR_STOP=1 -f "$f" || {
|
||||
echo "ERROR: Failed to apply $f"
|
||||
psql -U quantengine_ci -d quantenginedb -c "SELECT tablename FROM pg_tables WHERE schemaname='quantengine' ORDER BY tablename;"
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
# Verify migrations: check kis_*_audit tables exist
|
||||
echo "=== Verifying Migrations ==="
|
||||
AUDIT_COUNT=$(psql -U quantengine_ci -d quantenginedb -t -c "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='quantengine' AND table_name LIKE 'kis_%_audit'")
|
||||
echo "kis_*_audit tables: $AUDIT_COUNT"
|
||||
|
||||
if [ "$AUDIT_COUNT" -lt 3 ]; then
|
||||
echo "ERROR: Expected 3 audit tables, found $AUDIT_COUNT"
|
||||
psql -U quantengine_ci -d quantenginedb -c "SELECT tablename FROM pg_tables WHERE schemaname='quantengine' ORDER BY tablename;"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify triggers exist
|
||||
TRIGGER_COUNT=$(psql -U quantengine_ci -d quantenginedb -t -c "SELECT COUNT(*) FROM information_schema.triggers WHERE trigger_schema='quantengine' AND trigger_name LIKE '%_audit_trigger'")
|
||||
if [ "$TRIGGER_COUNT" -lt 3 ]; then
|
||||
echo "WARNING: Expected 3 audit triggers, found $TRIGGER_COUNT"
|
||||
fi
|
||||
|
||||
echo "✓ Database migrations applied & verified"
|
||||
echo "✓ Database migrations applied & verified (3 audit tables created)"
|
||||
|
||||
- name: Setup .NET SDK
|
||||
uses: actions/setup-dotnet@v4
|
||||
|
||||
Reference in New Issue
Block a user