Skip to content

[FSSDK-12394] chore: local holdout logic behind FeatureGates flag#631

Merged
muzahidul-opti merged 10 commits into
masterfrom
muzahidul/feature-gate-local-holdouts
May 4, 2026
Merged

[FSSDK-12394] chore: local holdout logic behind FeatureGates flag#631
muzahidul-opti merged 10 commits into
masterfrom
muzahidul/feature-gate-local-holdouts

Conversation

@muzahidul-opti
Copy link
Copy Markdown
Contributor

@muzahidul-opti muzahidul-opti commented Apr 30, 2026

Summary

  • Added FeatureGates.localHoldouts static var (default false) to Constants.swift
  • Wrapped both local holdout evaluation blocks in DefaultDecisionService.swift behind if FeatureGates.localHoldouts
  • Created BaseHoldoutTests class that automatically enables the feature gate in setUp/tearDown
  • Updated 6 holdout test classes to inherit from BaseHoldoutTests, removing duplicate gate setup code

Test plan

  • Ran all 6 holdout test suites (53 tests) — 0 failures
  • Verified global holdout tests pass independently (not gated)
  • Verified build succeeds via both swift build and xcodebuild
  • Confirmed base test class properly enables/disables feature gate for all holdout tests

Issues

  • FSSDK-12394 (local holdouts feature gate)

muzahidul-opti and others added 7 commits April 30, 2026 17:35
Default false to suppress local holdout logic until backend is ready.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both experiment rule and delivery rule local holdout checks are now
gated. When false, these blocks are skipped entirely. Global holdout
evaluation in getDecisionForFlag() is unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All holdout test classes set the gate to true in setUp and reset to false
in tearDown. Existing test methods are unchanged — they pass because the
gate enables the local holdout code paths during test execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bility

FeatureGates.swift was not registered in the Xcode project pbxproj file,
causing build failures. Moving into Constants.swift which is already
included in all build targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This test class also uses local holdout data (includedRules), so it
needs the gate enabled during test execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Added super.tearDown() to DecisionServiceTests_Holdouts tearDown
- Removed FeatureGates override from HoldoutConfigTests since it tests
  the data model directly, not the gated decision service path

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 30, 2026

Coverage Status

Coverage is 93.828%muzahidul/feature-gate-local-holdouts into master. No base build found for master.

@muzahidul-opti muzahidul-opti changed the title Gate local holdout logic behind FeatureGates flag [FSSDK-12524] chore: local holdout logic behind FeatureGates flag Apr 30, 2026
@muzahidul-opti muzahidul-opti changed the title [FSSDK-12524] chore: local holdout logic behind FeatureGates flag [FSSDK-12394] chore: local holdout logic behind FeatureGates flag Apr 30, 2026
… override

Created BaseHoldoutTests class that automatically enables the
FeatureGates.localHoldouts flag in setUp() and resets it in tearDown().
Updated all holdout test classes to inherit from this base class,
removing duplicate feature gate setup code from individual test files.

This centralizes feature gate management and ensures all holdout tests
run with the feature enabled consistently.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
raju-opti
raju-opti previously approved these changes May 4, 2026
Copy link
Copy Markdown

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

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

Changes looks good. It would be good to add some tests verifying that feature gating is working properly, i.e holdouts is not evaluated when the flag is off.

Created FeatureGateTests_LocalHoldouts with 5 tests verifying:
- Local holdouts are skipped when FeatureGates.localHoldouts = false
- Local holdouts are evaluated when FeatureGates.localHoldouts = true
- Global holdouts work regardless of flag state

Updated CLAUDE.md with concise guidance on properly linking new test
files to Xcode targets to prevent integration issues.

Addresses PR #631 review feedback from Raju.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@muzahidul-opti
Copy link
Copy Markdown
Contributor Author

Changes looks good. It would be good to add some tests verifying that feature gating is working properly, i.e holdouts is not evaluated when the flag is off.

FeatureGateTests_LocalHoldouts.swift cases added

@muzahidul-opti muzahidul-opti merged commit dea44de into master May 4, 2026
22 of 31 checks passed
@muzahidul-opti muzahidul-opti deleted the muzahidul/feature-gate-local-holdouts branch May 4, 2026 17:05
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