-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration Source Extraction part 1/4 #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/v4
Are you sure you want to change the base?
Conversation
Create public interfaces (I* prefix) for all DTOs in cloud.eppo.api package: - IFlagConfig, IFlagConfigResponse, IAllocation, ISplit, IShard, IShardRange - ITargetingRule, ITargetingCondition, IVariation - IBanditParameters, IBanditParametersResponse, IBanditReference - IBanditModelData, IBanditCoefficients, IBanditFlagVariation - IBanditAttributeCoefficients, IBanditNumericAttributeCoefficients, IBanditCategoricalAttributeCoefficients - IEppoValue Update DTOs to implement interfaces: - All DTOs in cloud.eppo.ufc.dto now implement their corresponding interfaces - EppoValue implements IEppoValue - ShardRange implements IShardRange Update consumers to use interface types: - Configuration stores and returns interface types (Map<String, ? extends IFlagConfig>) - FlagEvaluator, RuleEvaluator, BanditEvaluator use interface types - BaseEppoClient uses IFlagConfig, IBanditParameters This enables downstream SDKs (Android, KMP) to provide custom DTO implementations while maintaining type safety and compatibility with the common SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extracts public interfaces for all 17 DTOs in the cloud.eppo.api package to enable downstream SDK extensibility. The changes allow downstream SDKs and customers to provide custom implementations for configuration management, networking, and serialization while maintaining backward compatibility.
Changes:
- Created 17 new interface definitions in
cloud.eppo.apipackage - Updated all concrete DTO classes to implement their corresponding interfaces
- Modified internal code to use interface types instead of concrete classes
- Added backward compatibility methods where needed
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/cloud/eppo/api/I*.java (17 files) | New interface definitions for all DTOs with comprehensive Javadoc |
| src/main/java/cloud/eppo/ufc/dto/*.java | Updated concrete classes to implement new interfaces |
| src/main/java/cloud/eppo/api/Configuration.java | Changed to use interface types for flags, bandits, and references |
| src/main/java/cloud/eppo/BaseEppoClient.java | Updated to use IFlagConfig and IBanditParameters interfaces |
| src/main/java/cloud/eppo/FlagEvaluator.java | Modified to work with interface types throughout evaluation logic |
| src/main/java/cloud/eppo/BanditEvaluator.java | Updated to use IBanditModelData and related interfaces |
| src/main/java/cloud/eppo/RuleEvaluator.java | Changed to use ITargetingRule and ITargetingCondition interfaces |
| src/test/java/cloud/eppo/BaseEppoClientTest.java | Updated test to use IFlagConfig interface |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/cloud/eppo/ufc/dto/BanditNumericAttributeCoefficients.java
Outdated
Show resolved
Hide resolved
src/main/java/cloud/eppo/ufc/dto/BanditCategoricalAttributeCoefficients.java
Outdated
Show resolved
Hide resolved
…ents Remove EppoValue overload methods - use IEppoValue consistently. Breaking change acceptable since targeting feature/v4.
…interface Delete internal BanditAttributeCoefficients interface - use IBanditAttributeCoefficients everywhere. Concrete classes now only implement the public interface. Breaking change acceptable since targeting feature/v4.
- FlagEvaluationResult now uses IVariation throughout - Remove concrete Variation from public API - Remove wildcard imports of cloud.eppo.ufc.dto - Only import specific types needed (VariationType enum) - Breaking change: getVariation() returns IVariation instead of Variation
📚 Downstream SDK Extensibility Stacked Pull Requests 📚
👉 Extract DTO interfaces for downstream SDK extensibility (this PR)
🔲 Add HTTP ETag-based caching for configuration fetches (#202)
🔲 Extract IConfigurationSource interface for pluggable configuration loading (#203)
🔲 Make OkHttp a peer dependency for version flexibility (#204)
Motivation and Context
In order to support more flexible and custom configuration sources and parsing, we need to provide interfaces.
Currently, all DTOs are concrete classes in
cloud.eppo.ufc.dto. The goal is to make it possible for downstream SDKs/Customers to:This PR extracts public interfaces for all DTOs
Description
Extract public interfaces for all 17 DTOs in the
cloud.eppo.apipackage.How has this been documented?
cloud.eppo.api) clearly signals public APIHow has this been tested?
Automated Testing
Results:
✅ Compiles without errors
✅ All 249 tests passing
✅ No test modifications required (interfaces are transparent)
Verified Scenarios
? extends IFlagConfig) work correctlyBreaking Changes