SlideShare uma empresa Scribd logo
1 de 36
Waffle
Toby Champion
github.com/tobych
Feature switches for Django
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
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.
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
Let’s use feature switches!
Let’s use feature switches!
Use your switches everywhere
• Templates
• JavaScript
• Views
• Models
• Jinja2 templates (via Jingo)
• Mustache/Handlebars templates
• Management commands
• Celery tasks
{% load waffle_tags %}
{% switch switch_name %}
Switch is active!
{% else %}
Switch is inactive!
{% endswitch %}
Django template
Views
Wrap an entire view
JavaScript
Examples
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
Flags
Flags know about users and groups
Examples
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
Query string
http://example.com/?dwft_my_flag=0 – Off
http://example.com/?dwft_my_flag=1 – On
Persisted for the session using cookies.
Also use Waffle for
• A/B testing (Waffle chooses randomly)
• Canary releasing (roll out to % of users)
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
Pain
Persistence
• memcached
• Redis
Waffle
• http://coffeeonthekeyboard.com/introducing-waffle-for-django-541/
• https://github.com/jsocol/django-waffle
• http://waffle.readthedocs.org/
Feature Switches/Flags/Bits/Toggles
• http://martinfowler.com/bliki/FeatureToggle.html
• http://www.pgrs.net/2011/08/29/why-i-dont-like-feature-branches/
• http://blog.disqus.com/post/789540337/partial-deployment-with-feature-switches
• http://arialdomartini.wordpress.com/2011/11/02/help-me-because-i-think-martin-fowler-has-a-merge-paranoia/
• http://www.youtube.com/watch?v=xzstASOvqNc
• http://codeascraft.com/2011/02/04/how-does-etsy-manage-development-and-operations/
• http://www.infoq.com/presentations/Feature-Bits
Toby Champion
@tobych
linkedin.com/in/tobychampion
github.com/tobych/
toby@tobychampion.com
Seattle Python Day 2013
• Seattle Python Interest Group (SeaPIG)
• Late September?
• One day (Saturday)
• Free or at least very cheap
• Sprints on the Sunday?
Waffle: A feature switch/flag/toggle application for Django

Mais conteúdo relacionado

Destaque

Diyet Yemek Tarifleri
Diyet Yemek TarifleriDiyet Yemek Tarifleri
Diyet Yemek Tarifleri
uzmano
 
Technology of a Toaster _ history
Technology of a Toaster _ historyTechnology of a Toaster _ history
Technology of a Toaster _ history
SiempreParaTi
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature Branching
Alan Parkinson
 

Destaque (16)

Continuous Delivery and Feature Flagging
Continuous Delivery and Feature FlaggingContinuous Delivery and Feature Flagging
Continuous Delivery and Feature Flagging
 
Diyet Yemek Tarifleri
Diyet Yemek TarifleriDiyet Yemek Tarifleri
Diyet Yemek Tarifleri
 
Breville Waffle Kitabı
Breville Waffle KitabıBreville Waffle Kitabı
Breville Waffle Kitabı
 
Pull requests and testers can be friends
Pull requests and testers can be friendsPull requests and testers can be friends
Pull requests and testers can be friends
 
Who will test your tests?
Who will test your tests?Who will test your tests?
Who will test your tests?
 
Overcoming the fear of deployments
Overcoming the fear of deploymentsOvercoming the fear of deployments
Overcoming the fear of deployments
 
Entregas Contínuas com feature toggles
Entregas Contínuas com feature togglesEntregas Contínuas com feature toggles
Entregas Contínuas com feature toggles
 
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.ioContinuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
 
Continuous Integration, Delivery and Deployment
Continuous Integration, Delivery and DeploymentContinuous Integration, Delivery and Deployment
Continuous Integration, Delivery and Deployment
 
Technology of a Toaster _ history
Technology of a Toaster _ historyTechnology of a Toaster _ history
Technology of a Toaster _ history
 
Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Waffle at NYCJavaSig
Waffle at NYCJavaSigWaffle at NYCJavaSig
Waffle at NYCJavaSig
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature Branching
 
Using Waffle Maker and Toaster
Using Waffle Maker and ToasterUsing Waffle Maker and Toaster
Using Waffle Maker and Toaster
 
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
 
Feature Flagging to Reduce Risk in Database Migrations
Feature Flagging to Reduce Risk in Database MigrationsFeature Flagging to Reduce Risk in Database Migrations
Feature Flagging to Reduce Risk in Database Migrations
 

Semelhante a Waffle: A feature switch/flag/toggle application for Django

Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Erik Hansen
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testing
techbed
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
Noopur Gupta
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
lancehilliard
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
PostgresOpen
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Noopur Gupta
 

Semelhante a Waffle: A feature switch/flag/toggle application for Django (20)

Best Practices for Magento Debugging
Best Practices for Magento Debugging Best Practices for Magento Debugging
Best Practices for Magento Debugging
 
Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80Herding a Cat with Antlers - Catalyst 5.80
Herding a Cat with Antlers - Catalyst 5.80
 
java.pptx
java.pptxjava.pptx
java.pptx
 
Petri for kyiv.pptx
Petri for kyiv.pptxPetri for kyiv.pptx
Petri for kyiv.pptx
 
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
 
Feature toggles
Feature togglesFeature toggles
Feature toggles
 
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений" Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
Александр Махомет "Feature Flags. Уменьшаем риски при выпуске изменений"
 
Feature Flags. Reducing risks during shipping changes/
Feature Flags. Reducing risks during shipping changes/Feature Flags. Reducing risks during shipping changes/
Feature Flags. Reducing risks during shipping changes/
 
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama StudiosMagento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
Magento Imagine 2011 - Magento Debugging - Erik Hansen, Classy Llama Studios
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testing
 
Feature Toggle
Feature ToggleFeature Toggle
Feature Toggle
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
Mastering your Eclipse IDE - Java tooling, Tips & Tricks!
 
Instant DBMS Homework Help
Instant DBMS Homework HelpInstant DBMS Homework Help
Instant DBMS Homework Help
 
Writing Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of JelloWriting Well Abstracted Automation on Foundations of Jello
Writing Well Abstracted Automation on Foundations of Jello
 
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012).NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
.NET Unit Testing w/ Microsoft Fakes (TechCamp Memphis Spring 2012)
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
Branching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by AbstractionBranching Strategies: Feature Branches vs Branch by Abstraction
Branching Strategies: Feature Branches vs Branch by Abstraction
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Waffle: A feature switch/flag/toggle application for Django

Notas do Editor

  1. Waffle, a Django application that provides “feature switches”, which let you deploy the code for a new feature without showing it to the user.
  2. 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.
  3. 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
  4. 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
  5. Being able to hide changes from users lets you do things differently
  6. So some feature switch solutions for Django.But wait, this is Rover.com, not Felix.com…
  7. 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.
  8. 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.