Skip to content

Conversation

@zhukaihan
Copy link
Collaborator

Summary

Adds tracking options for assignment and exposure events for fetch calls.

Checklist

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

@promptless
Copy link

promptless bot commented Oct 28, 2025

📝 Documentation updates detected!

New suggestion: Document FetchOptions for Ruby Experiment SDK
Updated existing suggestions:

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 support for fetch options to control tracking behavior in the Amplitude Experiment SDK. The changes allow clients to specify whether to track assignment and exposure events via HTTP headers when fetching variants.

  • Introduces FetchOptions class with tracks_assignment and tracks_exposure properties
  • Updates client methods (fetch_v2, fetch_async_v2) to accept optional FetchOptions parameter
  • Adds logic to set tracking headers based on fetch options

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
lib/experiment/remote/fetch_options.rb New class to encapsulate tracking options for fetch requests
lib/experiment/remote/client.rb Updates fetch methods to accept and process fetch options, sets HTTP headers based on options
lib/amplitude-experiment.rb Adds require statement for the new FetchOptions class
spec/experiment/remote/client_spec.rb Adds test coverage for fetch options behavior and fixes async test synchronization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kyeh-amp
Copy link
Collaborator

LGTM just address the copilot nit. The timeouts are fine to me as long as they pass.

@zhukaihan zhukaihan requested a review from tyiuhc December 9, 2025 01:14
@zhukaihan zhukaihan merged commit 6b6bb2c into main Dec 15, 2025
5 checks passed
@zhukaihan zhukaihan deleted the add-assignment-exposure-options branch December 15, 2025 21:08
github-actions bot pushed a commit that referenced this pull request Dec 15, 2025
# [1.8.0](v1.7.1...v1.8.0) (2025-12-15)

### Features

* add assignment and exposure events tracking options ([#73](#73)) ([6b6bb2c](6b6bb2c))
@github-actions
Copy link

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants