<?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 Ruzal Sth on Medium]]></title>
        <description><![CDATA[Stories by Ruzal Sth on Medium]]></description>
        <link>https://medium.com/@ruzal.sth8888?source=rss-eebb18c081af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e5s4clQiy_l6Ccp28W2w8w.jpeg</url>
            <title>Stories by Ruzal Sth on Medium</title>
            <link>https://medium.com/@ruzal.sth8888?source=rss-eebb18c081af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:36:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ruzal.sth8888/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[Overcome Merge Hell with Trunk based development and Continuous Integration]]></title>
            <link>https://medium.com/@ruzal.sth8888/overcome-merge-hell-with-trunk-based-development-and-continuous-integration-ecc1d4a530fe?source=rss-eebb18c081af------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecc1d4a530fe</guid>
            <dc:creator><![CDATA[Ruzal Sth]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 15:20:39 GMT</pubDate>
            <atom:updated>2024-02-04T15:20:39.605Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>Different teams and projects require different workflows, as there is no one-size-fits-all approach. To enhance collaboration and tackle problems like merge hell, software teams have experimented with various techniques over the years</p><p><strong>Version control systems (VCS)</strong> revolutionized code management by introducing branches and merging capabilities. This paved the way for various branching and development strategies like Feature Branching and GitFlow. However, despite their benefits, these strategies often face the ongoing challenge known as Merge Hell.</p><p>The solution of this problem? <strong>Continuous Integration (CI)</strong>, coupled with <strong>trunk-based development</strong>, provides a powerful approach to mitigate merge hell. CI ensures frequent integration of changes, while trunk-based development reduces complexity by emphasizing a single, stable main branch as the source of truth, enabling smoother collaboration and reducing the risk of integration issues.</p><p>So, in this blog we will learn about the use and importance of CI and TBD with all it’s advantages and workflow.</p><h3>What is Version Control?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OiWMEjjD_C8AkdFcWTJyRw.png" /></figure><p>Version control is a method or software that keeps track of changes made to files over time, enabling teams or developers to collaborate, track modifications, and easily revert to previous states. It organizes different versions of files and maintains a detailed record of adjustments, including contributors, timestamps, and specific changes made.</p><p>Here’s a scenario, Consider that you are editing a document over time. You might occasionally want to review an earlier version of the document or check to see if anyone else has made any modifications. Using version control is like having a time machine for your files.</p><p>Similarly taking reference of the figure above, let’s consider our application, which has two versions: v0.1 and v0.2. In the event that any issues arise with v0.2, we always have the option to revert back to the previous version. Additionally, we can perform tasks such as comparing different versions, reverting to previous states, and merging changes from different versions. This flexibility allows us to manage our application effectively and address any problems that may arise while also incorporating and integrating various updates.</p><p>Here we will focus on <strong>git</strong> as our default version control.</p><h3>Why branch in version control?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*86VYh3j8GwxD7JGdlRzYUw.png" /></figure><p>Branching in version control is a powerful feature that allows for parallel development and isolation of changes within a project. It makes it possible for numerous people or teams to work on various features, bug fixes, or experiments at once without interfering with one another’s efforts.</p><p>Additionally, branching supports orderly and effective software development operations. Teams can set up branches for certain features, improvements, or bug fixes, enabling developers to work on several projects at once. This concurrent development strategy boosts output and facilitates meeting project deadlines. In addition, branches offer a distinct separation of concerns, making it simpler to track changes, examine code, and, if required, roll back adjustments. Effective branching enables teams to maintain a disciplined and cooperative development process, facilitating easier change integration and reducing codebase conflicts.</p><h3>Different Development Workflows: A Comparison</h3><p>Over time, as Git and other version control systems developed to suit the demands of diverse development scenarios, new Git workflows were added.</p><p>Git workflows are several methods or techniques that teams can use to coordinate and manage projects while utilizing the Git version control system. Git workflows motivate DevOps teams and developers to use Git efficiently and consistently. Let’s investigate and evaluate a few typical Git workflows:</p><ol><li><strong>Centralized Workflow:</strong><br>A central repository acts as the only reliable source of information in this workflow. The central repository is copied by developers, who then edit it and push the changes back.</li><li><strong>Feature Branch Workflow:</strong><br>This process focuses on creating separate branches for bug fixes or new features.<br>Each new feature or problem receives its own branch, which the developers work on before merging it back into the main branch.<br>Due to the independence of each feature branch, it enables simultaneous development.</li><li><strong>GitFlow Workflow:</strong><br>With the use of the branching model known as GitFlow, development is divided into several branches for features, releases, and bug fixes. It makes use of branches such as “develop” for current work, “feature” for new features, “release” for preparing releases, and “hotfix” for urgent fixes.<br>It works well for projects that need rigorous versioning and frequent releases.</li><li><strong>Forking Workflow:</strong><br>The forking method became more common as open-source development and remote team participation grew. Developers can fork a central repository to make their own copy that is distinct from the original. Developers can freely make modifications in their own forks using this approach, then send pull requests to the main repository for review and merging.<br>By enabling contributions from other collaborators while retaining control over the primary repository, forking encourages a decentralized development approach.</li></ol><h3>Challenges of Traditional Development Workflows</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*6Bv0rfLswB4mGnIHzJ1QGA.jpeg" /></figure><p>The traditional process, also known as the centralized workflow, faces a number of difficulties, one of which is referred to as <strong>“merge hell</strong>”, which we will discuss on the next section.</p><p>The <strong>centralized workflow</strong> allows for numerous developers to work together directly on a single branch, making changes as they go and committing them to the shared repository. Conflicts and challenges arise when integrating modifications from various team members as the number of developers and code changes grows. The resolution of these disputes might become difficult and drawn out.</p><p>Alternative workflows, like the <strong>Feature Branch Workflow</strong> or <strong>GitFlow</strong>, were introduced to address these issues. These processes encourage a more organized method of branching and let programmers focus just on one feature or task at a time. As a result, only fewer merge conflicts arise and modifications may be incorporated into the main branch more easily.</p><p>But even though alternative workflows aim to reduce merge conflicts and alleviate merge hell, it is still possible for merge conflicts to occur. Here are a few reasons why merge conflicts can still happen:</p><ol><li><strong>Long-lived branches: </strong><br>If feature branches or development branches have long lifespans, they are more prone to accumulating conflicting changes over time. Conflicts are more likely to arise while attempting to merge a branch the longer it hasn’t been merged into the main branch.</li><li><strong>Parallel development:</strong><br>When several developers are working on various features or tasks at once, there is always a chance that some modifications will overlap and conflict with one another when the code is merged. Even with well-organized workflows, this can still occur if engineers don’t consistently update their branches with the most recent modifications from the main branch.</li><li><strong>Lack of communication and coordination:</strong><br>Communication breakdowns or poor teamwork can cause conflicting modifications to be made in several branches in collaborative contexts. When attempting to merge these branches together, merge conflicts may occur if correct synchronization and alignment are not maintained.</li><li><strong>Major code refactor changes</strong>: When considerable code refactoring or reorganization takes place, it may result in extensive changes to numerous files and modules. When attempting to integrate the refactored code with existing branches, these changes may conflict with other ongoing development projects, resulting in merge conflicts. While refactoring aims to improve the code’s quality, readability, and maintainability, it can introduce conflicts when merging the refactored code with other branches. These conflicts arise when the changes made during refactoring overlap with modifications made in parallel by other developers or teams.</li></ol><h3>What is Merge Hell?</h3><p>Merge hell refers to a situation where frequent and complex merge conflicts occur during the process of merging code changes from multiple branches. It frequently leads to time-consuming and clumsy attempts to resolve these issues.</p><p><strong>Let us consider a scenario</strong>,</p><p>Imagine a software development project where Alice and Bob, two developers, are each working on a feature branch that is descended from the main branch. Bob is working on a feature that will create a notification system, while Alice is developing a feature that will provide user authentication capability.</p><ul><li><em>Alice and Bob starts working on their respective feature branches at once, making frequent changes to the codebase.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkJOK_bI-2KGPpGNp3eFdA.png" /></figure><ul><li><em>After some time, Alice finishes her feature and successfully merges it into the main branch without any issue.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I6JbSjkhFsuX-LaFWog_lQ.png" /></figure><ul><li><em>Meanwhile, Bob continues working on his feature branch, making significant changes to various files, including some areas that Alice modified for the user authentication feature.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JDVwv6ob-kZZ9m7C8csBbw.png" /></figure><ul><li><em>When Bob finishes his feature and attempts to merge it into the main branch, conflicts arise due to the overlapping changes in the codebase. This is </em><strong><em>merge hell in action</em></strong><em>.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b62aX0LFO99gjbcG2E9QnA.png" /></figure><ul><li><em>Bob discovers that the changes Alice made to user authentication conflict with the way he implemented the notification system. He has to alter his code to take into account the new authentication feature, which adds more time to the dispute resolution process.</em></li><li><em>As more conflicts arise during the merge process, Bob’s productivity decreases, and frustration builds up. It becomes challenging to determine the root cause of conflicts and find an optimal resolution.</em></li></ul><p>This illustration shows how developers working on different branches with overlapping modifications might end up in merge hell. One of the ways to reduce such hassle is by implementing <strong>Continuous Integration </strong>along with <strong>Trunk-Based Development</strong>.</p><h3>Intro to Continuous Integration and Trunk-Based Development</h3><p><strong>Continuous Integration (CI)</strong> is a development methodology in which programmers routinely integrate their code changes into a common repository. The primary goal of CI is to automatically integrate and validate code changes in order to identify and fix integration problems as soon as possible.</p><p>Here’s how continuous integration works:</p><ol><li><strong>Code Repository</strong>:<br>Developers modify the source code while working on their local codebases.</li><li><strong>Automated Build</strong>:<br>A CI server or build system instantly gets the most recent code when developers commit their modifications to the repository.</li><li><strong>Automated Testing</strong>:<br>A series of automated tests are run after the code has been created. This covers integration tests, unit tests, and other project-specific test types.</li><li><strong>Integration and Validation</strong>:<br>The code is incorporated into a common branch or trunk after it passes the automated tests. To ensure that all modifications coexist without conflict, the CI server combines the changes with the current codebase.</li><li><strong>Notification and Feedback</strong>:<br>The build and test results receive quick feedback from the CI server. The build status, test results, and any potential integration problems are communicated to developers.</li></ol><p><strong>Trunk based development</strong>(TBD) is a modern software development approach that emphasizes keeping a single branch, called the “<strong>trunk</strong>” or “<strong>mainline</strong>” as the primary development branch</p><p>The idea is you work in master or close to master and you make small simple changes and get them integrated into the main as soon as possible. The goal of trunk based development is to promote collaboration, streamline development, and enable faster feedback loops.</p><p><em>One of the best thing about TBD is that it enables code reviews and makes it much more easier and efficient. It is easier to review smaller chunks of code rather than hopelessly gazing at 1000 lines of code changes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tEqRHMw8LNJkK-xqqG6rSw.jpeg" /></figure><p>Trunk-based development also allows for relatively <strong>short-lived branches</strong> because they are removed as soon as a developer pushes or submits their changes to the trunk.</p><p>But why are short-lived branches a good thing?</p><p><em>Think branching as an integration credit card. And just like any credit, you eventually have to pay off the debt at some point. The more the debt remains the more it gets difficult. With short-lived branches you don’t have to worry about debt accumulating in the form of merge conflicts.</em></p><p><strong>Lets see how Trunk Based Development works</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwHGedHL_zCByF6XE1sSwA.png" /></figure><p>In trunk-based development, the primary branches are the trunk (also known as the main branch or the master branch) and feature branches. The trunk represents the mainline development, while feature branches are created to work on specific features or changes.</p><p>The developer occasionally updates the feature branch with the most recent modifications from the trunk when working with it. The modifications from the trunk into the feature branch are merged or integrated during this process. By doing this, the feature branch maintains sync with the most recent version of the trunk and incorporates any updates or problem fixes.</p><p>The developer repeatedly works on the feature branch throughout the development process, adding and changing things as needed. The feature is prepared to be merged back into the trunk once it has been finished and tested.</p><p>A final merge operation is carried out by the developer to combine the feature branch with the trunk. The new feature and the current codebase are combined in this process by incorporating the modifications made in the feature branch into the trunk. The completed feature is now a part of the mainstream development because it is now a part of the trunk.</p><h3>How TBD and CI mitigates the problem of Merge Hell</h3><p>In the above of scenario of Bob and Alice, lets see how they can use TBD and CI to solve their problems.</p><ul><li><strong><em>Create feature branches</em></strong><em>: Bob and Alice would create their own feature branches from the main/trunk branch to work on their respective features. For example, Alice could create a branch called “</em><strong><em>Auth Branch</em></strong><em>” and Bob could create a branch called “</em><strong><em>Notification Branch</em></strong><em>.”</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fd-uPo5_LeRLs99Pxv1NOQ.png" /></figure><ul><li><strong><em>Develop features in their branches</em></strong><em>: Alice would work on implementing the authentication feature in her branch, while Bob would work on the notification system in his branch. They would make regular commits to their feature branches as they progress. Alice completes a part of feature and merges the changes in the trunk in short time. Once the feature gets successfully merged, the branch gets deleted.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Twkr_cLoHnXuoMet_XZkkQ.png" /></figure><ul><li><strong><em>Bring Trunk up to date</em></strong><em>: In the meantime, Bob regularly examines any modifications made to the trunk, merges those modifications, and integrates them with his own codebase. After thorough testing, his changes are also merged into the trunk.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Ek4A4c5rcpTa8vkVNPHOw.png" /></figure><ul><li><strong><em>Pull Requests</em></strong><em>: The pull request is a request to the original repository’s maintainers to review your changes and potentially merge them into the main codebase.<br>In the given situation, Alice and Bob do not directly integrate their code into the main branch. Instead, they submit a pull request, which serves as a request to merge their code changes into the primary branch. This pull request undergoes a review process where designated reviewers evaluate the code and decide whether or not to proceed with the merge.<br>During the review, the reviewers thoroughly examine the code, test its functionality, and assess its adherence to coding standards and best practices. They may also consider factors such as performance, scalability, security, and overall system compatibility.Reviewers play a crucial role in ensuring the quality and reliability of the codebase. They have the expertise to identify potential issues, bugs, or design flaws. If any such problems are found, the reviewers can provide valuable feedback and suggest changes that need to be addressed before the code is merged. These suggestions may include specific improvements, optimizations, or adjustments to make the code more efficient, maintainable, or compliant with the project’s guidelines.</em></li><li><strong><em>Continuous Integration</em></strong><em>: Continuous Integration (CI) is triggered every time Bob or Alice pushes their code changes or a pull request is created, and it initiates automated build and testing processes. This streamlined approach significantly eases and accelerates the development cycle.<br>Whenever Bob or Alice pushes their code, CI springs into action, executing a series of automated tasks. Firstly, it initiates the automated build process, which involves compiling the code, resolving dependencies, and generating the necessary artifacts. By automating this process, potential human errors are minimized, and consistency in the build is ensured.<br>Simultaneously, CI kicks off the automation testing phase. This encompasses a suite of tests that verify the functionality and quality of the code. It includes various types of tests such as unit tests, integration tests, and other relevant tests specific to the project. The automated tests provide quick and accurate feedback on the correctness of the code changes.<br>Several well-known CI/CD (Continuous Integration/Continuous Deployment) technologies are available that offer automated build and test capabilities for CI implementation. Jenkins, Travis CI, CircleCI, GitLab CI/CD, and GitHub Actions are a few commonly used CI tools.</em></li></ul><p><em>Here is an example of CI workflow with automated testing. Everytime code is pushed into the trunk, a series of tests runs to ensure the correctness and quality of code.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSWNikQEPSjjoQFP4-mcpw.png" /></figure><h3>Conclusion</h3><p>In conclusion, the combination of continuous integration (CI) and trunk-based development offers significant advantages for the development process. CI detects conflicts and compatibility issues early, preventing them from accumulating and reducing the likelihood of merge conflicts later on. Trunk-based development promotes collaboration, streamlines development efforts, and minimizes the risk of conflicts through iterative and focused changes. Together, CI and trunk-based development create an efficient and harmonious environment, ensuring an up-to-date and stable codebase, smoother code integration, and faster development cycles. By adopting these practices, teams can deliver high-quality software more effectively and with reduced merge conflicts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecc1d4a530fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multi environment CICD for a NodeJS application using AWS Code Pipeline and Terraform Part 1]]></title>
            <link>https://medium.com/@ruzal.sth8888/multi-environment-cicd-for-a-nodejs-application-using-aws-code-pipeline-and-terraform-part-1-fad391cea604?source=rss-eebb18c081af------2</link>
            <guid isPermaLink="false">https://medium.com/p/fad391cea604</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws-codepipeline]]></category>
            <category><![CDATA[codebuild]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ruzal Sth]]></dc:creator>
            <pubDate>Tue, 30 May 2023 08:20:27 GMT</pubDate>
            <atom:updated>2023-05-30T08:32:38.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mb8NoYxxrjJvy_SVfrfM3A.png" /></figure><p><strong>Introduction </strong>📄<strong>:</strong></p><p>Continuous Integration and Continuous Deployment (CI/CD) techniques must be effective and trustworthy in today’s quickly changing software development environment. This tutorial will walk you through setting up an AWS Code Pipeline and Terraform-based multi-environment CI/CD pipeline for a Node.js application. Utilizing these potent tools will teach you how to accelerate the delivery of high-quality software while streamlining your deployment operations and ensuring consistency across many environments.</p><p><strong>Note</strong>❗<strong>:</strong></p><blockquote>This tutorial and the implementation of a multi-environment CI/CD pipeline using AWS Code Pipeline and Terraform are intended for learning purposes and to familiarize yourself with various approaches to building CI/CD pipelines. While the concepts and techniques discussed here are applicable in real-world scenarios, it’s important to note that every organization’s requirements and infrastructure setup may differ.</blockquote><blockquote>In real-world scenarios, it is advisable to consider factors such as the complexity of your application, the scale of your infrastructure, security requirements, and compliance regulations. Additionally, it’s crucial to consult with your team and infrastructure experts to ensure the chosen approach aligns with your organization’s goals and best practices.</blockquote><blockquote>This tutorial provides a foundation for understanding multi-environment CI/CD pipelines and introduces you to AWS CodePipeline and Terraform as powerful tools for achieving automation and consistency in your software delivery process. You can build upon this knowledge and adapt the concepts and techniques presented here to suit your specific needs and production environments.</blockquote><blockquote>Remember to thoroughly test and validate any CI/CD implementation before applying it to critical production systems. Regularly review and update your pipelines and infrastructure configurations as your application and organization evolve.</blockquote><h3><strong>Understanding Multi-Environment CI/CD</strong></h3><p>Multiple environments are frequently used in the software development industry to support the many phases of the application lifecycle, including development, build, test, and production. For effective software delivery, it is crucial to comprehend the idea of multi-environment CI/CD and how it relates to different environments. Examining each environment’s function in the CI/CD pipeline, let’s see what it is:</p><ol><li><strong>Development Environment </strong>👨‍💻: <br>Developers write and test code in a development environment. It acts as a testing ground for experiments and iterations. Developers can cooperate on code development, validate new features, and make changes fast in this setting.</li><li><strong>Build Environment </strong>🏗️<strong>:<br></strong>The application code compilation, building, and packaging are the main objectives of the build environment. Here, dependencies are handled, the code from the development environment is processed, and a deployable artifact is produced. It makes that the code is ready for further testing and deployment and is in a deployable state.</li><li><strong>Test Environment </strong>🧪:<br>Unit tests, integration tests, and system tests, among others, are carried out in the testing environment. Before promoting the program to production, it offers an isolated environment to verify its functionality, performance, and stability. To detect any problems that might occur during deployment, test environments closely resemble the production environment.</li><li><strong>Production Environment </strong>✅:<br>The live setting where end users can access the application is known as the production environment. Any code that is put into use in a production environment must go through rigorous testing and adhere to strict quality standards. To reduce downtime and user impact, deployment to the production environment is frequently a well planned and coordinated procedure.</li></ol><p>These many environments are taken into consideration by multi-environment CI/CD, which automates the deployment workflow between them. It gives developers the ability to effortlessly send code updates from the development environment, start builds, carry out tests, and eventually deploy to the production environment. This method makes it possible to deploy software consistently and reliably at different phases while ensuring that each environment is set up, validated, and prepared for its particular function.</p><blockquote>You can efficiently manage the transitions between different environments, automate the essential tasks, and create a streamlined software delivery process by establishing a multi-environment CI/CD pipeline using AWS Code Pipeline and Terraform.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKh7WGASNTY3xUHLLS9paA.png" /></figure><p>This is the architecture we are working on. On the <strong>next part</strong> we will implement this architecture to create our custom pipeline for corresponding environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fad391cea604" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>