GithubHelp home page GithubHelp logo

voormedia / flipflop Goto Github PK

View Code? Open in Web Editor NEW
180.0 7.0 33.0 326 KB

Flipflop lets you declare and manage feature flags in your Rails application.

License: MIT License

Ruby 60.57% HTML 37.43% SCSS 1.95% JavaScript 0.05%
rails feature-flags feature-toggles rails-engine

flipflop's People

Contributors

bak avatar bhalani avatar bsharpe avatar carloslopes avatar emielvanlankveld avatar felixandersen avatar gbxl avatar jasonblalock avatar jcoyne avatar jeiwan avatar joefiorini avatar kcm avatar kevinnio avatar lenidot avatar mldoscar avatar olleolleolle avatar pda avatar pewniak747 avatar piotrze avatar rolftimmermans avatar ryanhouston avatar vit-panchuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flipflop's Issues

Access to Flipflop in initializer ?

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 !

Allow grouping of features

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.

Not working "flipflop:xxx" rake tasks

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.

Exception when using Sequel rather than AR

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)

Bugfix release raises new errors

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)?

Capybara still reads from db after setting test strategy

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?

Change enabled badge color to improve accessibility

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.

Pair back the build matrix?

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?

Easily override features per environment?

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?

Flipflop::StrategyError: Strategy '<UUID>' unknown.

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

Does not work with Ruby 3.0 #35 from configurablerb

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)`

The error is in configurable.rb

Screenshot from 2022-09-06 18-45-28

Current user argunment

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?

rbx-head tests aren't testing flipflop

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?

Bundler warning

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

New tagged version?

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.

What are groups for and how to use them?

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?

referencing gem via git triggers missing bootstrap dependency

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.

Discussion of potential future goals for Flipflop?

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.

ActionView::MissingTemplate in Flipflop::Features#index in Rails 7

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

Allow downstream controller to provide a layout

I'm wondering about this change:

d5c7c3d

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?

Does not work with Ruby 3.0

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)`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.