Skip to content

Commit

Permalink
Document how to use feature flags with flipper
Browse files Browse the repository at this point in the history
  • Loading branch information
nilbus committed Mar 15, 2017
1 parent c899214 commit 7744778
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/flipper-feature-flags.md
@@ -0,0 +1,31 @@
Feature Flags
=============

Feature flags allow specific features to be turned on and off at runtime for a
percentage of users or the enitire site. Feature flags enable:

- Testing out new features on a limited portion of our users
- Quick rollback when we discover a problem in production

Process
-------

1. Surround the new feature's code with a conditional:

```ruby
if $flipper[:a_name_for_your_feature].enabled?(current_user)
# do the new thing
else
# do the old thing, or maybe nothing
end
```

2. In development, enable the feature in the UI (http://localhost:4567/flipper/)
3. Get your feature deployed, ensuring you mention the feature flag in the Pull
Request. Ask a flipper admin (@kytrinyx) to enable your feature.
4. Ensure everything is working in production.
5. **Important**: Create a new pull request that removes all your feature flipper's
conditionals, removing any old code the new feature replaced and all references to
your feature flag. Leaving enabled feature flags in the code increases complexity
and is unacceptable. The feature flag admin will delete the feature flag in the UI
after the PR is merged and deployed successfully.

0 comments on commit 7744778

Please sign in to comment.