Skip to content
David Corking edited this page Jun 23, 2014 · 3 revisions

Feature flags are provided by, and documented in, class Feature in feature.rb

We use feature flags to deploy incomplete code for large features, with the entry points turned off. This makes integration easier (shorter-lived branches) and supports continuous deployment. See Martin Fowler's 2009 article. In the future, we might want to allow site operators to turn off some features that their users don't want.

As of 2014, Feature uses ActiveRecord, but we aren't coupled to that. We could keep the same API if we switched the backend to memcached or redis, or even the rollout gem (based on redis.)

The first deployment (of June 2014) provides two flags.

To activate them, you need to add them to the database in your rails console (or your Heroku or ninefold console):

Feature.create(:name => :volunteer_ops_create)
Feature.create(:name => :volunteer_ops_list)

When you add them, they remain off by default. To turn them on, run:

Feature.activate(:volunteer_ops_list)
Feature.activate(:volunteer_ops_create)

There is a shortcut, but that is coupled to ActiveRecord. Instead, we really want to automate this. Follow or contribute to the chore at https://www.pivotaltracker.com/story/show/73601714 (with experience, most things are easy.)

Web UI

A web UI might be useful for speedy reactions by client staff. These might help: