Skip to content
Workforce · Engineering Showcase

Release engineering

Production reliability

The process used to change a system that drives payroll: automated gates, read-only preflight checks, explicit approvals, rollback plans and post-deployment validation.

CI/CDMigration safetyApprovalsRollback· Applied to every release

01Problem

Merging to the main branch deploys to production automatically, and the build does not run database migrations. A schema change merged at the wrong moment could break live attendance for every store.

The process had to be light enough to run on every change, yet leave little room for error.

02User Needs

  • Store staff: punching must keep working during and after a release.
  • HR: releases must not change existing attendance, leave or payroll results.
  • Release owner: an explicit decision before anything reaches production.

03Constraints

  • Some schema changes, such as new enum values, are not compatible with older deployed code.
  • Some test suites need a real PostgreSQL database; CI must never touch production data.
  • Production credentials are deliberately kept out of development tooling.

04Technical Decision

Make every stage an explicit gate: plan, implement, commit, open the PR, merge, migrate and deploy each need their own approval. Approving one stage never implies the next.

For releases with schema changes, apply the migration before merging, so the new code never runs against an old schema. Every mutating operator script defaults to a dry run.

Release pipeline

Each numbered stage is a gate. Approval of one stage does not imply the next.

  1. 01

    Plan

    Read-only investigation, written plan, approval

  2. 02

    Pull request

    AI-assisted implementation, human review

  3. 03

    CI gate

    Lint · build & typecheck · test suites on ephemeral Postgres

  4. 04

    Preflight

    Read-only production checks; frozen baseline

  5. 05

    Migrate

    Approved window; migrations before merge

  6. 06

    Merge & deploy

    Automatic production deployment

  7. 07

    Postflight

    Smoke checks, dry runs, owner acceptance; rollback target recorded

05Implementation

  • CI runs on every pull request: lint, a production build with full type checking, static safety guards, and the integration test suites against an ephemeral PostgreSQL service with no secrets configured.
  • Release candidates are built from a clean archive of the exact commit, with a locked dependency install.
  • Read-only preflight checks verify the production schema and data assumptions before any write.
  • Migrations are applied in a planned window, then post-flight checks compare record counts and fingerprints with the frozen baseline.
  • Every release records a known-good deployment to roll back to, plus the code-level rollback path.
  • Post-deployment, unauthenticated smoke checks and scheduled-job dry runs come first. Logged-in acceptance by the owner follows.
  • Change freezes protect data during multi-step releases, and anything that breaches a freeze is reported rather than quietly absorbed.

06Validation

  • Golden-output tests pin payroll-facing exports byte for byte.
  • Flaky tests are rerun once and documented, not silently retried until they pass.
  • Release notes record the commit, migrations applied, checks run and results.

07Outcome

  • Multi-stage releases, including the one that introduced the employment-status model, were applied with checks before and after deployment.
  • Every release has a documented rollback path.
  • Open findings from internal audits are tracked privately and are deliberately not described on this site.

08Lessons Learned

  • Ordering is part of correctness. 'Migrate, then merge' removed a whole class of deployment failure.
  • Dry-run-by-default scripts make the safe action the easy one.
  • Writing down what was not verified matters as much as listing what passed.

Based on the project history and release documentation. Identifiers, credentials, configuration values and open findings are intentionally omitted.

Next case studyPerformance optimization