feat: integrate Sentry + fix CI/CD issues
Sentry Integration (補強 SignOz): - Add @sentry/nextjs for frontend error tracking + session replay - Add sentry-sdk[fastapi] for backend error tracking - Create sentry.client/server/edge.config.ts - Integrate with next.config.js + instrumentation.ts - Add Sentry exception capture in FastAPI error handler - Create deployment scripts for Self-Hosted @ 192.168.0.110 CI/CD Fixes: - Fix F821 Undefined name 'Field' in incidents.py - Add NEXT_PUBLIC_API_URL env var to CI build step - Add build-arg to Docker build verification E2E Test Improvements: - Fix strict mode violations in dashboard-acceptance tests - Add timeout increase for Phase 4 demo tests - Make tests more resilient to UI variations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -55,12 +55,16 @@ def get_engine() -> AsyncEngine:
|
||||
if _engine is None:
|
||||
database_url = settings.DATABASE_URL
|
||||
|
||||
# 統帥鐵律: 禁止 SQLite
|
||||
# 統帥鐵律: 禁止 SQLite (AWOOOI 憲法)
|
||||
# 🔴 違反此規則必須立即報錯,禁止 fallback
|
||||
if "sqlite" in database_url.lower():
|
||||
import structlog
|
||||
logger = structlog.get_logger(__name__)
|
||||
logger.error("sqlite_forbidden", message="SQLite is FORBIDDEN. Using PostgreSQL default.")
|
||||
database_url = "postgresql+asyncpg://awoooi:changeme@192.168.0.188:5432/awoooi_prod"
|
||||
logger.error("sqlite_forbidden", url=database_url)
|
||||
raise ValueError(
|
||||
"SQLite is FORBIDDEN by AWOOOI Constitution. "
|
||||
"Set DATABASE_URL to PostgreSQL: postgresql+asyncpg://user:pass@host:5432/db"
|
||||
)
|
||||
|
||||
_engine = create_async_engine(
|
||||
database_url,
|
||||
|
||||
Reference in New Issue
Block a user