feat: add foundation layer for eppo-kotlin (PR 1: Steps 1-3) #232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implement the complete foundation layer combining data objects, storage, and network. This PR provides all the building blocks needed for the SDK but does not include evaluation logic or the public client implementation yet.
What's Included
This PR combines Steps 1-3 from the implementation plan:
Step 1: Data Objects & Parsing
ResolutionDetails,BanditResult, enums)@Serializablefor JSON parsingEppoPrecomputedConfigwith Builder pattern and validationStep 2: Storage Layer
FlagsState- Immutable state containerDecodedPrecomputedFlag/Bandit- Domain modelsFlagsRepository- Thread-safe storage with StateFlow + DataStoreFlagsStateSerializer- Persistence serializationAssignmentCache/BanditCache- LRU caches for deduplicationStep 3: Network Layer
PrecomputedRequestor- Coroutine-based HTTP clientRequestFactory- Builds POST requests to/api/v1/precomputed-flagsOkHttpExtensions-Call.await()with proper cancellationMd5- Hashing for flag key obfuscationFiles Added
21 source files:
6 test files (66 test cases):
Base64ExtensionsTest.kt- 10 testsMd5Test.kt- 11 testsOkHttpExtensionsTest.kt- 7 testsRequestFactoryTest.kt- 10 testsPrecomputedRequestorTest.kt- 10 testsFlagsRepositoryTest.kt- 18 testsKey Features
Thread-Safe Storage:
Type-Safe JSON:
Coroutine HTTP:
Code Review Fixes Applied
continuation.isCancelledchecksBase64.NO_WRAPflag (no newlines)banditActionsBuild Verification
What's NOT in This PR
This PR provides the foundation but you cannot yet create a working client or evaluate flags.
Test Plan
Next PR
PR 2 will add the evaluation layer (FlagEvaluator, BanditEvaluator, assignment logging).
🤖 Generated with Claude Code