Continuous Delivery vs. Continuous Integration
While these two topics are often discussed in the same context, they are in many ways, opposing ideas. Continuous Delivery requires a path to production for any code that is ready to be released but Continuous Integration says you should be integrating all of your latest code together multiple times per day. This makes releasing a certain feature that is ready difficult because it has been integrated with other code that may not be ready for prime-time.
In this post I’ll talk through a couple of techniques to find the balance of continually integrating your latest code while also being able to do on-demand releases of any work that is ready.
Branch By Feature
While this has typically been frowned upon by the CI crowd, there are some benefits to this approach. The perceived negatives of this approach are:
- * It promotes long running feature branches where the code isn’t integrated with other work until it is pushed into the trunk.
- * Branching has a lot of overhead.
- * It causes developers to work in a silo where they are not in touch with the rest of the team.
While these can be negatives, there are some techniques that can be applied to get around these. GitHub branches by feature successfully by pulling down latest from master for any feature branch that runs longer than a few days and utilizing pull requests to move code between branches. They also are able to run their test suite on any branch. A few things that can make branching by feature work better:
- * Keep your work items small. Small work items or stories can be completed in a couple days or less which should immediately be merged into master and released once they are completed and have passed all automated tests. Feature toggles may be required in order to hide incomplete features.
- * Merging down from master allows you to keep your branch in sync with anything that’s been released to production.
Integrated Feature Branches
I first read about this from a post from Adam Dymitruk as I was investigating a similar solution for my company. It basically starts out like the above flow from GitHub but adds in a CI branch. Each feature is developed in isolation but regular checkins and merges are made to an integration branch where tests are run and you verify that all of the in-progress code plays nice.
The key to making this work with CD is to only merge up to the CI branch and never merge down. By merging down you lose the ability to deploy your code in isolation so this should be avoided.
In the event you want to use some code someone has written in another branch you can cherry pick it from that branch directly without talking to the integration branch. Some other benefits of this approach are:
- * It keeps the ability to release code to production in isolation.
- * Code is still integrated constantly to ensure developers aren’t breaking each other’s code and not knowing for days or weeks.
- * It also allows for more rapid development since you are able to focus solely on your code in isolation.
- * When using Git on another DVCS you can still collaborate with other developers on a single feature branch.
Tooling
Obviously tooling becomes very important for branching by feature to work. Using something old school like SVN or TFS will have obvious issues with all of the branching and merging but in theory it would still work. More modern systems like Git or Mercurial makes this much easier among other things.
Now go forth and branch, integrate, and ship your code!
Twister Tracker Beta
I officially opened up the site I’ve been working on this morning to new users. You can signup for free at www.twistertracker.com and start tracking severe storms and tornadoes as they happen.
Ruby Version Manager (RVM)
So I’ve been struggling lately after trying to update my native/macport installation of Ruby/RubyGems/Rails to 1.9.2 and Rails3. After tons and tons of errors I decided to try RVM. Worked like a champ! I was up and running in less than 10 minutes. I’d highly recommend it if you are having configuration issues on OS X.
Twitter Weekly Updates for 2010-11-07
- This morning's run in #boulder I found a nice steep hill to run up on Dakota Ridge. http://connect.garmin.com/activity/55700069 #
- Brewing some india brown ale. http://twitpic.com/34v1qh #craftbeer #
Twitter Weekly Updates for 2010-10-24
- Enjoying beach life. http://twitpic.com/2yrdr2 #
- Sunset! http://twitpic.com/2z3wft #
- Another day, another sunset picture. http://twitpic.com/2zcduo #
- Just thought we saw a manatee sitting out on a sandbar off the coast but looking through the binoculars revealed a large person in a chair. #
Twitter Weekly Updates for 2010-08-29
- I really need to get my annual salary into the $2 million range. It's nice there are programs for the uber wealthy. http://nyti.ms/d6Nwpp #
- Today's lunchtime ride up flagstaff http://connect.garmin.com/activity/46123576 #
- Is about 3/4 unpacked so far. I wil l need to build some shelves in the garage before I can finish that. #
Twitter Weekly Updates for 2010-08-22
- Cool shot of the fog in #boulder from hwy 93. http://twitpic.com/2fbjom #
- Just got done taking Josie to the #boulder farmers market for dinner then to see the band on the bricks. Big evening of fun for a toddler. #
- 6.5 mile run on the mesa trail monday, climbing at @thespotgym tuesday, 7.5 mile run today, bike up linden planned tmrrw. Each during lunch. #
- Today's lunch ride up Linden in #boulder Probably the steepest ride around. http://connect.garmin.com/activity/45237238 #
- Had fun hanging out with all our KC area friends. Drank some good beers and watched all of the girls play together. #
Twitter Weekly Updates for 2010-08-15
- http://twitvid.com/LHFPO – Tap dancer! #
- 33 mile bike ride this morning over olde stage twice and up to Jamestown. #
Twitter Weekly Updates for 2010-08-01
- Set a PR in the 5K tonight at a corp challenge run. 19:41 My first sub 20 5k. #