-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add exposure service #75
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new exposure service to track feature flag exposures, deprecating the existing assignment service. The new exposure tracking provides improved functionality including per-flag event tracking and a tracks_exposure option for evaluate_v2.
Key changes:
- Introduced
ExposureService,ExposureFilter,Exposure, andExposureConfigclasses to replace assignment tracking - Added
tracks_exposureparameter toEvaluateOptionsfor controlling exposure tracking behavior - Deprecated assignment-related classes (
AssignmentService,AssignmentFilter,Assignment,AssignmentConfig)
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/experiment/local/exposure/exposure_service.rb | Implements the core exposure tracking service with event generation logic |
| lib/experiment/local/exposure/exposure_filter.rb | Provides deduplication filtering for exposure events using LRU cache |
| lib/experiment/local/exposure/exposure.rb | Defines the Exposure data structure representing user's flag exposures |
| lib/experiment/local/exposure/exposure_config.rb | Configuration class for exposure tracking settings |
| lib/experiment/local/evaluate_options.rb | New options class for evaluate_v2 including tracks_exposure flag |
| lib/experiment/local/config.rb | Updates configuration to support both assignment and exposure configs |
| lib/experiment/local/client.rb | Integrates exposure service into client and updates evaluate_v2 signature |
| lib/experiment/local/assignment/*.rb | Adds deprecation notices to assignment-related classes |
| lib/amplitude-experiment.rb | Adds require statements for new exposure modules |
| spec/experiment/local/exposure/*.rb | Comprehensive test coverage for exposure functionality |
| spec/experiment/local/client_spec.rb | Integration test verifying tracks_exposure behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
📝 Documentation updates detected! New suggestion: Document exposure tracking for Ruby Experiment SDK local evaluation |
|
📝 Documentation updates detected! New suggestion: Document exposure tracking for Ruby Experiment SDK local evaluation |
Summary
Adding exposure service, deprecating assignment service, and adding tracksExposure to evaluate options.
Checklist