sdk-reforge 1.9.1 → 1.9.2
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/VERSION +1 -1
- data/lib/reforge/criteria_evaluator.rb +13 -1
- data/sdk-reforge.gemspec +3 -3
- data/test/support/common_helpers.rb +15 -1
- data/test/test_client.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46d6f6afa160400b4319eb454fd5271462d1dc8264570c549327652a4debb1c3
|
4
|
+
data.tar.gz: 4a88ea9de1cdfef5dc0e8eff6f8d7b210808ffed6236efb8ec150d138d6923cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 569a9c836b3c0d85f06387235f3909343233ee2d5c8ab9c5d888d5f7780a16cac6c70b78fafa89e9cf3653890c16c1eb86a5461afedce5d96edcf904c1d8a42a
|
7
|
+
data.tar.gz: 1dd174148278acbc0625ee85081c39ca3d975d710ee837813c4ab3587f117796a341c27d63fd548e16a423d040421efb9096e62809d9922818d9a5ed6de508b2
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.2
|
@@ -227,11 +227,23 @@ module Reforge
|
|
227
227
|
row.values.each_with_index do |conditional_value, value_index|
|
228
228
|
next unless all_criteria_match?(conditional_value, properties)
|
229
229
|
|
230
|
+
# we compute the row index here as if the @config.rows were sorted with the default environment (id=0) last. the client would only ever see one or two rows
|
231
|
+
# 2 rows if there's a default env rule and a targed env rule
|
232
|
+
# 1 row if there's only a default env rule or only a target env rule
|
233
|
+
config_row_index = if @config.rows.length == 1
|
234
|
+
0
|
235
|
+
elsif row.project_env_id != 0
|
236
|
+
0
|
237
|
+
else
|
238
|
+
1
|
239
|
+
end
|
240
|
+
|
241
|
+
|
230
242
|
return Reforge::Evaluation.new(
|
231
243
|
config: @config,
|
232
244
|
value: conditional_value.value,
|
233
245
|
value_index: value_index,
|
234
|
-
config_row_index:
|
246
|
+
config_row_index: config_row_index,
|
235
247
|
context: properties,
|
236
248
|
resolver: @resolver
|
237
249
|
)
|
data/sdk-reforge.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sdk-reforge 1.9.
|
5
|
+
# stub: sdk-reforge 1.9.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "sdk-reforge".freeze
|
9
|
-
s.version = "1.9.
|
9
|
+
s.version = "1.9.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Jeff Dwyer".freeze]
|
14
|
-
s.date = "2025-10-
|
14
|
+
s.date = "2025-10-02"
|
15
15
|
s.description = "Feature Flags, Live Config as a service".freeze
|
16
16
|
s.email = "jeff.dwyer@reforge.com.cloud".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -137,7 +137,21 @@ module CommonHelpers
|
|
137
137
|
def assert_summary(client, data)
|
138
138
|
raise 'Evaluation summary aggregator not enabled' unless client.evaluation_summary_aggregator
|
139
139
|
|
140
|
-
|
140
|
+
actual = client.evaluation_summary_aggregator.data
|
141
|
+
|
142
|
+
# Compare keys first (order independent)
|
143
|
+
assert_equal data.keys.sort_by(&:to_s), actual.keys.sort_by(&:to_s), "Summary keys mismatch"
|
144
|
+
|
145
|
+
# Then compare each nested hash (order independent)
|
146
|
+
data.each do |key, expected_counters|
|
147
|
+
actual_counters = actual[key]
|
148
|
+
|
149
|
+
# Convert to sets for order-independent comparison
|
150
|
+
expected_set = expected_counters.to_a.to_set
|
151
|
+
actual_set = actual_counters.to_a.to_set
|
152
|
+
|
153
|
+
assert_equal expected_set, actual_set, "Counter mismatch for #{key}"
|
154
|
+
end
|
141
155
|
end
|
142
156
|
|
143
157
|
def assert_example_contexts(client, data)
|
data/test/test_client.rb
CHANGED
@@ -106,7 +106,7 @@ class TestClient < Minitest::Test
|
|
106
106
|
[KEY, :CONFIG] => {
|
107
107
|
{
|
108
108
|
config_id: config.id,
|
109
|
-
config_row_index:
|
109
|
+
config_row_index: 0,
|
110
110
|
selected_value: DESIRED_VALUE_CONFIG,
|
111
111
|
conditional_value_index: 0,
|
112
112
|
weighted_value_index: nil,
|
@@ -131,7 +131,7 @@ class TestClient < Minitest::Test
|
|
131
131
|
[KEY, :CONFIG] => {
|
132
132
|
{
|
133
133
|
config_id: config.id,
|
134
|
-
config_row_index:
|
134
|
+
config_row_index: 0,
|
135
135
|
selected_value: DESIRED_VALUE_CONFIG,
|
136
136
|
conditional_value_index: 0,
|
137
137
|
weighted_value_index: nil,
|
@@ -181,7 +181,7 @@ class TestClient < Minitest::Test
|
|
181
181
|
[KEY, :CONFIG] => {
|
182
182
|
{
|
183
183
|
config_id: config.id,
|
184
|
-
config_row_index:
|
184
|
+
config_row_index: 0,
|
185
185
|
selected_value: PrefabProto::ConfigValue.new(string: 'abc'),
|
186
186
|
conditional_value_index: 0,
|
187
187
|
weighted_value_index: 0,
|
@@ -190,7 +190,7 @@ class TestClient < Minitest::Test
|
|
190
190
|
|
191
191
|
{
|
192
192
|
config_id: config.id,
|
193
|
-
config_row_index:
|
193
|
+
config_row_index: 0,
|
194
194
|
selected_value: PrefabProto::ConfigValue.new(string: 'def'),
|
195
195
|
conditional_value_index: 0,
|
196
196
|
weighted_value_index: 1,
|
@@ -199,7 +199,7 @@ class TestClient < Minitest::Test
|
|
199
199
|
|
200
200
|
{
|
201
201
|
config_id: config.id,
|
202
|
-
config_row_index:
|
202
|
+
config_row_index: 0,
|
203
203
|
selected_value: PrefabProto::ConfigValue.new(string: 'ghi'),
|
204
204
|
conditional_value_index: 0,
|
205
205
|
weighted_value_index: 2,
|
@@ -278,9 +278,9 @@ class TestClient < Minitest::Test
|
|
278
278
|
weighted_value_index: nil, selected_index: nil } => 1
|
279
279
|
},
|
280
280
|
[KEY, :NOT_SET_CONFIG_TYPE] => {
|
281
|
-
{ config_id: 0, config_row_index:
|
281
|
+
{ config_id: 0, config_row_index: 1, conditional_value_index: 0, selected_value: DEFAULT_VALUE_CONFIG,
|
282
282
|
weighted_value_index: nil, selected_index: nil } => 2,
|
283
|
-
{ config_id: 0, config_row_index:
|
283
|
+
{ config_id: 0, config_row_index: 0, conditional_value_index: 0, selected_value: DESIRED_VALUE_CONFIG,
|
284
284
|
weighted_value_index: nil, selected_index: nil } => 1
|
285
285
|
}
|
286
286
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdk-reforge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-10-
|
10
|
+
date: 2025-10-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: concurrent-ruby
|