← Weekly essays

Ship it dark: building pipelines that deploy without firing

#infra#product#solo-founder

Four pipeline blocks in a row with an open amber switch between the second and third, so the later blocks sit dim behind dashed connectors

Sixteen commits went to production last Tuesday. A Lambda exists, wired to an EventBridge rule, with tests passing and types checking. After all of it, the pipeline cannot transmit a single profile, and that is the most useful deployment pattern I've shipped this year. It took me most of a night to work out why one boolean, checked in the right places, is worth that much.

Green checkmarks look like a launch

The pipeline belongs to Binderdex, a Pokémon card collection and price app I build. It connects the app to an outside service that sends collectors their emails and notifications. A Lambda is a small cloud function, and an EventBridge rule is the cloud trigger that runs it when an event arrives. Lifecycle integrations like this carry a particular tension. The code is real, the infrastructure is real, and the pipeline works. The tests pass, the types check, and the CDK stack synthesizes. Every one of those green checkmarks is also a reason to assume the feature is live. A merge to main, a deploy, a Lambda that exists and is wired to a rule: each one reads like activation to anyone going through the commit log at 2am, and that includes me.

I was building the communications pipeline for Binderdex. It has a dependency-free client for the messaging service, an event-triggered Lambda that syncs profile state, a bounded reporting webhook, and the preference screen where users choose what they want to hear about. A profile sync copies a user's contact details and preferences to the messaging service, and a suppression event tells it to stop messaging someone. That came to sixteen commits, from planning docs through tests to a production gate. The question I kept asking was how to ship the full pipeline to production with no risk of it doing anything until I said so.

The default answer in solo work is to hold everything back until it's ready, then ship and flip it live in one motion. I've done that for years, and it works until the pipeline has four moving parts and three places where it could quietly touch a real user's data.

One boolean, checked at every boundary

The answer I landed on is a single environment variable that must resolve to the exact string "true" before anything happens. The web app checks it before enqueueing a profile-sync or suppression event. The Lambda checks it again before it does any work. The production stack pins the variable to false and creates the event rule in a disabled state.

What makes this more than a feature flag is where the gate lives. An ordinary flag gets checked once at the edge, in the code path a user would reach first. This one is checked at every boundary that could transmit data. If the rule gets enabled and the variable is forgotten, the Lambda still skips. If the variable gets set before the rule has been deployed, nothing fires. Both have to be true, so the safety comes from the structure and doesn't depend on me following a procedure correctly at night.

DEPLOYED flag false, rule disabled Web app Event rule Lambda skips enqueue disabled exits on line one nothing fires ACTIVATED a separate, deliberate step Web app Event rule Lambda flag reads true enabled does the work profiles sync
Everything in the top row is already in production, and the only thing that separates it from the bottom row is a decision.

The gate runs before anything else

The ordering took the most thought. The check is the first line of the handler, ahead of every import that touches the outside world. When the gate is false, no secret is read, no database connection opens, and no telemetry starts. The Lambda exists, it's deployed, it's wired to a rule, and it does nothing at all.

That ordering sounds trivial until I picture the failure it prevents. A gate placed further down still lets every cold start load things the handler will never use, and still warms up instrumentation for nothing. Moving the check to the very first line makes the dark state cheap. The Lambda bills me for a few milliseconds and does nothing with them.

The webhook handler taught me a smaller lesson along the way. A quality review flagged avoidable complexity in it, and I split it into separate verification, parsing and forwarding units. That was the right call, and I wish I'd started there. The temptation at a boundary like this is to write one handler that does everything in sequence. Three small functions with their own tests are easier to reason about than one function with five branches.

Activation gets its own step

My first plan was to activate the pipeline right after deploying it. Then I thought through what could still be wrong: database columns not yet migrated, DNS not verified, sending not disabled in the provider's dashboard. So the plan grew a distinct activation approval. The order is schema review, then gated deployment, then health verification, then testing on the real mobile app, and only then activation. Any one of the five can stop the whole thing.

The phases aren't bureaucracy, because they sit at the exact points where I'd otherwise be trusting a green CI badge to mean "safe for real users." A green badge has never meant that.

Deploying and launching are two decisions

The fail-closed gate has nothing to do with distrusting the code. It separates the act of building from the act of activating. I can build aggressively, merge confidently and deploy without fear, because none of it can fire until I separately and deliberately say go.

Most solo deployment habits merge those two acts. I ship, I'm live, and if something is wrong I roll back. The pattern I landed on last Tuesday runs the other way. I ship, I verify, and being live is a separate decision I make after I've seen the evidence. The deployment is only the deployment, and the launch is a button I press later, on purpose.

Sixteen commits are in production tonight, the pipeline works, and nothing has fired. That is exactly what one boolean was supposed to buy me.