Skip to content

Conversation

@zhukaihan
Copy link
Collaborator

Summary

Adding exposure service, deprecating assignment service, and adding tracksExposure to evaluate options.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

Copy link

Copilot AI left a 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, and ExposureConfig classes to replace assignment tracking
  • Added tracks_exposure parameter to EvaluateOptions for 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.

@promptless
Copy link

promptless bot commented Nov 13, 2025

📝 Documentation updates detected!

New suggestion: Document exposure tracking for Ruby Experiment SDK local evaluation

@zhukaihan zhukaihan merged commit 632a0f4 into main Dec 15, 2025
5 checks passed
@zhukaihan zhukaihan deleted the add-exposure-service branch December 15, 2025 22:08
@promptless
Copy link

promptless bot commented Dec 15, 2025

📝 Documentation updates detected!

New suggestion: Document exposure tracking for Ruby Experiment SDK local evaluation

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