I think 1.4.1 introduced a regression here: v1.4.0...v1.4.1#diff-96a4545cdba96c81f7db7030c61b5f7a347a2a9e848b3ec81fb7806c9dc8786aR42
I have code like this in my spec setup, to just enable add the feature flags for tests:
RSpec.configure do |config|
config.before do
Rails.configuration.x.feature_flags.each { |flag| Flipper.enable(flag) }
When dependabot bumped the gem version from 1.4.0 to 1.4.1, now all the specs fail:
Flipper::Adapters::Strict::NotFound:
Could not find feature "player_search". Call `Flipper.add("player_search")` to create it.
# ./vendor/bundler/ruby/4.0.0/gems/flipper-1.4.1/lib/flipper/adapters/strict.rb:69:in 'Flipper::Adapters::Strict#assert_feature_exists'
# ./vendor/bundler/ruby/4.0.0/gems/flipper-1.4.1/lib/flipper/adapters/strict.rb:43:in 'Flipper::Adapters::Strict#add'
Following the error message, I updated my code to this:
Rails.configuration.x.feature_flags.each do |flag|
Flipper.add(flag.to_s)
Flipper.enable(flag.to_s)
end
But I get the same error, for the same thing, on the line where I'm doing the add. Looking at the change linked above, it seems like the .add method was implemented on Strict, informing the user they need to call Flipper.add before they can call Flipper.add.
Either the message needs to be updated, or that change to the add method needs to be reverted, since its not clear how to add features if you can't add them. The commit message talks about "sync mode", but its not documented outside that comment, that I can tell.
I fixed it like this, but this feels like I'm digging into flipper internals that I shouldn't be:
RSpec.configure do |config|
config.before do
Flipper::Adapters::Strict.with_sync_mode do
Rails.configuration.x.feature_flags.each do |flag|
Flipper.add(flag.to_s)
Flipper.enable(flag.to_s)
end
end
end
end
I think 1.4.1 introduced a regression here: v1.4.0...v1.4.1#diff-96a4545cdba96c81f7db7030c61b5f7a347a2a9e848b3ec81fb7806c9dc8786aR42
I have code like this in my spec setup, to just enable add the feature flags for tests:
When dependabot bumped the gem version from 1.4.0 to 1.4.1, now all the specs fail:
Following the error message, I updated my code to this:
But I get the same error, for the same thing, on the line where I'm doing the
add. Looking at the change linked above, it seems like the.addmethod was implemented on Strict, informing the user they need to callFlipper.addbefore they can callFlipper.add.Either the message needs to be updated, or that change to the
addmethod needs to be reverted, since its not clear how to add features if you can't add them. The commit message talks about "sync mode", but its not documented outside that comment, that I can tell.I fixed it like this, but this feels like I'm digging into flipper internals that I shouldn't be: