feat: add foundation layer for eppo-kotlin (PR 1: Steps 1-3)#232
Draft
typotter wants to merge 1 commit intofeature/eppo-kotlin-setupfrom
Draft
feat: add foundation layer for eppo-kotlin (PR 1: Steps 1-3)#232typotter wants to merge 1 commit intofeature/eppo-kotlin-setupfrom
typotter wants to merge 1 commit intofeature/eppo-kotlin-setupfrom
Conversation
Implement complete foundation combining data objects, storage, and network: **Step 1 - Data Objects & Parsing:** - Add model classes (ResolutionDetails, BanditResult, enums) - Add DTO models with @serializable for JSON (Request/Response/Flag/Bandit) - Add EppoPrecomputedConfig with Builder pattern and validation - Add exception hierarchy (5 exception classes) - Add Base64 encode/decode with NO_WRAP flag - Add TypeConverter for Base64→typed values **Step 2 - Storage Layer:** - Add FlagsState (immutable state container) - Add DecodedPrecomputedFlag/Bandit models - Add FlagsRepository with StateFlow (lock-free reads) + DataStore (persistence) - Add FlagsStateSerializer for disk persistence - Add AssignmentCache/BanditCache (LRU deduplication) - Thread-safe with Mutex for writes, atomic state updates **Step 3 - Network Layer:** - Add PrecomputedRequestor (coroutine HTTP client) - Add RequestFactory (builds POST requests with JSON) - Add OkHttpExtensions (Call.await() with proper cancellation) - Add Md5 hashing for flag key obfuscation **Tests:** 66 test cases across utils, network, and repository layers All code includes fixes from code review: - OkHttp: removed deprecated continuation.isCancelled - Base64: using NO_WRAP flag - Builder: banditActions validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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