Skip to content

[AI-FSSDK] [FSSDK-12760] Add localHoldouts datafile section#400

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

[AI-FSSDK] [FSSDK-12760] Add localHoldouts datafile section#400
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 a new top-level localHoldouts section to the datafile and updates DatafileProjectConfig to treat section membership as the sole signal for holdout scope. Entries in holdouts are global; entries in localHoldouts are rule-scoped via includedRules.

Changes

  • lib/optimizely/config/datafile_project_config.rb
    • Parse new top-level localHoldouts array; expose local_holdouts attribute.
    • All entries in holdouts are treated as global; any includedRules field on those entries is stripped at parse time so it cannot narrow scope.
    • Local holdouts without a non-empty includedRules array are logged at ERROR and excluded from evaluation (no fallback to global).
    • Build variation maps from both global and local holdouts.
    • Updated holdout_global? docstring to reflect section-based scoping.
  • lib/optimizely/helpers/constants.rb
    • Added localHoldouts to the datafile JSON schema (mirrors holdouts shape).
  • spec/spec_params.rb
    • Moved local-holdout fixtures (holdout_local_1, holdout_local_2) into the new top-level localHoldouts section. Removed the invalid empty-includedRules fixture (now logged + skipped per spec).
  • spec/config/datafile_project_config_spec.rb
    • Updated existing tests to use local_holdouts in tandem with holdouts for counts.
    • Added tests: section-based parsing, ignored includedRules on global entries, invalid local holdouts (missing/empty includedRules), backward compatibility with datafiles that have no localHoldouts section.

Backward Compatibility

Older SDKs ignore the unknown localHoldouts key entirely; only the global holdouts section is parsed. Gen 3 SDKs now read both sections with a hard partition. No deserializer risk, no schema enum changes, no log spam.

Jira Ticket

FSSDK-12760

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