<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Multunus &#187; Process</title>
	<atom:link href="http://www.multunus.com/blog/all/process/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.multunus.com</link>
	<description>Multunus Blog</description>
	<lastBuildDate>Mon, 30 Jan 2012 12:02:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Continuous Delivery for Android Apps – Part 2</title>
		<link>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/</link>
		<comments>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 06:51:57 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1742</guid>
		<description><![CDATA[This post talks about how to run tests for the build setup as mentioned in Part 1.
Generate the build script for test
The suggested practice is to have 2 separate projects for android, one the source and the other for the tests. The following command will generate a build.xml for the test project. Replace the  with [...]]]></description>
			<content:encoded><![CDATA[<p>This post talks about how to run tests for the build setup as mentioned in <a href="/continuous-delivery-for-android-apps-part-1/">Part 1</a>.</p>
<h3><span style="text-decoration: underline;">Generate the build script for test</span></h3>
<p>The suggested practice is to have 2 separate projects for android, one the source and the other for the tests. The following command will generate a build.xml for the test project. Replace the  with the path of the source path.</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">android update test-project -m ../&lt;project-path&gt; -p . </span></p>
<p>One problem I&#8217;ve seen is that, it does not break the build even if there are failures in the test. Issue is reported here:</p>
<p><a href="http://code.google.com/p/android/issues/detail?id=14241">http://code.google.com/p/android/issues/detail?id=14241</a></p>
<p>I had to override the run-tests target as mentioned below to fix this issue:</p>
<pre>&lt;target name="run-tests" depends="-install-tested-project, install"
description="Runs tests from the package defined in test.package property"&gt;
    &lt;echo&gt;Running tests ...&lt;/echo&gt;
    &lt;exec executable="${adb}" failonerror="true" outputproperty="tests.output"&gt;
        &lt;arg value="shell" /&gt;
        &lt;arg value="am" /&gt;
        &lt;arg value="instrument" /&gt;
        &lt;arg value="-w" /&gt;
        &lt;arg value="-e" /&gt;
        &lt;arg value="coverage" /&gt;
        &lt;arg value="@{emma.enabled}" /&gt;
        &lt;arg value="${manifest.package}/${test.runner}" /&gt;
    &lt;/exec&gt;
    &lt;echo message="${tests.output}"/&gt;
    &lt;fail message="Tests failed!!!"&gt;
        &lt;condition&gt;
            &lt;or&gt;
            &lt;contains string="${tests.output}" substring="Error" /&gt;
            &lt;contains string="${tests.output}" substring="Fail" /&gt;
            &lt;/or&gt;
        &lt;/condition&gt;
     &lt;/fail&gt;
&lt;/target&gt;</pre>
<p>You can change the ant commands to <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;">clean run-tests release </span>in Jenkins to run the tests as part of packaging.</p>
<p>Next I will be writing about how to start emulator from Jenkins while running the tests.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=96462303-c79f-4147-ace0-66d89521eb71" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/10/continuous-delivery-for-android-apps-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confident Estimates</title>
		<link>http://www.multunus.com/2011/09/confident-estimates/</link>
		<comments>http://www.multunus.com/2011/09/confident-estimates/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 08:58:51 +0000</pubDate>
		<dc:creator>Manoj</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1744</guid>
		<description><![CDATA[

We constantly try to provide accurate estimates that we can defend with confidence. But there are situations where we end up making mistakes. And this post describes one such situation.
One of our clients asked us to estimate a feature. As usual, we sent back an estimate without much delay.
After few days, our client asked us [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div class="wp-caption alignright" style="width: 310px"><a href="http://commons.wikipedia.org/wiki/File:Goudargues.JPG"><img title="Goudargues" src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Goudargues.JPG/300px-Goudargues.JPG" alt="Goudargues" width="300" height="200" /></a><p class="wp-caption-text">Image via Wikipedia</p></div>
</div>
<p>We constantly try to provide accurate estimates that we can defend with confidence. But there are situations where we end up making mistakes. And this post describes one such situation.</p>
<p>One of our clients asked us to estimate a feature. As usual, we sent back an estimate without much delay.</p>
<p>After few days, our client asked us to implement this feature. When we started to think about implementing the feature we found that it would take at least double the time that we&#8217;d earlier estimated. We&#8217;d put ourselves in a bad situation. It would of course be very hard to convince the client as to why there was this much deviation &#8211; considering we discovered this even before actually starting to implement the feature. We did the 5 why&#8217;s to get to the root of the problem.</p>
<p>We discovered the following reasons:</p>
<ul>
<li>We hadn&#8217;t gone through the usual process of breaking down the feature to the desired level of granularity. Digging deeper, the following root causes emerged:
<ul>
<li>The project had been on &#8216;pause&#8217; mode for a couple of weeks and we had gotten busy with other things in the meanwhile.</li>
<li>The value of the feature [to the end user] was not completely obvious to us.</li>
</ul>
</li>
</ul>
<p>The solution? We&#8217;ve decided to ask ourselves the following question before sending across an estimate to any client in the future:</p>
<blockquote><p><em>Is this a <strong>confident estimate</strong>? Can we defend the estimate with proper reasoning?</em></p></blockquote>
<p>The above will force us to think again about the estimate and help us become more consistent.</p>
<p><strong><span style="color: #008000;">Oh, and one more thing</span></strong>. Ask the stakeholder as to what value the feature is going to add &#8211; if it is not obvious. Don&#8217;t assume that you&#8217;re right!</p>
<p>If you&#8217;re curious on what the client&#8217;s reaction was, when we sent across the revised [and much larger] estimate, <strong>ask us in the comment below</strong> <img src='http://www.multunus.com/wp-blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We&#8217;d love to hear from you!</p>
<p><span style="color: #008000;"><strong><br />
</strong></span></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=b68198f2-3678-4b4b-af9e-0948f94e83f5" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/09/confident-estimates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery for Android Apps &#8211; Part 1</title>
		<link>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/</link>
		<comments>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 11:15:50 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[continuousdelivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1705</guid>
		<description><![CDATA[
We&#8217;ve set up our CI server for building android apps. We use Jenkins as our CI server, but the same steps can be applied to any CI server.
Setup Android Environment on CI server
You need to first install the android SDK and platform tools on the CI server. The steps are well defined here. You can run [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>We&#8217;ve set up our CI server for building android apps. We use Jenkins as our CI server, but the same steps can be applied to any CI server.</p>
<h3><span style="text-decoration: underline">Setup Android Environment on CI server</span></h3>
<p>You need to first install the android SDK and platform tools on the CI server. The steps are well defined <a href="http://developer.android.com/sdk/installing.html">here</a>. You can run the command <code>android update sdk --no-ui</code> if the CI server is in an headless environment.</p>
<h3><span style="text-decoration: underline">Generate Build script</span></h3>
<p>Using android SDK tool , you can generate build script for the android project which contains the standard steps for building the app such as clean, compile, release, install etc. The following command will generate the build script, replace &lt;appname&gt;, &lt;target&gt; and &lt;project path&gt; accordingly.</p>
<pre>android update project -n &lt;appname&gt; -t &lt;target&gt; -p &lt;project directory&gt;</pre>
<p>This will create build.xml file under the project directory. You need to create build.properties file with the following contents:</p>
<pre>key.store=path-to-keystore
key.alias=[alias]
key.store.password=[pw]
key.alias.password=[pw2]</pre>
<p>You can generate the key file using keytoool or you can generate the key file from eclipse. Run the command  <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px">ant clean release<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height: 19px">, which will compile the files, and generate the apk files (it generates signed, unsigned and unaligned files). The signed version can be used for uploading to Android Market or for installing directly on any device. Couple of stuff to be noted here are:</span></span></p>
<ul>
<li>Ant version has to be 1.8.0 or higher.</li>
<li>Put the external libraries in the <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace;line-height: 18px">libs</span> directory. Build script automatically picks up the libraries put under libs directory, otherwise the script need to be changed to look at a different classpath.</li>
</ul>
<p>Checkin the build.xml, build.properties and the key file into the repository.</p>
<h3><span style="text-decoration: underline">Setup the CI server</span></h3>
<p>The CI server has to run the ant script for building the app. One more setting what we&#8217;ve done in our Jenkins server was to archive the apks as artifacts (available in the post build action). In upcoming posts, I will cover how to do the following:</p>
<ol>
<li>Running android tests</li>
<li>Running code/test coverage tools</li>
<li>Actual deployment</li>
</ol>
<p>References: <a href="http://skaug.no/ingvald/2011/09/android-app-with-jenkins/" target="_blank">http://skaug.no/ingvald/2011/09/android-app-with-jenkins/</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/09/continuous-delivery-for-android-apps-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 4: Rolling back database migrations with Capistrano rollback</title>
		<link>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/</link>
		<comments>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 08:22:40 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1527</guid>
		<description><![CDATA[According to the book Continuous Delivery, the database also should be under version control, and Rails allows us to achieve this with ActiveRecord Migrations. Even though Capistrano can run the migrations automatically with its deploy command, its deploy:rollback task does not rollback the DB migrations automatically.  I&#8217;ve created a small capistrano recipe which can take care [...]]]></description>
			<content:encoded><![CDATA[<p>According to the book <a href="http://www.amazon.com/gp/product/0321601912?tag=contindelive-20">Continuous Delivery</a>, the database also should be under version control, and Rails allows us to achieve this with ActiveRecord Migrations. Even though <a class="zem_slink" title="Capistrano" rel="homepage" href="http://www.capify.org/">Capistrano</a> can run the migrations automatically with its <code>deploy</code> command, its <code>deploy:rollback</code> task does not rollback the DB migrations automatically.  I&#8217;ve created a small capistrano <a href="https://github.com/multunus/capistrano-db-rollback">recipe</a> which can take care of rolling back migrations.  The assumptions made are:</p>
<ul>
<li>All the migrations have the <code>down</code> method defined properly. You can check for this by running <code>rake db:migrate:redo</code></li>
<li>The schema.rb exists in the repository. This is one of the <a href="http://guides.rubyonrails.org/migrations.html#schema-dumps-and-source-control">suggested practices</a> for Rails.</li>
</ul>
<p>The script is very simple, it extracts the version from the <code>schema.rb</code> and runs the <code>rake db:migrate</code> with the same version. The task gets run automatically along with <code>deploy:rollback</code>. This approach should work for most small and medium complexity Rails apps.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=37c95294-b89a-4f0c-91c2-51a1717f4ba4" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 3: Running custom rake tasks during deployment</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-contd/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-contd/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:50:54 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[continuousdelivery]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1482</guid>
		<description><![CDATA[One problem we faced with the pipeline setup what I had mentioned in my first post was that &#8211; it was not handling how to run the extra tasks that we need to do in some of the deployments. Some examples are:

Reindex the solr/lucene indexes if any new field has been added to the index
Some [...]]]></description>
			<content:encoded><![CDATA[<p>One problem we faced with the pipeline setup what I had mentioned in my <a href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">first post</a> was that &#8211; it was not handling how to run the extra tasks that we need to do in some of the deployments. Some examples are:</p>
<ul>
<li>Reindex the solr/lucene indexes if any new field has been added to the index</li>
<li>Some custom rake tasks , say for eg: task to update values in the DB, which you don&#8217;t want to add to migrations</li>
</ul>
<p>We do have Cap tasks for running the required rake tasks, but again it was done manually. So we&#8217;ve to remember to run them after deploying to production.  And also there is no way to track what steps were followed for a certain deployment.</p>
<p>I used the build parameter again for fixing the above issue i.e. after accepting the extra tasks as parameter for the build for the first job, they will be passed on to the downstream jobs. In this way the same deployment steps will be automatically followed for rest of the jobs in the pipeline.</p>
<p>The only difference in this case is that &#8211; sometimes the parameter can be empty. This check has to be done in the scripts i.e. if the value exists for the parameter, execute the extra tasks along with the normal deployment else just do a normal deployment.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0a6adeff-692b-401b-9726-093189c9c0b1" alt="Enhanced by Zemanta" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-contd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 2: Code metrics with metrical</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:44:40 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1500</guid>
		<description><![CDATA[Metrical is for easier metric_fu setup. You can see the details on why and how here. Its an awesome tool which allows us to easily use metric_fu without adding any dependency to the project code.
The steps I followed for setting it up in our Jenkins server are:

 Install the gem. I installed it under our [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://iain.nl/easier-metricfu-with-metrical">Metrical</a> is for easier <a href="http://metric-fu.rubyforge.org/">metric_fu</a> setup. You can see the details on why and how <a href="http://iain.nl/easier-metricfu-with-metrical">here</a>. Its an awesome tool which allows us to easily use metric_fu without adding any dependency to the project code.</p>
<p>The steps I followed for setting it up in our Jenkins server are:</p>
<ul>
<li> Install the gem. I installed it under our ruby 1.9.2 in RVM.</li>
<li> Create a .metrics file under your projects directory with the settings. This is not mandatory, but I had to use this because some configurations do not seem to be working with ruby 1.9.2. I&#8217;ve mentioned those below along with the contents of the .metrics file</li>
<li> Create a job in Jenkins server, mention the repository details and for build step give the shell command as <em>rvm 1.9.2 -S metrical</em></li>
<li> Configure the <a href="https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin">HTML Publisher plugin</a> for showing the nice Graphs generated by metric_fu as part of the build report. The default report location is tmp/metric_fu/output under the project directory. You can change the same in .metrics file.</li>
</ul>
<p>As I mentioned above, tools such as flay and flog, which comes as part of metric_fu, have <a href="https://github.com/iain/metrical/issues/4">issues</a> working with ruby 1.9.2. And the same case with stats graph and syntax highlighting. The same case with <a href="https://github.com/relevance/rcov/issues/8">rcov</a> also. So I had to create a <em><strong>.metrics</strong></em> file with the following contents and put in the project dir:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px;"> </span></p>
<pre class="brush: ruby;">
MetricFu::Configuration.run do |config|
        config.code_dirs = ['app', 'lib']
        config.syntax_highlighting = false
        config.metrics  = [:churn,:reek,:roodi,:hotspots,:rails_best_practices]
        config.graphs   = [:reek, :roodi, :rails_best_practices]
        config.rcov[:test_files] = ['spec/**/*_spec.rb']
        config.rcov[:rcov_opts] &lt;&lt; &quot;-Ispec&quot; # Needed to find spec_helper
end
</pre>
<p>For test coverage I&#8217;ve used <a href="https://github.com/colszowka/simplecov">Simplecov</a> which is easy to setup. It will generate the coverage report whenever you run the tests. This also generated html report which can be integrated easily into Jenkins. As mentioned <a href="https://github.com/colszowka/simplecov/issues/42">here</a> in the issue list, it does not generate the report when you are running with <a href="https://github.com/timcharper/spork/wiki">spork</a>.</p>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup" href="http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/">Continuous Delivery – Part 1: Our Jenkins Build Pipeline setup</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Delivery &#8211; Part 1: Our Jenkins Build Pipeline setup</title>
		<link>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/</link>
		<comments>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 14:28:55 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Continuous Delivery]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1417</guid>
		<description><![CDATA[As part of our journey towards implementing Continous Delivery, I&#8217;ve added the Build pipeline for our continous integration server Jenkins.  There are quite a few resources available on the net on how to add the plugin and configure it. This blog is not about how to configure the plugin, but more on how I&#8217;ve configured [...]]]></description>
			<content:encoded><![CDATA[<p>As part of our journey towards implementing <a href="http://continuousdelivery.com/">Continous Delivery</a>, I&#8217;ve added the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin">Build pipeline</a> for our continous integration server <a href="http://jenkins-ci.org/">Jenkins</a>.  There are quite a few resources available on the net on how to add the plugin and configure it. This blog is not about how to configure the plugin, but more on how I&#8217;ve configured it for one of our projects and issues I faced while doing the same.</p>
<p>The pipeline we have now is very simple. They are:</p>
<ul>
<li>Run all the RSpec tests</li>
<li>Run the Javascript Unit tests</li>
<li>Deploy to staging</li>
<li>Deploy to production</li>
</ul>
<p><strong>The problems we had with our earlier approach, and how the current approach solved those problems:</strong></p>
<p>What we had in the past was, simple scripts with the above items. We had a job for running the tests. If the build was successful, we would run <a href="https://github.com/capistrano/capistrano">capistrano</a> scripts to deploy to staging and once the customer gave the thumbs up, we&#8217;d push it to production.  There are a series of steps that we had to do for each deployment. For eg:  for staging deployment:</p>
<ul>
<li>Merge the &#8220;staging&#8221; branch with master</li>
<li>Run the cap script</li>
<li>Tag the build</li>
</ul>
<p>And almost similar steps needed to be followed for production deployment also. The usual problems that we used to face are:</p>
<ul>
<li>There is no way we knew what deployment was done on a certain day for what</li>
<li>All staging updates would not get pushed to production, so it was a tough task to identify which tag to merge when we were finally ready for a production update</li>
</ul>
<p>With the current approach, the advantages are:</p>
<ul>
<li>Its a one click deployment, so rare chance of making any kind of mistake</li>
<li>We can clearly see when a feature has been moved to staging, and whether it has been pushed to production or not</li>
<li>Anyone can do deployment as it is just a click of a button. We may even be able to teach the client how to do this.</li>
</ul>
<p>One of the major problems I had faced in the earlier &#8220;manual&#8221; system &#8211; was the inability to pass parameters between builds. For example, once the app would be moved to staging, a tag is created and when its ready to be pushed to production, we&#8217;d have to merge that particular tag to production and then push it.</p>
<p>To achieve the above I used the &#8220;parameterized build&#8221; option. In Jenkins, the parameters get converted to Environment Variables and got passed to the downstream job. This is how you can set the parameterized build:</p>
<p style="text-align: left;">
<a href="http://www.multunus.com/wp-blog/wp-content/gallery/images/parameterized_build_new.png" target="_new" title=""  >
	<img class="ngg-singlepic ngg-center" src="http://www.multunus.com/wp-blog/wp-content/gallery/cache/184__620x300_parameterized_build_new.png" alt="Parameterized Build" title="Parameterized Build" />
</a>
</p>
<p>When you fire the build, it prompts for the value of the TAG parameter. Once entered this would be available as an Environment variable for this job and all its downstream jobs.</p>
<p>For eg: in the pipeline, the downstream project is &#8220;Stage deploy&#8221;, and it will know the value for TAG and uses that value to create a tag in Git after successful deployment.</p>
<p>When it is ready for production deployment it merges with the same tag and deploys to production. In the latest version of the plugin, moving to the next step is <strong>not</strong> triggered automatically and you can retry the failed ones. The following is a sample pipeline dashboard view:</p>

<a href="http://www.multunus.com/wp-blog/wp-content/gallery/images/pipeline-new.png" target="_new" title=""  >
	<img class="ngg-singlepic ngg-center" src="http://www.multunus.com/wp-blog/wp-content/gallery/cache/183__620x300_pipeline-new.png" alt="Build Pipeline" title="Build Pipeline" />
</a>

<p><strong>Note:</strong> Capturing the parameter will happen <strong>only</strong> for the first job. So, if the parameterized job is <em>not</em> the first one in the pipeline, the capture of the parameter will not happen.</p>
<p>So we&#8217;ve reached the &#8220;one click deployment stage&#8221; with this. But we&#8217;ve still got the following pending tasks &#8211; based on what&#8217;s mention in the book  <a href="http://www.informit.com/store/product.aspx?isbn=0321601912">Continuous Delivery</a>:</p>
<ul>
<li>Rolling back the bad builds</li>
<li>Add non-functional tests to the pipeline i.e. performance and security tests</li>
<li>Feature flags</li>
<li>Zero downtime deployment</li>
<li>Canary Releases (Something on the lines of A/B testing)</li>
</ul>
<p>Continued..</p>
<ul>
<li><a title="Continuous Delivery – Part 2: Code metrics with metrical" href="http://www.multunus.com/2011/07/continuous-delivery-code-metrics-with-metrical/">Continuous Delivery – Part 2: Code metrics with metrical</a></li>
<li><a title="Continuous Delivery – Part 3: Running custom rake tasks during deployment" href="http://www.multunus.com/2011/07/continuous-delivery-contd/">Continuous Delivery – Part 3: Running custom rake tasks during deployment</a></li>
<li><a title="Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback" href="http://www.multunus.com/2011/08/continuous-delivery-part-3-rolling-back-database-migrations-with-capistrano-rollback/">Continuous Delivery – Part 4: Rolling back database migrations with Capistrano rollback</a></li>
</ul>
<p>References:</p>
<ul>
<li><a href="http://weblogs.java.net/blog/johnsmart/archive/2011/03/10/build-pipelines-jenkinshudson">http://weblogs.java.net/blog/johnsmart/archive/2011/03/10/build-pipelines-jenkinshudson</a></li>
<li><a href="http://continuousdelivery.com/patterns">http://continuousdelivery.com/patterns</a></li>
<li><a href="http://www.quora.com/How-does-Etsy-manage-development-and-operations" target="_blank">http://www.quora.com/How-does-Etsy-manage-development-and-operations</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/07/continuous-delivery-using-jenkins-build-pipeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding the &#8220;crunch mode&#8221; in the last few weeks of a project</title>
		<link>http://www.multunus.com/2011/06/avoiding-the-crunch-mode-in-the-last-few-weeks-of-a-project/</link>
		<comments>http://www.multunus.com/2011/06/avoiding-the-crunch-mode-in-the-last-few-weeks-of-a-project/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 11:19:52 +0000</pubDate>
		<dc:creator>anitha</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1358</guid>
		<description><![CDATA[We recently launched a product into production. It was a 4 month long project &#8211; with 5 full time members on the team. Right from the outset, one of things that we wanted to do, was to set and maintain a rhythm across the entire duration of the project. We set this rhythm to 1 [...]]]></description>
			<content:encoded><![CDATA[<p>We recently launched a product into production. It was a 4 month long project &#8211; with 5 full time members on the team. Right from the outset, one of things that we wanted to do, was to set and maintain a rhythm across the entire duration of the project. We set this rhythm to 1 week iterations &#8211; with a demo at the end of each iteration. Things went pretty well for most of the project. We had expected to have to hustle a little bit in the last couple of weeks &#8211; but in the end we actually ended up working much longer hours than the usual.</p>
<p>After the launch, we realized that the number of issues reported over the last few weeks of the project were much higher than what we were used to for most of the project. So not only did we have a tired team at launch time, we also had lower quality. In the retrospective that soon followed the launch, we discussed this in great detail and came up with one important conclusion:</p>
<p style="padding-left: 30px;"><em>We were missing the forest for trees &#8211; by focusing  too much on the individual <strong>practices</strong>, but not appreciating the <strong>overall XP Process</strong>. Had we been perhaps more aware of the value we were getting by following the practices, we&#8217;d probably tried to find or create new practices that would have suited the changing context better. </em></p>
<p>Thankfully though, I got this thought that writing to <a href="http://jamesshore.com/">James Shore</a> directly might help as well. James is, among many other things, the author of our favorite book &#8211; <a href="http://jamesshore.com/Agile-Book/">The Art of Agile Development</a>. What follows is the question/answer emails I exchanged with him:</p>
<p>My Question to James:</p>
<blockquote><p><em><span style="color: #000000;">We are a team that has transitioned to XP for a while now. We have been following almost everything mentioned in your book &#8220;The Art of Agile Development&#8221;. We found that the project was more stable than any other project that we&#8217;d done in the past.</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">But we found recently that we were not able to sustain the pace with which we had started the project. There was this &#8220;Crunch Mode&#8221; in the last few weeks of the project with everyone in the team putting in long hours of work.</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">We really want to avoid to such situations in our future projects. Can you suggest as to how we could achieve that?</span></em></p></blockquote>
<p>And the response I got from him:</p>
<blockquote>
<p style="text-align: left;"><em><span style="color: #000000;">Glad to hear it worked for you! It&#8217;s hard to know what happened since I wasn&#8217;t there, but there are several possibilities:</span></em></p>
<p style="text-align: left;"><em><span style="color: #000000;"><br />
</span></em></p>
<p style="text-align: left;"><em><span style="color: #000000;">- You might have overcommitted. In that case, take a second look at the &#8220;<a href="http://jamesshore.com/Agile-Book/release_planning.html" target="_blank">Release Planning</a>&#8221; and &#8220;<a href="http://jamesshore.com/Blog/Use-Risk-Management-to-Make-Solid-Commitments.html" target="_blank">Risk Management</a>&#8221; practices. You might have been better off reducing scope or delaying the release date.</span></em></p>
<p style="text-align: left;"><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">- You might have had incurred too much technical debt. In that case, remember the maxim that you should always leave the code better than you found it, and take a second look at the <a href="http://jamesshore.com/Agile-Book/slack.html" target="_blank">Slack</a>, <a href="http://jamesshore.com/Agile-Book/test_driven_development.html" target="_blank">TDD</a>, <a href="http://jamesshore.com/Agile-Book/refactoring.html" target="_blank">Refactoring</a>, <a href="http://jamesshore.com/Agile-Book/simple_design.html" target="_blank">Simple Design</a>, and <a href="http://jamesshore.com/Agile-Book/incremental_design.html" target="_blank">Incremental Design</a> practices.</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">- You might have had too many bugs. In that case, take a second look at the &#8220;<a href="http://jamesshore.com/Agile-Book/no_bugs.html" target="_blank">No Bugs</a>&#8221; practice and remember that you need to keep things clean and bug-free all the time rather than saving up bug-fixing for the end. Also consider doing the &#8220;Exploratory Testing <sup>[1]</sup>&#8221; practice from the beginning of the project, and not saving testing for the end.</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">- You might have had a difficult relationship with your key stakeholders. This problem, in particular, can result in excessive schedule pressure, which will lead to all of the other problems I&#8217;ve mentioned. In that case, see the &#8220;<a href="http://jamesshore.com/Agile-Book/trust.html" target="_blank">Trust</a>&#8221; practice and enlist the help of some politically-savvy people in your organization. You might also be interested in the Rabu project I&#8217;ve started (<a href="http://www.teamrabu.com/" target="_blank">http://www.teamrabu.com</a>).</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><em><span style="color: #000000;">Finally, consider that a week or two of crunch mode at the end of a longer project isn&#8217;t always a bad thing, so long as that&#8217;s all it is.</span></em></p>
<p><em><span style="color: #000000;"><br />
</span></em></p>
<p><span style="color: #000000;"><em> </em><em> </em><em> </em><em> </em><em> </em><em> </em></span></p>
<p style="text-align: left;"><em><span style="color: #000000;">Best wishes,</span></em></p>
<p style="text-align: left;"><em><span style="color: #000000;"> Jim</span></em></p>
</blockquote>
<p>I guess our problem was that we had overcommitted. We also did not consider practices like the Risk Management and Slack.</p>
<p>Now speaking of action items, we&#8217;ve come up with the following:</p>
<ul>
<li>Commit to deliver features only after following the Risk Management techniques mentioned in the book</li>
<li>Introduce Slack as part of every iteration</li>
<li>And finally, to ensure we don&#8217;t forget to appreciate the process enough, we&#8217;ve added one additional item in our Navigator&#8217;s<sup>[2]</sup> checklist.
<ul>
<li>[Update] The value of this action item is debatable. Its been about 3 weeks since we put it up on the checklist &#8211; but we&#8217;ve got the tendency to ignore anything that doesn&#8217;t change frequently enough. So we&#8217;ll need to come up with a better solution for the &#8220;lack of appreciation&#8221; problem. Any ideas? Please help us by commenting below. Thanks!</li>
</ul>
</li>
</ul>
<p><strong><span style="text-decoration: underline;">Notes:</span></strong></p>
<p>[1] This practice is yet to be put online.</p>
<p>[2] This refers to the role of the Navigator in the context of <a href="http://jamesshore.com/Agile-Book/pair_programming.html">Pair Programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/06/avoiding-the-crunch-mode-in-the-last-few-weeks-of-a-project/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Takeaways from Ruby Conf India 2011</title>
		<link>http://www.multunus.com/2011/06/takeaways-from-ruby-conf-india-2011/</link>
		<comments>http://www.multunus.com/2011/06/takeaways-from-ruby-conf-india-2011/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 13:58:56 +0000</pubDate>
		<dc:creator>Leena</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1290</guid>
		<description><![CDATA[I know its been almost two weeks since its all over, things may not be fresh in mind. And all of us were very busy with &#8220;go live&#8221; for one of our client projects. But as its &#8220;better later than never&#8221;, I am putting my thoughts about the recently concluded RubyConf held in Bangalore on [...]]]></description>
			<content:encoded><![CDATA[<p>I know its been almost two weeks since its all over, things may not be fresh in mind. And all of us were very busy with &#8220;go live&#8221; for one of our client projects. But as its &#8220;better later than never&#8221;, I am putting my thoughts about the recently concluded RubyConf held in Bangalore on 28th and 29th of May 2011.</p>
<p>There were quite a few presentations this year which I felt were very useful for me. Those are:</p>
<ul>
<li><a href="http://rubyconfindia.org/2011/presentations/brianGuthrie-RubyPlusRailsPlusAppMinusRails.key" target="_blank">Ruby Plus Rails Plus Your Application Minus Rails</a> by Brian Guthrie</li>
<li><a href="http://rubyconfindia.org/2011/presentations/janmejay-TLB-rocketBoosterForYourBuild.pdf" target="_blank">Test Load Balancer: Rocket Booster for your Build</a> by Janmejay Singh and Pavan</li>
<li><a href="http://rubyconfindia.org/2011/presentations/brianGuthrie-ContinuousDelivery.key" target="_blank">Continuous Delivery</a> in Ruby by Srushti Ambekallu and Brian Guthrie</li>
</ul>
<p>And its needless to say that the keynotes by Yehuda Katz, Chad Fowler, Nick Sieger and Ola Bini were awesome too. Especially<a href="http://rubyconfindia.org/2011/presentations/chadFowler-service.key" target="_blank"> Chad Fowler&#8217;s session</a> gave a new perspective on &#8220;Service&#8221; and who should be considered as a &#8220;Customer&#8221;. And Nick Sieger&#8217;s closing note gave a different perspective on how to contribute back to the community by conducting workshops and with <a href="http://kidsruby.com/" target="_blank">Kidsruby</a>.</p>
<p>So whats next? Yes, implement the stuff we learned. So these are the immediate action items for us:</p>
<ul>
<li>More automation for the entire release mechanism. We do have a CI server and do have a Cap script for deployment. But we do not have a &#8220;one click deployment&#8221; process. A &#8220;<a href="http://www.google.com/url?sa=D&amp;q=http://code.google.com/p/build-pipeline-plugin/">Build pipeline</a>&#8221; plugin for Hudson should help us achieve that.</li>
<li>Tools like <a href="http://wiki.opscode.com/display/chef/Home">Chef</a>/<a href="http://www.puppetlabs.com/puppet/introduction/">Puppet</a> for server configuration management. We&#8217;ve tried <a href="https://github.com/wr0ngway/rubber/wiki">rubber</a>, but are yet to use it for any production setup.</li>
<li>Use <a href="http://test-load-balancer.github.com/">TLB</a> to run tests in parallel.  Setup seem to be pretty straightforward. This will be a huge help when you are doing many deployment in a day.</li>
</ul>
<p><strong>Update: </strong>One talk I missed in the list was <a href="http://rubyconfindia.org/2011/presentations/sherinC-DesigningHighThroughputWebServiceClients.key">Designing High Throughput Web Service Clients</a> by Sherin. He was able to convey the problems he faced and how he went ahead and solved those.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/06/takeaways-from-ruby-conf-india-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Venkat Subramaniam&#8217;s talk on Code Quality</title>
		<link>http://www.multunus.com/2011/04/venkat-subramaniam-code-quality/</link>
		<comments>http://www.multunus.com/2011/04/venkat-subramaniam-code-quality/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 09:47:11 +0000</pubDate>
		<dc:creator>Shakeeb</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.multunus.com/?p=1213</guid>
		<description><![CDATA[We attended Venkat Subramaniam&#8217;s talk on Code Quality at Yahoo India a couple of days back.
Venkat is the founder of Agile Developer and the author of several books. Consultant and Adjunct Professor are some of the other hats he wears. It was an inspiring experience. While we were reassured that our current practices are on [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-1217" href="http://www.multunus.com/2011/04/venkat-subramaniam-code-quality/venkat_at_yahoo/"><img class="alignright size-medium wp-image-1217" title="Venkat_at_yahoo" src="http://www.multunus.com/wp-blog/wp-content/uploads/2011/04/Venkat_at_yahoo-300x224.jpg" alt="" width="300" height="224" /></a>We attended <a href="http://http://www.agiledeveloper.com/presentations/caring_about_code_quality.pdf">Venkat Subramaniam&#8217;s talk on Code Quality</a> at Yahoo India a couple of days back.</p>
<p>Venkat is the founder of Agile Developer and the author of several books. Consultant and Adjunct Professor are some of the other hats he wears. It was an inspiring experience. While we were reassured that our current practices are on the right track during most of the talk, there were a some things which caused us to rethink the way we do things.</p>
<h3><strong>Why do we need Code Quality?</strong></h3>
<p>One of the first things Venkat asked us to think about was why code quality was necessary in the first place. Most of the audience had reasons like &#8216;Easy Maintainence&#8217;, &#8216;To make a better product&#8217;, &#8216;Company&#8217;s image&#8217; etc. These were reasons which we had on the top of our mind as well. However his reasoning was quite different:</p>
<p style="text-align: left;">&#8220;<em>We need Code Quality to be truly Agile</em>&#8220;</p>
<p style="text-align: justify;">What this means is that rapidly adding new features or quickly changing existing features to incorporate feedback is not possible without clean code.</p>
<p style="text-align: justify;">We have been focusing on writing cleaner code for quite some time as well. But our approach to improving in this area has been limited to reading books and online articles about better approaches to write clean code and internal discussions with our team. One essential ingredient that we were missing was using an existing sample, something near perfection which we could look at and learn from or at least be inspired by.</p>
<h3><strong>Pair Programming Vs Code Review</strong></h3>
<p style="text-align: justify;">Code Review aims to provide external feedback. But we already do pair programming which tries to achieve nearly the same. The danger lies in the navigator becoming so invloved that he is not externalized enough. So the solution is to switch pairs every half a day.</p>
<h3 style="text-align: justify;">Additional Action Items</h3>
<p style="text-align: justify;">After having a brainstroming session with the entire team here, we decided to include the following suggestions from Venkat&#8217;s talk to our existing practices:</p>
<p style="text-align: justify;"><strong>Starting &#8220;Perspective&#8221; based Peer Reviews</strong><br />
This is mandatory for  projects which have only one pair (and hence cannot switch pairs). The reviewer should have enough familiarity(perspective) with the project to be able to make a judgement on the design and quality. This is also useful for projects which can switch pairs &#8211; but not mandatory.</p>
<p style="text-align: justify;"><strong>Dedicated time to pay off technical debt</strong><br />
While our iterations always have time baked in, to clear technical debt, we often spend that time doing something else instead. More disclipine in paying down our technical debt is something we intend to work on.</p>
<p style="text-align: justify;"><strong>Code Quality metrics in the Informative Workspace</strong><br />
While &#8216;name and shame&#8217; is certainly not something we do, Venkat&#8217;s belief in publicising quality metrics as a way to encourage code quality [in our informative workspace] is something we will explore in the coming weeks.</p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.multunus.com/2011/04/venkat-subramaniam-code-quality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

