The CI Failure That Could Have Cost Us 42,000 SEK/Year — Until a 2-Line Fix

This week, I merged a PR into develop that looked clean locally — only to have it fail in CI after merge.

The reason?
My dev build passed, but there was no local process or a step in our feature branch pipeline that attempted a production build before committing and/or merging.
A small TypeScript mismatch slipped through — and CI caught it only after it was merged.

Root cause

A type import didn’t get checked in the local dev build.

tsc –build in production mode caught it — but that step wasn’t part of local workflows.

Our develop branch builds from scratch using yarn build:prod.

Fix

I added a yarn build:prod step to our Husky pre-commit hook.
Now, prod build errors fail before the commit even hits GitHub.

Impact — Quantified

1. Engineer Time Lost to Debugging

Avg 1 engineer loses ~30 min diagnosing unexpected CI failure
Happens ~2x/month in teams of 3–5
= 1 hour/month x 1,500 SEK = 1,500 SEK/month

Annualized: 18,000 SEK/year just in lost debugging time

Reduced CI re-runs

  • 5 avoidable failed builds/month + 15 min of rework
    → 2,000 SEK/month = 24,000 SEK/year

Compute cost reduction

  • ~75 CI minutes/month avoided
    → 4.5 SEK/month = ~54 SEK/year

Total estimated savings: ~42,054 SEK/year from a 2-line config change.

____

So, The earlier the feedback, the cheaper the fix. If you’ve been relying on dev builds alone before merging, double check what your CI’s really doing. You might catch more with less.

Verified by ExactMetrics