Skip to content

Commit 3dcc292

Browse files
authored
Merge pull request #12 from IBM/saikumar1607-202507171948
experimentation
2 parents 187186a + bb94f61 commit 3dcc292

File tree

5 files changed

+22
-27
lines changed

5 files changed

+22
-27
lines changed

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-04-29T10:55:37Z",
6+
"generated_at": "2025-07-17T19:49:02Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

package-lock.json

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ibm-appconfiguration-js-client-sdk",
3-
"version": "0.2.0-beta.2",
3+
"version": "0.2.0-beta.3",
44
"description": "IBM Cloud App Configuration JavaScript Client SDK",
55
"keywords": [
66
"client-sdk",

src/models/Experiment.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
export interface IExperiment {
1818
experiment_id: string;
19-
experiment_name?: string;
20-
hypothesis?: string;
2119
experiment_status?: string;
22-
traffic_distribution_json: TrafficDistribution;
20+
traffic_distribution: TrafficDistribution;
2321
iteration: Iteration;
2422
variations: Variation[];
2523
metrics: Metric[];
@@ -40,22 +38,17 @@ export interface Group {
4038

4139
export interface Iteration {
4240
iteration_id: string;
43-
iteration_name?: string;
4441
iteration_key: string;
45-
start_time?: Date;
4642
}
4743

4844
export interface Variation {
49-
description?: string;
5045
variation_id: string;
51-
variation_name?: string;
5246
variation_value: string;
5347
}
5448

5549
export interface Metric {
5650
metric_id: string;
5751
primary: boolean;
58-
metric_name?: string;
5952
metric_type: string;
6053
event_type: string;
6154
event_key: string;

src/models/Feature.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default class Feature {
192192
if (this.enabled) {
193193
if (this.experiment && this.experiment.experiment_status === 'RUNNING') {
194194
// experiment is running
195-
const trafficDistribution = this.experiment.traffic_distribution_json;
195+
const trafficDistribution = this.experiment.traffic_distribution;
196196
const { iteration } = this.experiment;
197197
const { variations } = this.experiment;
198198
if (trafficDistribution.type === 'ALL') {
@@ -223,7 +223,7 @@ export default class Feature {
223223
logger.error('no variation was found to serve');
224224
return { current_value: evaluationResult.value }
225225
}
226-
if (trafficDistribution.type === 'DEFAULT_RULE') {
226+
if (trafficDistribution.type === 'NO_RULE') {
227227
evaluationResult.evaluated_segment_id = Constants.DEFAULT_SEGMENT_ID;
228228
if (this.segment_rules.length > 0 && Object.keys(entityAttributes).length > 0) {
229229
const rulesMap = this.parseRules(this.segment_rules);
@@ -309,7 +309,7 @@ export default class Feature {
309309
// check whether the entityAttributes satifies all the rules of that segment
310310
if (this.evaluateSegment(segmentId, entityAttributes)) {
311311
evaluationResult.evaluated_segment_id = segmentId;
312-
const expRuleId = parseInt(trafficDistribution.rule_id.split('-')[1])
312+
const expRuleId = parseInt(trafficDistribution.rule_id)
313313
if (expRuleId === segmentRule.order) {
314314
const allVariations: VariationWithAudience[] = [];
315315
for (const expV of trafficDistribution.experimental_group) {

0 commit comments

Comments
 (0)