UC-PLT-402: Automated CI/CD & Schema Migration
1. Metadata
| Property | Value |
|---|---|
| ID | UC-PLT-402 |
| Actor | Software Engineer / System |
| Trigger | Git Push to production branch |
| Pre-conditions | All tests passed in Staging; Approval received from Lead |
| Post-conditions | Code deployed to Edge; DB Schema updated; Cache invalidated |
| Side Effects | Short-term lock on specific DB tables during migration (< 500ms) |
2. Description
Streamlines the deployment process, ensuring that new features and security patches are released with zero manual intervention and no database synchronization errors.
3. Success Scenario
- Push: Developer merges a 'Feature' branch into
main. - Build: GitHub Actions triggers a build process, transpiling TypeScript and minifying assets.
- Testing: System executes 250+ unit tests and 50+ E2E integration tests.
- Schema Update:
- System detects a new SQL migration file.
AtlasorFlywayexecutes the migration against the Production database.
- Deployment:
- Compiled Worker code is pushed to Cloudflare Pages/Workers.
- Assets are propagated to the global CDN.
- Verification: Automated 'Smoke Tests' run against the live endpoint.
- Cleanup: Old build artifacts are archived.
4. Acceptance Criteria
- [ ] Rollback: Every deployment must be revertible to the previous stable state with a single click in < 30 seconds.
- [ ] Safety: Database migrations must be 'Backward Compatible' (No destructive
DROP COLUMNwithout multi-phase planning). - [ ] Speed: Total pipeline duration (Build to Live) must be < 5 minutes.
5. Deployment Pipeline
sequenceDiagram
participant Dev as Developer
participant Git as Git Repo
participant CI as CI/CD Pipeline
participant DB as Production DB
participant Live as Cloudflare Edge
Dev->>Git: Push to main
Git->>CI: Trigger Build
CI->>CI: Run Tests
CI->>DB: Apply SQL Migrations
CI->>Live: Deploy Code
Live-->>Dev: Success Notification