Skip to content

[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#633

Open
jaeopt wants to merge 1 commit into
masterfrom
ai/jaeopt/FSSDK-12760-local-datafile
Open

[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#633
jaeopt wants to merge 1 commit into
masterfrom
ai/jaeopt/FSSDK-12760-local-datafile

Conversation

@jaeopt

@jaeopt jaeopt commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the new top-level localHoldouts datafile section so older SDKs (Gen 1/Gen 2) that don't understand local holdouts safely ignore them while Gen 3 SDKs scope holdouts by section membership.

Changes

  • HoldoutConfig — section-aware constructor (globalHoldouts, localHoldouts). Entries in holdouts are global (any includedRules is stripped); entries in localHoldouts must carry includedRules (null/missing → log error + skip; empty list → valid but inert). Legacy single-list constructor preserved as deprecated.
  • DatafileProjectConfig — new 21-arg v4 constructor accepting localHoldouts separately. Legacy 20-arg constructor auto-partitions a mixed list by entity-level includedRules for backward compatibility with existing callers.
  • All 4 parsers (Gson, Jackson, org.json, json-simple) — read the optional top-level localHoldouts array and pass it through alongside holdouts.
  • Holdout — docstring updates clarifying that scope comes from the datafile section, not includedRules.
  • Tests — new section-aware tests in HoldoutConfigTest (8 added, 25 total) plus moved the existing local-holdout entry in holdouts-project-config.json into the new localHoldouts section. All existing parser/DecisionService/UserContext tests continue to pass unchanged.

Jira ticket

FSSDK-12760

Reference PRs

Test plan

  • ./gradlew :core-api:test — all suites pass (HoldoutConfigTest: 25/25; all 4 parser tests pass; DecisionServiceTest and OptimizelyUserContextTest pass)
  • ./gradlew test — all modules pass
  • CI green

@jaeopt

jaeopt commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

I reviewed and it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant