Skip to content
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 #remove method to the Feature class #126

Merged
merged 2 commits into from
Jun 3, 2016

Conversation

svarks
Copy link
Contributor

@svarks svarks commented May 27, 2016

I thought it might make sense for it to be available on the feature level:

flipper[:feature].remove

@jnunemaker
Copy link
Collaborator

This brings of up the question of what does remove mean. Adapter#remove is for removing the feature from the set of known features, but I would assume Feature#remove would also clear the gate values and such. Also, we currently don't have Feature#add, which would be the reciprocal method of #remove. I think for these reason I'm inclined to just let the api use the adapter remove method and not add remove to feature. What are your thoughts on this?

@svarks
Copy link
Contributor Author

svarks commented Jun 1, 2016

Hmm that's a good point. I've been mostly using this api:

flipper.class                  # => Flipper::DSL

flipper[:feature]              # calls Feature.new(name, @adapter, ...)
flipper[:feature].enable       # calls adapter.enable(self)
flipper[:feature].disable      # calls adapter.disable(self)
flipper[:feature].enable(user)

So it seems that almost every adapter method is exposed through DSL, except for #remove.
And I just noticed that it wasn't obvious to me how to remove redis data when you stop using the feature.
I don't have a strong preference either way though.

@jnunemaker
Copy link
Collaborator

I lied. Adapter#remove is for removing feature from set of known features and clearing gate values. Totally forgot. My bad. I think the only thing this is missing is adding the remove method to the DSL with an accompanying spec and changing the web action to use feature#remove instead of adapter#remove. If you have time to knock those out, go for it. If not, I'll try to get it done in the coming weeks.

@svarks
Copy link
Contributor Author

svarks commented Jun 2, 2016

Thanks John! I've just added the DSL#remove method. Please let me know if I missed anything, I'm happy to make any other changes.


json_response({}, 204)
else
json_response({}, 404)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@jnunemaker jnunemaker merged commit 89f2eeb into flippercloud:master Jun 3, 2016
@camallen camallen mentioned this pull request Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants