[FSSDK-11132] make entity validation configurable in bucketer#1071
Merged
[FSSDK-11132] make entity validation configurable in bucketer#1071
Conversation
for cmab, we are using a dummy entityId which is not a real variation id. We need to skip entity validation for cmab experiments.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a configurable flag to skip entity (variation) validation for CMAB experiments.
- Adds an optional
validateEntityparameter toBucketerParams. - Defaults
validateEntitytofalsefor CMAB experiments in the DecisionService. - Updates the bucketer logic to only warn on invalid variation IDs when
validateEntityistrue.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/shared_types.ts | Added validateEntity? to the BucketerParams interface |
| lib/core/decision_service/index.ts | Initialized and set validateEntity based on CMAB flag |
| lib/core/bucketer/index.ts | Guarded invalid-variation checks on validateEntity |
Comments suppressed due to low confidence (3)
lib/shared_types.ts:67
- Consider adding a doc comment explaining the default behavior and purpose of
validateEntityso consumers understand when to enable or disable entity validation.
validateEntity?: boolean;
lib/shared_types.ts:67
- [nitpick] The name
validateEntitycould be clearer if inverted (e.g.,skipEntityValidation) to more directly reflect thatfalseskips validation.
validateEntity?: boolean;
lib/core/bucketer/index.ts:142
- It would be helpful to add a unit test covering the case when
validateEntityisfalseto ensure invalid variation IDs in CMAB experiments do not trigger warnings.
if (bucketerParams.validateEntity && entityId !== null && !bucketerParams.variationIdMap[entityId]) {
junaed-optimizely
approved these changes
Jun 20, 2025
Contributor
junaed-optimizely
left a comment
There was a problem hiding this comment.
LGTM! Just a suggestion and a confusion 😅
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
for cmab, we are using a dummy entityId which is not a real variation id. We need to skip entity validation for cmab experiments.
Test plan
Issues