<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ravindu Hasantha Naulla on Medium]]></title>
        <description><![CDATA[Stories by Ravindu Hasantha Naulla on Medium]]></description>
        <link>https://medium.com/@ravindu.hasantha?source=rss-86f0378f43de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vmK-8KNFlmYWyp6JpTWSiw.jpeg</url>
            <title>Stories by Ravindu Hasantha Naulla on Medium</title>
            <link>https://medium.com/@ravindu.hasantha?source=rss-86f0378f43de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:44:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ravindu.hasantha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What is Trunk based development?, why we need it? and how to do it!!]]></title>
            <link>https://medium.com/@ravindu.hasantha/what-is-trunk-based-development-why-we-need-it-and-how-to-do-it-26256da0c1bc?source=rss-86f0378f43de------2</link>
            <guid isPermaLink="false">https://medium.com/p/26256da0c1bc</guid>
            <category><![CDATA[cherrypick]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tip-of-the-master]]></category>
            <category><![CDATA[trunk-based-development]]></category>
            <category><![CDATA[tbd]]></category>
            <dc:creator><![CDATA[Ravindu Hasantha Naulla]]></dc:creator>
            <pubDate>Sun, 23 Dec 2018 05:37:40 GMT</pubDate>
            <atom:updated>2018-12-23T05:37:40.498Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will briefly discuss the currently practiced software development process, when trunk based development is needed and rules to follow when practicing trunk based development.</p><h4>Traditional software development process</h4><p>As developers we are all familiar with the branching method where we have the ‘master’ branch which is deployed as the live version of the application. Then we have the &#39;development&#39; or the &#39;dev&#39; branch for the development purposes. When we want to add a new feature to the application:</p><ul><li>We create a branch from the latest development branch</li><li>Push the new code to the new branch and make a pull request to the development branch</li><li>Reviewers review and merge the pull request into the development branch</li></ul><p>Here the development branch most probably is deployed and manual and automation testing can be performed to verify the changes. Also there can be several staging environments where the change can be merged for testing before the change is merged into the development branch depending on your software development process as well.</p><p>So all the developers have to go through the above process to a add new feature and to add bug fixes for the newly added code.</p><p>After all the added features and bug fixes are tested, development branch can be merged into the master and deployed as a new release.</p><h4><strong>Why trunk based development is needed?</strong></h4><p>The previously mentioned development model is more suitable for projects which has no more than one or two releases per sprint. What if the solution/product you are building is so dynamic and cannot wait for two weeks for things to go live? Then you have to turn to trunk based development.</p><p>Then there are no long lived branches like development. Only the master which we call the ‘trunk’. Every feature has a short lived branch created from the latest master, which will be merged into the master as frequently as possible.</p><h4>Guidelines to follow when following trunk based development</h4><p>First, it is better if you use <a href="https://en.wikipedia.org/wiki/CI/CD">CI/CD</a> to deploy the master (trunk) on every commit. Developers are needed to strictly follow below points before committing:</p><ul><li>Make sure your commit does not break the trunk by doing sufficient developer testing</li><li>Write unit tests for each new functionality implemented</li><li>Gate the functionality whenever possible specially when the task is partially completed so it can be turned off when releasing (tools like <a href="https://launchdarkly.com/feature-management/">LaunchDarkly</a> can be used to gate the code)</li></ul><p>QA engineers can test the deployed master branch, covering the tasks up to a certain commit or the latest commit. If the testing is done to the latest commit, a release branch can be created from the <strong>tip of the master</strong>. Otherwise we can create the branch from the commit which the testing is completed up to.</p><p>In the case of not creating the release branch from tip of the master, you might have some commits to go live but not included in the release what would you do? Well you can use <em>git-cherry-pick ‘commit-id’ </em>command to get those specific commits into the release branch. Although cherry picking helps you to avoid these kind of tricky situations it is not recommended. If you find yourself cherry picking quite often, then you might not be following trunk based development correctly.</p><p>In the case of a hot bug fix, you will create a branch from the trunk/master implement the fix and then merge into trunk/master first. Then based on the current situation, you can do another release from a new release branch which includes the fix or can cherry pick the fix to the current release branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*-ZAUFv75TVoy-ZxYGefg1g.png" /><figcaption>Trunk based development (Image source: <a href="https://www.gocd.org/2018/05/30/ci-microservices-feature-toggles-trunk-based-development.html">https://www.gocd.org/2018/05/30/ci-microservices-feature-toggles-trunk-based-development.html</a>)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26256da0c1bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>