-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rake tasks to manage features #30
Add rake tasks to manage features #30
Conversation
15f7c67
to
2e96260
Compare
@rolftimmermans If you could do a quick review of this, I'll appreciate it. There's also #27 waiting for review. 😉 |
Love this idea! I wonder how to deal with strategies that cannot be changed via the console though, especially those that require a request context (like session & cookie strategies). Another concern I have is the new gem dependency; I prefer to have minimal dependencies where possible; Anyway, I would love to see this implemented so if you have any thoughts on this I would love to hear it! |
Thanks for the quick reply, @rolftimmermans. I added About the other strategies, I originally built this for a project that was using only |
Just looked at the code for the strategies in more detail and it seems all request-based strategies will default to |
2e96260
to
38ef23d
Compare
Flipflop already provides a GUI to manage feature statuses. This adds rake tasks that allow the user to do the same from the console.
Not all strategies are switchable. This adds a check to see if the strategy is switchable before trying to switch on/off a feature using the new rake tasks.
38ef23d
to
130531a
Compare
@rolftimmermans I replaced What do you think? |
Starting to look good. The only remaining comment I have when looking at the code is that features are 'ternary' – they can be explicitly enabled ( |
Yeah, totally makes sense. I'll check for By the way, do you think adding a |
When printing the features table using rake flipflop:features, this shows an empty whenever cell a feature in unset for a strategy.
Unsetting/clearing does seem potentially useful. I think the dashboard refers to this as |
OK, then. I'll add a |
This task replicates the "Clear" feature from the dashboard. With it, a feature can be cleared (unset) using the specified strategy.
Added the |
788187f
to
fd19b5a
Compare
9d52b71
to
1e9aa01
Compare
LGTM. Would you say it's ready? |
1e9aa01
to
d433525
Compare
Yeah, totally. Ready to merge whenever you are! |
Hey guys, I noticed Flipflop doesn't have a way to manage features via console out of the box, so here's this PR built from work I had to do in one of my projects.
This adds a set of rake tasks that allow the user to control features the same way they can currently do it in the Dashboard.
These are the new tasks:
For example, let's say you have a
config/features.rb
file like this:To enable
:peace_among_worlds
using:active_record
you would do:To disable
:world_domination
using:cookie
you would do:To see the current state of your features you would do:
Thanks for such a great gem, guys!