No code reaches production without passing every gate below. No gate can be bypassed by an individual contributor.
Pull request gates
Every PR tomaster must pass:
Linting
RuboCop (backend), ESLint + TypeScript strict (frontend),
terraform fmt + terraform validate.Tests
Backend:
parallel_rspec across 4 shards. Frontend: Vitest across 4 shards. E2E: Playwright smoke tests. 90% / 80% coverage minimums enforced.Security scans
Brakeman (SAST), bundler-audit, npm audit, Trivy (Terraform), gitleaks, license_finder. All blocking on medium+ severity.
OpenAPI drift check
If request specs changed, the OpenAPI spec must be regenerated and the TypeScript types migrated.
Deployment pipeline
Build
On merge to
master, GitHub Actions builds Docker images for backend and frontend. Images are tagged with the full commit SHA.Push
Images are pushed to GCP Artifact Registry via Workload Identity Federation — no long-lived keys.
Deploy
Cloud Run deploys the new image with a gradual rollout. Health checks must pass before 100% traffic.
Strong migrations
Thestrong_migrations gem enforces safe migration practices:
- No removing columns without
safety_assuredand a compatibility window. - Concurrent index creation for large tables.
- Backfills must be separated from schema changes.
- Any unsafe migration raises
StrongMigrations::UnsafeMigrationin development.
Rollback
- Cloud Run revision rollback — any previous revision can be promoted via one command.
- Database rollback — migrations are forward-compatible where possible; destructive rollbacks require a manual runbook and approval.
- Config rollback — Terraform state is versioned; any change can be rolled back via re-apply of the previous plan.
Segregation of duties
- Developers have read access to production logs and metrics (via GCP IAM) but no direct write access to the database or production Secret Manager values.
- Deployment is performed by the CI/CD pipeline under a deploy-specific service account — no humans hold its credentials.
- Break-glass access for production incidents is granted just-in-time via a documented procedure and audit-logged.