eppo-server-sdk 3.3.0-x86_64-linux → 3.4.0-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e93165f3b268c185a4a5af8b0fb87f734ee59ea1bc19ae619004d036f696197
4
- data.tar.gz: 4f31d5c57c4bb7c433900de8c2156853a8015ade970c2c53855562f932c454d2
3
+ metadata.gz: 1cabf31591d8d3ef883ef100bfb27f3a0bb8cd0709bd1df89a1e96494390d6e9
4
+ data.tar.gz: c62fa94ca5fb8f11fbc6346563ca14c0dcbb8ad81d2ce0b88eac6b4ac2e16b04
5
5
  SHA512:
6
- metadata.gz: a999ae1712fdc583ba573ec9a2d807eaf277b83ef6a8fa93de9050319ea789c1aebe59a501788592e5c238d707ef6c28466a0b7284e3578cafb5532bdd35e42a
7
- data.tar.gz: bcb87553ec818cbdf6238e57a933f758d5712110616758a53103bac09d5e65ffebe3e63feeb7ff17b4124cd1c0217273afcb148fe090f6451588a45923bd2199
6
+ metadata.gz: 10bf824ecbd04f507b7d346b20ffe56f2f22464fc73d02bffc7976da992db8b3d22c7030aa2204a01984c0af9e4a9345629f73c9ba9cefe5c1a0d6fbb54f32e9
7
+ data.tar.gz: 77bd9e0deab45cb447a6f3be4f09e1479d12966a34fd7b0bb9ca30490fe63e14e09ee85c0c327c7f8d734eeeddd0d2115d2e30fd7f8376a7ec771ed4f498f652
data/README.md CHANGED
@@ -38,8 +38,40 @@ eppo_core = { path = '../eppo_core' }
38
38
 
39
39
  Make sure you remove the override before updating `Cargo.lock`. Otherwise, the lock file will be missing `eppo_core` checksum and will be unsuitable for release. (CI will warn you if you do this accidentally.)
40
40
 
41
+ ## Build locally
42
+
43
+ Install all dependencies:
44
+ ```sh
45
+ bundle install
46
+ ```
47
+
48
+ Build native extension:
49
+ ```sh
50
+ bundle exec rake build
51
+ ```
52
+
53
+ Run tests:
54
+ ```sh
55
+ bundle exec rspec
56
+ ```
57
+
41
58
  ## Releasing
42
59
 
43
60
  * Bump versions in `ruby-sdk/lib/eppo_client/version.rb` and `ruby-sdk/ext/eppo_client/Cargo.toml`
44
61
  * Run `cargo update --workspace --verbose` to update `Cargo.lock`
45
62
  * Run `bundle` to update `Gemfile.lock`
63
+
64
+
65
+ ## Building Ruby native lib
66
+
67
+ 1. Clone this repository at the desired Ruby SDK tag, eg.: `git clone --depth 1 --branch ruby-sdk@x.y.z https://github.com/Eppo-exp/eppo-multiplatform.git`
68
+ 2. Open `build.sh` and update `rb-sys-dock --platform <platform>` with the desired platform, eg.: `rb-sys-dock --platform x86_64-linux`
69
+ 3. Run `docker build --build-arg WORKDIR=$(pwd) -f Dockerfile.ruby.build -t ruby-sdk-builder .` to build the builder docker image
70
+ 4. Run the following command to build the gem with native lib:
71
+ ```
72
+ mkdir -p rust/cargo/registry && docker run --rm -it \
73
+ -v /var/run/docker.sock:/var/run/docker.sock \
74
+ -v /tmp:/tmp -v \
75
+ $(pwd)/rust:$(pwd)/rust ruby-sdk-builder
76
+ ```
77
+ 5. The gem will be available at `ruby-sdk/pkg/eppo-server-sdk-x.y.z-arch.gem`
Binary file
Binary file
Binary file
Binary file
@@ -22,7 +22,7 @@ module EppoClient
22
22
  def init(config)
23
23
  config.validate
24
24
 
25
- if !@core.nil?
25
+ if @core
26
26
  STDERR.puts "Eppo Warning: multiple initialization of the client"
27
27
  @core.shutdown
28
28
  end
@@ -91,7 +91,10 @@ module EppoClient
91
91
  log_assignment(result[:assignment_event])
92
92
  log_bandit_action(result[:bandit_event])
93
93
 
94
- return {:variation => result[:variation], :action => result[:action]}
94
+ {
95
+ :variation => result[:variation],
96
+ :action => result[:action]
97
+ }
95
98
  end
96
99
 
97
100
  def get_bandit_action_details(flag_key, subject_key, subject_attributes, actions, default_variation)
@@ -102,7 +105,7 @@ module EppoClient
102
105
  log_assignment(result[:assignment_event])
103
106
  log_bandit_action(result[:bandit_event])
104
107
 
105
- return {
108
+ {
106
109
  :variation => result[:variation],
107
110
  :action => result[:action],
108
111
  :evaluationDetails => details
@@ -116,13 +119,11 @@ module EppoClient
116
119
  logger = Logger.new($stdout)
117
120
  begin
118
121
  assignment = @core.get_assignment(flag_key, subject_key, subject_attributes, expected_type)
119
- if not assignment then
120
- return default_value
121
- end
122
+ return default_value unless assignment
122
123
 
123
124
  log_assignment(assignment[:event])
124
125
 
125
- return assignment[:value][:value]
126
+ return assignment[:value]
126
127
  rescue StandardError => error
127
128
  logger.debug("[Eppo SDK] Failed to get assignment: #{error}")
128
129
 
@@ -137,19 +138,16 @@ module EppoClient
137
138
  result, event = @core.get_assignment_details(flag_key, subject_key, subject_attributes, expected_type)
138
139
  log_assignment(event)
139
140
 
140
- if not result[:variation] then
141
+ if !result[:variation]
141
142
  result[:variation] = default_value
142
- else
143
- # unwrap from AssignmentValue to untyped value
144
- result[:variation] = result[:variation][:value]
145
143
  end
146
144
 
147
- return result
145
+ result
148
146
  end
149
147
  # rubocop:enable Metrics/MethodLength
150
148
 
151
149
  def log_assignment(event)
152
- if not event then return end
150
+ return unless event
153
151
 
154
152
  # Because rust's AssignmentEvent has a #[flatten] extra_logging
155
153
  # field, serde_magnus serializes it as a normal HashMap with
@@ -170,7 +168,7 @@ module EppoClient
170
168
  end
171
169
 
172
170
  def log_bandit_action(event)
173
- if not event then return end
171
+ return unless event
174
172
 
175
173
  begin
176
174
  @assignment_logger.log_bandit_action(event)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # TODO: this version and ext/eppo_client/Cargo.toml should be in sync
4
4
  module EppoClient
5
- VERSION = "3.3.0"
5
+ VERSION = "3.4.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eppo-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Eppo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-11-22 00:00:00.000000000 Z
11
+ date: 2025-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: