flipper-active_support_cache_store 1.3.6 → 1.4.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f24ef2d4b542a165ec1c70ec7e52c28f7fd666f3a8c5b7c58ddd79d1cbedaad7
|
|
4
|
+
data.tar.gz: d7aa239fa34e287564fadded1ecd86e502f9a2efa6f6e76620838ddfda6f93c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e5c6170f5a3cfc6d2bf352aa68cdb43088a9a18189ce63b196493367e24e029c16c6636bc5c896c01070587762333073f27240411a692c05f16dfc8de894ede9
|
|
7
|
+
data.tar.gz: 0f24fa65c8075ad1f66abc716f0c82490869e91a81dff0840778b7647812e4e7df621784720aff8534734dc0343f39f81df2f055b28d1e081d98070cb0daf969
|
|
@@ -41,6 +41,7 @@ module Flipper
|
|
|
41
41
|
if @write_through
|
|
42
42
|
result = @adapter.enable(feature, gate, thing)
|
|
43
43
|
cache_write feature_cache_key(feature.key), @adapter.get(feature)
|
|
44
|
+
expire_get_all_cache
|
|
44
45
|
result
|
|
45
46
|
else
|
|
46
47
|
super
|
|
@@ -51,6 +52,7 @@ module Flipper
|
|
|
51
52
|
if @write_through
|
|
52
53
|
result = @adapter.disable(feature, gate, thing)
|
|
53
54
|
cache_write feature_cache_key(feature.key), @adapter.get(feature)
|
|
55
|
+
expire_get_all_cache
|
|
54
56
|
result
|
|
55
57
|
else
|
|
56
58
|
super
|
data/lib/flipper/version.rb
CHANGED
|
@@ -61,9 +61,13 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
61
61
|
adapter.features
|
|
62
62
|
expect(cache.read("flipper/v1/features")).not_to be(nil)
|
|
63
63
|
|
|
64
|
+
adapter.get_all
|
|
65
|
+
expect(cache.read("flipper/v1/get_all")).not_to be(nil)
|
|
66
|
+
|
|
64
67
|
# expire cache
|
|
65
68
|
adapter.expire_features_cache
|
|
66
69
|
expect(cache.read("flipper/v1/features")).to be(nil)
|
|
70
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
67
71
|
end
|
|
68
72
|
|
|
69
73
|
it "can expire feature cache" do
|
|
@@ -71,9 +75,13 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
71
75
|
adapter.get(flipper[:stats])
|
|
72
76
|
expect(cache.read("flipper/v1/feature/stats")).not_to be(nil)
|
|
73
77
|
|
|
78
|
+
adapter.get_all
|
|
79
|
+
expect(cache.read("flipper/v1/get_all")).not_to be(nil)
|
|
80
|
+
|
|
74
81
|
# expire cache
|
|
75
82
|
adapter.expire_feature_cache("stats")
|
|
76
83
|
expect(cache.read("flipper/v1/feature/stats")).to be(nil)
|
|
84
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
77
85
|
end
|
|
78
86
|
|
|
79
87
|
it "can generate feature cache key" do
|
|
@@ -88,6 +96,10 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
88
96
|
expect(adapter.features_cache_key).to eq("foo/flipper/v1/features")
|
|
89
97
|
end
|
|
90
98
|
|
|
99
|
+
it "knows get_all_cache_key" do
|
|
100
|
+
expect(adapter.get_all_cache_key).to eq("foo/flipper/v1/get_all")
|
|
101
|
+
end
|
|
102
|
+
|
|
91
103
|
it "can generate feature cache key" do
|
|
92
104
|
expect(adapter.feature_cache_key("stats")).to eq("foo/flipper/v1/feature/stats")
|
|
93
105
|
end
|
|
@@ -109,9 +121,10 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
109
121
|
adapter.get_all
|
|
110
122
|
|
|
111
123
|
# verify cached with prefix
|
|
124
|
+
get_all_cache_value = cache.read("foo/flipper/v1/get_all")
|
|
112
125
|
expect(cache.read("foo/flipper/v1/features")).to eq(Set["stats", "search"])
|
|
113
|
-
expect(
|
|
114
|
-
expect(
|
|
126
|
+
expect(get_all_cache_value["search"][:percentage_of_actors]).to eq("10")
|
|
127
|
+
expect(get_all_cache_value["stats"][:boolean]).to eq("true")
|
|
115
128
|
end
|
|
116
129
|
end
|
|
117
130
|
|
|
@@ -120,11 +133,13 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
120
133
|
|
|
121
134
|
before do
|
|
122
135
|
adapter.get(feature)
|
|
136
|
+
adapter.get_all
|
|
123
137
|
adapter.remove(feature)
|
|
124
138
|
end
|
|
125
139
|
|
|
126
140
|
it 'expires feature and deletes the cache' do
|
|
127
141
|
expect(cache.read("flipper/v1/feature/#{feature.key}")).to be_nil
|
|
142
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
128
143
|
expect(cache.exist?("flipper/v1/feature/#{feature.key}")).to be(false)
|
|
129
144
|
expect(feature).not_to be_enabled
|
|
130
145
|
end
|
|
@@ -144,10 +159,13 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
144
159
|
let(:feature) { flipper[:stats] }
|
|
145
160
|
|
|
146
161
|
before do
|
|
162
|
+
adapter.get(feature)
|
|
163
|
+
adapter.get_all
|
|
147
164
|
adapter.enable(feature, feature.gate(:boolean), Flipper::Types::Boolean.new(true))
|
|
148
165
|
end
|
|
149
166
|
|
|
150
167
|
it 'enables feature and deletes the cache' do
|
|
168
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
151
169
|
expect(cache.read("flipper/v1/feature/#{feature.key}")).to be_nil
|
|
152
170
|
expect(cache.exist?("flipper/v1/feature/#{feature.key}")).to be(false)
|
|
153
171
|
expect(feature).to be_enabled
|
|
@@ -157,6 +175,7 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
157
175
|
let(:write_through) { true }
|
|
158
176
|
|
|
159
177
|
it 'expires feature and writes to the cache' do
|
|
178
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
160
179
|
expect(cache.exist?("flipper/v1/feature/#{feature.key}")).to be(true)
|
|
161
180
|
expect(cache.read("flipper/v1/feature/#{feature.key}")).to include(boolean: 'true')
|
|
162
181
|
expect(feature).to be_enabled
|
|
@@ -168,10 +187,13 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
168
187
|
let(:feature) { flipper[:stats] }
|
|
169
188
|
|
|
170
189
|
before do
|
|
190
|
+
adapter.get(feature)
|
|
191
|
+
adapter.get_all
|
|
171
192
|
adapter.disable(feature, feature.gate(:boolean), Flipper::Types::Boolean.new)
|
|
172
193
|
end
|
|
173
194
|
|
|
174
195
|
it 'disables feature and deletes the cache' do
|
|
196
|
+
expect(cache.read("flipper/v1/get_all")).to be(nil)
|
|
175
197
|
expect(cache.read("flipper/v1/feature/#{feature.key}")).to be_nil
|
|
176
198
|
expect(cache.exist?("flipper/v1/feature/#{feature.key}")).to be(false)
|
|
177
199
|
expect(feature).not_to be_enabled
|
|
@@ -224,8 +246,10 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
224
246
|
|
|
225
247
|
it 'warms all features' do
|
|
226
248
|
adapter.get_all
|
|
227
|
-
|
|
228
|
-
expect(
|
|
249
|
+
get_all_cache_value = cache.read("flipper/v1/get_all")
|
|
250
|
+
expect(get_all_cache_value).not_to be(nil)
|
|
251
|
+
expect(get_all_cache_value["stats"][:boolean]).to eq('true')
|
|
252
|
+
expect(get_all_cache_value["search"][:boolean]).to be(nil)
|
|
229
253
|
expect(cache.read("flipper/v1/features")).to eq(Set["stats", "search"])
|
|
230
254
|
end
|
|
231
255
|
|
|
@@ -236,9 +260,8 @@ RSpec.describe Flipper::Adapters::ActiveSupportCacheStore do
|
|
|
236
260
|
it 'only invokes two calls to wrapped adapter (for features set and gate data for each feature in set)' do
|
|
237
261
|
memory_adapter.reset
|
|
238
262
|
5.times { adapter.get_all }
|
|
239
|
-
expect(memory_adapter.count(:
|
|
240
|
-
expect(memory_adapter.count
|
|
241
|
-
expect(memory_adapter.count).to eq(2)
|
|
263
|
+
expect(memory_adapter.count(:get_all)).to eq(1)
|
|
264
|
+
expect(memory_adapter.count).to eq(1)
|
|
242
265
|
end
|
|
243
266
|
end
|
|
244
267
|
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flipper-active_support_cache_store
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- John Nunemaker
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-02-26 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: flipper
|
|
@@ -15,14 +16,14 @@ dependencies:
|
|
|
15
16
|
requirements:
|
|
16
17
|
- - "~>"
|
|
17
18
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 1.
|
|
19
|
+
version: 1.4.0
|
|
19
20
|
type: :runtime
|
|
20
21
|
prerelease: false
|
|
21
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
23
|
requirements:
|
|
23
24
|
- - "~>"
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 1.
|
|
26
|
+
version: 1.4.0
|
|
26
27
|
- !ruby/object:Gem::Dependency
|
|
27
28
|
name: activesupport
|
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -43,6 +44,7 @@ dependencies:
|
|
|
43
44
|
- - "<"
|
|
44
45
|
- !ruby/object:Gem::Version
|
|
45
46
|
version: '9'
|
|
47
|
+
description:
|
|
46
48
|
email: support@flippercloud.io
|
|
47
49
|
executables: []
|
|
48
50
|
extensions: []
|
|
@@ -61,8 +63,9 @@ metadata:
|
|
|
61
63
|
homepage_uri: https://www.flippercloud.io
|
|
62
64
|
source_code_uri: https://github.com/flippercloud/flipper
|
|
63
65
|
bug_tracker_uri: https://github.com/flippercloud/flipper/issues
|
|
64
|
-
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.
|
|
66
|
+
changelog_uri: https://github.com/flippercloud/flipper/releases/tag/v1.4.0
|
|
65
67
|
funding_uri: https://github.com/sponsors/flippercloud
|
|
68
|
+
post_install_message:
|
|
66
69
|
rdoc_options: []
|
|
67
70
|
require_paths:
|
|
68
71
|
- lib
|
|
@@ -77,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
77
80
|
- !ruby/object:Gem::Version
|
|
78
81
|
version: '0'
|
|
79
82
|
requirements: []
|
|
80
|
-
rubygems_version: 3.
|
|
83
|
+
rubygems_version: 3.5.22
|
|
84
|
+
signing_key:
|
|
81
85
|
specification_version: 4
|
|
82
86
|
summary: ActiveSupport::Cache feature flag cache adapter for Flipper
|
|
83
|
-
test_files:
|
|
84
|
-
- spec/flipper/adapters/active_support_cache_store_spec.rb
|
|
87
|
+
test_files: []
|