fix(ci): normalize migration database url for psql
All checks were successful
CD Pipeline / tests (push) Successful in 1m30s
Code Review / ai-code-review (push) Successful in 27s
CD Pipeline / build-and-deploy (push) Successful in 13m20s
CD Pipeline / post-deploy-checks (push) Successful in 3m36s

This commit is contained in:
Your Name
2026-05-01 13:30:32 +08:00
parent 7e4d995e4b
commit 6ec3f116fd
2 changed files with 7 additions and 2 deletions

View File

@@ -74,12 +74,13 @@ jobs:
echo "::error::MIGRATION_DATABASE_URL secret not set in Gitea"
exit 1
fi
PGURL_PSQL="${PGURL/postgresql+asyncpg:\/\//postgresql:\/\/}"
# 套用每個新檔 (single transaction per file)
echo "${{ steps.diff.outputs.new_files }}" | while IFS= read -r file; do
[ -z "$file" ] && continue
echo "=== Applying: $file ==="
psql "$PGURL" \
psql "$PGURL_PSQL" \
-v ON_ERROR_STOP=1 \
--single-transaction \
-f "$file"
@@ -91,8 +92,9 @@ jobs:
env:
PGURL: ${{ secrets.MIGRATION_DATABASE_URL }}
run: |
PGURL_PSQL="${PGURL/postgresql+asyncpg:\/\//postgresql:\/\/}"
FILES_JSON=$(echo "${{ steps.diff.outputs.new_files }}" | jq -Rn '[inputs | select(length > 0)]')
psql "$PGURL" -c "
psql "$PGURL_PSQL" -c "
INSERT INTO asset_discovery_run (
run_id, triggered_by, scope, scan_depth, status,
started_at, ended_at, tools_used, summary

View File

@@ -37,6 +37,9 @@ Claude Code 成本評估指出真正瓶頸不是外部 AI 費用,而是同一
### 驗證
- `python3 -m py_compile` 針對 MCP registry/audit、AI provider interface、Agent Loop、Claude/Ollama provider、DB models 通過。
- `cd apps/api && pytest tests/test_agent_loop_foundation.py tests/test_mcp_tool_registry.py tests/test_callback_dispatcher.py tests/test_openclaw_cache_key.py -q` → 64 passed。
- `cd apps/api && pytest tests/test_agent_loop_foundation.py tests/test_mcp_tool_registry.py tests/test_pre_decision_investigator.py tests/test_callback_dispatcher.py tests/test_openclaw_cache_key.py tests/test_alertmanager_rule_bypass.py -q` → 103 passed。
- Prod 手動套用 `adr105_mcp_audit_snapshots.sql` 通過,確認四表存在,且 `mcp_audit_log``agent_role` 欄位。
- 修復 Gitea migration workflow`postgresql+asyncpg://` 轉成 `postgresql://` 再交給 `psql`,避免 migration CI 退成 local socket。
## 2026-05-01 | HostBackupFailed rule-first e2e 補洞