Skip to content

Commit 3e890c8

Browse files
add dynamic config pulse (#249)
Co-authored-by: kenny-statsig <[email protected]>
1 parent d857be1 commit 3e890c8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

client_initialize_response.go

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type ConfigInitializeResponse struct {
4646
ExplicitParameters *[]string `json:"explicit_parameters,omitempty"`
4747
GroupName string `json:"group_name,omitempty"`
4848
IDType string `json:"id_type,omitempty"`
49+
RulePassed bool `json:"passed"`
4950
}
5051

5152
type LayerInitializeResponse struct {
@@ -123,6 +124,7 @@ func getClientInitializeResponse(
123124
Group: evalRes.RuleID,
124125
IsDeviceBased: strings.EqualFold(spec.IDType, "stableid"),
125126
IDType: spec.IDType,
127+
RulePassed: evalRes.Value,
126128
}
127129
if evalRes.GroupName != "" {
128130
result.GroupName = evalRes.GroupName

logger.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,9 @@ func (l *logger) getConfigExposureWithEvaluationDetails(
192192
context *evalContext,
193193
) *ExposureEvent {
194194
metadata := map[string]string{
195-
"config": configName,
196-
"ruleID": res.RuleID,
195+
"config": configName,
196+
"ruleID": res.RuleID,
197+
"rulePassed": strconv.FormatBool(res.Value),
197198
}
198199
if context != nil && context.IsManualExposure {
199200
metadata["isManualExposure"] = "true"

logger_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ func TestLog(t *testing.T) {
8585
}
8686

8787
configExposureEvent := ExposureEvent{EventName: ConfigExposureEventName, User: privateUser, Metadata: map[string]string{
88-
"config": "test_config",
89-
"ruleID": "rule_id_config",
88+
"config": "test_config",
89+
"ruleID": "rule_id_config",
90+
"rulePassed": "false",
9091
}, SecondaryExposures: exposures, Time: evt3.Time}
9192

9293
if !reflect.DeepEqual(evt3, configExposureEvent) {

0 commit comments

Comments
 (0)