Rollout Condition Evaluator
Component Detail
Description
A pure service that evaluates phase-based rollout conditions for a feature flag given the current app version and date. Returns whether a flag should be considered active based on its configured minimum app version and optional activation date thresholds.
rollout-evaluator
Summaries
The Rollout Condition Evaluator ensures that new features are only surfaced to users whose app version and timing context meet the configured launch criteria, eliminating the risk of exposing unfinished or incompatible functionality to users who have not yet updated. This protects brand reputation, reduces support ticket volume from confused users on older app versions, and gives product and commercial teams confidence to configure phased launches without engineering intervention. Its purely logical, dependency-free design means it can be audited independently, reducing compliance and QA overhead. The result is faster, safer feature launches with measurable reduction in rollout-related incidents.
The Rollout Condition Evaluator is a low-complexity, zero-dependency pure service, making it the lowest-risk component in the feature flag system and an ideal early deliverable. It has no network, database, or platform dependencies, so it can be fully unit-tested in isolation with 100% branch coverage in a short time. Its interfaces are stable—`evaluate`, `isVersionSufficient`, and `isDateReached`—and unlikely to require changes unless rollout condition types are extended. It carries no deployment risk and can be developed and signed off before the repository or cache layers are complete.
Schedule it as an early sprint task to unblock provider development.
RolloutEvaluator is a stateless pure-Dart service with no injected dependencies. `evaluate(flag, appVersion, now)` is the primary entry point and returns `true` only when both `isVersionSufficient` and `isDateReached` pass. `isVersionSufficient` must implement semantic version comparison (split on `.`, parse to List
Keep this class free of Flutter imports so it can be tested with `dart test` without a device. FeatureFlagProvider calls this synchronously inside its map-building loop—no async, no side effects.
Responsibilities
- Compare current semantic app version against flag's minimum required version
- Check current date against the flag's optional activation date
- Return a boolean indicating whether rollout conditions are met
Interfaces
evaluate(FeatureFlag flag, String appVersion, DateTime now) → bool
isVersionSufficient(String currentVersion, String minVersion) → bool
isDateReached(DateTime? activationDate, DateTime now) → bool
Relationships
Related Data Entities (2)
Data entities managed by this component