[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#1157
Open
jaeopt wants to merge 1 commit into
Open
[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#1157jaeopt wants to merge 1 commit into
jaeopt wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for a new top-level
localHoldoutsdatafile section so older SDKversions (Gen 1 / Gen 2) ignore local holdouts safely instead of misapplying
them as global holdouts. Section membership in
holdoutsvslocalHoldoutsisnow the sole signal for holdout scope.
holdoutsare always global;includedRuleson these entries isstripped at parse time so scope is unambiguous.
localHoldoutsare always local (rule-scoped viaincludedRules);entries missing or with empty
includedRulesare invalid, logged at ERROR,and excluded from evaluation (no fallback to global).
localHoldoutssection continue towork unchanged.
Changes
lib/project_config/project_config.tsProjectConfig.localHoldouts: Holdout[]added (defaults to[]).createMutationSafeDatafileCopyshallow-copies entries in both holdoutsections so per-entry mutations (e.g. stripping
includedRules) don't bleedinto the caller's datafile.
parseHoldoutsConfigrewritten to partition by section membership; threadsan optional
LoggerFacadefor invalid-entry diagnostics.createProjectConfigandtryCreatingProjectConfigthread the loggerthrough so parse-time errors are surfaced.
HoldoutConfig,getGlobalHoldouts,getHoldoutsForRuleupdated — section membership is the sole signal.
lib/shared_types.ts— docstrings onHoldout.includedRulesandHoldout.isGlobalupdated to reflect section-driven scope.lib/project_config/project_config.spec.ts— existing FSSDK-12369 testsmigrated to the two-section layout; new FSSDK-12760 suite covers
localHoldoutsparsing, backward compat, strip-and-ignore for global-sectionincludedRules, caller-mutation regression, both-sections partitioning,invalid-entry logging (missing / null / empty), and variation map coverage.
lib/core/decision_service/index.spec.ts—makeLocalHoldoutDatafilehelper updated to emit local holdouts in the
localHoldoutssection.Reference implementations
Jira
FSSDK-12760