flipper 0.22.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5ccee45a49e10626a3168f1d4ac5b833a7a353be908044a9e056a8a38977e11
4
- data.tar.gz: e4835d28c5db82466369bd78a002454c882e1c731ff171e352bbee3b53df1102
3
+ metadata.gz: 14514238ff1ea823df0cefeb2e1048816b86995d582e6c3dda037d36db344078
4
+ data.tar.gz: 285650a29a45623ed0468a08736621ccf88a6453eeadd8f42a29740a4a2955bc
5
5
  SHA512:
6
- metadata.gz: efc365c24401b44a56f0c3818dd3d85868b89859ec22ee9119e3ac2764043a90d966d5a4a079e3aab231f07df017017cea09ab1f351edcdaa90a97837ee38614
7
- data.tar.gz: 42e748dfb24633faca15dde30f1062b349e29c72bbf014382a22a9ad06cea214ea4fa679fc5e69d4e4b8e259a1c98863e9a29bf1f302fcee319a3729f8ee85a5
6
+ metadata.gz: 3af99a75cafb349025fd03a6c2bab4bb224f76acd2a0ac820bf6306ded28235b615fc0f891ce8d3df7612eca26d631fc7a51fb6ee738fdfdb614a561b121af04
7
+ data.tar.gz: bbaa9c0da5be73f4d1ab4ebc284919585878162e2c0151e346d77ad6909fddff7d0da7eff823ad29281d645e521d53e21f1de9184efda072e90e919d465a2c48
@@ -51,8 +51,3 @@ jobs:
51
51
  run: |
52
52
  bundle install --jobs 4 --retry 3
53
53
  bundle exec rake
54
- - name: Run Examples with Rails ${{ matrix.rails }}
55
- env:
56
- FLIPPER_CLOUD_TOKEN: ${{ secrets.FLIPPER_CLOUD_TOKEN }}
57
- RAILS_VERSION: ${{ matrix.rails }}
58
- run: script/examples
@@ -0,0 +1,56 @@
1
+ name: Examples
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ name: Test on ruby ${{ matrix.ruby }} and rails ${{ matrix.rails }}
6
+ runs-on: ubuntu-latest
7
+ services:
8
+ redis:
9
+ image: redis
10
+ ports: ['6379:6379']
11
+ options: >-
12
+ --health-cmd "redis-cli ping"
13
+ --health-interval 10s
14
+ --health-timeout 5s
15
+ --health-retries 5
16
+ strategy:
17
+ matrix:
18
+ ruby: ['2.5', '2.6', '2.7']
19
+ rails: ['5.2', '6.0.0', '6.1.0']
20
+ env:
21
+ SQLITE3_VERSION: 1.4.1
22
+ REDIS_URL: redis://localhost:6379/0
23
+ CI: true
24
+ steps:
25
+ - name: Setup memcached
26
+ uses: KeisukeYamashita/memcached-actions@v1
27
+ - name: Start MongoDB
28
+ uses: supercharge/mongodb-github-action@1.3.0
29
+ with:
30
+ mongodb-version: 4.0
31
+ - name: Check out repository code
32
+ uses: actions/checkout@v2
33
+ - name: Do some action caching
34
+ uses: actions/cache@v1
35
+ with:
36
+ path: vendor/bundle
37
+ key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.rails }}-${{ hashFiles('**/Gemfile.lock') }}
38
+ restore-keys: |
39
+ ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.rails }}-
40
+ - name: Set up Ruby ${{ matrix.ruby }}
41
+ uses: actions/setup-ruby@v1
42
+ with:
43
+ ruby-version: ${{ matrix.ruby }}
44
+ - name: Install libpq-dev
45
+ run: sudo apt-get -yqq install libpq-dev
46
+ - name: Install bundler
47
+ run: gem install bundler
48
+ - name: Bundle install with Rails ${{ matrix.rails }}
49
+ env:
50
+ RAILS_VERSION: ${{ matrix.rails }}
51
+ run: bundle install --jobs 4 --retry 3
52
+ - name: Run Examples with Rails ${{ matrix.rails }}
53
+ env:
54
+ FLIPPER_CLOUD_TOKEN: ${{ secrets.FLIPPER_CLOUD_TOKEN }}
55
+ RAILS_VERSION: ${{ matrix.rails }}
56
+ run: script/examples
data/Changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 0.22.1
2
+
3
+ ## Additions/Changes
4
+
5
+ * Remove Octicons and replace with a pure CSS status circle (https://github.com/jnunemaker/flipper/pull/547)
6
+ * Rescue unique errors in AR and Sequel when setting value (https://github.com/jnunemaker/flipper/commit/87f5a98bce7baad7a27b75b5bce3256967769f27)
7
+ * Add a Content-Security-Policy to flipper-ui (https://github.com/jnunemaker/flipper/pull/552)
8
+ * Fix Synchronizer issue that occurs for ActiveRecord adapter (https://github.com/jnunemaker/flipper/pull/554)
9
+
1
10
  ## 0.22.0
2
11
 
3
12
  ## Additions/Changes
data/docker-compose.yml CHANGED
@@ -1,34 +1,37 @@
1
- # postgres:
2
- # container_name: flipper_postgres
3
- # image: postgres:9.4
4
- redis:
5
- container_name: flipper_redis
6
- image: redis:2.8
7
- mongo:
8
- container_name: flipper_mongo
9
- image: mongo:3.3
10
- memcached:
11
- container_name: flipper_memcached
12
- image: memcached:1.4.33
13
- app:
14
- container_name: flipper_app
15
- build: .
16
- dockerfile: Dockerfile
17
- volumes:
18
- - .:/srv/app
19
- volumes_from:
20
- - bundle_cache
21
- links:
22
- # - postgres
23
- - redis
24
- - mongo
25
- - memcached
26
- environment:
27
- - REDIS_URL=redis://redis:6379
28
- - MONGODB_HOST=mongo
29
- - MEMCACHED_URL=memcached:11211
30
- bundle_cache:
31
- container_name: flipper_bundle_cache
32
- image: busybox
33
- volumes:
34
- - /bundle_cache
1
+ version: "2.4"
2
+ services:
3
+ # postgres:
4
+ # container_name: flipper_postgres
5
+ # image: postgres:9.4
6
+ redis:
7
+ container_name: flipper_redis
8
+ image: redis:6.2.5
9
+ mongo:
10
+ container_name: flipper_mongo
11
+ image: mongo:4.4.8
12
+ memcached:
13
+ container_name: flipper_memcached
14
+ image: memcached:1.4.33
15
+ app:
16
+ container_name: flipper_app
17
+ build:
18
+ context: .
19
+ dockerfile: Dockerfile
20
+ volumes:
21
+ - .:/srv/app
22
+ volumes_from:
23
+ - bundle_cache
24
+ links:
25
+ # - postgres
26
+ - redis
27
+ - mongo
28
+ - memcached
29
+ environment:
30
+ - REDIS_URL=redis://redis:6379
31
+ - MONGODB_HOST=mongo
32
+ - MEMCACHED_URL=memcached:11211
33
+ bundle_cache:
34
+ container_name: flipper_bundle_cache
35
+ image: busybox
36
+ volumes:
37
+ - /bundle_cache
@@ -0,0 +1,37 @@
1
+ # Quick example of how to keep track of when a feature was last checked.
2
+ require 'bundler/setup'
3
+ require 'securerandom'
4
+ require 'active_support/notifications'
5
+ require 'flipper'
6
+
7
+ class FlipperSubscriber
8
+ def self.stats
9
+ @stats ||= {}
10
+ end
11
+
12
+ def call(name, start, finish, id, payload)
13
+ if payload[:operation] == :enabled?
14
+ feature_name = payload.fetch(:feature_name)
15
+ self.class.stats[feature_name] = Time.now
16
+ end
17
+ end
18
+
19
+ ActiveSupport::Notifications.subscribe(/feature_operation.flipper/, new)
20
+ end
21
+
22
+ Flipper.configure do |config|
23
+ config.default {
24
+ Flipper.new(config.adapter, instrumenter: ActiveSupport::Notifications)
25
+ }
26
+ end
27
+
28
+ Flipper.enabled?(:search)
29
+ Flipper.enabled?(:booyeah)
30
+ Flipper.enabled?(:hooray)
31
+ sleep 1
32
+ Flipper.enabled?(:booyeah)
33
+ Flipper.enabled?(:hooray)
34
+ sleep 1
35
+ Flipper.enabled?(:hooray)
36
+
37
+ pp FlipperSubscriber.stats
@@ -37,7 +37,8 @@ module Flipper
37
37
  # Sync all the gate values.
38
38
  remote_get_all.each do |feature_key, remote_gates_hash|
39
39
  feature = Feature.new(feature_key, @local)
40
- local_gates_hash = local_get_all[feature_key] || @local.default_config
40
+ # Check if feature_key is in hash before accessing to prevent unintended hash modification
41
+ local_gates_hash = local_get_all.key?(feature_key) ? local_get_all[feature_key] : @local.default_config
41
42
  local_gate_values = GateValues.new(local_gates_hash)
42
43
  remote_gate_values = GateValues.new(remote_gates_hash)
43
44
  FeatureSynchronizer.new(feature, local_gate_values, remote_gate_values).call
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.22.1'.freeze
3
3
  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: 0.22.0
4
+ version: 0.22.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: 2021-07-08 00:00:00.000000000 Z
11
+ date: 2021-08-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".codeclimate.yml"
21
21
  - ".github/workflows/ci.yml"
22
+ - ".github/workflows/examples.yml"
22
23
  - CODE_OF_CONDUCT.md
23
24
  - Changelog.md
24
25
  - Dockerfile
@@ -50,6 +51,7 @@ files:
50
51
  - examples/importing.rb
51
52
  - examples/individual_actor.rb
52
53
  - examples/instrumentation.rb
54
+ - examples/instrumentation_last_accessed_at.rb
53
55
  - examples/memoizing.rb
54
56
  - examples/percentage_of_actors.rb
55
57
  - examples/percentage_of_actors_enabled_check.rb