Skip to content

Upgrade sdk-common-jvm to v4.0.0 (major version bump to 6.0.0)#156

Open
typotter wants to merge 17 commits into
mainfrom
typo/migrate-to-v4
Open

Upgrade sdk-common-jvm to v4.0.0 (major version bump to 6.0.0)#156
typotter wants to merge 17 commits into
mainfrom
typo/migrate-to-v4

Conversation

@typotter
Copy link
Copy Markdown
Collaborator

@typotter typotter commented May 28, 2026

Summary

  • Bumps cloud.eppo:sdk-common-jvm from 3.13.2 to 4.0.0-SNAPSHOT
  • Wires EppoClient to extend BaseEppoClient<JsonNode> (v4 generic API)
  • Copies test helpers from sdk-common-jvm into this repo (replaces unresolvable test JAR dependency)
  • Rewrites EppoClientTest to use v4 API surface
  • Bumps SDK version to 6.0.0-SNAPSHOT (major bump due to transitive breaking changes)

Breaking changes

sdk-common-jvm is declared as api scope, so its types are transitive to consumers:

  • cloud.eppo.ufc.dto.* package moved to cloud.eppo.api.dto.*
  • cloud.eppo.EppoHttpClient removed (replaced by OkHttpEppoClient)

New public API (additive)

  • get*AssignmentDetails() methods for all types (boolean, int, double, string, JSON)
  • getBanditActionDetails()
  • unsubscribeFromConfigurationChange()

Test plan

  • All existing tests pass (./gradlew test)
  • publishToMavenLocal succeeds
  • java-server-sdk-relay builds and compiles against the new jar
  • Run relay against live Eppo environment

@typotter typotter changed the title Upgrade sdk-common-jvm from 3.13.2 to 4.0.0 Upgrade sdk-common-jvm to v4.0.0 (major version bump to 6.0.0) May 29, 2026
@typotter typotter marked this pull request as draft May 29, 2026 06:25
@typotter typotter marked this pull request as ready for review May 29, 2026 06:31
@typotter typotter requested a review from aarsilv May 29, 2026 06:41
@aarsilv aarsilv requested a review from Copilot May 29, 2026 11:53
Copy link
Copy Markdown

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

Upgrades the SDK’s shared dependency (cloud.eppo:sdk-common-jvm) to the new v4 API and updates this repo’s client + tests to match the new generic BaseEppoClient<JsonNode> surface, while removing the previously used “tests” classifier dependency.

Changes:

  • Bump sdk-common-jvm to 4.0.0-SNAPSHOT and SDK version to 6.0.0-SNAPSHOT.
  • Update EppoClient to extend BaseEppoClient<JsonNode> and wire new v4 initialization components.
  • Replace the old test-jar dependency by copying test helper classes and rewriting EppoClientTest to use WireMock-based HTTP stubbing.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/main/java/cloud/eppo/EppoClient.java Migrates client to v4 generic BaseEppoClient<JsonNode> construction.
src/test/java/cloud/eppo/EppoClientTest.java Reworks tests to use WireMock stubs instead of the removed HTTP client override.
src/test/java/cloud/eppo/helpers/TestUtils.java Adds local test helper for mocking configuration client responses.
src/test/java/cloud/eppo/helpers/TestCaseValue.java Adds test-only EppoValue wrapper to represent JSON test values.
src/test/java/cloud/eppo/helpers/SubjectAssignment.java Adds test fixture model for subject assignments and optional evaluation details.
src/test/java/cloud/eppo/helpers/BanditTestCaseDeserializer.java Adds JSON deserialization for bandit test vectors.
src/test/java/cloud/eppo/helpers/BanditTestCase.java Adds runner/parsing for bandit test cases.
src/test/java/cloud/eppo/helpers/BanditSubjectAssignment.java Adds bandit test fixture model for per-subject expected outcomes.
src/test/java/cloud/eppo/helpers/AssignmentTestCaseDeserializer.java Adds JSON deserialization for assignment test vectors + evaluation details.
src/test/java/cloud/eppo/helpers/AssignmentTestCase.java Adds runner/parsing/assertion utilities for assignment test cases (incl. details).
README.md Updates documented dependency coordinates to 6.x.
build.gradle Bumps SDK + sdk-common-jvm versions and removes the sdk-common-jvm test-jar dependency.
Comments suppressed due to low confidence (1)

src/test/java/cloud/eppo/EppoClientTest.java:71

  • These stubs read JSON responses from src/test/resources/shared/ufc/*.json, but that directory/files are not present in this repo checkout. As written, readConfig(...) will throw and tests will fail. The referenced JSON fixtures (flags-v1.json, bandit-flags-v1.json, bandit-models-v1.json) need to be added under src/test/resources (or the code updated to point at the actual fixture location).
    // If we get the dummy flag API key, return flags-v1.json
    String ufcFlagsResponseJson = readConfig("src/test/resources/shared/ufc/flags-v1.json");
    mockServer.stubFor(
        WireMock.get(
                WireMock.urlMatching(
                    ".*flag-config/v1/config\\?.*apiKey=" + DUMMY_FLAG_API_KEY + ".*"))
            .willReturn(WireMock.okJson(ufcFlagsResponseJson)));

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

Comment on lines +9 to +13
import cloud.eppo.api.MatchedRule;
import cloud.eppo.api.RuleCondition;
import cloud.eppo.api.dto.VariationType;
import cloud.eppo.ufc.dto.adapters.EppoValueDeserializer;
import com.fasterxml.jackson.core.JsonParser;
Comment on lines +2 to +5

import cloud.eppo.api.*;
import cloud.eppo.ufc.dto.adapters.EppoValueDeserializer;
import com.fasterxml.jackson.core.JsonParser;
Comment on lines +68 to +73
public static Stream<Arguments> getAssignmentTestData() {
File testCaseFolder = new File("src/test/resources/shared/ufc/tests");
File[] testCaseFiles = testCaseFolder.listFiles();
assertNotNull(testCaseFiles);
assertTrue(testCaseFiles.length > 0);
List<Arguments> arguments = new ArrayList<>();
Comment on lines +44 to +49
public static Stream<Arguments> getBanditTestData() {
File testCaseFolder = new File("src/test/resources/shared/ufc/bandit-tests");
File[] testCaseFiles = testCaseFolder.listFiles();
assertNotNull(testCaseFiles);
assertTrue(testCaseFiles.length > 0);
List<Arguments> arguments = new ArrayList<>();
Comment thread README.md
Comment on lines 10 to 13
```groovy
dependencies {
implementation 'cloud.eppo:eppo-server-sdk:5.3.3'
implementation 'cloud.eppo:eppo-server-sdk:6.0.0'
}
Comment on lines +3 to +4
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
Comment on lines +24 to +25
private String fileName;

Comment on lines +354 to +360
if (expectedConditions.size() != actualConditions.size()) {
fail(
message
+ String.format(
" (expected %d conditions but got %d)",
expectedConditions.size(), actualConditions.size()));
}
@aarsilv
Copy link
Copy Markdown
Collaborator

aarsilv commented May 29, 2026

🤖 Comment from AI: I reviewed the v4 wiring in EppoClient and the copied test helpers and did not find an additional code-level blocker. One landing blocker remains outside the diff itself: GitHub currently reports this PR as CONFLICTING, so it will need a rebase or merge from main before it can land.

Copy link
Copy Markdown
Collaborator

@aarsilv aarsilv left a comment

Choose a reason for hiding this comment

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

Approving as we could do red-green-refactor method here but love to hit on the refactor part to consolidate what I think should be common test files

Comment on lines +64 to +65
new JacksonConfigurationParser(),
new OkHttpEppoClient());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

import org.apache.commons.io.FileUtils;
import org.junit.jupiter.params.provider.Arguments;

public class AssignmentTestCase {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Now that the common v4 is settling for this and android, could we have this in there as well and export them in a non-production artifact way? Would remove a ton of duplication I reckon.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed — these helpers are duplicated from the android repo. Tracking as followup: move them into sdk-common-jdk as a test artifact so both SDKs consume them.

typotter added 17 commits May 29, 2026 09:30
Research covers stack changes, feature landscape, architecture
differences, and pitfalls for upgrading from v3.13.2 to v4.0.0-SNAPSHOT.
…hot repo URL

- Replace s01.oss.sonatype.org snapshot URL with central.sonatype.com/repository/maven-snapshots/
- Bump api dependency cloud.eppo:sdk-common-jvm from 3.13.2 to 4.0.0-SNAPSHOT
- Bump test helpers from sdk-common-jvm:3.5.4:tests to 4.0.0-SNAPSHOT:tests
- Replace cloud.eppo.ufc.dto.VariationType with cloud.eppo.api.dto.VariationType
- Zero cloud.eppo.ufc.dto references remain in any .java file
- Add <JsonNode> generic type parameter to BaseEppoClient class declaration
- Remove null at super() position 4 (String param removed in v4)
- Append JacksonConfigurationParser and OkHttpEppoClient as new super() args 14 and 15
- Add import for com.fasterxml.jackson.databind.JsonNode
- EppoClient wired to BaseEppoClient<JsonNode> with 15-arg super()
- JacksonConfigurationParser and OkHttpEppoClient injected as pluggable deps
- compileJava and spotlessCheck both pass
…lvable tests JAR dependency

- Copy 8 test helper source files from sdk-common-jdk into helpers/ package
- Remove unresolvable testImplementation 'sdk-common-jvm:4.0.0-SNAPSHOT:tests' from build.gradle
- Remove EppoHttpClient mocking, use WireMock request counting for testPolling
- Rewrite testConfigurationChangeListener using WireMock scenarios
- Rewrite mockHttpError to use WireMock server error stubs
- Replace Constants.appendApiPathToHost(TEST_HOST) with TEST_HOST
- Delete setBaseClientHttpClientOverrideField reflection method
- Fix initBuggyClient to use mock IConfigurationStore instead of null
- Extract registerDefaultStubs for WireMock reset between tests
- Remove unused imports (CompletableFuture, ExecutionException, TestUtils)
- build.gradle: version 5.3.4 -> 5.4.0-SNAPSHOT
- README.md: release example 5.3.3 -> 5.4.0
- README.md: snapshot example 4.0.1-SNAPSHOT -> 5.4.0-SNAPSHOT
- Add 03-02-SUMMARY.md for phase 3 plan 2
Already in .gitignore but was committed before the ignore rule.
Major version bump due to transitive breaking changes in
sdk-common-jvm v4 (ufc.dto package moved to api.dto,
EppoHttpClient removed).
@typotter typotter force-pushed the typo/migrate-to-v4 branch from 96575fd to bc69156 Compare May 29, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants