Skip to content

Lesson 6 of 9 · 25m

Release Orchestration and Artifact Promotion

Coordinate versions, builds, deployments, and rollbacks across independent applications without letting the monorepo imply a monolithic release.

A monorepo does not mean a monolith release. This distinction ruins teams when they miss it: source control can be unified while deployment units remain independent. If every commit requires every application to redeploy, you have recreated the worst parts of a distributed monolith with better source control.

Build once, promote deliberately

Artifacts should be immutable outputs of a specific commit and build graph:

commit -> task graph -> artifact -> staging -> production

Do not rebuild the same application separately for staging and production if you can avoid it. Rebuilding introduces toolchain and input drift exactly where you want forensic confidence. Promote the artifact and attach deployment-specific configuration at runtime or deploy time.

A simple artifact manifest might record:

{
  "app": "web",
  "commit": "6f2d1a9",
  "taskHash": "8d4d2f0c",
  "image": "registry.example.internal/web@sha256:7c31...",
  "schemaVersion": 42
}

When something breaks, this tells you which source, build inputs, and deployed artifact are implicated.

Independent deployability requires explicit contracts

Applications in one repository can still deploy independently if their boundaries are stable. The API and web client must tolerate version skew. Database migrations need forward and backward compatibility discipline. Shared libraries must not secretly become coordination couplings.

The dangerous pattern is a shared package that changes both producer and consumer behavior, followed by deploying only one side. If the change requires synchronized deployment, say so in the release plan. Do not pretend independent deployability exists because artifacts are separate.

Versioning internal packages

Tools like Changesets make release intent explicit at PR time:

pnpm changeset

A changeset records which packages need version bumps and why:

---
"@acme/auth": minor
---

Add passkey enrollment helpers while preserving existing token APIs.

Even if you never publish packages publicly, this habit forces authors to think about consumer impact. For deployable apps, versions may be commit-derived rather than semver. The key is consistent meaning, not ideological semver.

Database migrations outrank application order

The schema often constrains deployment order more than code does. Expand-then-contract is the standard survival pattern:

expand: add nullable column / new table / dual-write if needed
deploy application versions that tolerate old and new shapes
contract: remove old column/path after all consumers are gone

A monorepo makes it easy to change application and migration in one commit. That does not make it safe to deploy them as one instantaneous event. Rollback is especially important: rolling back application code must not leave it incompatible with a newer destructive schema.

Rollback is part of release design

Every deployment artifact should answer:

  • What is the previous known-good artifact?
  • Which migrations have run since then?
  • Can this rollback coexist with data written by the new version?
  • Which feature flags decouple release from exposure?

Feature flags are not a substitute for engineering, but they are often the difference between a controlled rollback and a panicked redeploy.

Field notes

  • "Everything is in one repo" is not a deployment strategy. Artifact identity and promotion rules are the strategy.
  • Rebuilding per environment makes incident reconstruction harder and wastes cache correctness work.
  • Database compatibility windows deserve as much design attention as API compatibility.
  • A synchronized deployment is sometimes necessary. Make it explicit, rehearse it, and do not let it become the default by accident.

Was this lesson helpful?

Sign in to rate