Quality and Release in Holigo: What Works, What is Still Homework, and What We Learned - Part 7
Architecture & Decision Log·November 13, 2026·10 min read
All notes

Quality and Release in Holigo: What Works, What is Still Homework, and What We Learned - Part 7

The closing retrospective of the Holigo migration series: an honest assessment of environment isolation, automated testing, release pipelines, and what we would do differently if starting over.

The Part That Is Rarely Written: A Candid Look at Engineering Reality#

Across the first six parts of this series, we explored architectural decisions that transformed Holigo from an unpredictable, tightly coupled GetX codebase into a modular, testable system powered by Clean Architecture and BLoC. We detailed our three-layer boundaries, service locator dependency injection, declarative navigation, centralized data pipelines, and the Ship (Pelni) blueprint.

However, writing about software architecture often suffers from a common bias: tech blogs tend to paint an idealized picture where every pattern executes flawlessly and all problems vanish overnight.

In this concluding installment, I want to break that mold and share an honest retrospective. A large-scale architectural migration is never truly "finished" without leaving behind valuable lessons, ongoing homework, and operational friction. Talking candidly about the imperfect aspects of software engineering (environments, test coverage, build pipelines, and release signing) is infinitely more useful to fellow engineers than pretending our journey was without blemishes.

FIG.
Environment Isolation: Production Default Pitfall vs Dedicated Entry Points
Release Environment Safety
Legacy: Production by DefaultHigh Risk of Live Data Corruption
  1. 01Single main.dart: Develop vs production environments switched manually by altering single constants.
  2. 02Default to Production: Developers spinning up local test builds risked hitting live production servers.
  3. 03Human Error Vulnerability: Frequent risk of committing test endpoints or releasing dirty builds to stores.
Test data easily contaminates live production records without hard separation
Target: Dedicated Flavor Entry PointsDeterministic Flavors · Safe
  1. 01main_dev.dart & main_prod.dart: Each environment operates its own immutable entry point and targeted configuration.
  2. 02Safe by Default: Local dev commands default strictly to sandbox servers; live clusters stay sealed.
  3. 03Automated Build Flavors: CI/CD pipelines specify exact release flavors explicitly during production builds.
Dedicated entry points ensure predictable environment isolation
Core Lesson:

The safe development sandbox must always be the default; never rely on developer memory to prevent accidental calls to production clusters.

Environment Isolation: Eliminating the Production-by-Default Hazard#

When our team audited the legacy application during early migration phases, we uncovered a dangerous operational landmine: while the codebase technically possessed constants for both develop and production environments, the single entry point defaulted straight to the production server.

The risk of this setup cannot be overstated:

  • A developer spinning up a local debug build to spot-test a new UI button could inadvertently execute network requests against live production databases.
  • Developers routinely altered single endpoint constants in main.dart locally, creating an ongoing risk of committing staging URLs or accidently deploying a debug binary configured for the wrong server.

We immediately dismantled this hazard by introducing Dedicated Entry Points and Flutter Flavors:

  • main_dev.dart: The default local launch target. It binds strictly to sandbox mock servers, enables comprehensive curl logging, and displays a prominent visual environment banner in the app's appbar.
  • main_prod.dart: Reserved strictly for release binaries. Endpoints, API keys, and sensitive tokens are injected via compile-time environment flags, with debug logging completely stripped.

By making the safe development sandbox the uncompromised default, we eliminated human error and guaranteed the integrity of our production databases.

Testing in the Real World: The Prerequisite vs Coverage Reality#

In Part 3, I emphasized a crucial principle: a decoupled architecture makes an application testable, but it does not write tests for you.

When we migrated the Ship ticketing feature, we took immense pride in the pure Dart domain layer and deterministic BLoC stream transitions. In theory, every use case and repository could now be mocked in milliseconds. Yet in practice, as sprint deadlines tightened and commercial pressures mounted to deliver flight, train, and bill payment services, writing automated unit tests lagged behind feature velocity.

For several months, our test suite was modest compared to our rapidly expanding feature catalog. While the architecture successfully isolated bugs to their individual modules, catching regressions still relied too heavily on manual QA verification cycles.

Recognizing this debt, we initiated a structured testing roadmap:

  • We prioritized automated unit tests for high-stakes financial operations: fare calculation use cases, currency formatting, and token refresh interceptors.
  • We implemented BLoC stream tests using bloc_test, verifying that specific event inputs yielded exact, predictable state transitions.
  • The journey toward comprehensive test coverage is ongoing engineering homework, but having strict layer contracts makes writing those tests straightforward and repeatable.

Automated Quality Gates: From Pre-Commit to Store Deployment#

In a high-performing engineering culture, quality cannot depend on developer memory or manual vigilance. Release builds must not originate from someone's personal laptop, where local environment variables, uncommitted git tweaks, or outdated Flutter SDKs can taint binary artifacts.

We established an automated CI/CD Quality Pipeline:

FIG.
Quality Engineering Roadmap: Static Analysis to Automated Release
CI/CD Quality Pipeline
01

Pre-Commit Lint

Local Check

Run automated dart analyze and formatting guards before git commits are accepted.

02

CI Test Suite

Pull Request Guard

Automated unit tests validating Use Cases, Repositories, and BLoC streams run on CI.

03

Secure Signing

Keystore Vault

Release signing for Android Keystore and iOS Certificates performed securely via CI vault.

04

Store Deploy

Continuous Delivery

Binary artifacts uploaded directly to Google Play Tracks and Apple TestFlight automatically.

Core Lesson:

Building releases from automated pipelines eliminates 'works on my machine' syndromes and ensures all production binaries are transparently reproducible.

  1. Pre-Commit Linting and Formatting: Automated git hooks run dart analyze and dart format locally before any commit is accepted, ensuring consistent styling and preventing common static analysis warnings from entering the repository.
  2. Pull Request Quality Gates: When a developer opens a pull request, our continuous integration server spins up an isolated runner to execute static analysis, run the automated unit test suite, and verify that modular ARB localization files compile cleanly. Merging is blocked if tests fail.
  3. Hardware Keystore Vault: Android keystores and iOS distribution provisioning profiles are stored securely within encrypted CI secrets vaults. No individual developer stores production private release keys on their workstation.
  4. Automated Continuous Delivery: Upon merging into the release branch, the pipeline compiles signed App Bundles (.aab) and iOS binaries (.ipa), deploying them directly to Google Play Internal Testing tracks and Apple TestFlight for automated distribution to internal stakeholders and QA testers.

This pipeline permanently eradicated the "works on my machine" syndrome and made our release cadence transparent, safe, and repeatable.

Honest Retrospective: What I Would Do Differently If Starting Over#

Looking back across the entire multi-year migration journey, here are four fundamental decisions I would execute differently if I were to reset the clock to day one:

FIG.
Migration Retrospective Matrix: Real-World Engineering Lessons
Architectural Wisdom
01Environment from Day OneEarly Prerequisite

Isolate develop and production configs from line one, rather than retrofitting after codebase grows.

02Tests with Pilot FeatureInherited Standard

Write unit tests alongside the pilot module so test examples naturally propagate to subsequent features.

03Automate CI/CD EarlierTeam Efficiency

Building automated pipelines with few features is exponentially cheaper than retrofitting onto dozens.

04Transparent Tech DebtTeam Integrity

Document skeleton modules and technical debt honestly so the team operates on facts, not illusions.

Core Lesson:

Architectural decisions made consciously, embracing their trade-offs and operational costs, are far more valuable than patterns that only look perfect on paper.

Architecture Discipline→Team Collaboration→Long-Term Scalability
  1. Isolate Environments Before Writing a Single Feature: We should have separated main_dev.dart and main_prod.dart on day one rather than retrofitting it after several modules were already in flight. Environment safety should always precede feature development.
  2. Ship Automated Tests Alongside the Pilot Feature: We built the Ship feature as an architectural blueprint, but we did not package it with a comprehensive suite of example unit tests. As a result, when subsequent teams duplicated the Ship blueprint, they inherited the layer structure but omitted the tests. Shipping a gold-standard test suite with the pilot would have established testing as an ingrained cultural standard from the outset.
  3. Invest in CI/CD Automation Earlier: Building automated pipelines when an application only has two modules is simple and friction-free. Retrofitting continuous integration when you have ten concurrent features undergoing active development is exponentially harder.
  4. Maintain an Unflinching, Transparent Technical Debt Ledger: In any iterative migration, some modules remain intermediate skeletons or partial refactors. Recording those half-migrated screens openly in team documentation prevents false assumptions and keeps technical debt visible to product leadership.

What You Can Take from This 7-Part Series#

If you are leading or contributing to a large-scale mobile migration, here are the overarching principles that guided our journey:

  • Avoid the Rewrite Trap: Incremental, feature-by-feature migration using the Strangler Fig pattern protects daily business revenue and breaks overwhelming technical risk into bite-sized units.
  • Set the Pattern Before Adding the Second Feature: Use your pilot module to forge clear Presentation, Domain, and Data boundaries. Team velocity multiplies when developers duplicate proven blueprints instead of re-inventing basics.
  • Embrace Unidirectional State and Explicit DI: Pair BLoC with modular feature injectors in get_it. The auditability of explicit event-state transitions pays massive dividends in production stability.
  • Guard the Entry Point: Treat startup as a sequential bootstrap pipeline. Use declarative router middleware like go_router to enforce session security deterministically across all routes and deep links.
  • Harden the Data Layer: Centralize HTTP clients, automate token refresh in interceptors, isolate hardware-encrypted storage from ephemeral cache, and replace leaky try-catch blocks with functional Either boundaries.
  • Automate Quality Relentlessly: Pre-commit hooks, CI test gates, and automated store deployments protect your team from human error and keep releases reproducible.

Closing the Series#

Architecture migration reshapes how an engineering team designs, verifies, and maintains a digital product with confidence over the long haul, going far beyond adopting a new state management library or chasing theoretical purity on paper.

Every architectural decision carries a price tag. The hallmark of mature senior engineering is not finding a pattern that has zero trade-offs (such a thing does not exist), but understanding the costs of your choices and consciously choosing the trade-offs you are willing to manage.

To everyone who followed this series from Part 1 to Part 7: thank you for reading my story :)

P.S. This entire series was written at the level of software design decisions, system architecture, and engineering leadership, without disclosing proprietary code or internal company data. If you are navigating a similar architecture transition in your mobile organization or want to discuss enterprise Flutter architecture, let's connect and share experiences!