Skip to content

Commit 8f4a168

Browse files
authored
chore: latest common package and move /api to baseUrl (#84)
* chore: latest common package and move api to baseUrl * versions in README
1 parent 1348140 commit 8f4a168

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
```groovy
1111
dependencies {
12-
implementation 'cloud.eppo:eppo-server-sdk:3.1.0'
12+
implementation 'cloud.eppo:eppo-server-sdk:4.0.0'
1313
}
1414
```
1515

@@ -58,6 +58,6 @@ repositories {
5858
}
5959
6060
dependencies {
61-
implementation 'cloud.eppo:eppo-server-sdk:3.2.0-SNAPSHOT'
61+
implementation 'cloud.eppo:eppo-server-sdk:4.0.1-SNAPSHOT'
6262
}
6363
```

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ java {
1111
}
1212

1313
group = 'cloud.eppo'
14-
version = '3.2.0-SNAPSHOT'
14+
version = '4.0.0'
1515
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
1616

1717
import org.apache.tools.ant.filters.ReplaceTokens
@@ -30,7 +30,7 @@ repositories {
3030
}
3131

3232
dependencies {
33-
api 'cloud.eppo:sdk-common-jvm:3.5.4'
33+
api 'cloud.eppo:sdk-common-jvm:3.6.0'
3434

3535
implementation 'com.github.zafarkhaja:java-semver:0.10.2'
3636
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'

src/main/java/cloud/eppo/EppoClient.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
public class EppoClient extends BaseEppoClient {
2121
private static final Logger log = LoggerFactory.getLogger(EppoClient.class);
2222

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

3938
private EppoClient(
4039
String apiKey,
41-
String host,
4240
String sdkName,
4341
String sdkVersion,
42+
@Nullable String baseUrl,
4443
@Nullable AssignmentLogger assignmentLogger,
4544
@Nullable BanditLogger banditLogger,
4645
boolean isGracefulMode,
4746
@Nullable IAssignmentCache assignmentCache,
4847
@Nullable IAssignmentCache banditAssignmentCache) {
4948
super(
5049
apiKey,
51-
host,
5250
sdkName,
5351
sdkVersion,
52+
null,
53+
baseUrl,
5454
assignmentLogger,
5555
banditLogger,
5656
null,
@@ -77,7 +77,7 @@ public static class Builder {
7777
private boolean isGracefulMode = DEFAULT_IS_GRACEFUL_MODE;
7878
private boolean forceReinitialize = DEFAULT_FORCE_REINITIALIZE;
7979
private long pollingIntervalMs = DEFAULT_POLLING_INTERVAL_MS;
80-
private String host = DEFAULT_HOST;
80+
private String apiBaseUrl = null;
8181

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

141141
/**
142-
* Overrides the host from where it fetches configurations. This typically should not be
143-
* explicitly set so that the default of the Fastly CDN is used.
142+
* Overrides the base URL from where the SDK fetches configurations. This typically should not
143+
* be explicitly set so that the default API URL is used.
144144
*/
145-
public Builder host(String host) {
146-
this.host = host;
145+
public Builder apiBaseUrl(String apiBaseUrl) {
146+
this.apiBaseUrl = apiBaseUrl;
147147
return this;
148148
}
149149

@@ -178,7 +178,7 @@ public EppoClient buildAndInit() {
178178
apiKey,
179179
sdkName,
180180
sdkVersion,
181-
host,
181+
apiBaseUrl,
182182
assignmentLogger,
183183
banditLogger,
184184
isGracefulMode,

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private EppoClient initClient(String apiKey) {
287287

288288
return new EppoClient.Builder()
289289
.apiKey(apiKey)
290-
.host(TEST_HOST)
290+
.apiBaseUrl(Constants.appendApiPathToHost(TEST_HOST))
291291
.assignmentLogger(mockAssignmentLogger)
292292
.banditLogger(mockBanditLogger)
293293
.isGracefulMode(false)
@@ -301,7 +301,7 @@ private EppoClient initFailingGracefulClient(boolean isGracefulMode) {
301301

302302
return new EppoClient.Builder()
303303
.apiKey(DUMMY_FLAG_API_KEY)
304-
.host("blag")
304+
.apiBaseUrl("blag")
305305
.assignmentLogger(mockAssignmentLogger)
306306
.banditLogger(mockBanditLogger)
307307
.isGracefulMode(isGracefulMode)

0 commit comments

Comments
 (0)