Delivery Automation: Optimise the Wait, Not the Build
By Maplecode
Teams that want faster delivery usually start by making the build faster. It is the visible number, and it is almost never where the time goes.
Measure the interval from a commit to that change running in production, and the compute is typically a small fraction. The rest is waiting — for a reviewer, for a free environment, for a release window, for someone to notice an approval request. Optimising the fast part while ignoring the queues is the most common way delivery improvement work disappoints.
Measure four things, honestly
Deployment frequency, lead time from commit to production, change failure rate, and time to restore service. These are widely cited and unevenly applied, usually because the definitions get loosened until the numbers look acceptable.
Lead time is the one most often measured wrongly. It should start when the commit is made, not when the pull request is approved, because the interval where a change sits waiting for review is precisely the queue you are trying to see. Measuring from approval hides the problem you are looking for.
Change failure rate similarly needs an agreed definition of failure — any rollback, or only customer-visible incidents. Either is defensible; changing it mid-measurement is not.
Review latency is usually the largest single delay
A pull request that takes four hours to get a first response has spent longer waiting than in any pipeline stage. Multiply that across a team and it dominates.
The causes are structural more than cultural. Large pull requests take longer to review and get deferred, which makes them larger. A single nominated reviewer becomes a bottleneck when they are busy. Reviews that mix substantive design questions with formatting comments take longer and produce more back-and-forth.
The interventions that work are unglamorous: keep changes small enough to review in ten minutes, allow anyone qualified to review rather than routing to one person, and move everything mechanical — formatting, lint, import order — into automated checks so humans only discuss what matters.
Environment scarcity creates invisible queues
Where teams share a small number of staging environments, work queues for access, and that queue rarely appears in any dashboard. It presents instead as slow delivery with no identifiable cause.
Ephemeral environments created per change and destroyed afterwards remove the contention. This is straightforward with containerised applications and genuinely hard where the system depends on a large stateful database or licensed third-party components that cannot be spun up freely.
Where full environments are impractical, the partial win is worth taking: an ephemeral environment for the services under change, pointed at shared instances of the rest. Less isolation, considerably less queueing.
Test suites fail in a specific way
A test suite becomes a delivery constraint through two mechanisms, and only one is duration. The other is flakiness, and it is more damaging.
An intermittently failing test teaches people to re-run the pipeline rather than investigate. Once that habit exists, a genuine failure gets re-run too, and the suite has stopped providing the signal it exists for. A flaky test is worse than no test, because it consumes time and produces false confidence.
The discipline that works is treating flakiness as a defect with an owner: quarantine the test immediately so it stops blocking, raise it as work, and fix or delete it. Leaving it in the suite while everyone knows to ignore it is the outcome to avoid.
On duration, parallelisation helps and selective execution helps more — running only the tests affected by the change. That requires dependency mapping, which is real work, and it is usually worth it once a full suite exceeds ten minutes.
Approval gates that do not reduce risk
Change advisory boards and manual sign-offs exist to reduce risk, and beyond a point they increase it. Heavy approval slows releases, which makes releases larger, which makes them riskier and harder to diagnose when something goes wrong. The control produces the outcome it was designed to prevent.
Automated controls satisfy the underlying concern better. Segregation of duties enforced by the pipeline rather than by signature. Deployment records that are immutable by construction. Policy checks that cannot be skipped. Auditors generally find these more convincing than a form, because they cannot be bypassed under deadline pressure.
Deployment and release are separate decisions
The most useful structural change available to most teams is separating deploying code from releasing behaviour. Feature flags let code reach production continuously while the change stays off until someone decides otherwise.
That decouples engineering cadence from business timing, makes rollback a configuration change rather than a redeploy, and allows gradual exposure. It costs something — flags accumulate, and a codebase with hundreds of stale flags is genuinely harder to reason about — so it needs a removal discipline alongside it.
Rollback has to be rehearsed
Most teams have a rollback plan and few have tested it. The plan assumes reverting the deployment restores the previous state, which holds until a database migration is involved — at which point rolling back code against a migrated schema fails in ways nobody has practised.
The discipline that makes rollback real is expand-and-contract migrations: add the new column, deploy code that writes both, backfill, deploy code that reads the new one, and only then remove the old. Each step is independently reversible. It is more steps than a single migration and it is the difference between a rollback that works and one that turns an incident into an outage.
Rehearsing it in a non-production environment, on a schedule, is what turns the plan from a document into a capability.
Pipeline security is frequently the weakest link
Build pipelines hold credentials to production and often run code from pull requests. That combination is attractive to an attacker and is regularly under-protected relative to what it can reach.
The controls worth having: pipelines from forked pull requests run without access to secrets, deployment credentials are short-lived and scoped rather than long-lived tokens, and the pipeline definition itself is reviewed like application code. A repository where anyone can modify the workflow file is one where anyone can exfiltrate the deployment credentials.
Where to start
Measure lead time from commit, not from approval. Look at where the interval actually sits. In most organisations it is review latency, environment contention, or a release window that exists for historical reasons.
Fix the largest queue first. Build-time optimisation is satisfying, easy to measure, and usually the smallest available win.