Skip to content

Commit 0ab0e71

Browse files
committed
Merge branch 'main' into issue/828_fractional_relative_weighting
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
2 parents ddbcc84 + 92a0499 commit 0ab0e71

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

providers/flagd/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In vscode for instance, the following settings are recommended:
2323
The continuous integration runs a set of [gherkin e2e tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) using [`flagd`](https://github.com/open-feature/flagd). These tests do not run with the default maven profile. If you'd like to run them locally, you can start the flagd testbed with
2424

2525
```
26-
docker-compose up -d
26+
docker-compose up
2727
```
2828
and then run
2929
```

providers/flagd/docker-compose.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
services:
22
flagd:
3-
build:
4-
context: test-harness
5-
dockerfile: flagd/Dockerfile
3+
image: ghcr.io/open-feature/flagd-testbed:v0.5.4
64
ports:
75
- 8013:8013
86
flagd-unstable:
9-
build:
10-
context: test-harness
11-
dockerfile: flagd/Dockerfile.unstable
7+
image: ghcr.io/open-feature/flagd-testbed-unstable:v0.5.4
128
ports:
139
- 8014:8013
1410
flagd-sync:
15-
build:
16-
context: test-harness
17-
dockerfile: sync/Dockerfile
11+
image: ghcr.io/open-feature/sync-testbed:v0.5.4
1812
ports:
1913
- 9090:9090
2014
flagd-sync-unstable:
21-
build:
22-
context: test-harness
23-
dockerfile: sync/Dockerfile.unstable
15+
image: ghcr.io/open-feature/sync-testbed-unstable:v0.5.4
2416
ports:
2517
- 9091:9090

providers/flagd/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<!-- we only support unix sockets on linux, via epoll native lib -->
6565
<groupId>io.netty</groupId>
6666
<artifactId>netty-transport-native-epoll</artifactId>
67-
<version>4.1.111.Final</version>
67+
<version>4.1.110.Final</version>
6868
<!-- TODO: with 5+ (still alpha), arm is support and we should package multiple versions -->
6969
<classifier>linux-x86_64</classifier>
7070
</dependency>

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/targeting/Fractional.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ public Object evaluate(List arguments, Object data) throws JsonLogicEvaluationEx
6767
return distributeValue(bucketBy, propertyList, totalWeight);
6868
}
6969

70-
private static String distributeValue(final String hashKey, final List<FractionProperty> propertyList, int totalWeight)
71-
throws JsonLogicEvaluationException {
70+
private static String distributeValue(
71+
final String hashKey,
72+
final List<FractionProperty> propertyList,
73+
int totalWeight
74+
) throws JsonLogicEvaluationException {
7275
byte[] bytes = hashKey.getBytes(StandardCharsets.UTF_8);
7376
int mmrHash = MurmurHash3.hash32x86(bytes, 0, bytes.length, 0);
7477
float bucket = (Math.abs(mmrHash) * 1.0f / Integer.MAX_VALUE) * 100;
@@ -113,7 +116,7 @@ protected final void finalize() {
113116
}
114117

115118
variant = (String) array.get(0);
116-
if(array.size() >= 2) {
119+
if (array.size() >= 2) {
117120
// second element must be a number
118121
if (!(array.get(1) instanceof Number)) {
119122
throw new JsonLogicException("Second element of the fraction property is not a number");

0 commit comments

Comments
 (0)