The Practice
every push to main (and every PR):
1. build compiles + artifacts construct
2. test suites run (unit → integration slices)
3. static analysis: lint, type-check, security scan
4. artifact PUBLISHED with immutable version tag
[git push]──►[CI pipeline]──►✓ green: merge/deploy-eligible
└─✗ red: block, notify, fix-forward
the contract: MAIN IS ALWAYS RELEASABLE.
integration pain gets paid in tiny increments continuously
instead of as a big-bang merge catastrophe quarterly.
What Separates Real CI From Ritual
□ SPEED BUDGET: pipleline ≤ ~10min for PRs. slower = devs
batch commits = integration risk returns through the back door.
parallelize; cache aggressively; tier suites (fast on PR,
deep nightly)
□ DETERMINISM: flaky tests are poison — quarantine + fix
discipline, never "re-run until green" culture
□ ARTIFACT IMMUTABILITY: build once, promote the SAME
artifact through environments (never rebuild per env —
"tested ≠ deployed" drift dies here)
□ EVERYTHING IN REPO: pipeline-as-code, reviewed like code
□ FAIL LOUD: broken main is an incident-class event;
revert-first culture over debug-on-main culture
Pipeline Anatomy That Scales
| Stage | Contents | Budget |
|---|---|---|
| pre-flight | lint/format/typecheck | <2 min |
| unit | fast tests, high coverage | <5 min |
| build+scan | artifact, SBOM, CVE scan | parallel |
| integration slice | container deps, key paths | <10 min |
| nightly | full suites, perf smoke, e2e sample | unhurried |
monorepo note: affected-detection ("which services did this
change touch?") keeps CI proportional to change size —
otherwise monorepos drown everyone in everyone's builds.
The Payoff Chain
CI is unglamorous but load-bearing:
CI ✓ → deployable anytime → CD becomes possible
→ trunk-based development viable
→ feature flags carry releases (not branches)
→ rollbacks are boring (small deltas since last good)
skip CI rigor and every downstream practice degrades into
ceremony: deploys become events, branches fossilize,
releases turn heroic. the boring foundation IS the strategy.
Interview Framing
“How do you keep 30 services integrable?” scored shape: always-releasable-main contract stated, speed-budget + flaky-quarantine disciplines named, build-once-promote-artifact rule emphasized, monorepo affected-detection mentioned if relevant. CI questions grade whether you see pipelines as ENGINEERING CULTURE infrastructure rather than a YAML afterthought.
Premium Content
Unlock Continuous Integration and all premium lessons with a subscription.
All premium lessons
Ad-free experience
Priority support
From ₹199.99/year — See plans