<?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[Continuous Integration - Medium]]></title>
        <description><![CDATA[CI and CD - Medium]]></description>
        <link>https://medium.com/continuous-integration?source=rss----d29f501d4eb5---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Continuous Integration - Medium</title>
            <link>https://medium.com/continuous-integration?source=rss----d29f501d4eb5---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 13:15:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/continuous-integration" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One Day. Dozens of Volunteers. Hundreds of Cans. (And a CI Tool)]]></title>
            <link>https://medium.com/continuous-integration/one-day-dozens-of-volunteers-hundreds-of-cans-and-a-ci-tool-b5e930689c0?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/b5e930689c0</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 12 Jul 2016 19:05:20 GMT</pubDate>
            <atom:updated>2016-07-12T19:05:20.311Z</atom:updated>
            <content:encoded><![CDATA[<p>Posted by <a href="https://blog.snap-ci.com/authors/suzie-prince/">Suzie Prince</a></p><p>Kevin Yeung from ThoughtWorks’ Singapore office joins The Pipeline to tell us all about how technology can help nonprofits track thousands of tin cans across a major city on a single day. He discusses the importance of understanding your users to make better technology and design choices and build better products.</p><h3>What is Project Tintin?</h3><p>Every weekend in Singapore we have this tradition called “Flag Day”. On Flag Day, pre-selected nonprofits send volunteers go to train stations, shopping centers and other popular places to ask for donations by shaking a tin can. That’s why we called the project “Tintin”. The one-day donation drives are called “Flag Day” because after you make a donation, the volunteers give you a little sticker to “flag you” and it basically says, “I’ve donated. Stop bothering me!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PytKzskZRpm11f8c.png" /></figure><p>Our project was to help organize and manage the tin cans for the <a href="http://www.dpa.org.sg/">Disabled People’s Association (DPA)</a> Flag Day on April 23, 2016[^1]. The DPA wanted a better way to track their tin cans. As you can imagine, tracking these tins is not easy: we’re talking about several thousand tins. After a tin is filled up with donations, it needs to be boxed and later taken back to the organization. And, we have to make sure volunteers don’t run out of tins.</p><p>The process of tracking tins has traditionally been manual and paper-based. It was a paperwork nightmare. In the past, they would print all the participants and tin information out on an A3 piece of paper (23” x 33”) and manually update that as the day went on. If you think about it, a few thousand tins and hundreds of volunteers… even on a piece of A3 paper, it is a lot of information to squeeze in. They wanted something better.</p><h3>What special requirements did you have for the software?</h3><p>We needed a system that was easy to use in the field. It would be used for only one day, so we had one chance to get things right. The system needed to provide real-time visibility of where tins were to allow organizers to react accordingly.</p><p>UX was very important due to the variety of people using the software. DPA volunteers have different ability levels, including impaired vision and limited fine motor skills. Because of this, we wanted the software to be high-contrast and the buttons very big so that everyone could use it easily.</p><p>On top of that, it was a low-budget project. We couldn’t build new hardware, and we didn’t know what devices volunteers would have. We had to decide to either build some kind of hybrid mobile app, or we had to build the same app for iOS and Android. In the latter case, we’d need to worry about Android fragmentation, and so on.</p><h3>With those specifics in mind, how did you approach this problem?</h3><p>Our client said: “We need to track tins.” My team’s first instinct was, “Well, let’s put a barcode on tins.” But, when we thought about it a little more, that would mean printing a thousands of distinct barcodes to put on individual tins, then scanning barcodes on a cylindrical surface. On top of that, we didn’t know what devices volunteers were going to use to scan the tins anyway.</p><p>Remembering that we were revamping that old, paper-based process, we thought long and hard about what we could do instead. Given all these requirements, we decided to track the people instead. We designed an aggregation model of tins, and boxes, and people by handing QR codes to various people. We believed it was going to work, but we wanted the users to keep us honest as well. We did some paper prototyping, some role-playing and several rounds of ideas and designs before we actually wrote any code as we were quite anxious to validate the journey, the experience, and whether the QR code was actually going to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m_Gj1DSbVK-XYe68.jpg" /></figure><h3>What did the final software look like?</h3><p>It’s a web app. The entry point to the system is the personal QR code you’ve been assigned, which is embedded with a URL to bring you to our web app. Combined with the session information of the person doing the scanning, we get complete information about the scanner, the person being scanned, and the stage they’re in so we can present the right screen with the right information. That provided us enough information to follow the end-to-end flow of tins. We used whatever QR code scanner that people have on their phone.</p><h3>Can you tell us about the technology stack?</h3><p>We were also thoughtful about the technology we choose for this project. This is client is a nonprofit. Their IT system is limited to email and web browsing, maybe some Excel spreadsheets. We wanted to ensure they could maintain this project themselves after we left. So we were more conservative and went with a Rails web app. We used very minimal Javascript using a concept called progressive enhancement. We stuck to HTML5, CSS3, to make it work, and then used Javascript as necessary instead of putting in a big framework upfront.</p><p>We used to Cucumber for functional tests.</p><p>We used PostgreSQL database.</p><p>The entire software runs on AWS in Singapore. For much of the development, we ran on micro-instances, so, it’s basically free.</p><p>We use event-sourcing. So, the database is an append-only data store, even though it is relational. When someone scans a QR code and says, “Hey, this tin, #123, has now gone out to Kevin,” we fire a tin assigned event, and we just capture the information and stick it in the database. So, it’s always append, so operation at the station is going to be very fast.</p><p>We also used Snap CI for Continuous Integration.</p><h3>Why Snap CI?</h3><p>I made a beeline for Snap CI. I actually used Snap in 2013 for another ThoughtWorks project and I was keen to try it again. For this project we needed something that was fuss-free. We didn’t want to wrangle with a CI tool and try to get it set up. Because Snap is hosted, has an integration with GitHub, and an easy set up made it a simple choice for us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aTCrBi7fmMKDY6n7.jpg" /></figure><h3>So you build software for use on one day? How did it go? Was it is a success? What did you learn?</h3><p>Well, we could tell the volunteers and coordinators lots more information about the tins and volunteers than they could ever have got in the paper-based system.</p><p>But it was quite scary, really. What we provided, primarily, was intra-day, up to the minute, visibility into tin movements so that the organizers could respond. And, I think, we succeeded. Let me give you a few examples. There is a place in Singapore called Bishan?. It is a very populous place, very crowded, also very popular place with shoppers. Around mid-day, we actually saw they were running out of tins because we could see tins going out, coming back, getting filled, getting boxed, and we could say, “Oh, yes, they’re running out of tins.” The organizers were then informed, knew what happened, and could redeploy tins from elsewhere to Bishan to continue collecting money.</p><p>Another incident was, at the end of the day, we had a small handful of missing tins. Those tins didn’t come back to the center. In the past, it would mean several hours of tracing the different sheets of paper, finding out what shopping center or train station the tin was dispatched to in the morning, then calling the supervisor and asking, “Hey, do you have any record of this tin? Did you hand it out to anyone?” It would be a pain.</p><p>This year, we could look at a dashboard, trace the people and tins and say, “This guy took the tin at this time, and he didn’t return it.” We had all the information in our system, so we could just pick up the phone and say, “Hey dude, where’s the tin?” That was super awesome. The charity got all their tins back! And that was what the project was all about.</p><h3>What’s next for Project Tintin?</h3><p>Their director said she wanted give this app to other organizations. We hope that in the future we can help other organizations have a better system for their Flag Days.</p><p>[^1]: This Flag Day was a joint effort benefiting both DPA and the Muscular Dystrophy Association Singapore.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e930689c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/one-day-dozens-of-volunteers-hundreds-of-cans-and-a-ci-tool-b5e930689c0">One Day. Dozens of Volunteers. Hundreds of Cans. (And a CI Tool)</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are Your Team Practices Accidentally Making Things Harder for Introverts?]]></title>
            <link>https://medium.com/continuous-integration/are-your-team-practices-accidentally-making-things-harder-for-introverts-b1cb8c7814f3?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/b1cb8c7814f3</guid>
            <category><![CDATA[introvert]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Wed, 11 May 2016 21:37:24 GMT</pubDate>
            <atom:updated>2016-05-11T21:37:23.915Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can continuous integration improve life for introverts?</h3><p>A common definition of an introvert is someone who is energized by spending time alone. This does not mean that they don’t work well in groups or that they need to be locked in a quiet room by themselves (like I am right now writing this) to to be productive. It just means that some team activities may be fun and energizing to certain members, but draining to others. Just because an activity is draining doesn’t mean you shouldn’t do it; you should just make sure it’s the most effective use of your team’s energy.</p><p>Let’s say you have two members of your team, Indy the introvert and Elsa the Extrovert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*fLAccAB9kELZKc6s.jpg" /></figure><p>Both Indy and Elsa have each spent the last two weeks working on really important features for your product to manage Archeological Expeditions Inc. They have both been regularly committing their code to their feature branches, and are ready to merge back into the master branch. Unfortunately, there are some major merge conflicts in regards to how artifacts from the expeditions are stored. To resolve the issue, you have a meeting with the whole team to hash out all the details. It is a long, drawn out meeting. Elsa dominates the conversation because she really enjoys having lively debates. As a result, she ends up getting her way, since Indy decides after answering the third round of objections that it is too much work to fight it out. Elsa seems to think of the debate as a fun verbal joust, while Indy thinks of it as a bitter battle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*W4fBUDp_hkE3BSYU.jpg" /></figure><p>How could this situation have been handled differently? Before we start, we acknowledge that both Elsa and Indy care a lot about Archeological Expeditions Inc. They want the product to be successful and are doing everything they can to make sure that it is. They just don’t always see eye-to-eye on how to achieve that goal and conflict comes out of trying to resolve the disconnect.</p><h3>Identify the conflict early</h3><p>When the conflict is identified early, it’s relatively easy to fix. If it’s not caught early, it gets exponentially worse, building more functionality on top of their differences. So to avoid conflicts, they actually need to encourage having really small conflicts a lot earlier. They need to bring their changes back to a shared master/trunk on a regular basis, at least once a day. They could either move towards trunk-based development or–if they really want to keep working in their branches–they need to merge their code back into trunk regularly. The usual way that people would do this is to merge their code with the trunk and run all the tests on the merged code. If it passes all the tests, then they can confidently merge their code back into the trunk. In the Snap CI tool, this is done automatically using branch tracking. This small change lets Elsa make her changes to how the artifacts are stored, then Indy can see that there is a disconnect right away, rather than waiting until both of them have made substantial changes that rely on their different assumptions.</p><h3>Be specific and be sensitive</h3><p>Conflicts are much less painful when they are specific and one-on-one instead of general and in a group setting. Large team discussions can swerve from a facts-based discussion of the issue at hand to a dramatic conflict with charged emotions. Elsa and Indy both want to have the best possible solution to storing artifacts. If they get into a giant argument, there is a good chance that Indy will feel personally attacked or that Elsa may think that she is being accused of being a bad teammate because she didn’t take Indy’s needs into account. If they had broken the disagreement up into several small discussions, then they would have been able to resolve them one at a time and would have come to a shared understanding earlier. Once they agree where artifacts should be stored, then they can go back to focus on their own parts of the system.</p><h3>Break changes up into small, manageable pieces</h3><p>By breaking their changes into smaller pieces and deploying them separately, Indy and Elsa can get value from their changes faster. Because of his quiet personality, Indy might not make a big deal out of the valuable things that he is doing to the system, while Elsa finds it very easy to talk about her successes. Having smaller, more regular builds allows the team to see the value of Indy’s contributions in working software faster. It also lets the team find bugs faster and isolate exactly when they happened. Because they are getting feedback faster, they can incorporate that feedback to quickly change direction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*uJJ_VmGyLPLQEQ_B.jpg" /></figure><h3>When consistently applied, CI practices moves team communication forward</h3><p>By paying attention to the personalities of your teammates, you can make substantial improvements to their well-being as well as to overall productivity. You want to make sure that they are spending their energy on things that really matter. You also want to make sure that decisions are made based on what is best for the team overall, not just who is the best debater. When consistently applied, continuous integration practices help the team bring communication forward so team members can have simple, straightforward discussions and come to a shared understanding sooner.</p><p><em>This article was originally published on Snap CI’s </em><a href="https://blog.snap-ci.com/blog/2016/05/10/continuous-integration-introverts/"><em>The Pipeline</em></a><em> blog. Written by </em><a href="https://blog.snap-ci.com/authors/jeff-norris/"><em>Jeff Norris</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1cb8c7814f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/are-your-team-practices-accidentally-making-things-harder-for-introverts-b1cb8c7814f3">Are Your Team Practices Accidentally Making Things Harder for Introverts?</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get faster feedback now]]></title>
            <link>https://medium.com/continuous-integration/how-to-get-faster-feedback-now-3ee9202a0646?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ee9202a0646</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 22 Mar 2016 17:44:42 GMT</pubDate>
            <atom:updated>2016-03-22T17:44:42.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/80/0*2gLno3Wpk0y7DE-E." /><figcaption>by Suzie Prince</figcaption></figure><p>We’ve all experienced that feeling of working really hard on something that you “think” is amazing, only to have someone else give feedback that it’s “not quite right”. I love the way Mark Chang describes it <a href="https://www.thoughtworks.com/insights/blog/fail-fast-learn-fast">here</a>: “in hindsight, with every attempt, my mom taught me what she wanted to see and gave me course corrections.”</p><p>Getting course corrections with every attempt is the interesting bit for me, and it’s what I want with everything I do… even this blog post! I want to incrementally and iteratively get to the right place rather than trying to get there in one go and realizing I’m way off. I want fast feedback. The same applies to software. I want to know, quickly, if the thing I built works. But not just if it works, I also want to know if it…</p><ul><li>works with all the other things I wrote</li><li>works with all the other things you wrote</li><li>works when I deploy it</li><li>solves a customer need</li><li>makes my business better</li></ul><p>There is probably a bunch of other stuff I want to know as well (like does X work better than Y at solving my customer’s needs) but let’s just stick with the above questions to start. The key to answering them is to test the smallest thing possible, as fast as possible, in situations that answer them.</p><p>Here is how I answer these questions, quickly:</p><h3>Does it work at all and work with all the other things I wrote?</h3><p>My answer to this is self-testing code such as <a href="https://en.wikipedia.org/wiki/Unit_testing">Unit Testing</a>. This process allows you to write the smallest possible piece of code to pass a test to prove whether your code does what you want it to. By running all previous tests that have been written, you also ensure that your new code works with all the old code. Feedback, super fast.</p><h3>Does it work with all the other things my team wrote?</h3><p>Here the answer is <a href="http://www.mindtheproduct.com/2016/02/what-the-hell-are-ci-cd-and-devops-a-cheatsheet-for-the-rest-of-us/">Continuous Integration</a>, also referred to as CI. Unlike traditional processes where you integrate at the end, CI means that you regularly (daily or more often) get feedback on whether your work integrates with others’. This fast feedback ensures you don’t spend days, weeks, or months making everything work together at the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EYGeIaIzD5MkMKUc.png" /></figure><h3>Will it work when I deploy it?</h3><p>You could just deploy it and see, I suppose. But I assume you want to ensure you’re deploying quality code to production. By having self-testing code and doing CI, you will have confidence about individual changes in a development environment. You can also test in different environments to get a better feel for performance in production. However, once you start getting all these different types of tests, the “fast” part of “fast feedback” can slow down. How, then, do I continue to answer all my questions quickly?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*XKKMIWo3O7m1xDuN.png" /></figure><p>A deployment pipeline is the answer. A deployment pipeline uses a staged approach to testing and deploying to different environments, allowing you to test the things that are most likely to fail quickly, and get faster feedback from them. In addition, by making the environments at each stage increasingly production-like as they progress through the pipeline, you also get increasing confidence that your code will work in production. You can also parallelize your testing at each stage: by testing things simultaneously, you get faster feedback as well.</p><h3>Do my code changes solve a customer’s needs and improve my business?</h3><p>There are lots of ways to get feedback from users and customers, and you should start as soon as you can by asking questions, learning about customer needs and conducting usability tests. But if you really want to know if what you have done will work well and meet real-world needs, you will want to actually deliver to the real world regularly by practicing Continuous Delivery (CD) or Continuous Deployment.</p><p>Getting feedback from users sooner can be <a href="https://www.theguardian.com/info/developer-blog/2015/jan/05/delivering-continuous-delivery-continuously">transformative to businesses</a>. Using CD with deployment pipelines can help provide answers to your questions quickly… so you can transform your business.</p><p>Finally, there are two most things that also help you get faster feedback:</p><ul><li>The first is do things frequently. Doing all of these things over and over again might seem counter-intuitive and costly, but <a href="http://martinfowler.com/bliki/FrequencyReducesDifficulty.html">frequency reduces difficulty</a>. Frequency means smaller tasks, which are easier to achieve than big ones. Plus, with frequency you get better feedback sooner, and you just simply get better at doing things.</li><li>The second is automation. Automation will help you do all these things even more quickly and effectively, with less waste and less error. Tools for testings, CI and CD can help automate your processes and get your questions answered faster.</li></ul><p>So why not get out there, get feedback, and get faster?</p><p><em>This article was originally published on Snap CI’s </em><a href="https://blog.snap-ci.com/blog/2016/03/22/fail-fast/"><em>The Pipeline blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ee9202a0646" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/how-to-get-faster-feedback-now-3ee9202a0646">How to get faster feedback now</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enabling Trunk Based Development with Deployment Pipelines]]></title>
            <link>https://medium.com/continuous-integration/enabling-trunk-based-development-with-deployment-pipelines-d7c57dc3b736?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/d7c57dc3b736</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[trunk-based-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 06 Oct 2015 20:39:33 GMT</pubDate>
            <atom:updated>2015-10-06T20:39:33.135Z</atom:updated>
            <content:encoded><![CDATA[<p>Puppet Labs’ recently published <a href="https://puppetlabs.com/2015-devops-report">State of DevOps report</a> talks about how Continuous Delivery (CD) practices affect team performance, and specifically calls out trunk-based development as a leading indicator of high performance.</p><p>(Image below via Puppet Labs’ report)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wqcStFPBxmhv9LgI.jpg" /></figure><p>The <a href="http://www.amazon.com/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912">Continuous Delivery book</a> also highlights the importance of it in chapter 14 where it implies that trunk- (or mainline-) based development is actually a necessary condition for practicing Continuous Integration:</p><blockquote><em>“(Mainline development) is an extremely effective way of developing, and the only one which enables you to perform continuous integration.”</em></blockquote><p>At Snap, we practice trunk-based development (TBD) to develop our product and so do most consulting projects at<a href="https://www.thoughtworks.com/">ThoughtWorks</a> where we work.</p><p>Before we talk about TBD, let us look at some of the anti-patterns with branch-based workflows.</p><h2>Common anti-patterns with branch based workflows</h2><h3>Anti-pattern #1 — Long-lived feature branches</h3><p>The <a href="http://www.martinfowler.com/articles/continuousIntegration.html">core principle</a> of Continuous Integration is that of integrating code frequently. So, if you are doing development on long lived feature branches then you are no longer integrating code with everybody else frequently enough. This means delayed feedback and big bang merges that result in merge conflict resolution, reduced visibility and reduced confidence.</p><p>Of course, advanced CI features like <a href="https://blog.snap-ci.com/blog/2013/11/07/automatic-branch-tracking-and-integration/">automatic branch tracking</a> can help to some extent by automatically picking up new branches and running builds.</p><p>Snap even goes further and runs a build if it is able to merge successfully with the master and this tells you whether the branch can be safely integrated to the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TmVzJRb6cJZIUK7C.jpg" /></figure><p>This can be very useful feature for short-lived branches where you perhaps want to get your code reviewed by others before merging to the master or you are doing an experimental change and want to get feedback from CI.</p><h4>But working on long-lived branches adds significant risk that cannot be fixed with tooling:</h4><p>Firstly, the change-set in long-lived branches tends to be large. If someone else pushes a big change then it is going to be extremely difficult and risky to merge the code. We have all seen this at some point where we had to painstakingly merge lot of conflicts.</p><p>Secondly, this pain creates a tendency to hold back on refactoring on feature branches. Developers become wary of moving code between classes or even renaming methods because of the looming fear of having to resolve merge conflicts. Inevitably, this leads to piling up of technical debt.</p><p>Thirdly, working out of long lived branches does not give a chance for other developers on the team to pick up your changes quickly enough. This affects code reuse and can also result in duplicated efforts. For example, multiple developers upgrading to a new version of a library they need. Also, there is likely no visibility on changes happening in feature branches which eliminates any feedback loop from other developers in the project until the work is pushed to master, by which time it is too late to make changes to the design.</p><p>Fourthly, notice that the feedback loop with integration pipelines is long. If you have merge conflicts leading up-to master or test failures, it can be slow and painful to resolve.</p><p>Finally, feature branches promote the tendency of big bang feature releases — “Let me add one more thing before I merge to master” — which means not only delayed integration but also delay in delivering customer value and receiving early feedback. Also, the large change-set makes it difficult to troubleshoot issues or even rollback changes in Production if things go wrong.</p><p>In short, working out of long-lived branches adds risks and friction to the process of software delivery.</p><h3>Anti-pattern #2 — Branch per environment</h3><p>One of other most common anti-patterns is to have supporting branches like Dev, QA, Staging and Production in addition to features branches. Developers work out of feature branches and merge to Dev branch when they are ready, and merge to upstream branches all the way to the Production branch. Each branch would then be configured on the CI server to run builds and deploy to a specific environment on which the feature is validated.</p><p>Apart from inheriting the problems associated with long lived feature branches, this workflow gives a false sense of security that the mainline or Production branch is pristine whereas if you look closely, it in fact introduces many new unknowns and risks.</p><p>For instance, even if you test your code exhaustively in a staging or a QA environment, there is no guarantee that the same revision is what is deployed to production. Because other changes can be made directly on any of the branches (e.g. Hot fixes for Production!) it means that what you verified on QA is not valid anymore. Merge conflicts while promoting to any of the upstream branches further reduce confidence.</p><p>In addition, because you rebuild the artifacts for every branch, there is even more risk because even small environment configuration changes can lead to differences in the binaries. For e.g. a package update or compiler version difference is enough to make the binary different from what was built previously.</p><p>The build promotion process with branch based workflow also doesn’t give enough visibility into what gets deployed and<a href="http://nvie.com/posts/a-successful-git-branching-model/"> feels extremely complicated</a>. Modeling the workflow for different scenarios like hot fixes required on Production, rollbacks etc. is extremely tricky.</p><p>Unfortunately, this anti-pattern is encouraged by many CI tools that do not provide a true deployment pipeline which we will talk about shortly.</p><h2>How trunk-based development helps</h2><p>In trunk-based development (TBD), developers always check into one branch, typically the master branch also called the “mainline” or “trunk”. You almost never create long-lived branches and as developer, check in as frequently as possible to the master — at least few times a day.</p><blockquote><em>“Every developer is touching mainline, so all features grow in the mainline… which acts as a communication point. With CI, the mainline must always be healthy, so in theory (and often in practice) you can safely release after any commit. — </em><a href="http://martinfowler.com/bliki/FeatureBranch.html"><em>Martin Fowler</em></a></blockquote><p>With everyone working out of the same branch, TBD increases visibility into what everyone is doing, increases collaboration and reduces duplicate effort.</p><p>The practice of checking in often means that merge conflicts if any are small and there is no reason to hold back on refactoring. Troubleshooting test failures or defects becomes easier when the change-set is small.</p><p>TBD also implies deploying code from the mainline to production — which means that your mainline must always be in a state that it can be released to production.</p><h3>But, isn’t it too risky to develop on the mainline?</h3><p>This sounds like a scary idea and many people initially balk at the idea of checking in directly to the mainline in favor of using branches which in comparison feel safe and cozy.</p><p>But don’t worry. Even the browser that you are most likely reading this on, was <a href="https://medium.com/@aboodman/in-march-2011-i-drafted-an-article-explaining-how-the-team-responsible-for-google-chrome-ships-c479ba623a1b">built using this practice</a>.</p><p>While it is true that TBD expects a certain discipline from the developer, with the right practices, it can dramatically make your software development and deployment process much more reliable and lightweight.</p><p>The Continuous Delivery book mentions several best practices (below) to adopt TBD around the principle of keeping the mainline version releasable at all times:</p><h4>Small, incremental changes over big bang changes</h4><p>Frequent small changes are less risky, easier to integrate with and easier to rollback. Use <a href="http://continuousdelivery.com/2011/05/make-large-scale-changes-incrementally-with-branch-by-abstraction/">branch by abstraction</a> (not to be confused with version control branching!) to make even large-scale changes incrementally.</p><h4>Hide unfinished functionality with feature toggles</h4><p>Hide features that aren’t finished yet from users. <a href="http://martinfowler.com/bliki/FeatureToggle.html">Feature toggles</a> are an effective way to hide new features before you are confident about releasing them to users.</p><h4>Comprehensive automated tests to give confidence</h4><p>With a comprehensive automated test suite designed to give <a href="http://martinfowler.com/bliki/TestPyramid.html">fast feedback</a>, you have high confidence about the changes you are making. If you are always checking in small incremental changes, test failures are easy to fix.</p><h2>The deployment pipeline and trunk-based development</h2><p>The deployment pipeline enables a trunk-based CD workflow. By modeling your application delivery as a pipeline of stages from the trunk all the way to Production, you get the visibility and reliability required to deploy continuously to Production.</p><h3>The deployment pipeline represents the path to production</h3><p>The deployment pipeline is nothing but a concept that models your build and deployment workflow as a path to production. You model the pipeline as a <a href="https://blog.snap-ci.com/blog/2015/07/23/multi-stage-builds/">series of stages</a>. Each stage can be configured to run automatically based on the success of the previous stage OR with a manual trigger. Artifacts built in one stage can be consumed in subsequent stages — giving you the confidence that the same artifact that was tested is what is being deployed.</p><p>Continuous Delivery tools that implement the Deployment pipeline as first class concept can enable highly effective workflows with Trunk-based development.</p><p>A deployment pipeline modeled in Snap CI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QwqWeRlw7YJEqkpQ.jpg" /></figure><p>The pipeline status page in Snap CI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WfsLJEnAM3HeG6Bp.jpg" /></figure><p>You can see the list of commits and each commit has triggered a series of stages that lead all the way to Production. With each passing stage, you get higher confidence with that revision of the code. If something fails, the pipeline stops and you have to fix the build OR revert the commit that caused the failure. (Yes, this is inspired from <a href="http://www.lean.org/WhatsLean/">Lean</a>principles). Thus, the deployment pipeline thus affords a high degree of visibility into the build and the deployment process.</p><p>The pipeline can have any number of custom stages — including manually triggered stages — to deploy to intermediate environments like a QA or a PreProduction (staging) environment. This way, a QA (for example) can decide to manually promote a revision to a QA environment and after verification, promote it to a production or staging environment as is the process.</p><p>This eliminates the need to have a branch per environment and enables a highly visualized and reliable workflow with trunk-based development.</p><p>Also, because there is no friction that comes with intermediate branches, this workflow promotes the practice of pushing small incremental changes that the customer benefits from continuously — which is the whole point.</p><p>There are cases, of course, where directly checking in to trunk might not be suitable. For example, if you are developing an open source project you might not be willing to give access to third-party developers to commit to your mainline. Or if in an organization, you don’t want to give other teams the access to directly make changes without going through review by the core team. In such cases, Pull Requests and <a href="https://docs.snap-ci.com/working-with-branches/integration-pipelines/">Integration pipelines</a> can be suitable options and can be used in conjunction with TBD.</p><p><em>This article was originally published on </em><a href="http://snap.ci/1Ph3I2A"><em>Snap CI’s The Pipeline Blog</em></a><em>. Written by </em><a href="https://blog.snap-ci.com/authors/vishal-naik/"><em>Vishal Naik</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7c57dc3b736" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/enabling-trunk-based-development-with-deployment-pipelines-d7c57dc3b736">Enabling Trunk Based Development with Deployment Pipelines</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pull Request Workflow with Snap CI]]></title>
            <link>https://medium.com/continuous-integration/pull-request-workflow-with-snap-ci-f7e22a4c5441?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/f7e22a4c5441</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Tue, 22 Sep 2015 18:00:03 GMT</pubDate>
            <atom:updated>2015-09-22T18:01:43.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*XYk289zm9XrQJdcgFnH3Zg.png" /></figure><p><em>Snap CI has had pull request integration with GitHub for quite some time now. In this article, we will revisit the workflow in more detail.</em></p><p>Pull requests are an excellent mechanism to collaborate on projects on GitHub. With a pull request, a developer makes changes on the clone of a repo or a branch and requests for the change to be merged to the master branch — thereby enabling the repository’s core committers to review the code change before accepting it.</p><p>Continuous Integration tools further augment this workflow. For e.g. Snap can be configured to execute builds for pull requests and reflect the status of the build GitHub Pull Request page. This is valuable feedback and gives confidence that the pull request can be safely merged to the master.</p><p>In this example, I am using a fork of a <a href="https://github.com/spring-projects/spring-petclinic">sample project</a> from <a href="https://github.com/snap-ci-examples">Snap examples repos</a>.</p><p>The pipeline has been modeled with three stages: Test (run unit and integration tests), Package (build and package a web application archive) and Deploy (deploy to AWS Elastic Beanstalk).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OZkXX-Upwr4SHeFJ.png" /></figure><p>To enable pull request integration with GitHub, I click on the “Pull Request” link on the Settings page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yf8ggX8ynFBeFHUS.png" /></figure><p>This takes me to the “Pull Requests Settings” page where I can configure the build stages that need to run to validate the pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rN5d4nNJlG_bv0L5.png" /></figure><p>In above example, I want the Test and Package stages to be run so that I know that the application is in a clean slate.</p><p>I obviously don’t want the Deploy stage to be executed for pull requests, so I delete that stage from the pipeline configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fwESqFwyENXkV6Fr.jpg" /></figure><p>Apart from this, Snap also allows you to decide whether the secure files and environment variables configured for the master build should be applied to the “Pull Requests” build as well.</p><p>For pull requests from forked repos, Snap disables the option to copy configuration from master by default. This is because a malicious user can potentially expose the secure variables on your build.</p><p>Therefore, please be judicious when choosing to use the “copy configuration” option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oYN-tuER4IEHf2jK.jpg" /></figure><p>Let’s see what happens when I submit a pull request from GitHub. To do this, I first fork the example project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t2wtpbhk62emXieW.jpg" /></figure><p>After pushing my changes on the fork, I am now ready to submit a pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x91M4nn1L1nteDdy.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0jmO48w9iGE7aTmI.jpg" /></figure><p>After I create a pull request, note that GitHub starts showing information about pending checks — with a link to the Snap CI build for the pull request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yGr9mweAn9B3vloU.jpg" /></figure><p>Clicking on the “Detail” link takes me directly to Snap’s pull request build page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fBfmzqJG_B4tI2Cl.jpg" /></figure><p>Note that the Pull Request pipeline can be re-run at any point. This is handy if the master has moved ahead before you merged the pull request and you want to re-validate the build against the current master revision.</p><p>Once the build completes, GitHub reflects the status of the build on the pull request page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7KBZDEZ3s99eBCKy.jpg" /></figure><p>I now know that the pull request can be safely merged to the master!</p><p><em>This article is Part 1 in a series from our upcoming e-Book “CD with Snap CI”</em></p><p><em>This article was originally published on </em><a href="https://blog.snap-ci.com/blog/2015/09/22/pull-request-workflow/"><em>Snap CI’s The Pipeline Blog</em></a><em>. Written by Vishal Naik.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7e22a4c5441" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/pull-request-workflow-with-snap-ci-f7e22a4c5441">Pull Request Workflow with Snap CI</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI does include deploying to production]]></title>
            <link>https://medium.com/continuous-integration/ci-does-include-deploying-to-production-188a232e4c5d?source=rss----d29f501d4eb5---4</link>
            <guid isPermaLink="false">https://medium.com/p/188a232e4c5d</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <dc:creator><![CDATA[Snap CI]]></dc:creator>
            <pubDate>Thu, 13 Aug 2015 21:37:57 GMT</pubDate>
            <atom:updated>2015-08-13T21:37:57.441Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="http://www.thoughtworks.com/continuous-integration">Continuous Integration</a> has been around in some shape or form for over 10 years now. Back in 2001, with CruiseControl as the only tooling and Selenium still a few years away, it didn’t usually involve much more than compiling the application, running JUnit tests and finally building a jar if the tests finished successfully.</p><p>By 2004, I encountered my very first hand-crafted CI pipeline, created by hooking up two independent CruiseControl instances building the same repository together. One ran the faster unit tests and the other ran the much slower functional tests. The idea was just as cool as the implementation was fragile. In 2005, at a different client, my team came up with the concept of the “Big Purple Button” which would unsurprisingly be a big, purple button on the cruise dashboard which the business users of the application could click on to self-service a deployment to an internal staging environment. This was definitely not a new idea- and by the time of the <a href="http://martinfowler.com/articles/continuousIntegration.html">2006 rewrite of the ContinuousIntegration article</a> by <a href="http://martinfowler.com/">Martin Fowler</a>, it was commonplace for ContinuousIntegration to include not just unit tests, but also functional tests of some sort and additionally to even <a href="http://martinfowler.com/articles/continuousIntegration.html#AutomateDeployment">deploy to production</a>.</p><p>Since that time, 7 years ago, automating the deployment of your application all the way through to production has been a standard part of what might be considered Continuous Integration. We take that pretty seriously. We believe that any Continuous Integration tool, hosted or not, should treat deployments as a first class member of the Continuous Integration process. With Snap, this takes the form of a simple deployment pipeline; first described in the book <a href="http://www.amazon.com/gp/product/0321601912?ie=UTF8&amp;tag=martinfowlerc-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321601912">Continuous Delivery</a>, and summarized beautifully <a href="http://martinfowler.com/bliki/DeploymentPipeline.html">here</a>.</p><p>The key benefits of automating deployments and having them modelled as stages in a deployment pipeline are: * it creates cross-team visibility of when an environment is ready for an upgrade * it makes the history of deployments to an environment be easily visible, shared team information * smoke tests following the deployment can verify the health of the deployment and make evident its readiness for promotion</p><p>The following image shows the recent deployment history for the Snap <a href="http://docs.snap-ci.com/">documentation site</a>. The first stage generates the website using Jekyll and the subsequent stages which deploy to staging and production sync it to an S3 bucket. And yes, this does mean that deployments in Snap are not limited to just Heroku! That’s a different blog post for another day, though. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qJheVLbCmd-DRfMg.png" /></figure><p><em>This article was originally published on </em><a href="https://blog.snap-ci.com/blog/2013/08/06/ci-does-include-deploying-to-production/"><em>Snap CI’s The Pipeline Blog</em></a><em>. Written by Badrinath Janakiraman.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=188a232e4c5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continuous-integration/ci-does-include-deploying-to-production-188a232e4c5d">CI does include deploying to production</a> was originally published in <a href="https://medium.com/continuous-integration">Continuous Integration</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>