-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improvement(ci): ensure atomicity in trigger deploys, improve overall ci organization #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ai/chat/[identifier]
…ses sim.ai/chat/[identifier]" This reverts commit c68c052.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
This PR significantly improves CI organization and deployment atomicity by restructuring GitHub Actions workflows. The key improvements include:
- Atomicity Enhancement: Split Trigger.dev deployment into deploy → migrate → promote phases, preventing incomplete deployments
- Workflow Organization: Consolidated duplicate build logic from
build-ecr.ymlandbuild.ymlinto a unifiedimages.ymlworkflow - Modular Design: Extracted reusable workflows (
test-build.yml,migrations.yml) that can be called independently - Proper Dependencies: Established clear sequential execution (test-build → build-images → trigger-deploy → migrations → trigger-promote → process-docs)
- Environment Handling: Maintained proper branch-based logic for staging vs production deployments
The changes ensure ECS deployments and database migrations complete successfully before promoting Trigger.dev deployments, eliminating race conditions that could lead to inconsistent application state.
Confidence Score: 5/5
- This PR is safe to merge with minimal risk - it improves deployment reliability and workflow organization
- Score reflects excellent architectural improvements that enhance deployment reliability. The changes are well-structured with proper dependency chains, maintain existing functionality while improving atomicity, and follow GitHub Actions best practices.
- No files require special attention - all changes improve the existing CI architecture
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| .github/workflows/ci.yml | 5/5 | Reorganized CI workflow with proper dependency chain - test-build → build-images → trigger-deploy → migrations → trigger-promote → process-docs |
| .github/workflows/images.yml | 5/5 | New unified image building workflow supporting both ECR and GHCR with conditional logic for staging vs main branches |
| .github/workflows/trigger-deploy.yml | 5/5 | New workflow for Trigger.dev deployment with --skip-promotion flag to ensure atomicity with ECS deployments |
| .github/workflows/trigger-promote.yml | 5/5 | New workflow for Trigger.dev promotion that runs after migrations complete, completing the atomic deployment |
Sequence Diagram
sequenceDiagram
participant GitHub as GitHub Actions
participant TestBuild as test-build.yml
participant Images as images.yml
participant ECR as Amazon ECR
participant GHCR as GitHub Container Registry
participant TriggerDeploy as trigger-deploy.yml
participant TriggerDev as Trigger.dev
participant Migrations as migrations.yml
participant Database as Database
participant TriggerPromote as trigger-promote.yml
participant ProcessDocs as docs-embeddings.yml
GitHub->>TestBuild: 1. Run tests and build
TestBuild-->>GitHub: Tests pass, build successful
GitHub->>Images: 2. Build and push images
Images->>ECR: Push ECR images (staging/latest tags)
alt if main branch
Images->>GHCR: Push GHCR images (amd64 + arm64)
Images->>GHCR: Create multi-arch manifests
end
Images-->>GitHub: Images built and pushed
GitHub->>TriggerDeploy: 3. Deploy with --skip-promotion
TriggerDeploy->>TriggerDev: Deploy but skip promotion
TriggerDev-->>TriggerDeploy: Deployment ready (not promoted)
TriggerDeploy-->>GitHub: Trigger.dev deployed, awaiting promotion
GitHub->>Migrations: 4. Apply database migrations
Migrations->>Database: Run migrations
Database-->>Migrations: Migrations applied
Migrations-->>GitHub: Database ready
GitHub->>TriggerPromote: 5. Promote Trigger.dev deployment
TriggerPromote->>TriggerDev: Promote latest deployment
TriggerDev-->>TriggerPromote: Deployment promoted
TriggerPromote-->>GitHub: Trigger.dev live
GitHub->>ProcessDocs: 6. Process documentation embeddings
ProcessDocs-->>GitHub: Documentation processed
8 files reviewed, 1 comment
Summary
ensure atomicity in trigger deploys, improve overall ci organization
Type of Change
Testing
N/A
Checklist