flipper 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +295 -283
- data/lib/flipper/engine.rb +1 -2
- data/lib/flipper/model/active_record.rb +23 -0
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/model/active_record_spec.rb +61 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a399f5f1ee9a91cdc05d7d47ac2b5a337e1f27ed076dbd39ff7ce952f445d80c
|
4
|
+
data.tar.gz: 129babef74f77cae24886e92078af369ee31652a3b41e14b5921d55a236e41ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c5d6b3f364e5f50ff7e7df4642c3a31659be1f56bcb5a313b976fcfc677271536202454c890ef9e6b17be69cdaf750eeb73e02217122b986f23fb77694d4229
|
7
|
+
data.tar.gz: 0bce7c2195a3759034d3b46666bef74c3c808835a0dc27f8d8ab6cc2f99182f0a2751a9c0dd6d6c0522bd8f40754bfe2f36a001989311d9b62341c8dafcad4ff
|
data/Changelog.md
CHANGED
@@ -2,19 +2,25 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
##
|
5
|
+
## v1.1.1
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
- Whoops! Anyone not using flipper-active_record would hit a missing require because of our fancy gemspecs (https://github.com/flippercloud/flipper/pull/785).
|
10
|
+
|
11
|
+
## v1.1.0
|
6
12
|
|
7
13
|
### Additions/Changes
|
8
14
|
|
9
|
-
|
10
|
-
|
15
|
+
- Better read-only mode for UI (https://github.com/flippercloud/flipper/pull/772).
|
16
|
+
- Allow configuring preload via a block similar to memoize (https://github.com/flippercloud/flipper/pull/771).
|
11
17
|
```ruby
|
12
18
|
Rails.application.configure do
|
13
19
|
# don't preload features for /assets/* but do for everything else
|
14
20
|
config.flipper.preload = ->(request) { !request.path.start_with?('/assets') }
|
15
21
|
end
|
16
22
|
```
|
17
|
-
|
23
|
+
- Added `strict` configuration to warn when accessing a feature that doesn't exist (https://github.com/flippercloud/flipper/pull/760, https://github.com/flippercloud/flipper/pull/763)
|
18
24
|
```ruby
|
19
25
|
Rails.application.configure do
|
20
26
|
# Setting to `true` or `:raise` will raise error when a feature doesn't exist.
|
@@ -22,19 +28,25 @@ All notable changes to this project will be documented in this file.
|
|
22
28
|
config.flipper.strict = !Rails.env.production?
|
23
29
|
end
|
24
30
|
```
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
- Handle deprecation of Rack::File in Rack 3.1 (https://github.com/flippercloud/flipper/pull/773).
|
32
|
+
- Human readable actor names in flipper-ui (https://github.com/flippercloud/flipper/pull/737).
|
33
|
+
- Expressions are now available and considered "alpha". They are not yet documented, but you can see examples in [examples/expressions.rb](examples/expressions.rb). Those using the `flipper-active_record` adapter will want to migrate the database so it can store JSON expressions (https://github.com/flippercloud/flipper/pull/692)
|
34
|
+
```
|
35
|
+
$ rails generate migration change_flipper_gates_value_to_text
|
36
|
+
```
|
37
|
+
```ruby
|
38
|
+
change_column :flipper_gates, :value, :text
|
39
|
+
```
|
40
|
+
- Allow head requests to api (https://github.com/flippercloud/flipper/pull/759)
|
41
|
+
- Cloud Telemetry alpha (https://github.com/flippercloud/flipper/pull/775).
|
42
|
+
- Easier statsd setup (https://github.com/flippercloud/flipper/pull/779).
|
31
43
|
```ruby
|
32
44
|
# You can now just do this in your configure block and it'll require the files and configure the client.
|
33
45
|
Flipper.configure do |conf|
|
34
46
|
conf.statsd = my_client
|
35
47
|
end
|
36
48
|
```
|
37
|
-
|
49
|
+
- Load cloud secrets from Rails credentials (https://github.com/flippercloud/flipper/pull/782)
|
38
50
|
```bash
|
39
51
|
$ rails credentials:edit -e development
|
40
52
|
```
|
@@ -48,52 +60,52 @@ All notable changes to this project will be documented in this file.
|
|
48
60
|
|
49
61
|
### Additions/Changes
|
50
62
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
63
|
+
- ui, api: Allow Rack 3 (https://github.com/flippercloud/flipper/pull/670)
|
64
|
+
- cloud: The `flipper-cloud` gem has been merged into the `flipper` and no longer needs to be added separately. Configure cloud by setting the `FLIPPER_CLOUD_TOKEN` environment variable. (https://github.com/flippercloud/flipper/pull/743)
|
65
|
+
```diff
|
66
|
+
# Gemfile
|
67
|
+
gem 'flipper'
|
68
|
+
- gem 'flipper-cloud'
|
69
|
+
```
|
58
70
|
|
59
71
|
### Breaking Changes
|
60
72
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
73
|
+
- Removed `bool`, `actors`, `time`, `actor`, `percentage_of_actors`, and `percentage_of_time` methods on `Flipper` and `Flipper::DSL`. They are rarely if ever used and conflict with some upcoming features. If you are using them, you can migrate via a search and replace like so:
|
74
|
+
- Change `Flipper.bool` => `Flipper::Types::Boolean.new`
|
75
|
+
- Change `Flipper.boolean` => `Flipper::Types::Boolean.new`
|
76
|
+
- Change `Flipper.actor` => `Flipper::Types::Actor.new`
|
77
|
+
- Change `Flipper.percentage_of_actors` => `Flipper::Types::PercentageOfActors.new`
|
78
|
+
- Change `Flipper.actors` => `Flipper::Types::PercentageOfActors.new`
|
79
|
+
- Change `Flipper.percentage_of_time` => `Flipper::Types::PercentageOfTime.new`
|
80
|
+
- Change `Flipper.time` => `Flipper::Types::PercentageOfTime.new`
|
69
81
|
|
70
82
|
## 0.28.3
|
71
83
|
|
72
|
-
|
84
|
+
- Updated cloud config to ensure that poll adapter ONLY syncs from cloud to local adapter (and never back to cloud). Shouldn't affect anyone other than making things more safe if an incorrect response is received from the cloud poll endpoint. (https://github.com/flippercloud/flipper/pull/740)
|
73
85
|
|
74
86
|
## 0.28.2
|
75
87
|
|
76
88
|
### Additions/Changes
|
77
89
|
|
78
|
-
|
90
|
+
- UI: fix path to bundled assets when mounted in another Rack app (https://github.com/flippercloud/flipper/pull/742)
|
79
91
|
|
80
92
|
## 0.28.1
|
81
93
|
|
82
94
|
### Additions/Changes
|
83
95
|
|
84
|
-
|
85
|
-
|
96
|
+
- Use new method of making logs bold for rails (https://github.com/flippercloud/flipper/pull/726)
|
97
|
+
- Bundle bootstrap, jquery and poppler with the library. (https://github.com/flippercloud/flipper/pull/731)
|
86
98
|
|
87
99
|
## 0.28.0
|
88
100
|
|
89
101
|
### Additions/Changes
|
90
102
|
|
91
|
-
|
103
|
+
- Allow multiple actors for Flipper.enabled?. Improves performance of feature flags for multiple actors and simplifies code for users of flipper. This likely breaks things for anyone using Flipper internal classes related to actors, but that isn't likely you so you should be fine.
|
92
104
|
```diff
|
93
105
|
- [user, user.team, user.org].any? { |actor| Flipper.enabled?(:my_feature, actor) }
|
94
106
|
+ Flipper.enabled?(:my_feature, user, user.team, user.org)
|
95
107
|
```
|
96
|
-
|
108
|
+
- If you currently use `actor.thing` in a group, you'll need to change it to `actor.actor`.
|
97
109
|
```diff
|
98
110
|
- Flipper.register(:our_group) do |actor|
|
99
111
|
- actor.thing.is_a?(OurClassName)
|
@@ -102,7 +114,7 @@ All notable changes to this project will be documented in this file.
|
|
102
114
|
+ actor.actor.is_a?(OurClassName)
|
103
115
|
+ end
|
104
116
|
```
|
105
|
-
|
117
|
+
- If you currently use `context.thing` in a group or elsewhere, you'll need to change it to `context.actors`.
|
106
118
|
```diff
|
107
119
|
- Flipper.register(:our_group) do |actor, context|
|
108
120
|
- context.thing.is_a?(OurClassName)
|
@@ -114,155 +126,155 @@ All notable changes to this project will be documented in this file.
|
|
114
126
|
|
115
127
|
### Deprecations
|
116
128
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
129
|
+
- `:thing` in `enabled?` instrumentation payload. Use `:actors` instead.
|
130
|
+
```diff
|
131
|
+
ActiveSupport::Notifications.subscribe('enabled?.feature_operation.flipper') do |name, start, finish, id, payload|
|
132
|
+
- payload[:thing]
|
133
|
+
+ payload[:actors]
|
134
|
+
end
|
135
|
+
```
|
124
136
|
|
125
137
|
## 0.27.1
|
126
138
|
|
127
|
-
|
139
|
+
- Quick fix for missing require of "flipper/version" that was causing issues with some flipper-ui people.
|
128
140
|
|
129
141
|
## 0.27.0
|
130
142
|
|
131
|
-
|
143
|
+
- Easy Import/Export (https://github.com/flippercloud/flipper/pull/709). This has some breaking changes but only if you are using flipper internals. If you are just using Flipper.\* methods, you'll be fine.
|
132
144
|
|
133
145
|
## 0.26.2
|
134
146
|
|
135
|
-
|
147
|
+
- Improve Active Record Adapter get/get_multi/get_all performance by 5-10x when dealing with thousands of gate values (https://github.com/flippercloud/flipper/pull/707).
|
136
148
|
|
137
149
|
## 0.26.1
|
138
150
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
151
|
+
- Improve `Flipper#enabled?` performance by ~37%-55% (https://github.com/flippercloud/flipper/pull/706)
|
152
|
+
- Make Memory adapter threadsafe (https://github.com/flippercloud/flipper/pull/702 and https://github.com/flippercloud/flipper/pull/703)
|
153
|
+
- ActiveRecord adapter: wrap all reads/writes in `with_connection` (https://github.com/flippercloud/flipper/pull/705)
|
154
|
+
- Improve performance of background polling (https://github.com/flippercloud/flipper/pull/699)
|
155
|
+
- Remove executables directive from gem (https://github.com/flippercloud/flipper/pull/693)
|
144
156
|
|
145
157
|
## 0.26.0
|
146
158
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
159
|
+
- Cloud Background Polling (https://github.com/flippercloud/flipper/pull/682)
|
160
|
+
- Changed default branch from master to main
|
161
|
+
- Allow configuring railtie via ENV vars (https://github.com/flippercloud/flipper/pull/681)
|
162
|
+
- flipper-ui: Fix issue preventing feature flags being enabled when confirm_fully_enable is on and feature_removal_enabled is off (https://github.com/flippercloud/flipper/pull/680)
|
151
163
|
|
152
164
|
## 0.25.4
|
153
165
|
|
154
|
-
|
166
|
+
- Added read_only UI config option (https://github.com/flippercloud/flipper/pull/679)
|
155
167
|
|
156
168
|
## 0.25.3
|
157
169
|
|
158
|
-
|
159
|
-
|
160
|
-
|
170
|
+
- Added configurable confirm warning for fully enabling a feature (https://github.com/flippercloud/flipper/pull/665)
|
171
|
+
- Update rack protection to < 4 (https://github.com/flippercloud/flipper/pull/675)
|
172
|
+
- Check sadd_returns_boolean on the actual client class rather than ::Redis (https://github.com/flippercloud/flipper/pull/677)
|
161
173
|
|
162
174
|
## 0.25.2
|
163
175
|
|
164
|
-
|
176
|
+
- Fix deprecation warnings for Redis >= 4.8.0 (https://github.com/flippercloud/flipper/pull/660)
|
165
177
|
|
166
178
|
## 0.25.1
|
167
179
|
|
168
180
|
### Additions/Changes
|
169
181
|
|
170
|
-
|
171
|
-
|
172
|
-
|
182
|
+
- ActiveRecord: use provided `gate_class` option when calling `#get_all` (https://github.com/flippercloud/flipper/pull/647)
|
183
|
+
- Relaxed the rack-protection version to support latest (https://github.com/flippercloud/flipper/commit/f4a41c541ccf14c535a61c6bc6fe7eeabbfc7e71).
|
184
|
+
- Configure ActiveRecord adapter immediately upon require of flipper-active_record (https://github.com/flippercloud/flipper/pull/652)
|
173
185
|
|
174
186
|
## 0.25.0
|
175
187
|
|
176
188
|
### Additions/Changes
|
177
189
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
190
|
+
- Added a prompt in Flipper UI for the 'Delete' button to prevent accidental delete of features (https://github.com/flippercloud/flipper/pull/625)
|
191
|
+
- Added failsafe adapter (https://github.com/flippercloud/flipper/pull/626)
|
192
|
+
- Removed previously deprecated options and settings. Those upgrading from `<0.21` should upgrade to `~>0.24` first and fix any deprecation warnings when initializing Flipper. (https://github.com/flippercloud/flipper/pull/627)
|
193
|
+
- ActiveRecord: base class for internal models (https://github.com/flippercloud/flipper/pull/629)
|
194
|
+
- Remove use of `Rack::BodyProxy` in the memoizer middleware (https://github.com/flippercloud/flipper/pull/631)
|
183
195
|
|
184
196
|
## 0.24.1
|
185
197
|
|
186
198
|
### Additions/Changes
|
187
199
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
200
|
+
- flipper-api: `exclude_gates` parameter to exclude gate data in GETs (https://github.com/flippercloud/flipper/pull/572).
|
201
|
+
- Make it possible to disable internal memoization (https://github.com/flippercloud/flipper/pull/612).
|
202
|
+
- Add Flipper::Actor#hash so actors can be hash keys (https://github.com/flippercloud/flipper/pull/616).
|
203
|
+
- Pretty Up `rails routes` again and make rack-protection dependency less strict (https://github.com/flippercloud/flipper/pull/619).
|
204
|
+
- Add kwargs for method_missing using ruby 3.0 (https://github.com/flippercloud/flipper/pull/620).
|
205
|
+
- Relax the rack-protection dependency (https://github.com/flippercloud/flipper/commit/c1cb9cd78140c2b09123687642558101e6e5d37d).
|
194
206
|
|
195
207
|
## 0.24.0
|
196
208
|
|
197
209
|
### Additions/Changes
|
198
210
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
211
|
+
- Add Ruby 3.0 and 3.1 to the CI matrix and fix groups block arity check for ruby 3 (https://github.com/flippercloud/flipper/pull/601)
|
212
|
+
- Removed support for Ruby 2.5 (which was end of line 9 months ago)
|
213
|
+
- Add (alpha) client side instrumentation of events to cloud (https://github.com/flippercloud/flipper/pull/602)
|
214
|
+
- Fix deprecated uses of Redis#pipelined (https://github.com/flippercloud/flipper/pull/603). redis-rb >= 3 now required.
|
215
|
+
- Fix Flipper UI Rack application when `Rack::Session::Pool` is used to build it (https://github.com/flippercloud/flipper/pull/606).
|
204
216
|
|
205
217
|
## 0.23.1
|
206
218
|
|
207
219
|
### Additions/Changes
|
208
220
|
|
209
|
-
|
221
|
+
- Relax dalli version constraint (https://github.com/flippercloud/flipper/pull/596)
|
210
222
|
|
211
223
|
### Bug Fixes
|
212
224
|
|
213
|
-
|
225
|
+
- Fix railtie initialization to mount middleware after config/intializers/\* (https://github.com/flippercloud/flipper/pull/586)
|
214
226
|
|
215
227
|
## 0.23.0
|
216
228
|
|
217
229
|
### Additions/Changes
|
218
230
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
231
|
+
- Allow some HTML in banner and descriptions (https://github.com/flippercloud/flipper/pull/570).
|
232
|
+
- Moved some cloud headers to http client (https://github.com/flippercloud/flipper/pull/567).
|
233
|
+
- Update flipper-ui jquery and bootstrap versions (https://github.com/flippercloud/flipper/issues/565 and https://github.com/flippercloud/flipper/pull/566).
|
234
|
+
- Moved docs to www.flippercloud.io/docs (https://github.com/flippercloud/flipper/pull/574).
|
235
|
+
- PStore adapter now defaults to thread safe and no longer supports `.thread_safe` (https://github.com/flippercloud/flipper/commit/4048704fefe41b716015294a19a0b94546637630).
|
236
|
+
- Add failover adapter (https://github.com/flippercloud/flipper/pull/584).
|
237
|
+
- Improve http adapter error message (https://github.com/flippercloud/flipper/pull/587).
|
238
|
+
- Rails 7 support (mostly in https://github.com/flippercloud/flipper/pull/592).
|
227
239
|
|
228
240
|
## 0.22.2
|
229
241
|
|
230
242
|
### Additions/Changes
|
231
243
|
|
232
|
-
|
244
|
+
- Allow adding multiple actors at once in flipper-ui via comma separation (configurable via `Flipper::UI.configuration.actors_separator`) (https://github.com/flippercloud/flipper/pull/556)
|
233
245
|
|
234
246
|
### Bug Fixes
|
235
247
|
|
236
|
-
|
248
|
+
- Fix railtie initialization to avoid altering middleware order (https://github.com/flippercloud/flipper/pull/563)
|
237
249
|
|
238
250
|
## 0.22.1
|
239
251
|
|
240
252
|
### Additions/Changes
|
241
253
|
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
254
|
+
- Remove Octicons and replace with a pure CSS status circle (https://github.com/flippercloud/flipper/pull/547)
|
255
|
+
- Rescue unique errors in AR and Sequel when setting value (https://github.com/flippercloud/flipper/commit/87f5a98bce7baad7a27b75b5bce3256967769f27)
|
256
|
+
- Add a Content-Security-Policy to flipper-ui (https://github.com/flippercloud/flipper/pull/552)
|
257
|
+
- Fix Synchronizer issue that occurs for ActiveRecord adapter (https://github.com/flippercloud/flipper/pull/554)
|
246
258
|
|
247
259
|
## 0.22.0
|
248
260
|
|
249
261
|
### Additions/Changes
|
250
262
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
263
|
+
- Enable log subscriber by default in Rails (https://github.com/flippercloud/flipper/pull/525)
|
264
|
+
- Remove memoizer from API and UI (https://github.com/flippercloud/flipper/pull/527). If you are using the UI or API without configuring the default instance of Flipper, you'll need to enable memoization if you want it. For examples, see the examples/ui and examples/api directories.
|
265
|
+
- Fix SQL reserved word use in get_all for ActiveRecord and Sequel (https://github.com/flippercloud/flipper/pull/536).
|
266
|
+
- Handle spaces in names gracefully in UI (https://github.com/flippercloud/flipper/pull/541).
|
255
267
|
|
256
268
|
## 0.21.0
|
257
269
|
|
258
270
|
### Additions/Changes
|
259
271
|
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
272
|
+
- Default to using memory adapter (https://github.com/flippercloud/flipper/pull/501)
|
273
|
+
- Adapters now configured on require when possible (https://github.com/flippercloud/flipper/pull/502)
|
274
|
+
- Added cloud recommendation to flipper-ui. Can be disabled with `Flipper::UI.configure { |config| config.cloud_recommendation = false }`. Just want to raise awareness that more is available if people want it (https://github.com/flippercloud/flipper/pull/504)
|
275
|
+
- Added default `flipper_id` implementation via `Flipper::Identifier` and automatically included it in ActiveRecord and Sequel models (https://github.com/flippercloud/flipper/pull/505)
|
276
|
+
- Deprecate superflous sync_method setting (https://github.com/flippercloud/flipper/pull/511)
|
277
|
+
- Flipper is now pre-configured when used with Rails. By default, it will [memoize and preload all features for each request](https://flippercloud.io/docs/optimization#memoization). (https://github.com/flippercloud/flipper/pull/506)
|
266
278
|
|
267
279
|
### Upgrading
|
268
280
|
|
@@ -270,359 +282,359 @@ You should be able to upgrade to 0.21 without any breaking changes. However, if
|
|
270
282
|
|
271
283
|
1. Adapters are configured when on require, so unless you are using caching or other customizations, you can remove adapter configuration.
|
272
284
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
285
|
+
```diff
|
286
|
+
# config/initializers/flipper.rb
|
287
|
+
- Flipper.configure do |config|
|
288
|
+
- config.default { Flipper.new(Flipper::Adapters::ActiveRecord.new) }
|
289
|
+
- end
|
290
|
+
```
|
279
291
|
|
280
292
|
2. `Flipper::Middleware::Memoizer` will be enabled by default -- including preloading. **Note**: You may want to disable preloading (see below) if you have > 100 features.
|
281
293
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
+
```diff
|
295
|
+
# config/initializers/flipper.rb
|
296
|
+
- Rails.configuration.middleware.use Flipper::Middleware::Memoizer,
|
297
|
+
- preload: [:stats, :search, :some_feature]
|
298
|
+
+ Rails.application.configure do
|
299
|
+
+ # Uncomment to configure which features to preload on all requests
|
300
|
+
+ # config.flipper.preload = [:stats, :search, :some_feature]
|
301
|
+
+ #
|
302
|
+
+ # Or, you may want to disable preloading entirely:
|
303
|
+
+ # config.flipper.preload = false
|
304
|
+
+ end
|
305
|
+
```
|
294
306
|
|
295
307
|
3. `#flipper_id`, which is used to enable features for specific actors, is now defined by [Flipper::Identifier](lib/flipper/identifier.rb) on all ActiveRecord and Sequel models. You can remove your implementation if it is in the form of `ModelName;id`.
|
296
308
|
|
297
309
|
4. When using `flipper-cloud`, The `Flipper::Cloud.app` webhook receiver is now mounted at `/_flipper` by default.
|
298
310
|
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
311
|
+
```diff
|
312
|
+
# config/routes.rb
|
313
|
+
- mount Flipper::Cloud.app, at: "/_flipper"
|
314
|
+
```
|
303
315
|
|
304
316
|
## 0.20.4
|
305
317
|
|
306
318
|
### Additions/Changes
|
307
319
|
|
308
|
-
|
309
|
-
|
310
|
-
|
320
|
+
- Allow actors and time gates to deal with decimal percentages (https://github.com/flippercloud/flipper/pull/492)
|
321
|
+
- Change Flipper::Cloud::Middleware to receive webhooks at / in addition to /webhooks.
|
322
|
+
- Add `write_through` option to ActiveSupportCacheStore adapter to support write-through caching (https://github.com/flippercloud/flipper/pull/512)
|
311
323
|
|
312
324
|
## 0.20.3
|
313
325
|
|
314
326
|
### Additions/Changes
|
315
327
|
|
316
|
-
|
328
|
+
- Changed the internal structure of how the memory adapter stores things.
|
317
329
|
|
318
330
|
## 0.20.2
|
319
331
|
|
320
332
|
### Additions/Changes
|
321
333
|
|
322
|
-
|
323
|
-
|
334
|
+
- Http adapter now raises error when enable/disable/add/remove/clear fail.
|
335
|
+
- Cloud adapter sends some extra info like hostname, ruby version, etc. for debugging and decision making.
|
324
336
|
|
325
337
|
## 0.20.1
|
326
338
|
|
327
339
|
### Additions/Changes
|
328
340
|
|
329
|
-
|
341
|
+
- Just a minor tweak to cloud webhook middleware to provide more debugging information about why a hook wasn't successful.
|
330
342
|
|
331
343
|
## 0.20.0
|
332
344
|
|
333
345
|
### Additions/Changes
|
334
346
|
|
335
|
-
|
347
|
+
- Add support for webhooks to `Flipper::Cloud` (https://github.com/flippercloud/flipper/pull/489).
|
336
348
|
|
337
349
|
## 0.19.1
|
338
350
|
|
339
351
|
### Additions/Changes
|
340
352
|
|
341
|
-
|
342
|
-
|
353
|
+
- Bump rack-protection version to < 2.2 (https://github.com/flippercloud/flipper/pull/487)
|
354
|
+
- Add memoizer_options to Flipper::Api.app (https://github.com/flippercloud/flipper/commit/174ad4bb94046a25c432d3c53fe1ff9f5a76d838)
|
343
355
|
|
344
356
|
## 0.19.0
|
345
357
|
|
346
358
|
### Additions/Changes
|
347
359
|
|
348
|
-
|
349
|
-
|
360
|
+
- 100% of actors is now considered conditional. Feature#on?, Feature#conditional?, Feature#state would all be affected. See https://github.com/flippercloud/flipper/issues/463 for more.
|
361
|
+
- Several doc updates.
|
350
362
|
|
351
363
|
## 0.18.0
|
352
364
|
|
353
365
|
### Additions/Changes
|
354
366
|
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
367
|
+
- Add support for feature descriptions to flipper-ui (https://github.com/flippercloud/flipper/pull/461).
|
368
|
+
- Remove rubocop (https://github.com/flippercloud/flipper/pull/469).
|
369
|
+
- flipper-ui redesign (https://github.com/flippercloud/flipper/pull/470).
|
370
|
+
- Removed support for ruby 2.4.
|
371
|
+
- Added support for ruby 2.7.
|
372
|
+
- Removed support for Rails 4.x.x.
|
373
|
+
- Removed support for customizing actors, groups, % of actors and % of time text in flipper-ui in favor of automatic and more descriptive text.
|
362
374
|
|
363
375
|
## 0.17.2
|
364
376
|
|
365
377
|
### Additions/Changes
|
366
378
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
379
|
+
- Avoid errors on import when there are no features and shared specs/tests for get all with no features (https://github.com/flippercloud/flipper/pull/441 and https://github.com/flippercloud/flipper/pull/442)
|
380
|
+
- ::ActiveRecord::RecordNotUnique > ActiveRecord::RecordNotUnique (https://github.com/flippercloud/flipper/pull/444)
|
381
|
+
- Clear gate values on enable (https://github.com/flippercloud/flipper/pull/454)
|
382
|
+
- Remove use of multi from redis adapter (https://github.com/flippercloud/flipper/pull/451)
|
371
383
|
|
372
384
|
## 0.17.1
|
373
385
|
|
374
|
-
|
386
|
+
- Fix require in flipper-active_record (https://github.com/flippercloud/flipper/pull/437)
|
375
387
|
|
376
388
|
## 0.17.0
|
377
389
|
|
378
390
|
### Additions/Changes
|
379
391
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
392
|
+
- Allow shorthand block notation on group types (https://github.com/flippercloud/flipper/pull/406)
|
393
|
+
- Relax active record/support constraints to support Rails 6 (https://github.com/flippercloud/flipper/pull/409)
|
394
|
+
- Allow disabling fun (https://github.com/flippercloud/flipper/pull/413)
|
395
|
+
- Include thing_value in payload of Instrumented#enable and #disable (https://github.com/flippercloud/flipper/pull/417)
|
396
|
+
- Replace Erubis with Erubi (https://github.com/flippercloud/flipper/pull/407)
|
397
|
+
- Allow customizing Rack::Protection middleware list (https://github.com/flippercloud/flipper/pull/385)
|
398
|
+
- Allow setting write_timeout for ruby 2.6+ (https://github.com/flippercloud/flipper/pull/433)
|
399
|
+
- Drop support for Ruby 2.1, 2.2, and 2.3 (https://github.com/flippercloud/flipper/commit/cf58982e70de5e6963b018ceced4f36a275f5b5d)
|
400
|
+
- Add support for Ruby 2.6 (https://github.com/flippercloud/flipper/commit/57888311449ec81184d3d47ba9ae5cb1ad4a2f45)
|
401
|
+
- Remove support for Rails 3.2 (https://github.com/flippercloud/flipper/commit/177c48c4edf51d4e411e7c673e30e06d1c66fb40)
|
402
|
+
- Add write_timeout for flipper http adapter for ruby 2.6+ (https://github.com/flippercloud/flipper/pull/433)
|
403
|
+
- Relax moneta version to allow for < 1.2 (https://github.com/flippercloud/flipper/pull/434).
|
404
|
+
- Improve active record idempotency (https://github.com/flippercloud/flipper/pull/436).
|
405
|
+
- Allow customizing add actor placeholder text (https://github.com/flippercloud/flipper/commit/5faa1e9cf66b68f8227d2f8408fb448a14676c45)
|
394
406
|
|
395
407
|
## 0.16.2
|
396
408
|
|
397
409
|
### Additions/Changes
|
398
410
|
|
399
|
-
|
400
|
-
|
401
|
-
|
411
|
+
- Bump rollout redis dependency to < 5 (https://github.com/flippercloud/flipper/pull/403)
|
412
|
+
- Bump redis dependency to < 5 (https://github.com/flippercloud/flipper/pull/401)
|
413
|
+
- Bump sequel dependency to < 6 (https://github.com/flippercloud/flipper/pull/399 and https://github.com/flippercloud/flipper/commit/edc767e69b4ce8daead9801f38e0e8bf6b238765)
|
402
414
|
|
403
415
|
## 0.16.1
|
404
416
|
|
405
417
|
### Additions/Changes
|
406
418
|
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
419
|
+
- Add actors API endpoint (https://github.com/flippercloud/flipper/pull/372).
|
420
|
+
- Fix rack body proxy require for those using flipper without rack (https://github.com/flippercloud/flipper/pull/376).
|
421
|
+
- Unescapes feature_name in FeatureNameFromRoute (https://github.com/flippercloud/flipper/pull/377).
|
422
|
+
- Replace delete_all with destroy_all in ActiveRecord adapter (https://github.com/flippercloud/flipper/pull/395)
|
423
|
+
- Target correct bootstrap breakpoints in flipper UI (https://github.com/flippercloud/flipper/pull/396)
|
412
424
|
|
413
425
|
## 0.16.0
|
414
426
|
|
415
427
|
### Bug Fixes
|
416
428
|
|
417
|
-
|
429
|
+
- Support slashes in feature names (https://github.com/flippercloud/flipper/pull/362).
|
418
430
|
|
419
431
|
### Additions/Changes
|
420
432
|
|
421
|
-
|
422
|
-
|
433
|
+
- Re-order gates for improved performance in some cases (https://github.com/flippercloud/flipper/pull/370).
|
434
|
+
- Add Feature#exist?, DSL#exist? and Flipper#exist? (https://github.com/flippercloud/flipper/pull/371).
|
423
435
|
|
424
436
|
## 0.15.0
|
425
437
|
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
438
|
+
- Move Flipper::UI configuration options to Flipper::UI::Configuration (https://github.com/flippercloud/flipper/pull/345).
|
439
|
+
- Bug fix in adapter synchronizing and switched DSL#import to use Synchronizer (https://github.com/flippercloud/flipper/pull/347).
|
440
|
+
- Fix AR adapter table name prefix/suffix bug (https://github.com/flippercloud/flipper/pull/350).
|
441
|
+
- Allow feature names to end with "features" in UI (https://github.com/flippercloud/flipper/pull/353).
|
430
442
|
|
431
443
|
## 0.14.0
|
432
444
|
|
433
|
-
|
445
|
+
- Changed sync_interval to be seconds instead of milliseconds.
|
434
446
|
|
435
447
|
## 0.13.0
|
436
448
|
|
437
449
|
### Additions/Changes
|
438
450
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
451
|
+
- Update PStore adapter to allow setting thread_safe option (https://github.com/flippercloud/flipper/pull/334).
|
452
|
+
- Update Flipper::UI to Bootstrap 4 (https://github.com/flippercloud/flipper/pull/336).
|
453
|
+
- Add Flipper::UI configuration to add a banner with customizeable text and background color (https://github.com/flippercloud/flipper/pull/337).
|
454
|
+
- Add sync adapter (https://github.com/flippercloud/flipper/pull/341).
|
455
|
+
- Make cloud use sync adapter (https://github.com/flippercloud/flipper/pull/342). This makes local flipper operations resilient to cloud failures.
|
444
456
|
|
445
457
|
## 0.12.2
|
446
458
|
|
447
459
|
### Additions/Changes
|
448
460
|
|
449
|
-
|
461
|
+
- Improvements/fixes/examples for rollout adapter (https://github.com/flippercloud/flipper/pull/332).
|
450
462
|
|
451
463
|
## 0.12.1
|
452
464
|
|
453
465
|
### Additions/Changes
|
454
466
|
|
455
|
-
|
467
|
+
- Added rollout adapter documentation (https://github.com/flippercloud/flipper/pull/328).
|
456
468
|
|
457
469
|
### Bug Fixes
|
458
470
|
|
459
|
-
|
471
|
+
- Fixed ActiveRecord and Sequel adapters to include disabled features for `get_all` (https://github.com/flippercloud/flipper/pull/327).
|
460
472
|
|
461
473
|
## 0.12
|
462
474
|
|
463
475
|
### Additions/Changes
|
464
476
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
477
|
+
- Added Flipper.instance= writer method for explicitly setting the default instance (https://github.com/flippercloud/flipper/pull/309).
|
478
|
+
- Added Flipper::UI configuration instance for changing text and things (https://github.com/flippercloud/flipper/pull/306).
|
479
|
+
- Delegate memoize= and memoizing? for Flipper and Flipper::DSL (https://github.com/flippercloud/flipper/pull/310).
|
480
|
+
- Fixed error when enabling the same group or actor more than once (https://github.com/flippercloud/flipper/pull/313).
|
481
|
+
- Fixed redis cache adapter key (and thus cache misses) (https://github.com/flippercloud/flipper/pull/325).
|
482
|
+
- Added Rollout adapter to make it easy to import rollout data into Flipper (https://github.com/flippercloud/flipper/pull/319).
|
483
|
+
- Relaxed redis gem dependency constraint to allow redis-rb 4 (https://github.com/flippercloud/flipper/pull/317).
|
484
|
+
- Added configuration option for Flipper::UI to disable feature removal (https://github.com/flippercloud/flipper/pull/322).
|
473
485
|
|
474
486
|
## 0.11
|
475
487
|
|
476
488
|
### Backwards Compatibility Breaks
|
477
489
|
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
### Additions/Changes
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
490
|
+
- Set flipper from env for API and UI (https://github.com/flippercloud/flipper/pull/223 and https://github.com/flippercloud/flipper/pull/229). It is documented, but now the memoizing middleware requires that the SetupEnv middleware is used first, unless you are configuring a Flipper default instance.
|
491
|
+
- Drop support for Ruby 2.0 as it is end of lined (https://github.com/flippercloud/flipper/commit/c2c81ed89938155ce91acb5173ac38580f630e3d).
|
492
|
+
- Allow unregistered groups (https://github.com/flippercloud/flipper/pull/244). Only break in compatibility is that previously unregistered groups could not be enabled and now they can be.
|
493
|
+
- Removed support for metriks (https://github.com/flippercloud/flipper/pull/291).
|
494
|
+
|
495
|
+
### Additions/Changes
|
496
|
+
|
497
|
+
- Use primary keys with sequel adapter (https://github.com/flippercloud/flipper/pull/210). Should be backwards compatible, but if you want it to work this way you will need to migrate your database to the new schema.
|
498
|
+
- Add redis cache adapter (https://github.com/flippercloud/flipper/pull/211).
|
499
|
+
- Finish API and HTTP adapter that speaks to API.
|
500
|
+
- Add flipper cloud adapter (https://github.com/flippercloud/flipper/pull/249). Nothing to see here yet, but good stuff soon. ;)
|
501
|
+
- Add importing (https://github.com/flippercloud/flipper/pull/251).
|
502
|
+
- Added Adapter#get_all to allow for more efficient preload_all (https://github.com/flippercloud/flipper/pull/255).
|
503
|
+
- Added :unless option to Flipper::Middleware::Memoizer to allow skipping memoization and preloading for certain requests.
|
504
|
+
- Made it possible to instrument Flipper::Cloud (https://github.com/flippercloud/flipper/commit/4b10e4d807772202f63881f5e2c00d11ac58481f).
|
505
|
+
- Made it possible to wrap Http adapter when using Flipper::Cloud (https://github.com/flippercloud/flipper/commit/4b10e4d807772202f63881f5e2c00d11ac58481f).
|
506
|
+
- Instrument get_multi in instrumented adapter (https://github.com/flippercloud/flipper/commit/951d25c5ce07d3b56b0b2337adf5f6bcbe4050e7).
|
507
|
+
- Allow instrumenting Flipper::Cloud http adapter (https://github.com/flippercloud/flipper/pull/253).
|
508
|
+
- Add DSL#preload_all and Adapter#get_all to allow for making even more efficient loading of features (https://github.com/flippercloud/flipper/pull/255).
|
509
|
+
- Allow setting debug output of http adapter (https://github.com/flippercloud/flipper/pull/256 and https://github.com/flippercloud/flipper/pull/258).
|
510
|
+
- Allow setting env key for middleware (https://github.com/flippercloud/flipper/pull/259).
|
511
|
+
- Added ActiveSupport cache store adapter for use with Rails.cache (https://github.com/flippercloud/flipper/pull/265 and https://github.com/flippercloud/flipper/pull/297).
|
512
|
+
- Added support for up to 3 decimal places in percentage based rollouts (https://github.com/flippercloud/flipper/pull/274).
|
513
|
+
- Removed Flipper::GroupNotRegistered error as it is now unused (https://github.com/flippercloud/flipper/pull/270).
|
514
|
+
- Added get_all to all adapters (https://github.com/flippercloud/flipper/pull/298).
|
515
|
+
- Added support for Rails 5.1 (https://github.com/flippercloud/flipper/pull/299).
|
516
|
+
- Added Flipper default instance generation (https://github.com/flippercloud/flipper/pull/279).
|
505
517
|
|
506
518
|
## 0.10.2
|
507
519
|
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
520
|
+
- Add Adapter#get_multi to allow for efficient loading of more than one feature at a time (https://github.com/flippercloud/flipper/pull/198)
|
521
|
+
- Add DSL#preload for efficiently loading several features at once using get_mutli (https://github.com/flippercloud/flipper/pull/198)
|
522
|
+
- Add :preload and :preload_all options to memoizer as a way of efficiently loading several features for a request in one network call instead of N where N is the number of features checked (https://github.com/flippercloud/flipper/pull/198)
|
523
|
+
- Strip whitespace out of feature/actor/group values posted by UI (https://github.com/flippercloud/flipper/pull/205)
|
524
|
+
- Fix bug with dalli adapter where deleting a feature using the UI or API was not clearing the cache in the dalli adapter which meant the feature would continue to use whatever cached enabled state was present until the TTL was hit (1cd96f6)
|
525
|
+
- Change cache keys for dalli adapter. Backwards compatible in that it will just repopulate new keys on first check with this version, but old keys are not expired, so if you used the default ttl of 0, you'll have to expire them on your own. The primary reason for the change was safer namespacing of the cache keys to avoid collisions.
|
514
526
|
|
515
527
|
## 0.10.1
|
516
528
|
|
517
|
-
|
518
|
-
|
519
|
-
|
529
|
+
- Add docker compose support for contributing
|
530
|
+
- Add sequel adapter
|
531
|
+
- Show confirmation dialog when deleting a feature in flipper-ui
|
520
532
|
|
521
533
|
## 0.10.0
|
522
534
|
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
535
|
+
- Added feature check context (https://github.com/flippercloud/flipper/pull/158)
|
536
|
+
- Do not use mass assignment for active record adapter (https://github.com/flippercloud/flipper/pull/171)
|
537
|
+
- Several documentation improvements
|
538
|
+
- Make Flipper::UI.app.inspect return a String (https://github.com/flippercloud/flipper/pull/176)
|
539
|
+
- changes boolean gate route to api/v1/features/boolean (https://github.com/flippercloud/flipper/pull/175)
|
540
|
+
- add api v1 percentage_of_actors endpoint (https://github.com/flippercloud/flipper/pull/179)
|
541
|
+
- add api v1 percentage_of_time endpoint (https://github.com/flippercloud/flipper/pull/180)
|
542
|
+
- add api v1 actors gate endpoint (https://github.com/flippercloud/flipper/pull/181)
|
543
|
+
- wait for activesupport to tell us when active record is loaded for active record adapter (https://github.com/flippercloud/flipper/pull/192)
|
532
544
|
|
533
545
|
## 0.9.2
|
534
546
|
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
547
|
+
- GET /api/v1/features
|
548
|
+
- POST /api/v1/features - add feature endpoint
|
549
|
+
- rack-protection 2.0.0 support
|
550
|
+
- pretty rake output
|
539
551
|
|
540
552
|
## 0.9.1
|
541
553
|
|
542
|
-
|
554
|
+
- bump flipper-active_record to officially support rails 5
|
543
555
|
|
544
556
|
## 0.9.0
|
545
557
|
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
558
|
+
- Moves SharedAdapterTests module to Flipper::Test::SharedAdapterTests to avoid clobbering anything top level in apps that use Flipper
|
559
|
+
- Memoizable, Instrumented and OperationLogger now delegate any missing methods to the original adapter. This was lost with the removal of the official decorator in 0.8, but is actually useful functionality for these "wrapping" adapters.
|
560
|
+
- Instrumenting adapters is now off by default. Use Flipper::Adapters::Instrumented.new(adapter) to instrument adapters and maintain the old functionality.
|
561
|
+
- Added dalli cache adapter (https://github.com/flippercloud/flipper/pull/132)
|
550
562
|
|
551
563
|
## 0.8
|
552
564
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
565
|
+
- removed Flipper::Decorator and Flipper::Adapters::Decorator in favor of just calling methods on wrapped adapter
|
566
|
+
- fix bug where certain versions of AR left off quotes for key column which caused issues with MySQL https://github.com/flippercloud/flipper/issues/120
|
567
|
+
- fix bug where AR would store multiple gate values for percentage gates for each enable/disable and then nondeterministically pick one on read (https://github.com/flippercloud/flipper/pull/122 and https://github.com/flippercloud/flipper/pull/124)
|
568
|
+
- added readonly adapter (https://github.com/flippercloud/flipper/pull/111)
|
569
|
+
- flipper groups now match for truthy values rather than explicitly only true (https://github.com/flippercloud/flipper/issues/110)
|
570
|
+
- removed gate operation instrumentation (https://github.com/flippercloud/flipper/commit/32f14ed1fb25c64961b23c6be3dc6773143a06c8); I don't think it was useful and never found myself instrumenting it in reality
|
571
|
+
- initial implementation of flipper api - very limited functionality right now (get/delete feature, boolean gate for feature) but more is on the way
|
572
|
+
- made it easy to remove a feature (https://github.com/flippercloud/flipper/pull/126)
|
573
|
+
- add minitest shared tests for adapters that work the same as the shared specs for rspec (https://github.com/flippercloud/flipper/pull/127)
|
562
574
|
|
563
575
|
## 0.7.5
|
564
576
|
|
565
|
-
|
566
|
-
|
567
|
-
|
577
|
+
- support for rails 5 beta/ rack 2 alpha
|
578
|
+
- fix uninitialized constant in rails generators
|
579
|
+
- fix adapter test for clear to ensure that feature is not deleted, only gates
|
568
580
|
|
569
581
|
## 0.7.4
|
570
582
|
|
571
|
-
|
583
|
+
- Add missing migration file to gemspec for flipper-active_record
|
572
584
|
|
573
585
|
## 0.7.3
|
574
586
|
|
575
|
-
|
587
|
+
- Add Flipper ActiveRecord adapter
|
576
588
|
|
577
589
|
## 0.7.2
|
578
590
|
|
579
|
-
|
591
|
+
- Add Flipper::UI.application_breadcrumb_href for setting breadcrumb back to original app from Flipper UI
|
580
592
|
|
581
593
|
## 0.7.1
|
582
594
|
|
583
|
-
|
595
|
+
- Fix bug where features with names that match static file routes were incorrectly routing to the file action (https://github.com/flippercloud/flipper/issues/80)
|
584
596
|
|
585
597
|
## 0.7
|
586
598
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
599
|
+
- Added Flipper.groups and Flipper.group_names
|
600
|
+
- Changed percentage_of_random to percentage_of_time
|
601
|
+
- Added enable/disable convenience methods for all gates (enable_group, enable_actor, enable_percentage_of_actors, enable_percentage_of_time)
|
602
|
+
- Added value convenience methods (boolean_value, groups_value, actors_value, etc.)
|
603
|
+
- Added Feature#gate_values for getting typecast adapter gate values
|
604
|
+
- Added Feature#enabled_gates and #disabled_gates for getting the gates that are enabled/disabled for the feature
|
605
|
+
- Remove Feature#description
|
606
|
+
- Added Flipper::Adapters::PStore
|
607
|
+
- Moved memoizable decorator to instance variable storage from class level thread local stuff. Now not thread safe, but we can make a thread safe version later.
|
596
608
|
|
597
609
|
UI
|
598
610
|
|
599
|
-
|
611
|
+
- Totally new. Works like a charm.
|
600
612
|
|
601
613
|
Mongo
|
602
614
|
|
603
|
-
|
615
|
+
- Updated to latest driver (~> 2.0)
|
604
616
|
|
605
617
|
## 0.6.3
|
606
618
|
|
607
|
-
|
619
|
+
- Minor bug fixes
|
608
620
|
|
609
621
|
## 0.6.2
|
610
622
|
|
611
|
-
|
623
|
+
- Added Flipper.group_exists?
|
612
624
|
|
613
625
|
## 0.6.1
|
614
626
|
|
615
|
-
|
627
|
+
- Added statsd support for instrumentation.
|
616
628
|
|
617
629
|
## 0.4.0
|
618
630
|
|
619
|
-
|
631
|
+
- No longer use #id for detecting actors. You must now define #flipper_id on
|
620
632
|
anything that you would like to behave as an actor.
|
621
|
-
|
633
|
+
- Strings are now used instead of Integers for Actor identifiers. More flexible
|
622
634
|
and the only reason I used Integers was to do modulo for percentage of actors.
|
623
635
|
Since percentage of actors now uses hashing, integer is no longer needed.
|
624
|
-
|
625
|
-
|
636
|
+
- Easy integration of instrumentation with AS::Notifications or anything similar.
|
637
|
+
- A bunch of stuff around inspecting and getting names/descriptions out of
|
626
638
|
things to more easily figure out what is going on.
|
627
|
-
|
639
|
+
- Percentage of actors hash is now also seeded with feature name so the same
|
628
640
|
actors don't get all features instantly.
|
data/lib/flipper/engine.rb
CHANGED
@@ -15,9 +15,8 @@ module Flipper
|
|
15
15
|
end
|
16
16
|
|
17
17
|
initializer "flipper.properties" do
|
18
|
-
require "flipper/model/active_record"
|
19
|
-
|
20
18
|
ActiveSupport.on_load(:active_record) do
|
19
|
+
require "flipper/model/active_record"
|
21
20
|
ActiveRecord::Base.include Flipper::Model::ActiveRecord
|
22
21
|
end
|
23
22
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Flipper
|
2
|
+
module Model
|
3
|
+
module ActiveRecord
|
4
|
+
# The id of the record when used as an actor.
|
5
|
+
#
|
6
|
+
# class User < ActiveRecord::Base
|
7
|
+
# end
|
8
|
+
#
|
9
|
+
# user = User.first
|
10
|
+
# Flipper.enable :some_feature, user
|
11
|
+
# Flipper.enabled? :some_feature, user #=> true
|
12
|
+
#
|
13
|
+
def flipper_id
|
14
|
+
"#{self.class.base_class.name};#{id}"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Properties used to evaluate expressions
|
18
|
+
def flipper_properties
|
19
|
+
{"type" => self.class.name}.merge(attributes)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/flipper/version.rb
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'flipper/model/active_record'
|
3
|
+
|
4
|
+
# Turn off migration logging for specs
|
5
|
+
ActiveRecord::Migration.verbose = false
|
6
|
+
|
7
|
+
RSpec.describe Flipper::Model::ActiveRecord do
|
8
|
+
before(:all) do
|
9
|
+
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
|
10
|
+
end
|
11
|
+
|
12
|
+
before(:each) do
|
13
|
+
ActiveRecord::Base.connection.execute <<-SQL
|
14
|
+
CREATE TABLE users (
|
15
|
+
id integer PRIMARY KEY,
|
16
|
+
name string NOT NULL,
|
17
|
+
age integer,
|
18
|
+
is_confirmed boolean,
|
19
|
+
created_at datetime NOT NULL,
|
20
|
+
updated_at datetime NOT NULL
|
21
|
+
)
|
22
|
+
SQL
|
23
|
+
end
|
24
|
+
|
25
|
+
after(:each) do
|
26
|
+
ActiveRecord::Base.connection.execute("DROP table IF EXISTS `users`")
|
27
|
+
end
|
28
|
+
|
29
|
+
class User < ActiveRecord::Base
|
30
|
+
include Flipper::Model::ActiveRecord
|
31
|
+
end
|
32
|
+
|
33
|
+
class Admin < User
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "flipper_id" do
|
37
|
+
it "returns class name and id" do
|
38
|
+
expect(User.new(id: 1).flipper_id).to eq("User;1")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "uses base class name" do
|
42
|
+
expect(Admin.new(id: 2).flipper_id).to eq("User;2")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "flipper_properties" do
|
47
|
+
subject { User.create!(name: "Test", age: 22, is_confirmed: true) }
|
48
|
+
|
49
|
+
it "includes all attributes" do
|
50
|
+
expect(subject.flipper_properties).to eq({
|
51
|
+
"type" => "User",
|
52
|
+
"id" => subject.id,
|
53
|
+
"name" => "Test",
|
54
|
+
"age" => 22,
|
55
|
+
"is_confirmed" => true,
|
56
|
+
"created_at" => subject.created_at,
|
57
|
+
"updated_at" => subject.updated_at
|
58
|
+
})
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -169,6 +169,7 @@ files:
|
|
169
169
|
- lib/flipper/metadata.rb
|
170
170
|
- lib/flipper/middleware/memoizer.rb
|
171
171
|
- lib/flipper/middleware/setup_env.rb
|
172
|
+
- lib/flipper/model/active_record.rb
|
172
173
|
- lib/flipper/poller.rb
|
173
174
|
- lib/flipper/registry.rb
|
174
175
|
- lib/flipper/serializers/gzip.rb
|
@@ -258,6 +259,7 @@ files:
|
|
258
259
|
- spec/flipper/instrumenters/noop_spec.rb
|
259
260
|
- spec/flipper/middleware/memoizer_spec.rb
|
260
261
|
- spec/flipper/middleware/setup_env_spec.rb
|
262
|
+
- spec/flipper/model/active_record_spec.rb
|
261
263
|
- spec/flipper/poller_spec.rb
|
262
264
|
- spec/flipper/registry_spec.rb
|
263
265
|
- spec/flipper/serializers/gzip_spec.rb
|
@@ -386,6 +388,7 @@ test_files:
|
|
386
388
|
- spec/flipper/instrumenters/noop_spec.rb
|
387
389
|
- spec/flipper/middleware/memoizer_spec.rb
|
388
390
|
- spec/flipper/middleware/setup_env_spec.rb
|
391
|
+
- spec/flipper/model/active_record_spec.rb
|
389
392
|
- spec/flipper/poller_spec.rb
|
390
393
|
- spec/flipper/registry_spec.rb
|
391
394
|
- spec/flipper/serializers/gzip_spec.rb
|