DEV Community

Cover image for Why code review is not infrastructure validation 🛠️
Flora Brandão for Upsun

Posted on

Why code review is not infrastructure validation 🛠️

#ai

AI tools can check your code syntax all day, but they are completely blind to infrastructure context. When an AI agent auto-approves a low risk pull request, it ignores whether the application actually runs in a production environment.

Here is why text only reviews fail us:

  • Syntax is not state. AI catches logic errors but misses connection timeouts or failed schema migrations.
  • Traditional staging environments are rarely identical to production, which is exactly where regressions live.
  • While language models are probabilistic and prone to hallucination, a container build is deterministic.

By defining your stack in a unified configuration file, Upsun acts as the ground truth layer. It triggers instant, data complete preview environments for every branch using copy on write clones. This ensures your infrastructure validates system wide state before execution.

Check out the full technical article to see how to end review theater:

Why code review is not infra validation | Upsun

Stop relying on "looks good to me." use upsun to validate ai-generated code against byte-level clones and ensure true production-readiness for every pr.

favicon upsun.com

Top comments (1)

Collapse
 
jugeni profile image
Mike Czerwinski

Syntax is not state is the right instinct, and the cleaner version of it is that a check can only catch failures visible in the channel it reads. Code review reads the artifact the author produced: the diff, the intent. A failed schema migration is not in that channel, not because review is careless but because whether the database accepted the migration is a fact about the world at runtime, not a property of the code. The code is a claim about what should happen. The outcome is whether it did. Review reads intent, execution reads outcome, and neither can cover for the other because they are literally different channels.

Which is why the caveat you raise about staging applies to your own answer, and it is worth saying out loud rather than letting the pitch paper over it. You note staging is rarely identical to production, which is where regressions live. A data-complete preview clone is strictly better than staging, agreed, but it is still not production. It closes the parity gap on everything clonable: the schema, the data shape, the migration, and those are real wins because they are deterministic and reproduce in a copy. It does not close the gap on failures that only exist under production's non-clonable properties: the timeout under real load, the race under real concurrency, the topology and IAM and live traffic a clone does not carry. So the preview environment moves the boundary of what is checkable, it does not become ground truth. Ground truth for a production failure is production. The honest framing is that you made a much larger slice of failures reproduce before deploy, and named the slice that still cannot, because that residual slice is exactly where the next incident comes from.