feat: add exposure service#75
feat: add exposure service#75zhukaihan merged 8 commits intomainamplitude/experiment-ruby-server:mainfrom add-exposure-serviceamplitude/experiment-ruby-server:add-exposure-serviceCopy head branch name to clipboard
Conversation
There was a problem hiding this comment.
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 |
# [1.9.0](v1.8.0...v1.9.0) (2026-01-07) ### Features * add exposure service ([#75](#75)) ([632a0f4](632a0f4))
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
Adding exposure service, deprecating assignment service, and adding tracksExposure to evaluate options.
Checklist