flipper 1.0.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/.github/FUNDING.yml +1 -0
- data/.github/workflows/ci.yml +7 -3
- data/.github/workflows/examples.yml +27 -5
- data/Changelog.md +326 -272
- data/Gemfile +4 -4
- data/README.md +13 -11
- data/benchmark/typecast_ips.rb +8 -0
- data/docs/images/flipper_cloud.png +0 -0
- data/examples/cloud/backoff_policy.rb +13 -0
- data/examples/cloud/cloud_setup.rb +16 -0
- data/examples/cloud/forked.rb +7 -2
- data/examples/cloud/threaded.rb +15 -18
- data/examples/expressions.rb +213 -0
- data/examples/strict.rb +18 -0
- data/flipper.gemspec +1 -2
- data/lib/flipper/actor.rb +6 -3
- data/lib/flipper/adapter.rb +10 -0
- data/lib/flipper/adapter_builder.rb +44 -0
- data/lib/flipper/adapters/dual_write.rb +1 -3
- data/lib/flipper/adapters/failover.rb +0 -4
- data/lib/flipper/adapters/failsafe.rb +0 -4
- data/lib/flipper/adapters/http/client.rb +26 -7
- data/lib/flipper/adapters/http/error.rb +1 -1
- data/lib/flipper/adapters/http.rb +18 -13
- data/lib/flipper/adapters/instrumented.rb +0 -4
- data/lib/flipper/adapters/memoizable.rb +14 -19
- data/lib/flipper/adapters/memory.rb +4 -6
- data/lib/flipper/adapters/operation_logger.rb +0 -4
- data/lib/flipper/adapters/poll.rb +1 -3
- data/lib/flipper/adapters/pstore.rb +17 -11
- data/lib/flipper/adapters/read_only.rb +4 -4
- data/lib/flipper/adapters/strict.rb +47 -0
- data/lib/flipper/adapters/sync/feature_synchronizer.rb +10 -1
- data/lib/flipper/adapters/sync.rb +0 -4
- data/lib/flipper/cloud/configuration.rb +121 -52
- data/lib/flipper/cloud/telemetry/backoff_policy.rb +93 -0
- data/lib/flipper/cloud/telemetry/instrumenter.rb +26 -0
- data/lib/flipper/cloud/telemetry/metric.rb +39 -0
- data/lib/flipper/cloud/telemetry/metric_storage.rb +30 -0
- data/lib/flipper/cloud/telemetry/submitter.rb +98 -0
- data/lib/flipper/cloud/telemetry.rb +183 -0
- data/lib/flipper/configuration.rb +25 -4
- data/lib/flipper/dsl.rb +51 -0
- data/lib/flipper/engine.rb +27 -3
- data/lib/flipper/exporters/json/export.rb +1 -1
- data/lib/flipper/exporters/json/v1.rb +1 -1
- data/lib/flipper/expression/builder.rb +73 -0
- data/lib/flipper/expression/constant.rb +25 -0
- data/lib/flipper/expression.rb +71 -0
- data/lib/flipper/expressions/all.rb +11 -0
- data/lib/flipper/expressions/any.rb +9 -0
- data/lib/flipper/expressions/boolean.rb +9 -0
- data/lib/flipper/expressions/comparable.rb +13 -0
- data/lib/flipper/expressions/duration.rb +28 -0
- data/lib/flipper/expressions/equal.rb +9 -0
- data/lib/flipper/expressions/greater_than.rb +9 -0
- data/lib/flipper/expressions/greater_than_or_equal_to.rb +9 -0
- data/lib/flipper/expressions/less_than.rb +9 -0
- data/lib/flipper/expressions/less_than_or_equal_to.rb +9 -0
- data/lib/flipper/expressions/not_equal.rb +9 -0
- data/lib/flipper/expressions/now.rb +9 -0
- data/lib/flipper/expressions/number.rb +9 -0
- data/lib/flipper/expressions/percentage.rb +9 -0
- data/lib/flipper/expressions/percentage_of_actors.rb +12 -0
- data/lib/flipper/expressions/property.rb +9 -0
- data/lib/flipper/expressions/random.rb +9 -0
- data/lib/flipper/expressions/string.rb +9 -0
- data/lib/flipper/expressions/time.rb +9 -0
- data/lib/flipper/feature.rb +55 -0
- data/lib/flipper/gate.rb +1 -0
- data/lib/flipper/gate_values.rb +5 -2
- data/lib/flipper/gates/expression.rb +75 -0
- data/lib/flipper/instrumentation/statsd_subscriber.rb +2 -4
- data/lib/flipper/middleware/memoizer.rb +29 -13
- data/lib/flipper/model/active_record.rb +23 -0
- data/lib/flipper/poller.rb +1 -1
- data/lib/flipper/serializers/gzip.rb +24 -0
- data/lib/flipper/serializers/json.rb +19 -0
- data/lib/flipper/spec/shared_adapter_specs.rb +29 -11
- data/lib/flipper/test/shared_adapter_test.rb +24 -5
- data/lib/flipper/typecast.rb +34 -6
- data/lib/flipper/types/percentage.rb +1 -1
- data/lib/flipper/version.rb +1 -1
- data/lib/flipper.rb +38 -1
- data/spec/flipper/adapter_builder_spec.rb +73 -0
- data/spec/flipper/adapter_spec.rb +1 -0
- data/spec/flipper/adapters/http_spec.rb +39 -5
- data/spec/flipper/adapters/memoizable_spec.rb +15 -15
- data/spec/flipper/adapters/read_only_spec.rb +26 -11
- data/spec/flipper/adapters/strict_spec.rb +62 -0
- data/spec/flipper/adapters/sync/feature_synchronizer_spec.rb +27 -0
- data/spec/flipper/cloud/configuration_spec.rb +6 -23
- data/spec/flipper/cloud/telemetry/backoff_policy_spec.rb +108 -0
- data/spec/flipper/cloud/telemetry/metric_spec.rb +87 -0
- data/spec/flipper/cloud/telemetry/metric_storage_spec.rb +58 -0
- data/spec/flipper/cloud/telemetry/submitter_spec.rb +145 -0
- data/spec/flipper/cloud/telemetry_spec.rb +156 -0
- data/spec/flipper/cloud_spec.rb +12 -12
- data/spec/flipper/configuration_spec.rb +17 -0
- data/spec/flipper/dsl_spec.rb +39 -0
- data/spec/flipper/engine_spec.rb +108 -7
- data/spec/flipper/exporters/json/v1_spec.rb +3 -3
- data/spec/flipper/expression/builder_spec.rb +248 -0
- data/spec/flipper/expression_spec.rb +188 -0
- data/spec/flipper/expressions/all_spec.rb +15 -0
- data/spec/flipper/expressions/any_spec.rb +15 -0
- data/spec/flipper/expressions/boolean_spec.rb +15 -0
- data/spec/flipper/expressions/duration_spec.rb +43 -0
- data/spec/flipper/expressions/equal_spec.rb +24 -0
- data/spec/flipper/expressions/greater_than_or_equal_to_spec.rb +28 -0
- data/spec/flipper/expressions/greater_than_spec.rb +28 -0
- data/spec/flipper/expressions/less_than_or_equal_to_spec.rb +28 -0
- data/spec/flipper/expressions/less_than_spec.rb +32 -0
- data/spec/flipper/expressions/not_equal_spec.rb +15 -0
- data/spec/flipper/expressions/now_spec.rb +11 -0
- data/spec/flipper/expressions/number_spec.rb +21 -0
- data/spec/flipper/expressions/percentage_of_actors_spec.rb +20 -0
- data/spec/flipper/expressions/percentage_spec.rb +15 -0
- data/spec/flipper/expressions/property_spec.rb +13 -0
- data/spec/flipper/expressions/random_spec.rb +9 -0
- data/spec/flipper/expressions/string_spec.rb +11 -0
- data/spec/flipper/expressions/time_spec.rb +13 -0
- data/spec/flipper/feature_spec.rb +360 -1
- data/spec/flipper/gate_values_spec.rb +2 -2
- data/spec/flipper/gates/expression_spec.rb +108 -0
- data/spec/flipper/identifier_spec.rb +4 -5
- data/spec/flipper/instrumentation/statsd_subscriber_spec.rb +15 -1
- data/spec/flipper/middleware/memoizer_spec.rb +67 -0
- data/spec/flipper/model/active_record_spec.rb +61 -0
- data/spec/flipper/serializers/gzip_spec.rb +13 -0
- data/spec/flipper/serializers/json_spec.rb +13 -0
- data/spec/flipper/typecast_spec.rb +43 -7
- data/spec/flipper/types/actor_spec.rb +18 -1
- data/spec/flipper_integration_spec.rb +102 -4
- data/spec/flipper_spec.rb +89 -1
- data/spec/spec_helper.rb +5 -0
- data/spec/support/actor_names.yml +1 -0
- data/spec/support/fake_backoff_policy.rb +15 -0
- data/spec/support/spec_helpers.rb +11 -3
- metadata +107 -18
- data/lib/flipper/cloud/instrumenter.rb +0 -48
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/.github/FUNDING.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
github: flippercloud
|
data/.github/workflows/ci.yml
CHANGED
@@ -16,10 +16,14 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
matrix:
|
18
18
|
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
19
|
-
rails: ['5.2', '6.0.0', '6.1.0', '7.0.0']
|
19
|
+
rails: ['5.2', '6.0.0', '6.1.0', '7.0.0', '7.1.0']
|
20
20
|
exclude:
|
21
|
+
- ruby: "2.6"
|
22
|
+
rails: "7.1.0"
|
21
23
|
- ruby: "2.6"
|
22
24
|
rails: "7.0.0"
|
25
|
+
- ruby: "2.7"
|
26
|
+
rails: "7.1.0"
|
23
27
|
- ruby: "3.0"
|
24
28
|
rails: "5.2"
|
25
29
|
- ruby: "3.1"
|
@@ -41,11 +45,11 @@ jobs:
|
|
41
45
|
- name: Setup memcached
|
42
46
|
uses: KeisukeYamashita/memcached-actions@v1
|
43
47
|
- name: Start MongoDB
|
44
|
-
uses: supercharge/mongodb-github-action@
|
48
|
+
uses: supercharge/mongodb-github-action@v1.10.0
|
45
49
|
with:
|
46
50
|
mongodb-version: 4.0
|
47
51
|
- name: Check out repository code
|
48
|
-
uses: actions/checkout@
|
52
|
+
uses: actions/checkout@v4
|
49
53
|
- name: Do some action caching
|
50
54
|
uses: actions/cache@v3
|
51
55
|
with:
|
@@ -16,18 +16,27 @@ jobs:
|
|
16
16
|
--health-retries 5
|
17
17
|
strategy:
|
18
18
|
matrix:
|
19
|
-
ruby: ['2.6', '2.7', '3.0', '3.1']
|
20
|
-
rails: ['5.2', '6.0.0', '6.1.0', '7.0.0']
|
19
|
+
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
20
|
+
rails: ['5.2', '6.0.0', '6.1.0', '7.0.0', '7.1.0']
|
21
21
|
exclude:
|
22
|
+
- ruby: "2.6"
|
23
|
+
rails: "7.1.0"
|
22
24
|
- ruby: "2.6"
|
23
25
|
rails: "7.0.0"
|
26
|
+
- ruby: "2.7"
|
27
|
+
rails: "7.1.0"
|
24
28
|
- ruby: "3.0"
|
25
29
|
rails: "5.2"
|
26
30
|
- ruby: "3.1"
|
27
31
|
rails: "5.2"
|
28
32
|
- ruby: "3.1"
|
29
33
|
rails: "6.0.0"
|
30
|
-
|
34
|
+
- ruby: "3.2"
|
35
|
+
rails: "5.2"
|
36
|
+
- ruby: "3.2"
|
37
|
+
rails: "6.0.0"
|
38
|
+
- ruby: "3.2"
|
39
|
+
rails: "6.1.0"
|
31
40
|
env:
|
32
41
|
SQLITE3_VERSION: 1.4.1
|
33
42
|
REDIS_URL: redis://localhost:6379/0
|
@@ -37,11 +46,11 @@ jobs:
|
|
37
46
|
- name: Setup memcached
|
38
47
|
uses: KeisukeYamashita/memcached-actions@v1
|
39
48
|
- name: Start MongoDB
|
40
|
-
uses: supercharge/mongodb-github-action@
|
49
|
+
uses: supercharge/mongodb-github-action@v1.10.0
|
41
50
|
with:
|
42
51
|
mongodb-version: 4.0
|
43
52
|
- name: Check out repository code
|
44
|
-
uses: actions/checkout@
|
53
|
+
uses: actions/checkout@v4
|
45
54
|
- name: Do some action caching
|
46
55
|
uses: actions/cache@v3
|
47
56
|
with:
|
@@ -59,4 +68,17 @@ jobs:
|
|
59
68
|
- name: Run Examples with Rails ${{ matrix.rails }}
|
60
69
|
env:
|
61
70
|
FLIPPER_CLOUD_TOKEN: ${{ secrets.FLIPPER_CLOUD_TOKEN }}
|
71
|
+
FLIPPER_CLOUD_TOKEN_26_52: ${{ secrets.FLIPPER_CLOUD_TOKEN_26_52 }}
|
72
|
+
FLIPPER_CLOUD_TOKEN_26_60: ${{ secrets.FLIPPER_CLOUD_TOKEN_26_60 }}
|
73
|
+
FLIPPER_CLOUD_TOKEN_26_61: ${{ secrets.FLIPPER_CLOUD_TOKEN_26_61 }}
|
74
|
+
FLIPPER_CLOUD_TOKEN_27_52: ${{ secrets.FLIPPER_CLOUD_TOKEN_27_52 }}
|
75
|
+
FLIPPER_CLOUD_TOKEN_27_60: ${{ secrets.FLIPPER_CLOUD_TOKEN_27_60 }}
|
76
|
+
FLIPPER_CLOUD_TOKEN_27_61: ${{ secrets.FLIPPER_CLOUD_TOKEN_27_61 }}
|
77
|
+
FLIPPER_CLOUD_TOKEN_27_70: ${{ secrets.FLIPPER_CLOUD_TOKEN_27_70 }}
|
78
|
+
FLIPPER_CLOUD_TOKEN_30_60: ${{ secrets.FLIPPER_CLOUD_TOKEN_30_60 }}
|
79
|
+
FLIPPER_CLOUD_TOKEN_30_61: ${{ secrets.FLIPPER_CLOUD_TOKEN_30_61 }}
|
80
|
+
FLIPPER_CLOUD_TOKEN_30_70: ${{ secrets.FLIPPER_CLOUD_TOKEN_30_70 }}
|
81
|
+
FLIPPER_CLOUD_TOKEN_31_61: ${{ secrets.FLIPPER_CLOUD_TOKEN_31_61 }}
|
82
|
+
FLIPPER_CLOUD_TOKEN_31_70: ${{ secrets.FLIPPER_CLOUD_TOKEN_31_70 }}
|
83
|
+
RAILS_VERSION: ${{ matrix.rails }}
|
62
84
|
run: script/examples
|