mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Merge pull request #12111 from openfoodfoundation/dependabot/bundler/flipper-and-flipper-active_record-and-flipper-ui-1.2.2
chore(deps): bump flipper, flipper-active_record and flipper-ui
This commit is contained in:
14
Gemfile.lock
14
Gemfile.lock
@@ -286,15 +286,15 @@ GEM
|
||||
websocket-driver (>= 0.6, < 0.8)
|
||||
ffaker (2.23.0)
|
||||
ffi (1.16.3)
|
||||
flipper (0.26.2)
|
||||
flipper (1.2.2)
|
||||
concurrent-ruby (< 2)
|
||||
flipper-active_record (0.26.2)
|
||||
flipper-active_record (1.2.2)
|
||||
activerecord (>= 4.2, < 8)
|
||||
flipper (~> 0.26.2)
|
||||
flipper-ui (0.26.2)
|
||||
flipper (~> 1.2.2)
|
||||
flipper-ui (1.2.2)
|
||||
erubi (>= 1.0.0, < 2.0.0)
|
||||
flipper (~> 0.26.2)
|
||||
rack (>= 1.4, < 3)
|
||||
flipper (~> 1.2.2)
|
||||
rack (>= 1.4, < 4)
|
||||
rack-protection (>= 1.5.3, <= 4.0.0)
|
||||
sanitize (< 7)
|
||||
fog-aws (2.0.1)
|
||||
@@ -686,7 +686,7 @@ GEM
|
||||
rubyzip (2.3.2)
|
||||
rufus-scheduler (3.8.2)
|
||||
fugit (~> 1.1, >= 1.1.6)
|
||||
sanitize (6.0.2)
|
||||
sanitize (6.1.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.12.0)
|
||||
sass (3.4.25)
|
||||
|
||||
@@ -2,8 +2,23 @@ require "flipper"
|
||||
require "flipper/adapters/active_record"
|
||||
require "open_food_network/feature_toggle"
|
||||
|
||||
Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? }
|
||||
Rails.application.configure do
|
||||
# Disable Flipper's built-in test helper.
|
||||
# It fails in CI and feature don't get activated.
|
||||
config.flipper.test_help = false
|
||||
end
|
||||
|
||||
Flipper.configure do |flipper|
|
||||
# Still use recommended test setup with faster memory adapter:
|
||||
if Rails.env.test?
|
||||
# Use a shared Memory adapter for all tests. The adapter is instantiated
|
||||
# outside of the block so the same instance is returned in new threads.
|
||||
adapter = Flipper::Adapters::Memory.new
|
||||
flipper.adapter { adapter }
|
||||
end
|
||||
end
|
||||
|
||||
Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? }
|
||||
Flipper::UI.configure do |config|
|
||||
config.descriptions_source = ->(_keys) do
|
||||
# return has to be hash of {String key => String description}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ChangeFlipperGatesValueToText < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
# Ensure this incremental update migration is idempotent
|
||||
return unless connection.column_exists? :flipper_gates, :value, :string
|
||||
|
||||
if index_exists? :flipper_gates, [:feature_key, :key, :value]
|
||||
remove_index :flipper_gates, [:feature_key, :key, :value]
|
||||
end
|
||||
change_column :flipper_gates, :value, :text
|
||||
add_index :flipper_gates, [:feature_key, :key, :value], unique: true, length: { value: 255 }
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :flipper_gates, :value, :string
|
||||
end
|
||||
end
|
||||
@@ -282,7 +282,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_04_30_075133) do
|
||||
create_table "flipper_gates", id: :serial, force: :cascade do |t|
|
||||
t.string "feature_key", null: false
|
||||
t.string "key", null: false
|
||||
t.string "value"
|
||||
t.text "value"
|
||||
t.datetime "created_at", precision: nil, null: false
|
||||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.index ["feature_key", "key", "value"], name: "index_flipper_gates_on_feature_key_and_key_and_value", unique: true
|
||||
|
||||
@@ -102,7 +102,7 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
# Reset all feature toggles to prevent leaking.
|
||||
config.before(:suite) do
|
||||
config.before(:each) do
|
||||
Flipper.features.each(&:remove)
|
||||
OpenFoodNetwork::FeatureToggle.setup!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user