Skip to content

Commit bc5fb95

Browse files
Mat001claude
andauthored
[FSSDK-12877] Upgrade go-sdk to v2.5.0 and update ProjectConfig test mock (#464)
go-sdk v2.5.0 (local holdouts) replaced the ProjectConfig interface method GetHoldoutsForFlag with GetGlobalHoldouts and GetHoldoutsForRule. Update TestProjectConfig to implement the new methods so the mock keeps satisfying config.ProjectConfig; without this the build fails to compile. Verified: go build ./..., unit tests, and the full acceptance suite (89 passed against real Optimizely projects, incl. holdout tests). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent fddece3 commit bc5fb95

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/golang-jwt/jwt/v4 v4.5.2
1616
github.com/google/uuid v1.3.1
1717
github.com/lestrrat-go/jwx/v2 v2.0.21
18-
github.com/optimizely/go-sdk/v2 v2.4.0
18+
github.com/optimizely/go-sdk/v2 v2.5.0
1919
github.com/orcaman/concurrent-map v1.0.0
2020
github.com/prometheus/client_golang v1.18.0
2121
github.com/rakyll/statik v0.1.7

‎go.sum‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y
246246
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
247247
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
248248
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
249-
github.com/optimizely/go-sdk/v2 v2.4.0 h1:EE9FOr1bAT3lKSUOEI3Ywqi/01yVrw+RJY+bI0VMgBs=
250-
github.com/optimizely/go-sdk/v2 v2.4.0/go.mod h1:MusRCFsU7+XzJCoCTgheLoENJSf1iiFYm4KbJqz6BYA=
249+
github.com/optimizely/go-sdk/v2 v2.5.0 h1:M3U6J4Mq3y6GBNKrFAAq6JFtF6o5rPaE2azNx48gYd0=
250+
github.com/optimizely/go-sdk/v2 v2.5.0/go.mod h1:MusRCFsU7+XzJCoCTgheLoENJSf1iiFYm4KbJqz6BYA=
251251
github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY=
252252
github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
253253
github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=

‎pkg/optimizely/optimizelytest/config.go‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,17 @@ func (c *TestProjectConfig) GetHoldoutList() []entities.Holdout {
528528
return []entities.Holdout{}
529529
}
530530

531-
// GetHoldoutsForFlag returns all holdouts applicable to the given feature flag.
532-
// In production, this would return a filtered list based on the flag's includedFlags/excludedFlags.
531+
// GetGlobalHoldouts returns all global holdouts (those with IncludedRules == nil),
532+
// evaluated at flag level before any per-rule evaluation.
533533
// For this test mock, we return an empty list since no tests currently require holdout logic.
534-
func (c *TestProjectConfig) GetHoldoutsForFlag(featureKey string) []entities.Holdout {
534+
func (c *TestProjectConfig) GetGlobalHoldouts() []entities.Holdout {
535+
return []entities.Holdout{}
536+
}
537+
538+
// GetHoldoutsForRule returns all local holdouts targeting the given rule ID,
539+
// evaluated per-rule after forced decisions and before audience/traffic checks.
540+
// For this test mock, we return an empty list since no tests currently require holdout logic.
541+
func (c *TestProjectConfig) GetHoldoutsForRule(ruleID string) []entities.Holdout {
535542
return []entities.Holdout{}
536543
}
537544

0 commit comments

Comments
 (0)