Skip to content

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

Merged
esrakartalOpt merged 2 commits into
masterfrom
ai/jaeopt/FSSDK-12760-local-datafile
Jun 17, 2026
Merged

[AI-FSSDK] [FSSDK-12760] Add localHoldouts datafile section#400
esrakartalOpt merged 2 commits 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

This comment was marked as off-topic.

@esrakartalOpt esrakartalOpt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Reviewed by me, copilot, and claude. There is no issue. Everything looks good.

@esrakartalOpt esrakartalOpt merged commit 83b0a0f into master Jun 17, 2026
10 of 11 checks passed
@esrakartalOpt esrakartalOpt deleted the ai/jaeopt/FSSDK-12760-local-datafile branch June 17, 2026 16:16
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.

3 participants