Waffle is a Django app that allows developers to include all new features in the master branch while hiding them from users until they are ready. Feature switches allow features to be developed alongside other work in master, with separate deploy and release steps. This prevents features from impacting users until ready and avoids the need for many branching which can be painful and confusing. Switches can be used in templates, JavaScript, views, models and more to selectively show or hide code for a given feature. Care must be taken to ensure all code paths are tested when using feature switches.
4. Feature branches are nasty
• Must deploy a branch to try things out
• Unlikely to run full tests on a branch
• Many branches: painful and confusing
• Branching inhibits refactoring
5. Feature Switches
Allow you to include all new features on your
master branch, hiding them from users so you
can deploy all your code to production.
6. Now you can hide features!
• Features are developed in master
alongside others
• You have separate deploy and release steps
• Your work need not impact users until ready
• Leave branching just for spikes
• Tests on master run on all features
• Code is more often ready to deploy
18. Switches
show_replace_button
Show icon for incomplete feature
show_custom_fields
Show custom fields on the edit dialog (delete this switch!)
no_fancy_tag_defaults
Disable broken JavaScript code until we fix it
debug_live
Write extra live update debugging info to JavaScript console
use_reftag_kalman_filtering
Use kalman filtering for reference tag barometer smoothing
22. Flags
show_manage_rules
Show navigation item for new rule manager feature
use_selections
Use new fancy check-box selection instead of drag’n’drop
no_xmpp
Don’t try to contact XMPP (BOSH) server at page load
no_maps
Don’t try to load map tiles at page load
24. Also use Waffle for
• A/B testing (Waffle chooses randomly)
• Canary releasing (roll out to % of users)
25. Be careful!
• Even inactive code can break your product
• Unit tests must cover both cases
• Integration tests should cover combinations
• Remove unused switches!
• Harder to follow code wrapped in switches
35. Seattle Python Day 2013
• Seattle Python Interest Group (SeaPIG)
• Late September?
• One day (Saturday)
• Free or at least very cheap
• Sprints on the Sunday?
Notas do Editor
Waffle, a Django application that provides “feature switches”, which let you deploy the code for a new feature without showing it to the user.
Working with RECON Dynamics, a start-up headquartered in Kirkland, which makes these asset trackers that have sensors and radio transmitters in so you can monitor stuff remotely and locate them.
Looking more closely at thatscreengrabSee that this generator has been running for 1 hour, and that it’s in a parking lot by the beachfront in Carillon Point
A lot of developers use feature branchesWho uses feature branchesEspecially as Git makes it so easy to create, delete and merge branchesEven with CI, running full suite of unit and integration tests on a branch is painful, so less likely to do itIf you’re working on a lot of features at once, things can get pretty overwhelming
Being able to hide changes from users lets you do things differently
So some feature switch solutions for Django.But wait, this is Rover.com, not Felix.com…
Waffle is the most popular if you look at downloads. the other main candidate is Gargoyle (David Cramer), which we started out with but moved away from as it relies on Disqus' Nexus admin replacement thing, which is a little heavy and a little buggy for us.
Waffle is the most popular if you look at downloads. the other main candidate is Gargoyle (David Cramer), which we started out with but moved away from as it relies on Disqus' Nexus admin replacement thing, which is a little heavy and a little buggy for us.