Skip to content

Commit

Permalink
tweaked files
Browse files Browse the repository at this point in the history
  • Loading branch information
typotter committed Dec 3, 2024
1 parent 65c91f5 commit 663f2dd
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Eppo.Sdk" Version="3.4.0" />
<PackageReference Include="Eppo.Sdk" Version="3.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
Expand Down
2 changes: 1 addition & 1 deletion package-testing/dotnet-sdk-relay/EppoSDKRelay/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Startup

public static void InitEppoClient()
{
var url = "http://" + apiHost + ":" + apiPort;
var url = "http://" + apiHost + ":" + apiPort + "/api";
Console.WriteLine("Initializating SDK pointed at" + url);

var eppoClientConfig = new EppoClientConfig(apiToken, new AssignmentLogger())
Expand Down
21 changes: 7 additions & 14 deletions package-testing/php-sdk-relay/src/BanditHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public function getBanditAction(array $payload): array
{
$consoleLogger = new Logger();
$consoleLogger->log(LogLevel::INFO, "Processing Bandit");
$consoleLogger->log(LogLevel::DEBUG, json_encode($payload, true));

$flagKey = $payload['flag'];
$default = $payload['defaultValue'];
Expand All @@ -39,19 +38,6 @@ public function getBanditAction(array $payload): array
$payload['subjectAttributes']['categoricalAttributes']
);

$consoleLogger->log(
LogLevel::INFO,
var_export(
[
$flagKey,
$subjectKey,
$subjectAttributes,
$actions,
$default
],
true
)
);

try {
$result = $this->eppoClient->getBanditAction(
Expand All @@ -68,6 +54,13 @@ public function getBanditAction(array $payload): array
"assignmentLog" => $this->eppoEventLogger->assignmentLogs,
"banditLog" => $this->eppoEventLogger->banditLogs
];
// $consoleLogger->log(
// LogLevel::INFO,
// var_export(
// $results,
// true
// )
// );
} catch (EppoClientException $e) {
$results = array(
"subjectKey" => $subjectKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SDKRelay } from './SDKRelay';
import { SDKInfo } from './SDKInfo';
import { SDKConnectionFailure } from './SDKConnectionFailure';
import { ASSIGNMENT_PATH, BANDIT_PATH, RESET_PATH } from './constants';
import { log } from '../logging';

/**
* Uses `axios` to communicate with a Server SDK Relay via http
Expand Down Expand Up @@ -37,6 +38,7 @@ export class ServerSDKRelay implements SDKRelay {

async getBanditAction(request: BanditActionRequest): Promise<TestResponse> {
const result = await axios.post(`${this.sdkRelayAddress}${BANDIT_PATH}`, request);
log(result.data);
return result.data as TestResponse;
}

Expand All @@ -45,6 +47,7 @@ export class ServerSDKRelay implements SDKRelay {
}

async getAssignment(request: AssignmentRequest): Promise<TestResponse> {
log('GETING ASS');
return axios.post(`${this.sdkRelayAddress}${ASSIGNMENT_PATH}`, request).then((result) => {
return result.data as TestResponse;
});
Expand Down
10 changes: 5 additions & 5 deletions ufc/scenarios/jit-loading-2/bandit-flags-v1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"createdAt": "2024-04-17T19:40:53.716Z",
"createdAt": "2024-04-18T19:40:53.716Z",
"format": "SERVER",
"environment": {
"name": "Test"
Expand Down Expand Up @@ -31,7 +31,7 @@
"totalShards": 10000
},
"second_cold_start_bandit_flag": {
"key": "cold_start_bandit_flag",
"key": "second_cold_start_bandit_flag",
"enabled": true,
"variationType": "STRING",
"variations": {
Expand All @@ -54,7 +54,7 @@
}
],
"totalShards": 10000
}
}
},
"bandits": {
"cold_start_bandit": [
Expand All @@ -72,7 +72,7 @@
"variationKey": "second_cold_start_bandit",
"variationValue": "second_cold_start_bandit"
}
]
]
},
"banditReferences": {
"cold_start_bandit": {
Expand All @@ -97,7 +97,7 @@
"variationValue": "second_cold_start_bandit"
}
],
"modelVersion": "NOT cold start"
"modelVersion": "cold start"
}
}
}
2 changes: 1 addition & 1 deletion ufc/scenarios/jit-loading-2/bandit-models-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"banditKey": "second_cold_start_bandit",
"modelName": "falcon",
"updatedAt": "2023-09-13T04:52:06.462Z",
"modelVersion": "NOT cold start",
"modelVersion": "cold start",
"modelData": {
"gamma": 1.0,
"defaultActionScore": 0.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"flag": "cold_start_bandit_flag",
"flag": "second_cold_start_bandit_flag",
"defaultValue": "default",
"subjects": [
{
"subjectKey": "alice",
"subjectKey": "ephraim",
"subjectAttributes": {
"numericAttributes": {},
"categoricalAttributes": {}
Expand All @@ -25,7 +25,7 @@
"categoricalAttributes": {}
}
],
"assignment": {"variation": "cold_start_bandit", "action": "red"}
"assignment": {"variation": "second_cold_start_bandit", "action": "blue"}
},
{
"subjectKey": "bob",
Expand All @@ -50,10 +50,10 @@
"categoricalAttributes": {}
}
],
"assignment": {"variation": "cold_start_bandit", "action": "green"}
"assignment": {"variation": "second_cold_start_bandit", "action": "green"}
},
{
"subjectKey": "charles",
"subjectKey": "fiona",
"subjectAttributes": {
"numericAttributes": {},
"categoricalAttributes": {}
Expand All @@ -75,7 +75,7 @@
"categoricalAttributes": {}
}
],
"assignment": {"variation": "cold_start_bandit", "action": "blue"}
"assignment": {"variation": "second_cold_start_bandit", "action": "red"}
}
]
}

0 comments on commit 663f2dd

Please sign in to comment.