# If you are afraid to deploy to production, you are missing a check

By Mauricio Robles · Published 2026-12-04 · 21 min read · https://lopsum.com/articles/continuous-deployment-to-production/

> Real CI/CD includes automatic production deployments. The gates, feature flags, infrastructure, observability and rollback that make it safe, in the order to add them, with the DORA data on what fast teams look like.

## In short

- CI/CD is the practice of checking every code change automatically and shipping it to users automatically. Many teams automate the checking and then stop before production, so a person still presses the final button.
- The article argues that fear of that button is a signal. Each manual step before production stands for a safety check nobody has automated yet: tests, review, monitoring or a way to switch a feature off.
- It walks through the checks one by one, then through feature flags, the infrastructure underneath (scaling, databases, logging, alerts, automatic rollback) and the security and audit controls that make regulated teams comfortable.
- It ends with the order in which to add the missing pieces, answers to the usual objections (flaky tests, regulation, databases, QA sign-off) and a two-part checklist.
- You get a practical way to decide what stands between your team and shipping on every merge, and published research on how fast teams compare.

Real CI/CD includes automatic production deployments. If your codebase or your infrastructure is not ready for that, you are not missing courage. You are missing an automation check that would guard the behaviour: end-to-end tests, unit tests, integration tests, lint, a build, a feature flag. Feature flags are your friend here.

That is the whole argument, and the rest of this article is the detail. The first sections are written for anyone, engineer or not. After that it goes deep on the pipeline and then on the infrastructure under it, because a deploy is only as safe as the thing it deploys onto.

## What CI/CD is, in plain words

Software is built from many small changes that many people make every day. CI, continuous integration, means that every change is merged into the shared code quickly and checked by machines straight away: does it still compile, do the automated tests pass, does it follow the team's rules. The point is to find problems minutes after they are introduced, while the person who wrote the change still remembers it.

CD stands for two different things. Continuous delivery means the software is always in a state where it could be released. Martin Fowler defines it as a discipline where you build software so that it can be released to production at any time. Continuous deployment goes one step further: every change that passes the checks is put into production automatically, with no person pressing a button.

## Why stopping before production is only half of it

Picture a factory that inspects every car as it is built, rolls each one to the loading dock, and then waits for a manager to approve shipping. The inspection is automated. The expensive, risky, slow part is still a human decision made with less information than the machines had.

That is what "continuous delivery that stops before production" looks like in a software team. The pipeline is green, the change is ready, and it sits in a queue until a release day, a change meeting or someone's gut feeling says go. Three things go wrong with this.

- Changes pile up. The longer you wait, the more changes ship together, and the harder it is to tell which one broke something.
- The manual step does not actually check anything new. The person approving is looking at the same green pipeline you are, plus a feeling. If the feeling is worth something, it can be written down as a check.
- The fear gets worse over time. A deploy that happens once a fortnight is a big event. A deploy that happens twenty times a day is boring, and boring is what you want from the thing that puts software in front of customers.

The research agrees on the first point. DORA, the research programme run by Google Cloud, has consistently found that larger changes are slower and more prone to creating instability. Its 2024 report calls small batch sizes one of the basics of successful software delivery.

## Fear of deploying is a signal

When someone on a team says "I would like somebody to look at it before it goes out", they are saying something precise: there is a risk I cannot see from here. That instinct is correct. The mistake is to answer it with a person instead of with a system.

Every manual "someone should look at it first" step stands for a check you have not automated yet. Ask what that person would look at, and the answer is almost always one of a short list:

- "Does it still work for the main user flow?" That is an end-to-end test.
- "Did it break something nearby?" That is a unit or integration test.
- "Is the code reasonable?" That is lint, type checking and a code review on the pull request.
- "What if it is wrong in production?" That is a feature flag, a gradual rollout and an automatic rollback.
- "Will we notice if it breaks?" That is monitoring and alerting.

So the work is not to become braver. It is to take each fear, find the check that would answer it, and build that check. When there are no fears left that a machine cannot answer, the manual step has nothing to do and you remove it.

> **How I work.** I lead engineering teams where a merged change deploys automatically through dev, QA and stage to production. A merge queue and an AI pull-request reviewer (KRF, the tool I built and wrote about in another article) gate every pull request before it merges. My personal projects deploy to production on every push to main, gated by CI. I describe what I do; the rest of this article is the reasoning and the general practice, not a claim about any one company.

## The gates, one by one

A pipeline is a series of gates, ordered from cheap and fast to slow and expensive. Each one catches a class of problem and misses others, so you need several. The ordering matters: the cheap checks run first so that a typo fails in seconds, not after a twenty-minute test suite.

### Lint and type check

A linter enforces style and flags suspicious patterns. A type checker proves that the pieces fit together: a function that expects a number is not handed text. Both run in seconds and need no running system.

They catch typos, unused code, wrong argument shapes, null handling and a large share of careless mistakes. They miss anything about behaviour: code can be perfectly typed and still calculate the wrong price. They run first, often on the developer's machine before the change is even pushed, and again in CI so nobody can skip them.

### Build

The build turns source into the thing you will actually deploy: a bundle, a container image, a binary. A failing build means the change cannot ship at all, and it also catches problems lint cannot, such as a missing dependency, a bad import path or a configuration that only breaks at bundle time.

It misses everything that only happens when the program runs. Its most important job in a deployment pipeline is a different one: it produces the single artifact that every later stage will use. More on that below.

### Unit tests

Unit tests exercise one function or component in isolation, with its collaborators replaced by simple stand-ins. They are fast, so you can have thousands, and they pinpoint the line that broke. They catch logic errors, edge cases and regressions in code you have already learned to be careful about.

They miss the seams. Two units can each pass their own tests and still disagree about the shape of the data passed between them. They run right after lint and build, in parallel where possible.

### Integration tests

Integration tests run several real pieces together: your code against an actual database, a queue, or another service's contract. They catch what unit tests structurally cannot: a query that is valid SQL but returns the wrong rows, a migration that does not apply, a serialisation mismatch between two services.

They are slower and need real dependencies, usually containers started for the run. They miss full user journeys and anything that depends on the browser. They sit after the unit tests, so you only pay for them when the cheaper checks have already passed.

### End-to-end tests

End-to-end tests drive the whole system the way a user does: a real browser, the real front end, the real API, a realistic database. They answer the most direct version of the fear: can someone still sign in, add an item and pay?

They are the slowest and the most fragile, so keep them few and aimed at the journeys that earn money or that would be embarrassing to lose. They miss anything you did not think to script. They run against a deployed environment, typically after the change reaches QA or stage, and a small subset runs again against production after release as a smoke test.

### Review on the pull request

Review, by a person or an AI reviewer or both, catches what no test encodes: a design that will not scale, a security hole, a change that solves the wrong problem, a rule the team agreed on. It misses what a tired reviewer skims past, which is why it works as one gate among many, not the only one.

DORA's guidance on change approval is worth knowing here. It reports that heavyweight external approval, where a change advisory board or a senior manager approves changes from outside the team, has a negative impact on software delivery performance, and that there was no evidence linking a more formal external review process to lower change failure rates. Its recommendation is peer review during development, enforced when code is checked in, supported by automated tests. Review belongs on the pull request, in the pipeline, not in a meeting after it.

*Where each gate sits and what it is for.*

| Gate | Typical cost | Catches | Misses |
| --- | --- | --- | --- |
| Lint and types | Seconds | Typos, wrong shapes, careless errors | Wrong behaviour in correct code |
| Build | Seconds to minutes | Missing dependencies, bundle-time breaks | Anything that happens at run time |
| Unit tests | Seconds to minutes | Logic errors, regressions, edge cases | Disagreements between components |
| Integration tests | Minutes | Real database, queue and contract problems | Full user journeys |
| End-to-end tests | Minutes, slowest | Broken main user flows | Anything not scripted |
| PR review (human or AI) | Minutes to hours | Design, security, intent, team rules | What a skimming reviewer misses |

## What the research says about fast teams

The best-known body of evidence is DORA's annual State of DevOps research, which measures software delivery with four metrics: change lead time (from commit to production), deployment frequency, change fail rate (the share of deployments that need immediate intervention) and failed deployment recovery time. Each year it groups survey respondents into clusters that emerge from the data rather than being set in advance.

*The four performance clusters in DORA's 2024 report. Percentages are the share of respondents in each cluster (89% uncertainty interval in the report).*

| Cluster | Change lead time | Deployment frequency | Change fail rate | Failed deployment recovery | Respondents |
| --- | --- | --- | --- | --- | --- |
| Elite | Less than one day | On demand (multiple deploys per day) | 5% | Less than one hour | 19% |
| High | One day to one week | Once per day to once per week | 20% | Less than one day | 22% |
| Medium | One week to one month | Once per week to once per month | 10% | Less than one day | 35% |
| Low | One month to six months | Once per month to once every six months | 40% | One week to one month | 25% |

**Change fail rate by DORA performance cluster, 2024**

| | |
| --- | --- |
| Elite | 5% |
| High | 20% |
| Medium | 10% |
| Low | 40% |

The elite cluster deploys on demand and has the lowest failure rate. The medium cluster fails less than the high one: DORA notes the clusters emerge from the data and that throughput and stability are correlated within each.

Source: [DORA (Google Cloud), Accelerate State of DevOps Report 2024](https://dora.dev/research/2024/dora-report/2024-dora-accelerate-state-of-devops-report.pdf) (2024)

Two readings of the table matter for this article. First, the cluster that deploys most often, on demand and multiple times a day, is also the one with the lowest change fail rate and the fastest recovery. Speed and safety are not opposite ends of one dial in this data. Second, DORA warns against treating the levels as a target. Its own words: improving should matter more to a team than reaching a particular level.

**Estimated drop in delivery stability per 25% more AI adoption**

7.2%: estimated reduction in delivery stability for every 25% increase in AI adoption

The report says the effect on throughput was small but likely negative, an estimated 1.5% reduction on the same basis, and hypothesises that AI-generated changes are growing in size.

Source: [DORA (Google Cloud), Accelerate State of DevOps Report 2024](https://dora.dev/research/2024/dora-report/2024-dora-accelerate-state-of-devops-report.pdf) (2024)

That second figure is the reason this argument matters more now than it did five years ago. When agents write much of the code, changes arrive faster and larger, and DORA's hypothesis is that teams forgot the importance of small batches. The report's conclusion is that improving the development process does not automatically improve delivery without the basics, such as small batch sizes and robust testing. Gates are the basics. The more code is written by machines, the more the checks have to be machines too.

## Feature flags: separating deploy from release

A feature flag is a switch in the code that decides whether a feature is visible. It looks trivial and it changes the economics of deployment, because it separates two events that are usually welded together. Deploying means the new code is running in production. Releasing means users can see the new behaviour. With a flag, you deploy at any time, with the feature off, and release later, on purpose.

*The whole idea: both paths ship, one is chosen at run time.*

```ts
if (flags.isOn("new-checkout", { userId })) {
  return renderNewCheckout();
}
return renderCurrentCheckout();
```

### Why they make automatic deploys safe

- Deploy is no longer a launch. Unfinished work can merge to main every day, hidden behind a flag, so branches stay short and changes stay small.
- A kill switch. If a released feature misbehaves, turning the flag off takes seconds and needs no new deploy, no rollback and no waiting for a pipeline.
- Gradual rollout. Release to the team, then one percent of users, then ten, then everyone, watching your dashboards between steps. The blast radius of a mistake is the size of the current step.

### How to use them well

Pete Hodgson's article on feature toggles sorts them by how long they live. Release toggles, the kind used to hide unfinished work, are transitionary by nature and should generally not stick around much longer than a week or two. Experiment toggles live as long as it takes to get a statistically significant result. Ops toggles, the kill switches, are mostly short-lived, though a few key controls may stay for operators almost indefinitely. Permission toggles can live for years.

From that, four habits follow.

1. Give every flag an owner and an expiry. A release flag without a removal date is debt from the day it is created.
2. Remove the flag after launch. Once the feature is at one hundred percent and stable, delete the flag and the old code path in a small, boring pull request.
3. Test both paths. A flag that is only ever tested in the on position is a second, untested product waiting in your codebase. Run the relevant tests with the flag on and with it off.
4. Keep flag checks at the edge. Evaluate the flag in one place and pass the result inward, instead of scattering checks through the code.

### Their costs

Flags are not free, and the same article is blunt about it: savvy teams treat their flags as inventory with a carrying cost, and must be proactive about removing the ones no longer needed. One approach it describes is a cap on the number of flags, so that adding one means first removing another.

The second cost is combinatorial. With several flags in play there is, in the article's words, a combinatoric explosion of possible states. It also points out that you do not need to test every combination, because most flags do not interact. The practical rule: know which flags touch the same code, test those together, and keep the number of simultaneous flags low enough that you can.

## Environments and promotion

Most teams run several environments: dev, where changes first land; QA, where the test suites and any manual exploration happen; stage, a near copy of production; and production itself. The old model has a person promote a build from each to the next. The model that scales has the pipeline do it: when the checks for one environment are green, the same build moves to the next, and the last move is into production.

### Merge queues

On a busy repository, two pull requests can each pass their checks and still break main when combined. A merge queue fixes this. In GitHub's description, it automates merging into a busy branch and ensures the branch is never broken by incompatible changes: each queued pull request is checked against the latest version of the target branch and the pull requests ahead of it before it merges. The author does not have to keep rebasing and waiting.

### Post-deploy smoke tests and rollback

Once a change reaches an environment, the pipeline should confirm that the deployed system is alive and doing its core job: a handful of requests against real endpoints, a sign-in, a read, a write. If those fail, the pipeline rolls back by itself. This is covered properly in the infrastructure section, because it depends on how you deploy.

## Infrastructure that is ready for automatic deploys

A green pipeline only proves the code. Whether a bad deploy hurts customers depends on the platform: how it is defined, how new versions replace old ones, how it scales and how quickly you find out something is wrong. These are the pieces I would check before turning on automatic production deploys. The examples use AWS where a concrete name helps, but none of the ideas are specific to it.

### Infrastructure as code

Define infrastructure in code, with Terraform, CDK, Pulumi or similar, and treat it exactly like application code: in version control, reviewed on a pull request, applied by a pipeline.

- Plan on the pull request. The pipeline runs the tool's dry-run and posts what would change, so the reviewer reads a diff of real infrastructure and not just of the files.
- Apply from the pipeline. Humans do not run apply from a laptop. The pipeline's role holds the permissions, and every change has a commit behind it.
- Detect drift. Run the plan on a schedule, and alert when reality differs from the code. Drift is a manual change someone forgot to write down.
- No console changes. A fix made by clicking is a fix that will be overwritten, or that nobody can reproduce in another environment. If the console is the only way to change something, that is the missing automation.

### Immutable artifacts: build once, promote the same thing

Build the container image or bundle once, in the first stage, give it an identifier such as the commit hash, and promote that exact artifact through dev, QA, stage and production. If you rebuild per environment, what you tested is not what you shipped.

Everything that differs between environments, such as database addresses, API keys and feature settings, comes from outside the artifact: environment variables resolved at start-up, or a parameter store or secrets manager read at run time. Nothing environment-specific, and certainly no secret, is baked into the image. This also makes rollback trivial: redeploy the previous artifact, which still exists unchanged.

### Deployment strategies

How the new version replaces the old one decides how bad a mistake can be and how fast you can undo it.

| Strategy | How it works | Fits when | Watch out for |
| --- | --- | --- | --- |
| Rolling | Replace instances a few at a time | Stateless services, backward-compatible changes, the sensible default | Old and new versions run side by side during the deploy |
| Blue/green | Stand up a full new copy, then switch traffic | You want an instant switch back and can afford double capacity briefly | Cost, and the database is still shared between both |
| Canary | Send a small share of traffic to the new version first | High traffic, risky changes, strong metrics to judge by | Needs good monitoring and a way to split traffic |

Whichever you choose, three mechanics make it safe. Health checks tell the platform whether an instance is alive, and readiness checks tell it whether the instance is ready for traffic, so a new version that is still starting never receives requests. Connection draining lets the old version finish the requests in flight before it stops, so a deploy does not drop customers mid-action. And a deploy that fails its health checks must stop by itself and leave the old version serving.

### Auto scaling

If the platform cannot add capacity when traffic grows, every deploy that coincides with a busy hour is a risk. Auto scaling answers that, and a few details decide whether it helps or hurts during a deploy.

- Use target tracking. You pick a metric and a target value, and the service adds or removes capacity to hold it, like a thermostat. AWS documents predefined targets such as average CPU utilisation and Application Load Balancer request count per target, and the same idea works for queue depth if you express it per worker.
- Choose a metric that moves with capacity. AWS's documentation says the metric must describe how busy an instance is and change in proportion to the number of instances. Raw request count at the load balancer and latency do not qualify, while request count per target does.
- Mind warm-up. A new instance is not useful the moment it launches. AWS lets you set an instance warm-up time during which a new instance is not counted in the group's metrics, so the group does not over-react to numbers from a machine that is still starting.
- Protect capacity during a deploy. A rolling deploy temporarily removes instances. Keep a minimum capacity high enough to serve normal load while some are replaced, and consider pausing scale-in while a deploy runs; AWS notes that temporarily disabling the scale-in portion of a target tracking policy helps maintain a minimum number of instances for successful deployments.
- Know your floor. Setting the minimum to zero saves money for rarely used services, but the first request after idle pays a start-up cost. Decide that on purpose.

On the choice between containers and serverless functions, the trade is control against effort. Containers on a managed orchestrator give you predictable latency, long-running work and fine control over scaling and deploys, and make you responsible for capacity settings. Serverless platforms scale to zero and remove most capacity planning, at the cost of start-up latency, execution limits and less control over how a release rolls out. Neither is safer by itself. What matters is that you know how yours behaves while a deploy is happening.

### Database changes: expand, then contract

The database is where automatic deploys most often scare people, and rightly so: code can be rolled back in a minute, data cannot. The answer is to make schema changes backward compatible and to split them across several deploys.

The pattern has a name, parallel change, and Fowler's write-up gives its three phases. In the expand phase you augment the interface to support both the old and the new version. In the migrate phase you update every client to the new version. In the contract phase you remove the old version.

*Renaming a column safely, one boring deploy at a time.*

```text
Deploy 1  expand    add the new column, nullable
Deploy 2  write     code writes to both columns
Deploy 3  backfill  copy old values into the new column
Deploy 4  read      code reads from the new column
Deploy 5  contract  stop writing the old column
Deploy 6  drop      remove the old column
```

- Never ship a destructive change in the same deploy as the code that needs it. Dropping a column, renaming a table or tightening a constraint comes only after no running code depends on the old shape.
- Run migrations as their own pipeline step, before the application rollout, and only additive ones at that point. A migration that fails should stop the deploy while the old version is still serving.
- Make every migration safe to run twice and fast enough not to lock a busy table. Rehearse the slow ones against a production-sized copy in stage.
- Expect the old and new application versions to run at the same time during a rolling deploy, and design the schema for both.

## Observability is a deploy gate

Automatic deployment without monitoring is automatic deployment you cannot trust. The pipeline is only safe to run unattended if the system can tell it, and you, within minutes, that something went wrong. Treat observability as a required gate: a service does not get automatic production deploys until it has these.

### Logging

- Structured logs. Write each event as JSON with named fields, not as free text, so you can filter and aggregate by field.
- Request and correlation IDs. Generate an ID at the edge, include it in every log line and pass it to downstream services, so one user's failed request can be followed across the whole system.
- Sensible levels. Errors should mean something needs attention; debug noise should be off in production by default and switchable at run time.
- Retention that matches need. Keep recent logs searchable and cheap, archive what compliance requires, delete the rest. Logging everything forever is a cost, not a safety net.
- No secrets or personal data in logs. Scrub at the source.

### Metrics

Google's SRE book names four golden signals: latency, traffic, errors and saturation. They are the minimum for any user-facing service: how long requests take, how much demand there is, how many requests fail, and how close the system is to its limits. Two common shorthands cover the same ground from different angles. The RED method looks at requests: rate, errors and duration. The USE method looks at resources such as CPU, memory and disks: utilisation, saturation and errors.

### Tracing

A trace follows one request through every service and database call it touches, with the time spent in each. When a deploy makes things slow, metrics tell you that it is slow and a trace tells you where. Propagating the same correlation ID that your logs use makes the two line up.

### SLOs and error budgets

A service level objective states how reliable the service should be, in numbers users would recognise, for example the share of requests that succeed within a latency target over a period. The gap between the objective and perfection is the error budget. It turns the fear into a rule: while there is budget left, ship; when it is spent, slow down and spend the time on reliability. It also gives the automation something concrete to watch.

### Deploy markers and release tags

Annotate every dashboard with deploy markers, so a spike lines up visibly with the release that caused it. Tag your error tracker with the release identifier, so a new error can be tied to the exact version and the commit behind it, and so you can see at once whether an error is new in this release or was already there.

### Alerting that people keep trusting

- Alert on symptoms, not causes. Google's SRE guidance calls the difference between what is broken and why it is broken one of the most important distinctions in good monitoring: put most of the effort into catching the symptom, such as errors or slow responses that users feel, and use cause-level signals mainly to debug.
- Page only for what needs a person now. Every page should be actionable and should require intelligence; if the response is robotic, it should not be a page. Everything else is a ticket or a dashboard.
- Fight alert fatigue. The same source is direct about the cost: effective alerting has good signal and very low noise, and when pages are frequent engineers learn to skim them, which can hide a real incident. Delete or fix any alert that is routinely ignored.
- Link a runbook from every alert. The page should say what the alert means, how to check it and what to do first, so the person woken at night does not have to reconstruct that from memory.

## Automatic rollback

Automatic rollback is what turns an unattended deploy from a gamble into a safe one. It has three parts.

1. Post-deploy smoke tests. Immediately after the new version takes traffic, run a short script against the live system: it responds, a sign-in works, the key read and write succeed. Failure triggers rollback.
2. A bake time. Do not call a deploy done the moment it finishes. Keep watching error rate and latency, compared with the previous version, for a set period before promoting further. Clare Liguori, writing about Amazon's pipelines, describes bake time as a normal step before each production stage is promoted, and says typical pipelines wait at least an hour after each one-box stage and at least twelve hours after the first regional wave. Your numbers will differ with your traffic; the habit is what matters.
3. A decision that does not need a person. Her pipelines monitor alarms and, if any of the high-severity alarms go into the alarm state, roll back automatically. Tie rollback to the same symptom alerts you already trust.

Rollback has two forms, and you want both. Redeploying the previous immutable artifact undoes a code change. Turning off a feature flag undoes a behaviour change without touching the deploy at all, and it is the faster of the two. Liguori describes the same logic at Amazon: a new version goes first to a small slice of production, typically serving at most ten percent of requests for a Region or Availability Zone, and if it causes negative impact the pipeline rolls it back automatically.

*A sketch of the shape, not any one CI product's syntax.*

```yaml
deploy-prod:
  needs: [deploy-stage, e2e-stage]
  steps:
    - run: deploy --artifact $GIT_SHA
    - run: smoke-test --env prod
    - run: watch --alarm error-rate --for 30m
    - if: failure()
      run: deploy --artifact $PREVIOUS_SHA
```

## Security and compliance in the pipeline

Automation is a better place for security checks than a meeting, because it runs on every change and leaves a record.

- Dependency and container scanning. Check libraries and base images for known vulnerabilities on every build, and fail on the severities you have agreed not to ship.
- Secret scanning. Block commits that contain keys or tokens, and rotate any that leak.
- Least-privilege deploy roles with OIDC. Instead of storing a long-lived cloud key in the CI system, let the pipeline exchange its identity for temporary credentials. GitHub's documentation says OIDC means you do not need to duplicate cloud credentials as long-lived secrets, and that the token the cloud provider issues is short-lived and valid for a single job. Give each pipeline a role that can deploy its own service and nothing else.
- An audit trail. Every production change then has a pull request, a reviewer, a pipeline run, an artifact identifier and a timestamp, all recorded without anyone filling in a form.

That last point is the answer to the regulated-industry objection below. For most regulated teams, the requirement is evidence of review, separation of duties and traceability, not a person pressing the last button.

## Cost and right-sizing

Safe deploys cost money: blue/green doubles capacity briefly, extra environments run all the time, and detailed metrics and long log retention add up. Right-size each environment (dev and QA can scale down or off at night) and spend on what shortens detection and recovery.

## What "not ready" usually means, and the order to fix it

In practice, a team that says it is not ready for automatic production deploys is missing some of the following. You do not need all of them on day one, and the order below is the one that removes the most fear for the least effort.

1. A reliable pipeline that runs on every change. Lint, type check and build, required to pass before merge.
2. Fast unit tests on the code that matters, and a rule that bug fixes arrive with a test.
3. Monitoring and alerting on symptoms for the production service. If you cannot tell within minutes that a deploy went wrong, nothing else is safe.
4. One post-deploy smoke test, with an automatic rollback to the previous artifact.
5. A handful of end-to-end tests for the journeys that must not break, run against QA or stage.
6. Feature flags for risky changes, with a kill switch you have actually tried.
7. Integration tests against a real database, and expand and contract migrations.
8. Automatic promotion through the environments on green, then a merge queue.
9. Automatic production deploys, starting with the lowest-risk service, then widening.

## Common objections

### "Our tests are flaky"

Then they are not tests yet, they are noise, and the team has learned to ignore red builds. Fix that first, because every other gate depends on trust in the pipeline. Quarantine the flaky tests so they stop blocking merges, track them as bugs with owners, and delete the ones nobody will fix. A smaller suite that is always right beats a larger one that is sometimes wrong.

### "We are in a regulated industry"

Regulation asks for control and evidence: someone reviewed the change, duties were separated, you can show what shipped and when. A pipeline gives you that more reliably than a manual process: required reviews, protected branches, scanning, short-lived deploy credentials and a complete record per change. DORA's guidance on change approval makes the same point from the performance side, recommending peer review captured in the team's development platform to meet segregation of duties. Talk to your auditors with the pipeline's evidence in hand, rather than assuming they require a human at the end.

### "Database migrations are too risky"

They are risky when they are big and destructive. Expand and contract turns one scary change into several dull ones, each backward compatible and each safe to roll back, and running migrations as their own step means a failure stops the deploy while the old version is still serving.

### "We need QA sign-off"

Keep QA, and change what it is for. A person's attention is best spent exploring new features, thinking about what could go wrong and writing the automated checks that make the next sign-off unnecessary. Signing off on a regression run that a machine could do is the least valuable use of that skill. Feature flags make the compromise easy: ship the code off, let QA test it in production behind the flag, and release when they are satisfied.

## A practical checklist

If you can tick everything in both halves, remove the manual step. The items you cannot tick are your backlog, in roughly the order above.

### Pipeline

- Lint, type check and build run on every pull request and must pass to merge.
- Unit tests cover the code that matters and run in minutes.
- Integration tests run against a real database or the real contracts.
- A few end-to-end tests cover the journeys that earn money, and they are not flaky.
- Review happens on the pull request, by a person, an AI reviewer or both.
- A merge queue keeps main green when many changes land at once.
- One artifact is built once and promoted through every environment on green.
- Risky changes ship behind flags, flags have owners and expiry dates, and both paths are tested.
- A post-deploy smoke test runs, and failure rolls back without a person.
- Security scans and secret scanning run on every build.

### Infrastructure

- Infrastructure is code, planned on the pull request, applied by the pipeline, checked for drift.
- Nobody changes production through the console.
- Config and secrets come from a parameter store or secrets manager, never from the image.
- Health checks, readiness checks and connection draining are in place.
- The deployment strategy is chosen on purpose: rolling, blue/green or canary.
- Auto scaling tracks a metric that moves with capacity, with a floor that survives a rolling deploy.
- Schema changes are backward compatible, split into expand and contract, and migrations run as their own step.
- Logs are structured, carry correlation IDs and have a retention policy.
- Golden-signal metrics exist for every service, with dashboards marked with deploys.
- Errors are tracked and tagged with the release.
- Alerts fire on symptoms, page only when a person must act, and link to a runbook.
- Deploy credentials are short-lived, via OIDC, and scoped to one service.
- Rollback is rehearsed: both the previous artifact and the flag kill switch.

None of this is exotic. It is the ordinary list of things a careful engineer already worries about before pressing the button, written down and handed to machines. When the worry has somewhere to go, the button stops being necessary.

## Sources

1. [DORA (Google Cloud), Accelerate State of DevOps Report 2024](https://dora.dev/research/2024/dora-report/2024-dora-accelerate-state-of-devops-report.pdf) (2024): The four performance clusters (lead time, deployment frequency, change fail rate, failed deployment recovery time, share of respondents); the 7.2% and 1.5% estimated reductions per 25% increase in AI adoption; the small batch size point; the warning that improving matters more than reaching a level.
2. [DORA (Google Cloud), Streamlining change approval](https://dora.dev/capabilities/streamlining-change-approval/) (2025-10-30): Heavyweight external change approval has a negative impact on delivery performance, with no evidence it lowers change fail rates; peer review enforced at check-in is recommended.
3. [DORA (Google Cloud), DORA's software delivery performance metrics](https://dora.dev/guides/dora-metrics/) (2026-01-05): Definitions of change lead time, deployment frequency, change fail rate and failed deployment recovery time.
4. [martinfowler.com, Continuous Delivery (Martin Fowler)](https://martinfowler.com/bliki/ContinuousDelivery.html) (2013-05-30): Definitions of continuous delivery and continuous deployment.
5. [martinfowler.com, Feature Toggles (aka Feature Flags) (Pete Hodgson)](https://martinfowler.com/articles/feature-toggles.html) (2017-10-09): Toggle categories and lifetimes, toggles as inventory with a carrying cost, combinatorial explosion of states.
6. [martinfowler.com, Parallel Change (Danilo Sato)](https://martinfowler.com/bliki/ParallelChange.html) (2014-05-13): The expand, migrate and contract phases.
7. [GitHub Docs, Managing a merge queue](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue) (undated): What a merge queue does and why.
8. [AWS Builder Center, Automating safe, hands-off deployments (Clare Liguori)](https://builder.aws.com/content/3ErTKQOTKc5NIw031UePBPxTQ6I/automating-safe-hands-off-deployments) (2020-06-18): One-box serves at most ten percent of requests; automatic rollback on alarms; bake time of at least one hour after one-box and twelve hours after the first regional wave; backward-compatibility checks.
9. [Google, O'Reilly Media (Site Reliability Engineering), Monitoring Distributed Systems (Rob Ewaschuk)](https://sre.google/sre-book/monitoring-distributed-systems/) (2017): The four golden signals; symptoms versus causes; every page should be actionable; low-noise alerting.
10. [AWS Documentation, Target tracking scaling policies for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-target-tracking.html) (undated): Target tracking, predefined metrics, metric must scale with instance count, instance warm-up, disabling scale-in to keep capacity during deployments.
11. [GitHub Docs, OpenID Connect](https://docs.github.com/en/actions/concepts/security/openid-connect) (undated): OIDC removes long-lived cloud secrets; tokens are short-lived and valid for a single job.
