fix: M-AI-03 depends on current-integration for migrations
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 35s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 16s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 9s
Deploy API Server / deploy (push) Has been skipped

current-integration already handles migration baselining + deploy correctly.
Running a parallel baseline in m-ai-03 would mark all migrations as applied
without creating tables when _prisma_migrations is empty, then migrate deploy
finds nothing to run. Depending on current-integration ensures DB schema
is ready before E2E tests execute.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-21 12:23:32 +08:00
parent 127940cfe3
commit 7dfeb00382

View File

@ -295,7 +295,7 @@ jobs:
# Job 4: M-AI-03 Synthetic E2E # Job 4: M-AI-03 Synthetic E2E
# ═══════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════
m-ai-03-synthetic-e2e: m-ai-03-synthetic-e2e:
needs: build-and-unit needs: current-integration
runs-on: prod runs-on: prod
steps: steps:
- name: Restore build artifacts - name: Restore build artifacts
@ -309,23 +309,6 @@ jobs:
docker start mysql redis 2>/dev/null || true docker start mysql redis 2>/dev/null || true
sleep 2 sleep 2
- name: Apply database migrations
run: |
cd $WORKDIR
HAS_MIGS=$(npx prisma db execute --stdin <<< "SELECT COUNT(*) as cnt FROM _prisma_migrations" 2>/dev/null | grep -o '[0-9]*' | head -1 || echo "0")
if [ "$HAS_MIGS" = "0" ] || [ -z "$HAS_MIGS" ]; then
echo "[M-AI-03] Baselining existing migrations..."
for m in prisma/migrations/*/; do
m_name=$(basename "$m")
if [ "$m_name" != "backfill_chat_scope.sql" ] && [ "$m_name" != "migration_lock.toml" ]; then
DATABASE_URL="${{ secrets.DATABASE_URL }}" npx prisma migrate resolve --applied "$m_name" 2>/dev/null || true
fi
done
echo "[M-AI-03] Baseline complete."
fi
DATABASE_URL="${{ secrets.DATABASE_URL }}" npx prisma migrate deploy
timeout-minutes: 5
- name: M-AI-03 Gate E2E - name: M-AI-03 Gate E2E
run: | run: |
cd $WORKDIR cd $WORKDIR