Skip to content

Conversation

@ttypic
Copy link
Contributor

@ttypic ttypic commented Nov 20, 2025

  • Updated build scripts to use network-client-okhttp by default where appropriate.
  • Revised README to simplify proxy setup instructions.
  • Adjusted integration workflows to correctly configure HTTP client preferences.

Summary by CodeRabbit

  • Documentation

    • Updated proxy support guidance to use ProxyOptions configuration in ClientOptions instead of OkHttp-specific approach.
  • Chores

    • Updated CI/CD workflow and build configurations for HTTP client variant testing.

✏️ Tip: You can customize this high-level summary in your review settings.

… support setup

- Updated build scripts to use `network-client-okhttp` by default where appropriate.
- Revised README to simplify proxy setup instructions.
- Adjusted integration workflows to correctly configure HTTP client preferences.
@ttypic ttypic requested a review from sacOO7 November 20, 2025 23:57
@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

The changes revert the default network client implementation from HttpURLConnection to OkHttp in the Java build configuration, update test workflows to specifically test the HttpURLConnection variant, modify Android dependencies to use OkHttp as the runtime client, and update documentation to recommend ProxyOptions for proxy support instead of OkHttp dependencies.

Changes

Cohort / File(s) Summary
Workflow Test Configuration
.github/workflows/integration-test.yml
Renamed test jobs to specify HttpURLConnection variant (check-rest-httpurlconnection, check-realtime-httpurlconnection); added -PhttpURLConnection flag to rest and realtime test suites; removed -Pokhttp flags from okhttp-related test invocations.
Build Configuration
java/build.gradle.kts
Reversed dependency resolution logic: OkHttp client now the default; HttpURLConnection client included only when httpURLConnection property is set (inverts prior okhttp-property logic).
Build Configuration
android/build.gradle.kts
Changed runtime dependency from network-client-default to network-client-okhttp.
Documentation
README.md
Removed guidance to add OkHttp dependency for proxy support; replaced with recommendation to configure ProxyOptions in ClientOptions; updated example from OkHttp dependency to standalone ProxyOptions configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Changes are straightforward configuration and dependency updates with consistent patterns
  • Documentation update is a simple replacement of instructions
  • No complex logic or structural changes to review

Poem

🐰 From HttpURLConnection's gentle call,
OkHttp springs forth as default for all,
With ProxyOptions now the modern way,
Network clients dance—let defaults sway! 🌐

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: making OkHttp the default network client instead of the prior default, which is the core objective of this refactoring across build scripts and workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch make-okhttp-default

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f354a8 and 64f62a9.

📒 Files selected for processing (4)
  • .github/workflows/integration-test.yml (5 hunks)
  • README.md (1 hunks)
  • android/build.gradle.kts (1 hunks)
  • java/build.gradle.kts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: check-realtime-okhttp
  • GitHub Check: check-rest-okhttp
  • GitHub Check: check
  • GitHub Check: check-liveobjects
  • GitHub Check: check (29)
  • GitHub Check: build
  • GitHub Check: check-rest-httpurlconnection
  • GitHub Check: check (19)
  • GitHub Check: check-realtime-httpurlconnection
  • GitHub Check: check (29)
  • GitHub Check: check (21)
  • GitHub Check: check (24)
🔇 Additional comments (3)
android/build.gradle.kts (1)

57-57: Make OkHttp explicit as Android's runtime network client.

Switching to runtimeOnly scope for network-client-okhttp appropriately makes OkHttp the default HTTP client for Android users without exposing OkHttp internals at compile time. This aligns with the SDK's shift to OkHttp as the default across all platforms.

README.md (1)

130-178: Clear and practical proxy setup documentation.

The updated proxy guidance using ProxyOptions is cleaner and more user-friendly than requiring explicit OkHttp dependency management. The code example comprehensively covers both REST and Realtime clients with optional authentication, making it straightforward for users to implement proxy support.

Verify that all classes and fields referenced in the example (ProxyOptions, HttpAuth.Type.BASIC, HttpAuth.Type.DIGEST) exist and have the expected API.

.github/workflows/integration-test.yml (1)

11-92: Test matrix comprehensively covers both HTTP client variants; verify branch protection configuration.

The updated workflow maintains test coverage for both OkHttp (default via okhttp jobs without the property) and HttpURLConnection (via httpurlconnection jobs with -PhttpURLConnection). The renamed jobs clearly indicate what's being tested.

Repository scan found no internal references to the old job names. However, verify that any branch protection rules on the main branch have been updated to reference the new job names (check-rest-httpurlconnection, check-realtime-httpurlconnection, check-rest-okhttp, check-realtime-okhttp). Check this in GitHub repository settings under Branches → Branch protection rules and ensure required status checks reference the correct job names.

Comment on lines +25 to 29
if (findProperty("httpURLConnection") == null) {
runtimeOnly(project(":network-client-okhttp"))
} else {
runtimeOnly(project(":network-client-default"))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Breaking change: OkHttp is now the default network client.

The conditional logic now defaults to OkHttp when the httpURLConnection property is absent. Users who expect the previous HttpURLConnection-based default will need to explicitly pass -PhttpURLConnection to get that behavior. This is a significant behavioral change that should be clearly documented in release notes and may require user migration guidance.

Verify the following before release:

  1. A migration notice is added to CHANGELOG.md documenting this breaking change
  2. Users who specifically need HttpURLConnection behavior understand the -PhttpURLConnection flag requirement
  3. Integration tests comprehensively validate both variants to catch compatibility issues early
  4. Any user-facing documentation is updated to mention OkHttp as the default HTTP client

Run this script to verify integration test coverage:


🏁 Script executed:

#!/bin/bash
# Check that integration tests cover both HTTP client variants
grep -n "httpURLConnection\|okhttp" .github/workflows/integration-test.yml | head -20

Length of output: 187


🏁 Script executed:

#!/bin/bash
# Check for CHANGELOG entries about HTTP client changes
fd -e CHANGELOG -e CHANGELOG.md -e changelog.md -e HISTORY -e NEWS | head -10

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Look for migration guides, release notes, or docs about HTTP client
fd -e md -e txt | xargs grep -l "httpURLConnection\|network.*client\|HTTP.*client" 2>/dev/null | grep -E "(CHANGELOG|README|MIGRATION|RELEASE|GUIDE|NEWS)" | head -20

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Check if there's a README mentioning the default HTTP client
cat README.md 2>/dev/null | grep -A5 -B5 -i "http.*client\|okhttp\|network" | head -40

Length of output: 831


🏁 Script executed:

#!/bin/bash
# Find all possible documentation files
find . -type f -name "*CHANGE*" -o -name "*RELEASE*" -o -name "*NEWS*" 2>/dev/null | head -20

Length of output: 14


🏁 Script executed:

#!/bin/bash
# Check the build.gradle.kts file for comments explaining this logic
cat java/build.gradle.kts | head -40

Length of output: 1013


🏁 Script executed:

#!/bin/bash
# Look for any docs directory with HTTP client documentation
find . -type d -name "docs" -o -name "doc" 2>/dev/null | xargs ls -la 2>/dev/null | head -30

Length of output: 1796


🏁 Script executed:

#!/bin/bash
# Search CHANGELOG.md for HTTP client or httpURLConnection related entries
grep -n -A3 -B1 "httpURLConnection\|okhttp\|network.*client\|HTTP.*client" CHANGELOG.md | head -50

Length of output: 0


Breaking change: OkHttp is now the default network client — add documentation before release.

The conditional logic defaults to OkHttp when the httpURLConnection property is absent. Integration tests properly cover both variants, but the breaking change lacks critical documentation:

  • CHANGELOG.md: No entry documenting this behavioral change
  • Migration guidance: No documentation for users who specifically need HttpURLConnection (must pass -PhttpURLConnection)
  • User-facing docs: README.md doesn't mention the default HTTP client or how to switch between implementations

Users upgrading will unexpectedly receive OkHttp instead of HttpURLConnection without explicit migration instructions.

Add entries to CHANGELOG.md documenting the default change and add a section to README.md explaining HTTP client selection and the -PhttpURLConnection flag for users who need the legacy behavior.

🤖 Prompt for AI Agents
In java/build.gradle.kts around lines 25-29 the build now defaults to the OkHttp
network client when the -PhttpURLConnection property is absent; update docs
before release: add a CHANGELOG.md entry that clearly states the default changed
to OkHttp (include version, rationale, and note that HttpURLConnection remains
available via -PhttpURLConnection), add or update README.md with a new "HTTP
client selection" section that explains the default is OkHttp, shows the exact
flag to restore legacy HttpURLConnection (gradle -PhttpURLConnection or CI env
guidance), provides a short migration/compatibility note for users (e.g., known
behavior differences and testing advice), and ensure release notes / docs
reference any integration test coverage and how to run with the alternate client
for verification.

@sacOO7 sacOO7 requested a review from Copilot November 21, 2025 12:53
Copy link
Collaborator

@sacOO7 sacOO7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copilot finished reviewing on behalf of sacOO7 November 21, 2025 12:56
Copy link

Copilot AI left a 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 refactors the network client configuration to use OkHttp as the default HTTP client instead of HttpURLConnection. The change simplifies proxy setup by making OkHttp (which has better proxy support) the default choice while still allowing users to opt-in to HttpURLConnection when needed.

  • Inverted the build logic to make OkHttp the default network client, with HttpURLConnection as an opt-in via property flag
  • Updated CI/CD workflows to test both HTTP client implementations separately
  • Simplified README documentation by removing OkHttp-specific dependency instructions since it's now the default

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
java/build.gradle.kts Inverted dependency logic to use network-client-okhttp by default, falling back to network-client-default (HttpURLConnection) when -PhttpURLConnection property is set
android/build.gradle.kts Changed Android builds to unconditionally use network-client-okhttp as the runtime dependency
README.md Removed OkHttp dependency installation instructions from proxy setup guide since OkHttp is now the default
.github/workflows/integration-test.yml Renamed and restructured test jobs to explicitly test both HTTP client variants, with httpurlconnection tests using -PhttpURLConnection flag and okhttp tests running without flags
Comments suppressed due to low confidence (1)

.github/workflows/integration-test.yml:57

  • The artifact name for the Realtime test reports will conflict between the httpurlconnection and okhttp test jobs. When both check-realtime-httpurlconnection and check-realtime-okhttp jobs run, they will both try to upload artifacts with the name java-build-reports-realtime, causing one to overwrite the other.

Consider making the artifact name unique by including the HTTP client variant, for example: java-build-reports-realtime-httpurlconnection.

      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: java-build-reports-realtime
          path: java/build/reports/

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 29 to 33
- uses: actions/upload-artifact@v4
if: always()
with:
name: java-build-reports-rest
path: java/build/reports/
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The artifact names for the REST and Realtime test reports will conflict between the httpurlconnection and okhttp test jobs. When both check-rest-httpurlconnection and check-rest-okhttp jobs run, they will both try to upload artifacts with the name java-build-reports-rest, and similarly for the realtime jobs. This will cause one artifact to overwrite the other.

Consider making the artifact names unique by including the HTTP client variant in the name, for example:

  • java-build-reports-rest-httpurlconnection and java-build-reports-rest-okhttp
  • java-build-reports-realtime-httpurlconnection and java-build-reports-realtime-okhttp

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants