Making changes in production

Every change reaches production the same way: as code, reviewed, tested where it can't touch production, and one step from a rollback.

7 min read

On this page

The job

Get a change from a merge request to production without surprising anyone. Reliability and change management says how many changes the error budget allows. This document says how each one gets there.

What I value

These are the values the rest of the document optimizes for. When two of them pull apart, the left column wins.

Worth moreWorth less
A change someone else reviewedA change made fast from a console
A failure in QAThe same failure in production
A pipeline that goes red when the deploy failsA pipeline that always looks green
A human decision on anything you can't undo in 5 minutesAn agent's speed
An action item that changes the systemA reminder to be more careful

One path, four environments

Every change takes the same path. Each step proves one more thing before the next one runs.

  1. dev It builds and the unit tests pass.
  2. QA It works with its neighbors. No network path to production.
  3. sandbox It deploys and runs like production, on test data.
  4. prod Smoke tests pass. Rollback is one job away.

QA is isolated from production on purpose. A test there can't reach a real customer, a real database, or a real payment, so you can run anything in it.

Skipping a step is allowed when production is broken. Then it is an emergency change: it gets recorded as one, and reviewed after the fact.

Rule: write the path down for each service: each environment, what it proves, who can deploy to it, and how to roll back.

Changes are reviewed code

Infrastructure and application changes both go through a merge request. For infrastructure, the plan is the review. The pipeline runs the plan, posts it on the merge request, and a human reads it before anything applies. State lives in one managed place, so two people can't apply over each other.

The merge request is also the record. It says what changed, who approved it, and when. That is what an auditor asks for, and it is what you need at 3am to find the last change.

Rule: no change reaches production outside a merge request.

Pipelines fail when the deploy fails

A pipeline that reports success while the new version never started is worse than no pipeline. You trust it, and you find out from a customer.

The deploy job waits until the service is running the new version. If it isn't, the job fails. Then smoke tests run against the environment: the health check reports the expected version, one read and one write succeed, and the dependencies answer. Any failure stops the pipeline before the next environment.

Rule: green means the new version is running and answering.

Agents draft, a human approves

I use agents to prepare changes: read the state, run the plan, write the merge request, and draft the ticket. They don't approve their own work.

Everything waiting on a decision goes into one approval queue, sorted by risk. I work it once a day instead of being interrupted. An approval names the exact change, and it doesn't carry over to the next one.

The line for unattended work is the same one the reliability document uses. If a change can be undone in 5 minutes, the pipeline can ship it. If it can't, like a schema migration or a deleted resource, a human approves it first.

When a change breaks something, fix the system

I run blameless postmortems. They ask what allowed the failure, and they use roles instead of names. Each action item has an owner and a ticket, and it changes the system: a new check in the pipeline, a guardrail, a test in QA.

Diagnosis: what kind of change is this?

Answer these before you start. Each answer points to a runbook.

If the change isRun
Infrastructure: network, IAM, accounts, databasesTerraform changes via merge request
An application releaseContainers: blue/green, and rollback you have tested
Inside a compliance scopeChange control in regulated environments
Proposed by an agentHuman-in-the-loop approval patterns
A new service with no path yetOnboarding a new service
A repo without a protected branch or required reviewRepo governance and branch protection
Already broken in productionIncident triage, then roll back the last change
Done, and it caused an incidentPostmortems

Then two more questions. Can you undo it in 5 minutes? If not, it needs a named approver. Has it passed QA and sandbox? If not, it is an emergency change, and you record it as one.

Takeaways

These are the guiding principles for production changes. They follow from the values above.

  1. Every production change is code in a merge request. For infrastructure, a human reads the plan before it applies.
  2. One path for every change: dev, QA, sandbox, production. Skipping a step is an emergency change.
  3. Test where a mistake can't reach production. QA has no network path to it.
  4. A failed deploy fails the pipeline. Green means the new version is running and the smoke tests pass.
  5. If you can undo it in 5 minutes, the pipeline ships it. If not, a human approves that exact change.
  6. Agents draft. A human approves. An approval never carries over.
  7. Postmortem action items change the system, not a person.
  8. Done is never just "it works". It can be changed safely, it's observable, it's documented, and the trade-off is recorded.

What you can produce

With the values and the path above, you or your agent should be able to make these for your own services:

  1. A path document for a service: each environment, what it proves, who can deploy to it, and the rollback.
  2. A merge request template: what changes, the plan output, the blast radius, and the rollback.
  3. A deploy stage that fails when the new version doesn't start, followed by smoke tests that check the version, one read, one write, and the dependencies.
  4. A change policy: which changes are standard and ship on the pipeline, which need a named approver, and what counts as an emergency.
  5. An approval queue for your agents: one file, sorted by risk, worked once a day.
  6. A postmortem from an incident timeline, with action items that each change the system.

Tools

Everything above is in one repo you can clone: how-i-work. llms.txt has the exact steps to copy it.

ForUse
Writing the path for a servicetemplates/path-document.md
Every merge requesttemplates/merge-request.md
Smoke tests after every deploytemplates/smoke-tests.md
A deploy pipeline that checks the files landed and the site answerstemplates/ci/github-actions-static-site-s3-cloudfront.yml
Changes inside a compliance scopetemplates/release-change-ticket.txt
Agents that draft and a human who approvestemplates/approval-queue.md
Watching every app after a changedashboards/http-checks/
Reviewed infrastructureinfra-modules/
Postmortemstemplates/postmortem.md

The models behind this, error budgets, smaller releases, and deploy vs release, are in reliability and change management.