Skip to content

[FSSDK-11529] Impression event logic adjustment for holdouts #1076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Aug 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6412e89
decision service holdout implementation
junaed-optimizely Jul 24, 2025
3a90a81
[FSSDK-11528] audience condition improvement
junaed-optimizely Jul 25, 2025
f6c4cda
[FSSDK-11528] decision service tests added
junaed-optimizely Jul 25, 2025
9a77240
[FSSDK-11528] decision service tests improvement
junaed-optimizely Jul 25, 2025
b8eac89
[FSSDK-11528] test improvement + decision service logic adjustment
junaed-optimizely Jul 28, 2025
4c88648
[FSSDK-11528] feature toggle readibility improvement
junaed-optimizely Jul 28, 2025
aa3381e
[FSSDK-11528] type def update
junaed-optimizely Jul 28, 2025
0d034b2
[FSSDK-11528] test improvement
junaed-optimizely Jul 28, 2025
78eaa41
[FSSDK-11528] remove only
junaed-optimizely Jul 28, 2025
de3baaa
[FSSDK-11529] condition adjustment
junaed-optimizely Jul 29, 2025
8e33597
Revert "[FSSDK-11529] condition adjustment"
junaed-optimizely Jul 29, 2025
0618802
Reapply "[FSSDK-11529] condition adjustment"
junaed-optimizely Jul 29, 2025
83b7017
[FSSDK-11529] test addition + layer logic adjustment
junaed-optimizely Jul 29, 2025
fc8181f
Merge branch 'master' into junaed/fssdk-11529-update-impression-event
junaed-optimizely Jul 29, 2025
894af95
[FSSDK-11529] test data update
junaed-optimizely Jul 30, 2025
4fc5339
[FSSDK-11529] test name update
junaed-optimizely Jul 30, 2025
eb3df08
[FSSDK-11529] review improvements
junaed-optimizely Jul 31, 2025
504bb8c
[FSSDK-11529] fsc fix
junaed-optimizely Aug 1, 2025
6bf661a
[FSSDK-11529] project config issue fix
junaed-optimizely Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions lib/core/decision_service/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const getHoldoutTestDatafile = () => {
id: 'holdout_running_id',
key: 'holdout_running',
status: 'Running',
includeFlags: [],
excludeFlags: [],
includedFlags: [],
excludedFlags: [],
audienceIds: ['4001'], // age_22 audience
audienceConditions: ['or', '4001'],
variations: [
Expand All @@ -159,8 +159,8 @@ const getHoldoutTestDatafile = () => {
id: "holdout_not_bucketed_id",
key: "holdout_not_bucketed",
status: "Running",
includeFlags: [],
excludeFlags: [],
includedFlags: [],
excludedFlags: [],
audienceIds: ['4002'],
audienceConditions: ['or', '4002'],
variations: [
Expand Down Expand Up @@ -1940,8 +1940,8 @@ describe('DecisionService', () => {
id: 'holdout_included_id',
key: 'holdout_included',
status: 'Running',
includeFlags: ['flag_1'],
excludeFlags: [],
includedFlags: ['1001'],
excludedFlags: [],
audienceIds: ['4002'], // age_40 audience
audienceConditions: ['or', '4002'],
variations: [
Expand Down Expand Up @@ -1989,8 +1989,8 @@ describe('DecisionService', () => {
id: 'holdout_included_specific_id',
key: 'holdout_included_specific',
status: 'Running',
includeFlags: ['flag_1'],
excludeFlags: [],
includedFlags: ['1001'],
excludedFlags: [],
audienceIds: ['4002'], // age_60 audience (age <= 60)
audienceConditions: ['or', '4002'],
variations: [
Expand Down Expand Up @@ -2176,7 +2176,7 @@ describe('DecisionService', () => {
if(holdout.id === 'holdout_running_id') {
return {
...holdout,
excludeFlags: ['flag_1']
excludedFlags: ['1001']
}
}
return holdout;
Expand Down Expand Up @@ -2212,8 +2212,8 @@ describe('DecisionService', () => {
id: 'holdout_second_id',
key: 'holdout_second',
status: 'Running',
includeFlags: [],
excludeFlags: [],
includedFlags: [],
excludedFlags: [],
audienceIds: [], // no audience requirements
audienceConditions: [],
variations: [
Expand Down
5 changes: 3 additions & 2 deletions lib/event_processor/event_builder/user_event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {

import { EventTags, UserAttributes } from '../../shared_types';
import { LoggerFacade } from '../../logging/logger';
import { DECISION_SOURCES } from '../../common_exports';

export type VisitorAttribute = {
entityId: string
Expand Down Expand Up @@ -184,8 +185,8 @@ export const buildImpressionEvent = function({
const variationKey = decision.getVariationKey(decisionObj);
const variationId = decision.getVariationId(decisionObj);
const cmabUuid = decisionObj.cmabUuid;

const layerId = experimentId !== null ? getLayerId(configObj, experimentId) : null;
const layerId =
experimentId !== null ? (ruleType === DECISION_SOURCES.HOLDOUT ? '' : getLayerId(configObj, experimentId)) : null;

return {
...buildBaseEvent({
Expand Down
2 changes: 1 addition & 1 deletion lib/feature_toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
* flag and all associated checks can be removed from the codebase.
*/

export const holdout = () => false;
export const holdout = () => true;
Loading
Loading