-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration Source Extraction part 4/4 #204
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: tyler.potter/typo/config-source-extraction
Are you sure you want to change the base?
Configuration Source Extraction part 4/4 #204
Conversation
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 makes OkHttp a peer dependency instead of bundling it with the SDK, allowing host applications to control the OkHttp version they use. This is the final PR in a stack focused on downstream SDK extensibility.
Changes:
- Changed OkHttp from
implementationtocompileOnlydependency in build.gradle - Added CI workflow for testing compatibility with OkHttp 4.12.0 and 5.0.0-alpha.14
- Created comprehensive migration guide (MIGRATION_V3_TO_V4.md) with step-by-step instructions
- Updated README with dependency requirements and usage examples
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Added dependencies section documenting OkHttp as a peer dependency with version requirements and usage examples |
| MIGRATION_V3_TO_V4.md | New migration guide explaining the breaking change and providing detailed migration steps for Gradle and Maven |
| .github/workflows/okhttp-compatibility.yml | New CI workflow to test compatibility with both OkHttp 4.12.0 and 5.0.0-alpha.14 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if: always() | ||
| run: | | ||
| echo "## Test Results for OkHttp ${{ matrix.okhttp-version }}" >> $GITHUB_STEP_SUMMARY | ||
| if [ ${{ job.status }} == 'success' ]; then |
Copilot
AI
Jan 20, 2026
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.
The condition syntax is incorrect for GitHub Actions. The job.status context should be accessed without dollar signs and braces inside the bracket expression. Change to if [ "${{ job.status }}" == "success" ]; then with proper quoting.
| if [ ${{ job.status }} == 'success' ]; then | |
| if [ "${{ job.status }}" == "success" ]; then |
| matrix: | ||
| okhttp-version: | ||
| - '4.12.0' # Latest 4.x stable | ||
| - '5.0.0-alpha.14' # Latest 5.x alpha (update as 5.x stabilizes) |
Copilot
AI
Jan 20, 2026
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.
The comment suggests this version should be updated as 5.x stabilizes, but there's no mechanism to ensure this happens. Consider adding a comment about checking for newer versions periodically or linking to OkHttp's release page for tracking updates.
| - '5.0.0-alpha.14' # Latest 5.x alpha (update as 5.x stabilizes) | |
| - '5.0.0-alpha.14' # Latest 5.x alpha as of 2024-01; periodically check https://github.com/square/okhttp/releases for newer 5.x versions |
afa98b3 to
84f1b75
Compare
b78f2ac to
e43b140
Compare
84f1b75 to
b080986
Compare
e43b140 to
caf85e3
Compare
b080986 to
cd0a624
Compare
BREAKING CHANGE: OkHttp is now a peer dependency (compileOnly). Applications must provide OkHttp 4.12+ or 5.x as a dependency. Changes: - Change OkHttp from 'implementation' to 'compileOnly' in build.gradle - Add property-based version override support (-PokhttpVersion) - Add testWithOkHttp5 gradle task for local compatibility testing - Create CI workflow for multi-version testing (4.12.0 and 5.x) - Create MIGRATION_V3_TO_V4.md with detailed upgrade instructions - Update README.md with dependency requirements Benefits: - Applications control OkHttp version (4.12+, 5.x, or compatible versions) - Reduces SDK footprint by ~2MB (no bundled OkHttp, Okio, Kotlin stdlib) - Eliminates OkHttp version conflicts between SDK and applications - Tested and verified compatible with both OkHttp 4.12.0 and 5.0.0-alpha.14 Migration: Simply add OkHttp dependency to your build file. No code changes required. See MIGRATION_V3_TO_V4.md for complete instructions. Testing: ./gradlew test # Default (4.12.0) ./gradlew test -PokhttpVersion=5.0.0-alpha.14 # Test with 5.x ./gradlew testWithOkHttp5 -PokhttpVersion=5.0.0-alpha.14 # Convenience task
caf85e3 to
be33f15
Compare
📚 Downstream SDK Extensibility Stacked Pull Requests 📚
☑️ Extract DTO interfaces for downstream SDK extensibility (#197)
☑️ 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 (this PR)
Eppo Internal
🎟️ Enables host applications to control OkHttp version, avoiding dependency conflicts
📜 Design Doc: N/A - Dependency management improvement
Motivation and Context
Currently, OkHttp is bundled with the SDK as an
implementationdependency. This causes problems for host applications:By making OkHttp a peer dependency (compileOnly), host applications gain full control over which OkHttp version to use (4.12+, 5.x, or any compatible version).
Description
Change OkHttp from bundled dependency to peer dependency.
build.gradle Changes
Impact:
Multi-Version Testing
Added testWithOkHttp5 task:
Added CI workflow (
.github/workflows/okhttp-compatibility.yml):Migration Guide (MIGRATION_V3_TO_V4.md)
Created comprehensive migration guide with:
Updated README
Added dependencies section documenting:
How has this been documented?
How has this been tested?
Multi-Version Testing
✅ All 249 tests passing
✅ All 249 tests passing
Verified Scenarios
OkHttp Compatibility
The SDK uses only basic OkHttp APIs that are stable across versions:
OkHttpClient,OkHttpClient.Builder- Same in bothRequest,Response,Call,Callback- Same in bothHttpUrl- Same in bothconnectTimeout(),readTimeout()- Available in bothResult: Works with both OkHttp 4.12+ and 5.x without modifications.
Migration Example
Before (v3.x):
After (v4.0):
Code: No changes needed!
Stack Context
BREAKING CHANGE: This is the only breaking change in the stack.
This PR builds on:
Combined stack enables:
Result: Downstream SDKs have complete control over DTOs, configuration loading, AND HTTP client version.