Add deployment safeguards to prevent code mismatch issues

- Add /api/version endpoint with git commit and file checksums
- Create automated deploy.ps1 script with pre-flight checks
- Document file dependencies to prevent partial deployments
- Add version verification before and after deployment

Prevents: 4-hour debugging sessions due to production/local mismatch
Ensures: All dependent files deploy together atomically
Verifies: Production matches local code after deployment
This commit is contained in:
2026-01-18 15:13:47 -07:00
parent a534a72a0f
commit a6eedc1b77
4 changed files with 441 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ from api.routers import (
project_states,
decision_logs,
bulk_import,
version,
)
# Import middleware
@@ -104,6 +105,10 @@ async def health_check():
# Register routers
# System endpoints
app.include_router(version.router, prefix="/api", tags=["System"])
# Entity endpoints
app.include_router(machines.router, prefix="/api/machines", tags=["Machines"])
app.include_router(clients.router, prefix="/api/clients", tags=["Clients"])
app.include_router(sites.router, prefix="/api/sites", tags=["Sites"])