Skip to content

Commit

Permalink
chore: latest common package and move /api to baseUrl (#84)
Browse files Browse the repository at this point in the history
* chore: latest common package and move api to baseUrl
* versions in README
  • Loading branch information
typotter authored Jan 6, 2025
1 parent 1348140 commit 8f4a168
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

```groovy
dependencies {
implementation 'cloud.eppo:eppo-server-sdk:3.1.0'
implementation 'cloud.eppo:eppo-server-sdk:4.0.0'
}
```

Expand Down Expand Up @@ -58,6 +58,6 @@ repositories {
}
dependencies {
implementation 'cloud.eppo:eppo-server-sdk:3.2.0-SNAPSHOT'
implementation 'cloud.eppo:eppo-server-sdk:4.0.1-SNAPSHOT'
}
```
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ java {
}

group = 'cloud.eppo'
version = '3.2.0-SNAPSHOT'
version = '4.0.0'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

import org.apache.tools.ant.filters.ReplaceTokens
Expand All @@ -30,7 +30,7 @@ repositories {
}

dependencies {
api 'cloud.eppo:sdk-common-jvm:3.5.4'
api 'cloud.eppo:sdk-common-jvm:3.6.0'

implementation 'com.github.zafarkhaja:java-semver:0.10.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/cloud/eppo/EppoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
public class EppoClient extends BaseEppoClient {
private static final Logger log = LoggerFactory.getLogger(EppoClient.class);

private static final String DEFAULT_HOST = "https://fscdn.eppo.cloud";
private static final boolean DEFAULT_IS_GRACEFUL_MODE = true;
private static final boolean DEFAULT_FORCE_REINITIALIZE = false;
private static final long DEFAULT_POLLING_INTERVAL_MS = 30 * 1000;
Expand All @@ -38,19 +37,20 @@ public static EppoClient getInstance() {

private EppoClient(
String apiKey,
String host,
String sdkName,
String sdkVersion,
@Nullable String baseUrl,
@Nullable AssignmentLogger assignmentLogger,
@Nullable BanditLogger banditLogger,
boolean isGracefulMode,
@Nullable IAssignmentCache assignmentCache,
@Nullable IAssignmentCache banditAssignmentCache) {
super(
apiKey,
host,
sdkName,
sdkVersion,
null,
baseUrl,
assignmentLogger,
banditLogger,
null,
Expand All @@ -77,7 +77,7 @@ public static class Builder {
private boolean isGracefulMode = DEFAULT_IS_GRACEFUL_MODE;
private boolean forceReinitialize = DEFAULT_FORCE_REINITIALIZE;
private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS;
private String host = DEFAULT_HOST;
private String apiBaseUrl = null;

// Assignment and bandit caching on by default. To disable, call
// `builder.assignmentCache(null).banditAssignmentCache(null);`
Expand Down Expand Up @@ -139,11 +139,11 @@ public Builder pollingIntervalMs(long pollingIntervalMs) {
}

/**
* Overrides the host from where it fetches configurations. This typically should not be
* explicitly set so that the default of the Fastly CDN is used.
* Overrides the base URL from where the SDK fetches configurations. This typically should not
* be explicitly set so that the default API URL is used.
*/
public Builder host(String host) {
this.host = host;
public Builder apiBaseUrl(String apiBaseUrl) {
this.apiBaseUrl = apiBaseUrl;
return this;
}

Expand Down Expand Up @@ -178,7 +178,7 @@ public EppoClient buildAndInit() {
apiKey,
sdkName,
sdkVersion,
host,
apiBaseUrl,
assignmentLogger,
banditLogger,
isGracefulMode,
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/cloud/eppo/EppoClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private EppoClient initClient(String apiKey) {

return new EppoClient.Builder()
.apiKey(apiKey)
.host(TEST_HOST)
.apiBaseUrl(Constants.appendApiPathToHost(TEST_HOST))
.assignmentLogger(mockAssignmentLogger)
.banditLogger(mockBanditLogger)
.isGracefulMode(false)
Expand All @@ -301,7 +301,7 @@ private EppoClient initFailingGracefulClient(boolean isGracefulMode) {

return new EppoClient.Builder()
.apiKey(DUMMY_FLAG_API_KEY)
.host("blag")
.apiBaseUrl("blag")
.assignmentLogger(mockAssignmentLogger)
.banditLogger(mockBanditLogger)
.isGracefulMode(isGracefulMode)
Expand Down

0 comments on commit 8f4a168

Please sign in to comment.