Skip to content

Commit 769cd4a

Browse files
committed
fix pr comment
1 parent f7a9316 commit 769cd4a

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

pkg/cmab/client.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import (
3131
)
3232

3333
// CMABPredictionEndpoint is the endpoint for CMAB predictions
34-
var CMABPredictionEndpoint = "https://prediction.cmab.optimizely.com/predict/%s"
34+
// TEMPORARY: Using integration endpoint for testing
35+
var CMABPredictionEndpoint = "https://inte.prediction.cmab.optimizely.com/predict/%s"
3536

3637
const (
3738
// DefaultMaxRetries is the default number of retries for CMAB requests
@@ -134,7 +135,9 @@ func (c *DefaultCmabClient) FetchDecision(
134135
) (string, error) {
135136

136137
// Create the URL
137-
url := fmt.Sprintf(CMABPredictionEndpoint, ruleID)
138+
// TEMPORARY: Override with test ruleID
139+
testRuleID := "1304618"
140+
url := fmt.Sprintf(CMABPredictionEndpoint, testRuleID)
138141

139142
// Log the URL being called
140143
c.logger.Debug(fmt.Sprintf("CMAB Prediction URL: %s", url))
@@ -154,7 +157,7 @@ func (c *DefaultCmabClient) FetchDecision(
154157
Instances: []Instance{
155158
{
156159
VisitorID: userID,
157-
ExperimentID: ruleID,
160+
ExperimentID: testRuleID, // TEMPORARY: Use test ruleID
158161
Attributes: cmabAttributes,
159162
CmabUUID: cmabUUID,
160163
},

pkg/config/datafileprojectconfig/entities/entities.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ type FeatureFlag struct {
6969
Key string `json:"key"`
7070
ExperimentIDs []string `json:"experimentIds"`
7171
Variables []Variable `json:"variables"`
72-
HoldoutIDs []string `json:"holdoutIds"`
7372
}
7473

7574
// Variable represents a Variable object from the Optimizely datafile

pkg/config/datafileprojectconfig/mappers/feature.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func MapFeatures(featureFlags []datafileEntities.FeatureFlag, rolloutMap map[str
6262
feature.ExperimentIDs = featureFlag.ExperimentIDs
6363
feature.FeatureExperiments = featureExperiments
6464
feature.VariableMap = variableMap
65-
feature.HoldoutIDs = featureFlag.HoldoutIDs
65+
// HoldoutIDs will be populated later when holdouts are processed from the datafile
6666
featureMap[featureFlag.Key] = feature
6767
}
6868
return featureMap

pkg/config/datafileprojectconfig/mappers/feature_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ func TestMapFeaturesWithHoldoutIds(t *testing.T) {
8585
"key": "test_feature_22222",
8686
"rolloutId": "42222",
8787
"experimentIds": ["32222"],
88-
"variables": [{"defaultValue":"test","id":"2","key":"var","type":"string"}],
89-
"holdoutIds": ["holdout_1", "holdout_2"]
88+
"variables": [{"defaultValue":"test","id":"2","key":"var","type":"string"}]
9089
}`
9190

9291
var rawFeatureFlag datafileEntities.FeatureFlag
@@ -104,11 +103,12 @@ func TestMapFeaturesWithHoldoutIds(t *testing.T) {
104103
}
105104
featureMap := MapFeatures(rawFeatureFlags, rolloutMap, experimentMap)
106105

107-
// Verify that holdoutIds are properly mapped
106+
// Verify that the feature is created properly
107+
// HoldoutIDs will be populated later when holdouts are processed from the datafile
108108
feature := featureMap["test_feature_22222"]
109-
expectedHoldoutIds := []string{"holdout_1", "holdout_2"}
110109

111-
assert.Equal(t, expectedHoldoutIds, feature.HoldoutIDs)
110+
// For now, HoldoutIDs should be nil/empty since they're not in the datafile directly
111+
assert.Nil(t, feature.HoldoutIDs)
112112
assert.Equal(t, "22222", feature.ID)
113113
assert.Equal(t, "test_feature_22222", feature.Key)
114114
}

0 commit comments

Comments
 (0)