Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/odd-windows-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"eppo_core": minor
"ruby-sdk": minor
---

[ruby] support ruby-4.0
1 change: 1 addition & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- "3.2"
- "3.3"
- "3.4"
- "4.0.0-preview3"

steps:
- uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions eppo_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ pyo3 = { version = "0.23.0", optional = true, default-features = false }
serde-pyobject = { version = "0.6.0", optional = true }

# magnus dependencies
magnus = { version = "0.7.1", default-features = false, optional = true }
serde_magnus = { version = "0.9.0", default-features = false, optional = true }
magnus = { version = "0.8.0", default-features = false, optional = true }
serde_magnus = { version = "0.10.0", default-features = false, optional = true }

# elixir dependencies
rustler = { version = "0.36.1", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions eppo_core/src/eval/eval_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ mod magnus_impl {
use super::{EvaluationDetails, EvaluationResultWithDetails};

impl IntoValue for &EvaluationDetails {
fn into_value_with(self, _handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(self)
fn into_value_with(self, handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(handle, self)
.expect("EvaluationDetails should always be serializable to Ruby")
}
}
Expand Down
8 changes: 4 additions & 4 deletions eppo_core/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ mod magnus_impl {
use super::{AssignmentEvent, BanditEvent};

impl IntoValue for AssignmentEvent {
fn into_value_with(self, _handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(&self)
fn into_value_with(self, handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(handle, &self)
.expect("AssignmentEvent should always be serializable to Ruby")
}
}

impl IntoValue for BanditEvent {
fn into_value_with(self, _handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(&self)
fn into_value_with(self, handle: &magnus::Ruby) -> magnus::Value {
serde_magnus::serialize(handle, &self)
.expect("BanditEvent should always be serializable to Ruby")
}
}
Expand Down
8 changes: 5 additions & 3 deletions eppo_core/src/ufc/assignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ mod magnus_impl {
AssignmentValue::Integer(i) => i.into_value_with(handle),
AssignmentValue::Numeric(n) => n.into_value_with(handle),
AssignmentValue::Boolean(b) => b.into_value_with(handle),
AssignmentValue::Json { raw: _, parsed } => serde_magnus::serialize(&parsed)
.expect("JSON value should always be serializable to Ruby"),
AssignmentValue::Json { raw: _, parsed } => {
serde_magnus::serialize(handle, &parsed)
.expect("JSON value should always be serializable to Ruby")
}
}
}
}
Expand All @@ -392,7 +394,7 @@ mod magnus_impl {
let _ = hash.aset(handle.sym_new("value"), self.value);
let _ = hash.aset(
handle.sym_new("event"),
serde_magnus::serialize::<_, magnus::Value>(&self.event)
serde_magnus::serialize::<_, magnus::Value>(handle, &self.event)
.expect("AssignmentEvent should always be serializable to Ruby"),
);
hash.as_value()
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 12 additions & 14 deletions ruby-sdk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ruby-sdk/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PATH
remote: .
specs:
eppo-server-sdk (3.7.2)
rb_sys (~> 0.9.105)
eppo-server-sdk (3.7.4)
logger (~> 1.6)
rb_sys (~> 0.9.120)

GEM
remote: https://rubygems.org/
Expand All @@ -12,6 +13,7 @@ GEM
json (2.15.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
parallel (1.27.0)
parser (3.3.10.0)
ast (~> 2.4.1)
Expand Down
6 changes: 4 additions & 2 deletions ruby-sdk/eppo-server-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.extensions = ["ext/eppo_client/extconf.rb"]

# 0.9.105 added Ruby 3.4 to the list of supported version
spec.add_dependency "rb_sys", "~> 0.9.105"
# 0.9.120 added Ruby 4.0 to the list of supported version
spec.add_dependency "rb_sys", "~> 0.9.120"

spec.add_dependency "logger", "~> 1.6"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

logger is no longer a built-in gem and needs to be installed separately


# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down
6 changes: 3 additions & 3 deletions ruby-sdk/ext/eppo_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ crate-type = ["cdylib"]
env_logger = { version = "0.11.3", features = ["unstable-kv"] }
eppo_core = { version = "=9.3.0", features = ["magnus", "event_ingestion"] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you want to take the path of releasing a new eppo_core, then you bump this?

Copy link
Copy Markdown
Collaborator Author

@dd-oleksii dd-oleksii Dec 24, 2025

Choose a reason for hiding this comment

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

Yeah, the bumping is automated. Once we merge this PR, the CI will open a pull request with the necessary bumps in eppo_core and ruby sdk (edit: #381)

log = { version = "0.4.21", features = ["kv_serde"] }
magnus = { version = "0.7.1" }
magnus = { version = "0.8.2" }
serde = { version = "1.0.203", features = ["derive"] }
serde_magnus = "0.9.0"
rb-sys = "0.9.105"
serde_magnus = "0.10.0"
rb-sys = "0.9.120"
serde_json = "1.0.128"
tokio = { version = "1.44.1", default-features = false, features = ["time"] }
Loading
Loading