voormedia / flipflop Goto Github PK
View Code? Open in Web Editor NEWFlipflop lets you declare and manage feature flags in your Rails application.
License: MIT License
Flipflop lets you declare and manage feature flags in your Rails application.
License: MIT License
Hi !
First, congrats for this great library, it's super nice and very useful to us.
We wanted to add a feature and use it in an initializer (our use case: to be able to toggle Rails.application.config.content_security_policy_report_only
without doing a deployment, because content-security-policy headers are error-prone and we may need to quickly disable them, despite extensive tests)
It seem not to be possible, because of the boot order: config/features.rb
is loaded after anything in config/initializers
(or config/environments
). Did I understand the problem correctly ? Is there any chance to be able to use Flipflop during the initialization ?
Thanks !
It would be nice if we can do:
Flipflop.configure do
group :ui_improvements do
feature :widget_redesign
feature :sidebar_reimplementation
end
end
Grouping can lead to a clearer overview on the dashboard with a non-trivial amount of features.
Hello!
My team uses flipflop
for our project and today we noticed rake tasks are not available in our app (we get Don't know how to build task 'flipflop:features' (See the list of available tasks with "rake --tasks")
), everything else is working as expected. In our case it's just rather standard Rails app (with Rails 5.2.6
version used). Anyone else noticed the same problem? Seems we don't use any extra customisation that would cause such regression.
I'm not using ActiveRecord, but rather Sequel. I have implemented a SequelStrategy
which I'd be happy to share. I'd be fine simply disabling the Flipflop::Feature class totally or just removing the AR dependency, whichever is easier. I'm not even using this class.
2016-05-04T00:25:31.445373+00:00 app[web.1]: [3] ! Unable to load application: NameError: uninitialized constant ActiveRecord
2016-05-04T00:25:31.446144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/flipflop-2.2.0/app/models/flipflop/feature.rb:1:in `<top (required)>': uninitialized constant ActiveRecord (NameError)
Today's release of v2.3.2 introduces new explict raises to public method signatures. This is causing breaking builds on downstream dependencies with
Flipflop::FeatureError:
Feature '123' unknown.
In my case, this only seems to be impacting tests that explicitly pass dummy data to FlipFlop
methods, but I thought I'd report it as an unexpected breakage.
Perhaps 2.3.2 could have been 2.4.0 (or 3.0.0)?
In following the snippet for setting the testing strategy
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:world_domination, true)
When a capybara spec runs, flipflop still reads from the database and gets the previous value of the feature.
Is there a way to programmatically set the value of the feature without switching to test mode?
On the feature page the enabled badge's background color is #5cb85c has insufficient contrast with the foreground color (2.48:1) and fails WCAG 2.0 levels AA (4.5:1) and AAA (7:1) contrast standards.
The background color should be changed to increase contrast:
A value of #238637 (4.63) would meet AA and #036600 (7.23:1) would meet AA and AAA.
There are currently 34 builds (โ) in the matrix. Can we remove Rails 4.0 and Rails 4.1? They are no longer supported by the Rails core team. Do you know of anyone who has requested that flipflop be tested on those platforms?
Could you do a new release to include a6e639c?
Thanks
I'm trying to understand how to programmatically override a feature flag. My use case is that in development i'd like certain features to always be on (Not using the UI).
During test, we have accomplished this using the config shown in the readme:
test_strategy = Flipflop::FeatureSet.current.test!
test_strategy.switch!(:world_domination, true)
But there doesn't seem to be any other available strategies to switch features at runtime (in dev, acceptance, etc). Looking at how the Flipflop UI does it, it looks like there is some cache manipulation happening along side the actual manipulation of the status, so I didn't want to duplicate that code in my codebase.
Is there a recommended way of doing this that i'm missing?
where getting the following error every now and then when a strategy is turned off.
Flipflop::StrategyError: Strategy '<UUID>' unknown.
Backtrace includes:
/gems/flipflop-2.2.1/app/controllers/flipflop/strategies_controller.rb:26 in strategy
/gems/flipflop-2.2.1/app/controllers/flipflop/strategies_controller.rb:6 in update
This is pretty ambiguous.
flipflop version is 2.2.1
rails version is 5.1.4
51cc858#diff-50f28c8e6f2ebbc297d52daa88bac730
Maybe we should do like rails and Type::Boolean.new.cast(params[:commit])
?
See https://github.com/rails/rails/blob/v5.0.2/activemodel/lib/active_model/type/boolean.rb
Hello,
I see in the documentation for custom strategies that can only check features if we have the user's session. The problem with that is that the current user is not always obtain the same way in different parts of a application (API token, sso, session) and I would like to have an option to pass the current_user object directly like:
def enabled?(feature, current_user)
current_user.enabled_features[feature]
end
How could do it do something like this possible?
They are failing just trying to install rbx with:
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
Gemset '' does not exist, 'rvm rbx-head do rvm gemset create ' first, or append '--create'.
Can we drop them from the test matrix since they do nothing useful?
flipflop at /home/travis/build/voormedia/flipflop did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
["src/stylesheets/flipflop.css"] are not files
Hello, there are some deprecation warnings that were fixed a couple of months ago and I was wondering if you were going to tag a new release and roll it out to Ruby Gems?
Thank you for the time you've invested in this Gem,
Paul.
I'm not sure I understand why it's required here, when ENV["CONTINUOUS_INTEGRATION"]
is false:
https://github.com/voormedia/flipflop/blob/master/flipflop.gemspec#L20
but here when ENV["CONTINUOUS_INTEGRATION"]
is true:
https://github.com/voormedia/flipflop/blob/master/Gemfile#L5
I can see that features can be placed in groups, but what does it mean?
Can a feature participate in multiple groups?
Can a group be toggled on off?
Can a custom strategy find out feature's group(s)? How?
If you put this in your Gemfile:
gem 'flipflop', git: 'https://github.com/voormedia/flipflop.git'
And you don't include bootstrap 4, then you will get an error like:
Sass::SyntaxError at /
File to import not found or unreadable: bootstrap/reboot.
I would like to translate the strategy descriptions (tooltips in the ui) the same way I translated the titles, but they aren't displayed using I18n.
The current goal of Flipflop is pretty simple: have a series of on/off switches that can be easily configured, and stored in whatever way you want.
Are there any opinions on how to move forward? Are there use cases that could be interesting to address? I'm thinking about things like incremental rollout, enabling features per user/language/country, etc.
Feel free to comment here with ideas โ once they are concrete a new issue can be opened to discuss them in more detail.
Hello. We're experiencing this exception after Rails 7.0.2 upgrade, even using latest flipflop gem (2.6.0), and also same behavior using master branch.
Example for repeating the error: https://github.com/mldoscar/flipflop-issue-on-r7-example
Our application mounts the Flipflop engine in routes.rb
like this:
Rails.application.routes.draw do
mount Flipflop::Engine => '/flipflop'
end
Then when I try to surf to this address localhost:3000/flipflop
the following exception is raised:
ActionView::MissingTemplate in Flipflop::Features#index
Missing partial flipflop/stylesheets/_flipflop.css with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}.
We're aware that starting from Rails 7, rendering files with extension would cause an exception. Does anyone else is experiencing this issue?
Ruby: 2.7.4
Rails: 7.0.2.3
RVM: 1.29.12
Also i'm going to submit a PR in order to expect feedback if it's the best way to solve this issue
I'd like to use flipflop within a Rails engine. I'd like the config/features.rb
file to reside within the engine too (so that we can add features in the future). So I'd like to be able to change https://github.com/voormedia/flipflop/blob/master/lib/flipflop/engine.rb#L17
Should I write a PR to set the file path as a class_attribute
on Flipflop::Engine
?
I'm wondering about this change:
Previously I was able to provide a layout by doing:
module MySite
class FeaturesController < Flipflop::FeaturesController
layout 'my_layout'
end
end
But now, this isn't working due to render(layout: false)
. Would it be possible to just use render
there?
When trying to upgrade app to Ruby 3.0.1, flipflop (2.6.0) throws an error:
ruby/gems/3.0.0/gems/flipflop-2.6.0/lib/flipflop/engine.rb:54:in
new': tried to create Proc object without a block (ArgumentError)`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.