flipper 0.28.0 → 1.3.6

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.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/ci.yml +50 -7
  4. data/.github/workflows/examples.yml +52 -10
  5. data/CLAUDE.md +74 -0
  6. data/Changelog.md +1 -526
  7. data/Gemfile +17 -8
  8. data/README.md +31 -27
  9. data/Rakefile +2 -2
  10. data/benchmark/typecast_ips.rb +8 -0
  11. data/docs/images/banner.jpg +0 -0
  12. data/docs/images/flipper_cloud.png +0 -0
  13. data/examples/cloud/app.ru +12 -0
  14. data/examples/cloud/backoff_policy.rb +13 -0
  15. data/examples/cloud/basic.rb +22 -0
  16. data/examples/cloud/cloud_setup.rb +20 -0
  17. data/examples/cloud/forked.rb +36 -0
  18. data/examples/cloud/import.rb +17 -0
  19. data/examples/cloud/threaded.rb +33 -0
  20. data/examples/dsl.rb +0 -14
  21. data/examples/expressions.rb +213 -0
  22. data/examples/mirroring.rb +59 -0
  23. data/examples/strict.rb +18 -0
  24. data/exe/flipper +5 -0
  25. data/flipper-cloud.gemspec +19 -0
  26. data/flipper.gemspec +8 -4
  27. data/lib/flipper/actor.rb +6 -3
  28. data/lib/flipper/adapter.rb +10 -0
  29. data/lib/flipper/adapter_builder.rb +44 -0
  30. data/lib/flipper/adapters/actor_limit.rb +28 -0
  31. data/lib/flipper/adapters/cache_base.rb +143 -0
  32. data/lib/flipper/adapters/dual_write.rb +1 -3
  33. data/lib/flipper/adapters/failover.rb +0 -4
  34. data/lib/flipper/adapters/failsafe.rb +0 -4
  35. data/lib/flipper/adapters/http/client.rb +40 -12
  36. data/lib/flipper/adapters/http/error.rb +2 -2
  37. data/lib/flipper/adapters/http.rb +19 -14
  38. data/lib/flipper/adapters/instrumented.rb +0 -4
  39. data/lib/flipper/adapters/memoizable.rb +14 -19
  40. data/lib/flipper/adapters/memory.rb +37 -19
  41. data/lib/flipper/adapters/operation_logger.rb +18 -92
  42. data/lib/flipper/adapters/poll.rb +16 -3
  43. data/lib/flipper/adapters/pstore.rb +17 -11
  44. data/lib/flipper/adapters/read_only.rb +8 -41
  45. data/lib/flipper/adapters/strict.rb +45 -0
  46. data/lib/flipper/adapters/sync/feature_synchronizer.rb +10 -1
  47. data/lib/flipper/adapters/sync.rb +0 -4
  48. data/lib/flipper/adapters/wrapper.rb +54 -0
  49. data/lib/flipper/cli.rb +263 -0
  50. data/lib/flipper/cloud/configuration.rb +266 -0
  51. data/lib/flipper/cloud/dsl.rb +27 -0
  52. data/lib/flipper/cloud/message_verifier.rb +95 -0
  53. data/lib/flipper/cloud/middleware.rb +63 -0
  54. data/lib/flipper/cloud/routes.rb +14 -0
  55. data/lib/flipper/cloud/telemetry/backoff_policy.rb +96 -0
  56. data/lib/flipper/cloud/telemetry/instrumenter.rb +22 -0
  57. data/lib/flipper/cloud/telemetry/metric.rb +39 -0
  58. data/lib/flipper/cloud/telemetry/metric_storage.rb +30 -0
  59. data/lib/flipper/cloud/telemetry/submitter.rb +100 -0
  60. data/lib/flipper/cloud/telemetry.rb +191 -0
  61. data/lib/flipper/cloud.rb +53 -0
  62. data/lib/flipper/configuration.rb +25 -4
  63. data/lib/flipper/dsl.rb +47 -42
  64. data/lib/flipper/engine.rb +102 -0
  65. data/lib/flipper/export.rb +0 -2
  66. data/lib/flipper/exporters/json/export.rb +1 -1
  67. data/lib/flipper/exporters/json/v1.rb +1 -1
  68. data/lib/flipper/expression/builder.rb +73 -0
  69. data/lib/flipper/expression/constant.rb +25 -0
  70. data/lib/flipper/expression.rb +71 -0
  71. data/lib/flipper/expressions/all.rb +9 -0
  72. data/lib/flipper/expressions/any.rb +9 -0
  73. data/lib/flipper/expressions/boolean.rb +9 -0
  74. data/lib/flipper/expressions/comparable.rb +13 -0
  75. data/lib/flipper/expressions/duration.rb +28 -0
  76. data/lib/flipper/expressions/equal.rb +9 -0
  77. data/lib/flipper/expressions/greater_than.rb +9 -0
  78. data/lib/flipper/expressions/greater_than_or_equal_to.rb +9 -0
  79. data/lib/flipper/expressions/less_than.rb +9 -0
  80. data/lib/flipper/expressions/less_than_or_equal_to.rb +9 -0
  81. data/lib/flipper/expressions/not_equal.rb +9 -0
  82. data/lib/flipper/expressions/now.rb +9 -0
  83. data/lib/flipper/expressions/number.rb +9 -0
  84. data/lib/flipper/expressions/percentage.rb +9 -0
  85. data/lib/flipper/expressions/percentage_of_actors.rb +12 -0
  86. data/lib/flipper/expressions/property.rb +9 -0
  87. data/lib/flipper/expressions/random.rb +9 -0
  88. data/lib/flipper/expressions/string.rb +9 -0
  89. data/lib/flipper/expressions/time.rb +9 -0
  90. data/lib/flipper/feature.rb +63 -1
  91. data/lib/flipper/gate.rb +2 -1
  92. data/lib/flipper/gate_values.rb +5 -2
  93. data/lib/flipper/gates/expression.rb +75 -0
  94. data/lib/flipper/instrumentation/log_subscriber.rb +28 -5
  95. data/lib/flipper/instrumentation/statsd.rb +4 -2
  96. data/lib/flipper/instrumentation/statsd_subscriber.rb +2 -4
  97. data/lib/flipper/instrumentation/subscriber.rb +0 -4
  98. data/lib/flipper/metadata.rb +8 -1
  99. data/lib/flipper/middleware/memoizer.rb +30 -14
  100. data/lib/flipper/model/active_record.rb +23 -0
  101. data/lib/flipper/poller.rb +10 -9
  102. data/lib/flipper/serializers/gzip.rb +22 -0
  103. data/lib/flipper/serializers/json.rb +17 -0
  104. data/lib/flipper/spec/shared_adapter_specs.rb +82 -63
  105. data/lib/flipper/test/shared_adapter_test.rb +77 -58
  106. data/lib/flipper/test_help.rb +43 -0
  107. data/lib/flipper/typecast.rb +37 -9
  108. data/lib/flipper/types/percentage.rb +1 -1
  109. data/lib/flipper/version.rb +11 -1
  110. data/lib/flipper.rb +44 -7
  111. data/lib/generators/flipper/setup_generator.rb +68 -0
  112. data/lib/generators/flipper/templates/initializer.rb +45 -0
  113. data/lib/generators/flipper/templates/update/migrations/01_create_flipper_tables.rb.erb +22 -0
  114. data/lib/generators/flipper/templates/update/migrations/02_change_flipper_gates_value_to_text.rb.erb +18 -0
  115. data/lib/generators/flipper/update_generator.rb +35 -0
  116. data/package-lock.json +41 -0
  117. data/package.json +10 -0
  118. data/spec/fixtures/environment.rb +1 -0
  119. data/spec/flipper/adapter_builder_spec.rb +72 -0
  120. data/spec/flipper/adapter_spec.rb +1 -0
  121. data/spec/flipper/adapters/actor_limit_spec.rb +20 -0
  122. data/spec/flipper/adapters/dual_write_spec.rb +2 -2
  123. data/spec/flipper/adapters/http/client_spec.rb +61 -0
  124. data/spec/flipper/adapters/http_spec.rb +135 -74
  125. data/spec/flipper/adapters/instrumented_spec.rb +1 -1
  126. data/spec/flipper/adapters/memoizable_spec.rb +21 -21
  127. data/spec/flipper/adapters/memory_spec.rb +11 -2
  128. data/spec/flipper/adapters/operation_logger_spec.rb +2 -2
  129. data/spec/flipper/adapters/poll_spec.rb +41 -0
  130. data/spec/flipper/adapters/read_only_spec.rb +32 -17
  131. data/spec/flipper/adapters/strict_spec.rb +64 -0
  132. data/spec/flipper/adapters/sync/feature_synchronizer_spec.rb +27 -0
  133. data/spec/flipper/cli_spec.rb +166 -0
  134. data/spec/flipper/cloud/configuration_spec.rb +251 -0
  135. data/spec/flipper/cloud/dsl_spec.rb +82 -0
  136. data/spec/flipper/cloud/message_verifier_spec.rb +104 -0
  137. data/spec/flipper/cloud/middleware_spec.rb +289 -0
  138. data/spec/flipper/cloud/telemetry/backoff_policy_spec.rb +107 -0
  139. data/spec/flipper/cloud/telemetry/metric_spec.rb +87 -0
  140. data/spec/flipper/cloud/telemetry/metric_storage_spec.rb +58 -0
  141. data/spec/flipper/cloud/telemetry/submitter_spec.rb +145 -0
  142. data/spec/flipper/cloud/telemetry_spec.rb +208 -0
  143. data/spec/flipper/cloud_spec.rb +186 -0
  144. data/spec/flipper/configuration_spec.rb +17 -0
  145. data/spec/flipper/dsl_spec.rb +34 -73
  146. data/spec/flipper/engine_spec.rb +374 -0
  147. data/spec/flipper/exporters/json/v1_spec.rb +3 -3
  148. data/spec/flipper/expression/builder_spec.rb +248 -0
  149. data/spec/flipper/expression_spec.rb +188 -0
  150. data/spec/flipper/expressions/all_spec.rb +15 -0
  151. data/spec/flipper/expressions/any_spec.rb +15 -0
  152. data/spec/flipper/expressions/boolean_spec.rb +15 -0
  153. data/spec/flipper/expressions/duration_spec.rb +43 -0
  154. data/spec/flipper/expressions/equal_spec.rb +24 -0
  155. data/spec/flipper/expressions/greater_than_or_equal_to_spec.rb +28 -0
  156. data/spec/flipper/expressions/greater_than_spec.rb +28 -0
  157. data/spec/flipper/expressions/less_than_or_equal_to_spec.rb +28 -0
  158. data/spec/flipper/expressions/less_than_spec.rb +32 -0
  159. data/spec/flipper/expressions/not_equal_spec.rb +15 -0
  160. data/spec/flipper/expressions/now_spec.rb +11 -0
  161. data/spec/flipper/expressions/number_spec.rb +21 -0
  162. data/spec/flipper/expressions/percentage_of_actors_spec.rb +20 -0
  163. data/spec/flipper/expressions/percentage_spec.rb +15 -0
  164. data/spec/flipper/expressions/property_spec.rb +13 -0
  165. data/spec/flipper/expressions/random_spec.rb +9 -0
  166. data/spec/flipper/expressions/string_spec.rb +11 -0
  167. data/spec/flipper/expressions/time_spec.rb +13 -0
  168. data/spec/flipper/feature_spec.rb +380 -10
  169. data/spec/flipper/gate_values_spec.rb +2 -2
  170. data/spec/flipper/gates/expression_spec.rb +108 -0
  171. data/spec/flipper/identifier_spec.rb +4 -5
  172. data/spec/flipper/instrumentation/log_subscriber_spec.rb +10 -2
  173. data/spec/flipper/instrumentation/statsd_subscriber_spec.rb +16 -2
  174. data/spec/flipper/middleware/memoizer_spec.rb +79 -10
  175. data/spec/flipper/model/active_record_spec.rb +72 -0
  176. data/spec/flipper/serializers/gzip_spec.rb +13 -0
  177. data/spec/flipper/serializers/json_spec.rb +13 -0
  178. data/spec/flipper/typecast_spec.rb +43 -7
  179. data/spec/flipper/types/actor_spec.rb +18 -1
  180. data/spec/flipper_integration_spec.rb +114 -16
  181. data/spec/flipper_spec.rb +87 -29
  182. data/spec/spec_helper.rb +17 -17
  183. data/spec/support/actor_names.yml +1 -0
  184. data/spec/support/fail_on_output.rb +8 -0
  185. data/spec/support/fake_backoff_policy.rb +15 -0
  186. data/spec/support/spec_helpers.rb +34 -8
  187. data/test/adapters/actor_limit_test.rb +20 -0
  188. data/test_rails/generators/flipper/setup_generator_test.rb +69 -0
  189. data/test_rails/generators/flipper/update_generator_test.rb +96 -0
  190. data/test_rails/helper.rb +22 -2
  191. data/test_rails/system/test_help_test.rb +52 -0
  192. metadata +179 -19
  193. data/.tool-versions +0 -1
  194. data/lib/flipper/railtie.rb +0 -47
  195. data/spec/flipper/railtie_spec.rb +0 -109
data/Changelog.md CHANGED
@@ -1,528 +1,3 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## 0.28.0
6
-
7
- ### Additions/Changes
8
-
9
- * 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.
10
- ```diff
11
- - [user, user.team, user.org].any? { |actor| Flipper.enabled?(:my_feature, actor) }
12
- + Flipper.enabled?(:my_feature, user, user.team, user.org)
13
- ```
14
-
15
- ### Deprecations
16
-
17
- * `:thing` in `enabled?` instrumentation payload. Use `:actors` instead.
18
- ```diff
19
- ActiveSupport::Notifications.subscribe('enabled?.feature_operation.flipper') do |name, start, finish, id, payload|
20
- - payload[:thing]
21
- + payload[:actors]
22
- end
23
- ```
24
-
25
- ## 0.27.1
26
-
27
- * Quick fix for missing require of "flipper/version" that was causing issues with some flipper-ui people.
28
-
29
- ## 0.27.0
30
-
31
- * Easy Import/Export (https://github.com/jnunemaker/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.
32
-
33
- ## 0.26.2
34
-
35
- * Improve Active Record Adapter get/get_multi/get_all performance by 5-10x when dealing with thousands of gate values (https://github.com/jnunemaker/flipper/pull/707).
36
-
37
- ## 0.26.1
38
-
39
- * Improve `Flipper#enabled?` performance by ~37%-55% (https://github.com/jnunemaker/flipper/pull/706)
40
- * Make Memory adapter threadsafe (https://github.com/jnunemaker/flipper/pull/702 and https://github.com/jnunemaker/flipper/pull/703)
41
- * ActiveRecord adapter: wrap all reads/writes in `with_connection` (https://github.com/jnunemaker/flipper/pull/705)
42
- * Improve performance of background polling (https://github.com/jnunemaker/flipper/pull/699)
43
- * Remove executables directive from gem (https://github.com/jnunemaker/flipper/pull/693)
44
-
45
- ## 0.26.0
46
-
47
- * Cloud Background Polling (https://github.com/jnunemaker/flipper/pull/682)
48
- * Changed default branch from master to main
49
- * Allow configuring railtie via ENV vars (https://github.com/jnunemaker/flipper/pull/681)
50
- * flipper-ui: Fix issue preventing feature flags being enabled when confirm_fully_enable is on and feature_removal_enabled is off (https://github.com/jnunemaker/flipper/pull/680)
51
-
52
- ## 0.25.4
53
-
54
- * Added read_only UI config option (https://github.com/jnunemaker/flipper/pull/679)
55
-
56
- ## 0.25.3
57
-
58
- * Added configurable confirm warning for fully enabling a feature (https://github.com/jnunemaker/flipper/pull/665)
59
- * Update rack protection to < 4 (https://github.com/jnunemaker/flipper/pull/675)
60
- * Check sadd_returns_boolean on the actual client class rather than ::Redis (https://github.com/jnunemaker/flipper/pull/677)
61
-
62
- ## 0.25.2
63
-
64
- * Fix deprecation warnings for Redis >= 4.8.0 (https://github.com/jnunemaker/flipper/pull/660)
65
-
66
- ## 0.25.1
67
-
68
- ### Additions/Changes
69
-
70
- * ActiveRecord: use provided `gate_class` option when calling `#get_all` (https://github.com/jnunemaker/flipper/pull/647)
71
- * Relaxed the rack-protection version to support latest (https://github.com/jnunemaker/flipper/commit/f4a41c541ccf14c535a61c6bc6fe7eeabbfc7e71).
72
- * Configure ActiveRecord adapter immediately upon require of flipper-active_record (https://github.com/jnunemaker/flipper/pull/652)
73
-
74
- ## 0.25.0
75
-
76
- ### Additions/Changes
77
-
78
- * Added a prompt in Flipper UI for the 'Delete' button to prevent accidental delete of features (https://github.com/jnunemaker/flipper/pull/625)
79
- * Added failsafe adapter (https://github.com/jnunemaker/flipper/pull/626)
80
- * 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/jnunemaker/flipper/pull/627)
81
- * ActiveRecord: base class for internal models (https://github.com/jnunemaker/flipper/pull/629)
82
- * Remove use of `Rack::BodyProxy` in the memoizer middleware (https://github.com/jnunemaker/flipper/pull/631)
83
-
84
- ## 0.24.1
85
-
86
- ### Additions/Changes
87
-
88
- * flipper-api: `exclude_gates` parameter to exclude gate data in GETs (https://github.com/jnunemaker/flipper/pull/572).
89
- * Make it possible to disable internal memoization (https://github.com/jnunemaker/flipper/pull/612).
90
- * Add Flipper::Actor#hash so actors can be hash keys (https://github.com/jnunemaker/flipper/pull/616).
91
- * Pretty Up `rails routes` again and make rack-protection dependency less strict (https://github.com/jnunemaker/flipper/pull/619).
92
- * Add kwargs for method_missing using ruby 3.0 (https://github.com/jnunemaker/flipper/pull/620).
93
- * Relax the rack-protection dependency (https://github.com/jnunemaker/flipper/commit/c1cb9cd78140c2b09123687642558101e6e5d37d).
94
-
95
- ## 0.24.0
96
-
97
- ### Additions/Changes
98
-
99
- * Add Ruby 3.0 and 3.1 to the CI matrix and fix groups block arity check for ruby 3 (https://github.com/jnunemaker/flipper/pull/601)
100
- * Removed support for Ruby 2.5 (which was end of line 9 months ago)
101
- * Add (alpha) client side instrumentation of events to cloud (https://github.com/jnunemaker/flipper/pull/602)
102
- * Fix deprecated uses of Redis#pipelined (https://github.com/jnunemaker/flipper/pull/603). redis-rb >= 3 now required.
103
- * Fix Flipper UI Rack application when `Rack::Session::Pool` is used to build it (https://github.com/jnunemaker/flipper/pull/606).
104
-
105
- ## 0.23.1
106
-
107
- ### Additions/Changes
108
-
109
- * Relax dalli version constraint (https://github.com/jnunemaker/flipper/pull/596)
110
-
111
- ### Bug Fixes
112
-
113
- * Fix railtie initialization to mount middleware after config/intializers/* (https://github.com/jnunemaker/flipper/pull/586)
114
-
115
- ## 0.23.0
116
-
117
- ### Additions/Changes
118
-
119
- * Allow some HTML in banner and descriptions (https://github.com/jnunemaker/flipper/pull/570).
120
- * Moved some cloud headers to http client (https://github.com/jnunemaker/flipper/pull/567).
121
- * Update flipper-ui jquery and bootstrap versions (https://github.com/jnunemaker/flipper/issues/565 and https://github.com/jnunemaker/flipper/pull/566).
122
- * Moved docs to www.flippercloud.io/docs (https://github.com/jnunemaker/flipper/pull/574).
123
- * PStore adapter now defaults to thread safe and no longer supports `.thread_safe` (https://github.com/jnunemaker/flipper/commit/4048704fefe41b716015294a19a0b94546637630).
124
- * Add failover adapter (https://github.com/jnunemaker/flipper/pull/584).
125
- * Improve http adapter error message (https://github.com/jnunemaker/flipper/pull/587).
126
- * Rails 7 support (mostly in https://github.com/jnunemaker/flipper/pull/592).
127
-
128
- ## 0.22.2
129
-
130
- ### Additions/Changes
131
-
132
- * Allow adding multiple actors at once in flipper-ui via comma separation (configurable via `Flipper::UI.configuration.actors_separator`) (https://github.com/jnunemaker/flipper/pull/556)
133
-
134
- ### Bug Fixes
135
-
136
- * Fix railtie initialization to avoid altering middleware order (https://github.com/jnunemaker/flipper/pull/563)
137
-
138
- ## 0.22.1
139
-
140
- ### Additions/Changes
141
-
142
- * Remove Octicons and replace with a pure CSS status circle (https://github.com/jnunemaker/flipper/pull/547)
143
- * Rescue unique errors in AR and Sequel when setting value (https://github.com/jnunemaker/flipper/commit/87f5a98bce7baad7a27b75b5bce3256967769f27)
144
- * Add a Content-Security-Policy to flipper-ui (https://github.com/jnunemaker/flipper/pull/552)
145
- * Fix Synchronizer issue that occurs for ActiveRecord adapter (https://github.com/jnunemaker/flipper/pull/554)
146
-
147
- ## 0.22.0
148
-
149
- ### Additions/Changes
150
-
151
- * Enable log subscriber by default in Rails (https://github.com/jnunemaker/flipper/pull/525)
152
- * Remove memoizer from API and UI (https://github.com/jnunemaker/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.
153
- * Fix SQL reserved word use in get_all for ActiveRecord and Sequel (https://github.com/jnunemaker/flipper/pull/536).
154
- * Handle spaces in names gracefully in UI (https://github.com/jnunemaker/flipper/pull/541).
155
-
156
- ## 0.21.0
157
-
158
- ### Additions/Changes
159
-
160
- * Default to using memory adapter (https://github.com/jnunemaker/flipper/pull/501)
161
- * Adapters now configured on require when possible (https://github.com/jnunemaker/flipper/pull/502)
162
- * 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/jnunemaker/flipper/pull/504)
163
- * Added default `flipper_id` implementation via `Flipper::Identifier` and automatically included it in ActiveRecord and Sequel models (https://github.com/jnunemaker/flipper/pull/505)
164
- * Deprecate superflous sync_method setting (https://github.com/jnunemaker/flipper/pull/511)
165
- * 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/jnunemaker/flipper/pull/506)
166
-
167
- ### Upgrading
168
-
169
- You should be able to upgrade to 0.21 without any breaking changes. However, if you want to simplify your setup, you can remove some configuration that is now handled automatically:
170
-
171
- 1. Adapters are configured when on require, so unless you are using caching or other customizations, you can remove adapter configuration.
172
-
173
- ```diff
174
- # config/initializers/flipper.rb
175
- - Flipper.configure do |config|
176
- - config.default { Flipper.new(Flipper::Adapters::ActiveRecord.new) }
177
- - end
178
- ```
179
-
180
- 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.
181
-
182
- ```diff
183
- # config/initializers/flipper.rb
184
- - Rails.configuration.middleware.use Flipper::Middleware::Memoizer,
185
- - preload: [:stats, :search, :some_feature]
186
- + Rails.application.configure do
187
- + # Uncomment to configure which features to preload on all requests
188
- + # config.flipper.preload = [:stats, :search, :some_feature]
189
- + #
190
- + # Or, you may want to disable preloading entirely:
191
- + # config.flipper.preload = false
192
- + end
193
- ```
194
-
195
- 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`.
196
-
197
- 4. When using `flipper-cloud`, The `Flipper::Cloud.app` webhook receiver is now mounted at `/_flipper` by default.
198
-
199
- ```diff
200
- # config/routes.rb
201
- - mount Flipper::Cloud.app, at: "/_flipper"
202
- ```
203
-
204
- ## 0.20.4
205
-
206
- ### Additions/Changes
207
-
208
- * Allow actors and time gates to deal with decimal percentages (https://github.com/jnunemaker/flipper/pull/492)
209
- * Change Flipper::Cloud::Middleware to receive webhooks at / in addition to /webhooks.
210
- * Add `write_through` option to ActiveSupportCacheStore adapter to support write-through caching (https://github.com/jnunemaker/flipper/pull/512)
211
-
212
- ## 0.20.3
213
-
214
- ### Additions/Changes
215
-
216
- * Changed the internal structure of how the memory adapter stores things.
217
-
218
- ## 0.20.2
219
-
220
- ### Additions/Changes
221
-
222
- * Http adapter now raises error when enable/disable/add/remove/clear fail.
223
- * Cloud adapter sends some extra info like hostname, ruby version, etc. for debugging and decision making.
224
-
225
- ## 0.20.1
226
-
227
- ### Additions/Changes
228
-
229
- * Just a minor tweak to cloud webhook middleware to provide more debugging information about why a hook wasn't successful.
230
-
231
- ## 0.20.0
232
-
233
- ### Additions/Changes
234
-
235
- * Add support for webhooks to `Flipper::Cloud` (https://github.com/jnunemaker/flipper/pull/489).
236
-
237
- ## 0.19.1
238
-
239
- ### Additions/Changes
240
-
241
- * Bump rack-protection version to < 2.2 (https://github.com/jnunemaker/flipper/pull/487)
242
- * Add memoizer_options to Flipper::Api.app (https://github.com/jnunemaker/flipper/commit/174ad4bb94046a25c432d3c53fe1ff9f5a76d838)
243
-
244
- ## 0.19.0
245
-
246
- ### Additions/Changes
247
-
248
- * 100% of actors is now considered conditional. Feature#on?, Feature#conditional?, Feature#state would all be affected. See https://github.com/jnunemaker/flipper/issues/463 for more.
249
- * Several doc updates.
250
-
251
- ## 0.18.0
252
-
253
- ### Additions/Changes
254
-
255
- * Add support for feature descriptions to flipper-ui (https://github.com/jnunemaker/flipper/pull/461).
256
- * Remove rubocop (https://github.com/jnunemaker/flipper/pull/469).
257
- * flipper-ui redesign (https://github.com/jnunemaker/flipper/pull/470).
258
- * Removed support for ruby 2.4.
259
- * Added support for ruby 2.7.
260
- * Removed support for Rails 4.x.x.
261
- * Removed support for customizing actors, groups, % of actors and % of time text in flipper-ui in favor of automatic and more descriptive text.
262
-
263
- ## 0.17.2
264
-
265
- ### Additions/Changes
266
-
267
- * Avoid errors on import when there are no features and shared specs/tests for get all with no features (https://github.com/jnunemaker/flipper/pull/441 and https://github.com/jnunemaker/flipper/pull/442)
268
- * ::ActiveRecord::RecordNotUnique > ActiveRecord::RecordNotUnique (https://github.com/jnunemaker/flipper/pull/444)
269
- * Clear gate values on enable (https://github.com/jnunemaker/flipper/pull/454)
270
- * Remove use of multi from redis adapter (https://github.com/jnunemaker/flipper/pull/451)
271
-
272
- ## 0.17.1
273
-
274
- * Fix require in flipper-active_record (https://github.com/jnunemaker/flipper/pull/437)
275
-
276
- ## 0.17.0
277
-
278
- ### Additions/Changes
279
-
280
- * Allow shorthand block notation on group types (https://github.com/jnunemaker/flipper/pull/406)
281
- * Relax active record/support constraints to support Rails 6 (https://github.com/jnunemaker/flipper/pull/409)
282
- * Allow disabling fun (https://github.com/jnunemaker/flipper/pull/413)
283
- * Include thing_value in payload of Instrumented#enable and #disable (https://github.com/jnunemaker/flipper/pull/417)
284
- * Replace Erubis with Erubi (https://github.com/jnunemaker/flipper/pull/407)
285
- * Allow customizing Rack::Protection middleware list (https://github.com/jnunemaker/flipper/pull/385)
286
- * Allow setting write_timeout for ruby 2.6+ (https://github.com/jnunemaker/flipper/pull/433)
287
- * Drop support for Ruby 2.1, 2.2, and 2.3 (https://github.com/jnunemaker/flipper/commit/cf58982e70de5e6963b018ceced4f36a275f5b5d)
288
- * Add support for Ruby 2.6 (https://github.com/jnunemaker/flipper/commit/57888311449ec81184d3d47ba9ae5cb1ad4a2f45)
289
- * Remove support for Rails 3.2 (https://github.com/jnunemaker/flipper/commit/177c48c4edf51d4e411e7c673e30e06d1c66fb40)
290
- * Add write_timeout for flipper http adapter for ruby 2.6+ (https://github.com/jnunemaker/flipper/pull/433)
291
- * Relax moneta version to allow for < 1.2 (https://github.com/jnunemaker/flipper/pull/434).
292
- * Improve active record idempotency (https://github.com/jnunemaker/flipper/pull/436).
293
- * Allow customizing add actor placeholder text (https://github.com/jnunemaker/flipper/commit/5faa1e9cf66b68f8227d2f8408fb448a14676c45)
294
-
295
- ## 0.16.2
296
-
297
- ### Additions/Changes
298
-
299
- * Bump rollout redis dependency to < 5 (https://github.com/jnunemaker/flipper/pull/403)
300
- * Bump redis dependency to < 5 (https://github.com/jnunemaker/flipper/pull/401)
301
- * Bump sequel dependency to < 6 (https://github.com/jnunemaker/flipper/pull/399 and https://github.com/jnunemaker/flipper/commit/edc767e69b4ce8daead9801f38e0e8bf6b238765)
302
-
303
- ## 0.16.1
304
-
305
- ### Additions/Changes
306
-
307
- * Add actors API endpoint (https://github.com/jnunemaker/flipper/pull/372).
308
- * Fix rack body proxy require for those using flipper without rack (https://github.com/jnunemaker/flipper/pull/376).
309
- * Unescapes feature_name in FeatureNameFromRoute (https://github.com/jnunemaker/flipper/pull/377).
310
- * Replace delete_all with destroy_all in ActiveRecord adapter (https://github.com/jnunemaker/flipper/pull/395)
311
- * Target correct bootstrap breakpoints in flipper UI (https://github.com/jnunemaker/flipper/pull/396)
312
-
313
- ## 0.16.0
314
-
315
- ### Bug Fixes
316
-
317
- * Support slashes in feature names (https://github.com/jnunemaker/flipper/pull/362).
318
-
319
- ### Additions/Changes
320
-
321
- * Re-order gates for improved performance in some cases (https://github.com/jnunemaker/flipper/pull/370).
322
- * Add Feature#exist?, DSL#exist? and Flipper#exist? (https://github.com/jnunemaker/flipper/pull/371).
323
-
324
- ## 0.15.0
325
-
326
- * Move Flipper::UI configuration options to Flipper::UI::Configuration (https://github.com/jnunemaker/flipper/pull/345).
327
- * Bug fix in adapter synchronizing and switched DSL#import to use Synchronizer (https://github.com/jnunemaker/flipper/pull/347).
328
- * Fix AR adapter table name prefix/suffix bug (https://github.com/jnunemaker/flipper/pull/350).
329
- * Allow feature names to end with "features" in UI (https://github.com/jnunemaker/flipper/pull/353).
330
-
331
- ## 0.14.0
332
-
333
- * Changed sync_interval to be seconds instead of milliseconds.
334
-
335
- ## 0.13.0
336
-
337
- ### Additions/Changes
338
-
339
- * Update PStore adapter to allow setting thread_safe option (https://github.com/jnunemaker/flipper/pull/334).
340
- * Update Flipper::UI to Bootstrap 4 (https://github.com/jnunemaker/flipper/pull/336).
341
- * Add Flipper::UI configuration to add a banner with customizeable text and background color (https://github.com/jnunemaker/flipper/pull/337).
342
- * Add sync adapter (https://github.com/jnunemaker/flipper/pull/341).
343
- * Make cloud use sync adapter (https://github.com/jnunemaker/flipper/pull/342). This makes local flipper operations resilient to cloud failures.
344
-
345
- ## 0.12.2
346
-
347
- ### Additions/Changes
348
-
349
- * Improvements/fixes/examples for rollout adapter (https://github.com/jnunemaker/flipper/pull/332).
350
-
351
- ## 0.12.1
352
-
353
- ### Additions/Changes
354
-
355
- * Added rollout adapter documentation (https://github.com/jnunemaker/flipper/pull/328).
356
-
357
- ### Bug Fixes
358
-
359
- * Fixed ActiveRecord and Sequel adapters to include disabled features for `get_all` (https://github.com/jnunemaker/flipper/pull/327).
360
-
361
- ## 0.12
362
-
363
- ### Additions/Changes
364
-
365
- * Added Flipper.instance= writer method for explicitly setting the default instance (https://github.com/jnunemaker/flipper/pull/309).
366
- * Added Flipper::UI configuration instance for changing text and things (https://github.com/jnunemaker/flipper/pull/306).
367
- * Delegate memoize= and memoizing? for Flipper and Flipper::DSL (https://github.com/jnunemaker/flipper/pull/310).
368
- * Fixed error when enabling the same group or actor more than once (https://github.com/jnunemaker/flipper/pull/313).
369
- * Fixed redis cache adapter key (and thus cache misses) (https://github.com/jnunemaker/flipper/pull/325).
370
- * Added Rollout adapter to make it easy to import rollout data into Flipper (https://github.com/jnunemaker/flipper/pull/319).
371
- * Relaxed redis gem dependency constraint to allow redis-rb 4 (https://github.com/jnunemaker/flipper/pull/317).
372
- * Added configuration option for Flipper::UI to disable feature removal (https://github.com/jnunemaker/flipper/pull/322).
373
-
374
- ## 0.11
375
-
376
- ### Backwards Compatibility Breaks
377
-
378
- * Set flipper from env for API and UI (https://github.com/jnunemaker/flipper/pull/223 and https://github.com/jnunemaker/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.
379
- * Drop support for Ruby 2.0 as it is end of lined (https://github.com/jnunemaker/flipper/commit/c2c81ed89938155ce91acb5173ac38580f630e3d).
380
- * Allow unregistered groups (https://github.com/jnunemaker/flipper/pull/244). Only break in compatibility is that previously unregistered groups could not be enabled and now they can be.
381
- * Removed support for metriks (https://github.com/jnunemaker/flipper/pull/291).
382
-
383
- ### Additions/Changes
384
-
385
- * Use primary keys with sequel adapter (https://github.com/jnunemaker/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.
386
- * Add redis cache adapter (https://github.com/jnunemaker/flipper/pull/211).
387
- * Finish API and HTTP adapter that speaks to API.
388
- * Add flipper cloud adapter (https://github.com/jnunemaker/flipper/pull/249). Nothing to see here yet, but good stuff soon. ;)
389
- * Add importing (https://github.com/jnunemaker/flipper/pull/251).
390
- * Added Adapter#get_all to allow for more efficient preload_all (https://github.com/jnunemaker/flipper/pull/255).
391
- * Added :unless option to Flipper::Middleware::Memoizer to allow skipping memoization and preloading for certain requests.
392
- * Made it possible to instrument Flipper::Cloud (https://github.com/jnunemaker/flipper/commit/4b10e4d807772202f63881f5e2c00d11ac58481f).
393
- * Made it possible to wrap Http adapter when using Flipper::Cloud (https://github.com/jnunemaker/flipper/commit/4b10e4d807772202f63881f5e2c00d11ac58481f).
394
- * Instrument get_multi in instrumented adapter (https://github.com/jnunemaker/flipper/commit/951d25c5ce07d3b56b0b2337adf5f6bcbe4050e7).
395
- * Allow instrumenting Flipper::Cloud http adapter (https://github.com/jnunemaker/flipper/pull/253).
396
- * Add DSL#preload_all and Adapter#get_all to allow for making even more efficient loading of features (https://github.com/jnunemaker/flipper/pull/255).
397
- * Allow setting debug output of http adapter (https://github.com/jnunemaker/flipper/pull/256 and https://github.com/jnunemaker/flipper/pull/258).
398
- * Allow setting env key for middleware (https://github.com/jnunemaker/flipper/pull/259).
399
- * Added ActiveSupport cache store adapter for use with Rails.cache (https://github.com/jnunemaker/flipper/pull/265 and https://github.com/jnunemaker/flipper/pull/297).
400
- * Added support for up to 3 decimal places in percentage based rollouts (https://github.com/jnunemaker/flipper/pull/274).
401
- * Removed Flipper::GroupNotRegistered error as it is now unused (https://github.com/jnunemaker/flipper/pull/270).
402
- * Added get_all to all adapters (https://github.com/jnunemaker/flipper/pull/298).
403
- * Added support for Rails 5.1 (https://github.com/jnunemaker/flipper/pull/299).
404
- * Added Flipper default instance generation (https://github.com/jnunemaker/flipper/pull/279).
405
-
406
- ## 0.10.2
407
-
408
- * Add Adapter#get_multi to allow for efficient loading of more than one feature at a time (https://github.com/jnunemaker/flipper/pull/198)
409
- * Add DSL#preload for efficiently loading several features at once using get_mutli (https://github.com/jnunemaker/flipper/pull/198)
410
- * 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/jnunemaker/flipper/pull/198)
411
- * Strip whitespace out of feature/actor/group values posted by UI (https://github.com/jnunemaker/flipper/pull/205)
412
- * 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)
413
- * 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.
414
-
415
- ## 0.10.1
416
-
417
- * Add docker compose support for contributing
418
- * Add sequel adapter
419
- * Show confirmation dialog when deleting a feature in flipper-ui
420
-
421
- ## 0.10.0
422
-
423
- * Added feature check context (https://github.com/jnunemaker/flipper/pull/158)
424
- * Do not use mass assignment for active record adapter (https://github.com/jnunemaker/flipper/pull/171)
425
- * Several documentation improvements
426
- * Make Flipper::UI.app.inspect return a String (https://github.com/jnunemaker/flipper/pull/176)
427
- * changes boolean gate route to api/v1/features/boolean (https://github.com/jnunemaker/flipper/pull/175)
428
- * add api v1 percentage_of_actors endpoint (https://github.com/jnunemaker/flipper/pull/179)
429
- * add api v1 percentage_of_time endpoint (https://github.com/jnunemaker/flipper/pull/180)
430
- * add api v1 actors gate endpoint (https://github.com/jnunemaker/flipper/pull/181)
431
- * wait for activesupport to tell us when active record is loaded for active record adapter (https://github.com/jnunemaker/flipper/pull/192)
432
-
433
- ## 0.9.2
434
-
435
- * GET /api/v1/features
436
- * POST /api/v1/features - add feature endpoint
437
- * rack-protection 2.0.0 support
438
- * pretty rake output
439
-
440
- ## 0.9.1
441
-
442
- * bump flipper-active_record to officially support rails 5
443
-
444
- ## 0.9.0
445
-
446
- * Moves SharedAdapterTests module to Flipper::Test::SharedAdapterTests to avoid clobbering anything top level in apps that use Flipper
447
- * 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.
448
- * Instrumenting adapters is now off by default. Use Flipper::Adapters::Instrumented.new(adapter) to instrument adapters and maintain the old functionality.
449
- * Added dalli cache adapter (https://github.com/jnunemaker/flipper/pull/132)
450
-
451
- ## 0.8
452
-
453
- * removed Flipper::Decorator and Flipper::Adapters::Decorator in favor of just calling methods on wrapped adapter
454
- * fix bug where certain versions of AR left off quotes for key column which caused issues with MySQL https://github.com/jnunemaker/flipper/issues/120
455
- * 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/jnunemaker/flipper/pull/122 and https://github.com/jnunemaker/flipper/pull/124)
456
- * added readonly adapter (https://github.com/jnunemaker/flipper/pull/111)
457
- * flipper groups now match for truthy values rather than explicitly only true (https://github.com/jnunemaker/flipper/issues/110)
458
- * removed gate operation instrumentation (https://github.com/jnunemaker/flipper/commit/32f14ed1fb25c64961b23c6be3dc6773143a06c8); I don't think it was useful and never found myself instrumenting it in reality
459
- * initial implementation of flipper api - very limited functionality right now (get/delete feature, boolean gate for feature) but more is on the way
460
- * made it easy to remove a feature (https://github.com/jnunemaker/flipper/pull/126)
461
- * add minitest shared tests for adapters that work the same as the shared specs for rspec (https://github.com/jnunemaker/flipper/pull/127)
462
-
463
- ## 0.7.5
464
-
465
- * support for rails 5 beta/ rack 2 alpha
466
- * fix uninitialized constant in rails generators
467
- * fix adapter test for clear to ensure that feature is not deleted, only gates
468
-
469
- ## 0.7.4
470
-
471
- * Add missing migration file to gemspec for flipper-active_record
472
-
473
- ## 0.7.3
474
-
475
- * Add Flipper ActiveRecord adapter
476
-
477
- ## 0.7.2
478
-
479
- * Add Flipper::UI.application_breadcrumb_href for setting breadcrumb back to original app from Flipper UI
480
-
481
- ## 0.7.1
482
-
483
- * Fix bug where features with names that match static file routes were incorrectly routing to the file action (https://github.com/jnunemaker/flipper/issues/80)
484
-
485
- ## 0.7
486
-
487
- * Added Flipper.groups and Flipper.group_names
488
- * Changed percentage_of_random to percentage_of_time
489
- * Added enable/disable convenience methods for all gates (enable_group, enable_actor, enable_percentage_of_actors, enable_percentage_of_time)
490
- * Added value convenience methods (boolean_value, groups_value, actors_value, etc.)
491
- * Added Feature#gate_values for getting typecast adapter gate values
492
- * Added Feature#enabled_gates and #disabled_gates for getting the gates that are enabled/disabled for the feature
493
- * Remove Feature#description
494
- * Added Flipper::Adapters::PStore
495
- * 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.
496
-
497
- UI
498
-
499
- * Totally new. Works like a charm.
500
-
501
- Mongo
502
-
503
- * Updated to latest driver (~> 2.0)
504
-
505
- ## 0.6.3
506
-
507
- * Minor bug fixes
508
-
509
- ## 0.6.2
510
-
511
- * Added Flipper.group_exists?
512
-
513
- ## 0.6.1
514
-
515
- * Added statsd support for instrumentation.
516
-
517
- ## 0.4.0
518
-
519
- * No longer use #id for detecting actors. You must now define #flipper_id on
520
- anything that you would like to behave as an actor.
521
- * Strings are now used instead of Integers for Actor identifiers. More flexible
522
- and the only reason I used Integers was to do modulo for percentage of actors.
523
- Since percentage of actors now uses hashing, integer is no longer needed.
524
- * Easy integration of instrumentation with AS::Notifications or anything similar.
525
- * A bunch of stuff around inspecting and getting names/descriptions out of
526
- things to more easily figure out what is going on.
527
- * Percentage of actors hash is now also seeded with feature name so the same
528
- actors don't get all features instantly.
3
+ All notable [changes since 1.0 are documented in GitHub Releases](https://github.com/flippercloud/flipper/releases). View [0.x Changelog](https://github.com/flippercloud/flipper/blob/v0.28.3/Changelog.md).
data/Gemfile CHANGED
@@ -6,16 +6,20 @@ Dir['flipper-*.gemspec'].each do |gemspec|
6
6
  gemspec(name: "flipper-#{plugin}", development_group: plugin)
7
7
  end
8
8
 
9
+ gem 'concurrent-ruby', '1.3.4'
10
+ gem 'connection_pool'
9
11
  gem 'debug'
10
- gem 'rake', '~> 12.3.3'
12
+ gem 'rake'
11
13
  gem 'statsd-ruby', '~> 1.2.1'
12
14
  gem 'rspec', '~> 3.0'
13
15
  gem 'rack-test'
14
- gem 'sqlite3', "~> #{ENV['SQLITE3_VERSION'] || '1.4.1'}"
15
- gem 'rails', "~> #{ENV['RAILS_VERSION'] || '7.0.0'}"
16
+ gem 'rackup', '= 1.0.0'
17
+ gem 'sqlite3', "~> #{ENV['SQLITE3_VERSION'] || '2.1.0'}"
18
+ gem 'rails', "~> #{ENV['RAILS_VERSION'] || '8.0'}"
16
19
  gem 'minitest', '~> 5.18'
17
20
  gem 'minitest-documentation'
18
- gem 'webmock', '~> 3.0'
21
+ gem 'pstore'
22
+ gem 'webmock'
19
23
  gem 'ice_age'
20
24
  gem 'redis-namespace'
21
25
  gem 'webrick'
@@ -23,10 +27,15 @@ gem 'stackprof'
23
27
  gem 'benchmark-ips'
24
28
  gem 'stackprof-webnav'
25
29
  gem 'flamegraph'
30
+ gem 'mysql2'
31
+ gem 'pg'
32
+ gem 'cuprite'
33
+ gem 'puma'
34
+ gem 'warning'
26
35
 
27
36
  group(:guard) do
28
- gem 'guard', '~> 2.15'
29
- gem 'guard-rspec', '~> 4.5'
30
- gem 'guard-bundler', '~> 2.2'
31
- gem 'rb-fsevent', '~> 0.9'
37
+ gem 'guard'
38
+ gem 'guard-rspec'
39
+ gem 'guard-bundler'
40
+ gem 'rb-fsevent'
32
41
  end