Hello there, festive feature flagger!
The holidays are still a few weeks away, but we wanted to give you one of your presents early. It's not your whole gift, but you will want to open it now because it will make your next gift even better. Intrigued? Go on, open it…
It's the 1.1.0 release of the Flipper gem! Isn't it just what you wanted?! This "minor" update has a bunch of improvements, and a couple big surprises tucked inside.
Configuration improvements
Preloading configuration (#771)
By default, Flipper is configured to preload and memoize all features for each request to make your feature checks fast. In some cases, you may need to optimize those settings, and now you can pass a block to dynamically configure preloading like you already could with memoization.
Rails.application.configure do
# Returns true/false to enable preloading
config.flipper.preload = -> (request) {
!request.path.start_with?('/assets')
}
# Or, return specific features to preload
config.flipper.preload = -> (request) {
request.path.starts_with?('/admin') ? [:stats, :search] : false
}
end
Statsd configuration (#779)
Thanks to @dpep, it's now much easier to configure the built-in statsd instrumentation. Just provide the stated client to Flipper and it'll require the files and configure the instrumentation.
Rails credentials integration (#782)
Flipper Cloud will now load secrets from Rails credentials if you prefer that over ENV
variables . Just run $ rails credentials:edit -e <environment>
for each environment and paste in your token.
flipper:
cloud_token: <your-cloud-token>
cloud_sync_secret: <your-webhook-secret>
Strict mode (#760, #763)
Have you ever misspelled a feature name and then spent too much time trying to figure out why it wasn't working? Yeah, me too, but now you'll get a warning in development/test when accessing a feature that hasn't been enabled before.
>> Flipper.enabled?(:typod)
Could not find feature "typod". Call `Flipper.add("typod")` to create it.
You can configure strict mode to your liking (but we recommend leaving it set to false
in production).
Rails.application.configure do
# Set to true/:raise, false, or :warn (default in development/test)
config.flipper.strict = Rails.env.development?
end
config.use
for stacking adapters (#763)
Flipper is built from the ground-up on adapters, and a lot of those adapters just wrap other adapters to add functionality. Previously, introducing a new adapter to your app required a lot of reconfiguring. Now, you can just tell Flipper to use the new adapter. For example, if you want to add caching in front of your primary storage adapter:
Flipper.configure do |config|
config.use Flipper::Adapters::ActiveSupportCacheStore,
Rails.cache, expires_in: 5.minutes
end
Flipper UI improvements
Read-only (#772)
Thanks to @radar, the Flipper UI that you can embed in your own app is now better when Flipper is in read-only mode. Previously it would show buttons and other interface elements that implied you could just flip that little feature right here and now, but then would be like "ope, yeah no, this is all read only, don't ya know?" Well, now it's a lot more clear.
Actor names (#737)
Thanks to @jevin, Flipper UI can now show human-readable actor names when enabling a feature for specific actors.
To get this rolling, configure the actor_names_source
on Flipper to a block that resolves the given actor ids.
Flipper::UI.configure do |config|
config.actor_names_source = ->(actor_ids) {
# Lookup actor_ids here and return hash, e.g.
{
"User;1" => "Dr. Paul Rhoades"
}
}
end
Coming soon
Flipper 1.1.0 is a "minor" update, but there are two YUGE alpha features tucked inside that are spoilers for the real present we're still working on for you.
Expressions (alpha) (#692)
Flipper Expressions are a powerful new way to enable features by defining language-agnostic rules that evaluate against properties of an actor. There is a Ruby DSL for creating expressions, and the expressions themselves are serialized to JSON and can sync between your app and Flipper Cloud.
Expressions will make Flipper so much more flexible and powerful, and we are so excited! They are considered "alpha" and are not yet documented, but check out the examples if you want to start experimenting with them. We'll be releasing the beta UI for this soon. If you'd like to early access, please reach out.
Telemetry (alpha) (#775)
Last, but not least, Flipper::Cloud
now has the foundations of telemetry. Telemewhaaa? Sounds lame, amirite? But it's not. In fact, it makes me want to jump and skip. For real, I had to type this standing up. I'm that darn excited.
Telemetry is the in situ (on premise, local) collection of measurements or other data at remote points and their automatic transmission to receiving equipment (telecommunication) for monitoring. The word is derived from the Greek roots tele, 'remote', and metron, 'measure'.
For our purposes, telemetry is the collecting per minute of Flipper.enabled?
checks locally in your app and the transmission of said checks to Cloud.
This means Cloud will now be able to show you:
- when a feature was last checked in any environment. Is it safe to clean up (aka remove) this feature? Yep! You removed it from the code and it hasn't been checked in the past hour. Nope! Somewhere this feature is still being checked so you can't deleted.
- the
true
/false
results of those checks over the past day, week, or whatever. Think beautiful time series graphs that show you in near real time how your flags are working. - when was the last
true
or the lastfalse
for a given flag. Is my flag is behaving as expected? - beautiful summary emails (daily, weekly, whatever) of how your app and flags are working.
- ...and more!
We are pumped about these analytics as they can really drive a lot useful functionality in the future. We'll be releasing the beta UI for this soon. We have a few customers on the list, but if you'd like to early access too please reach out.
Whew! That was a lot for minor release. We hope you enjoy it.
Bundle it, deploy it, and happy flipping!