30 Days of DevOps Day 14: Source Control

30 Days of DevOps Day 14 we’re comparing our source control models:

Learn about your team’s source code control branching model and the reason for following it. Does the team practice trunk- or master-based development, use feature branches, or some other approach?

It’s been a while since I actively did this but in one of my previous companies we had a “master” and a “release” approach. Devs would work in feature branches which tied to Jira tickets. Once those branches were ready, they would be merged into master. At the end of each sprint, the master branch would be pushed to release so that both master and release mirrored each other.

What approach does your company take?

In the past few companies I worked in, our workflow was similar to this:

  • Our main branch was develop branch, which was considered the place for the latest code for the app.
  • Developers would create feature branches from develop to work on their stories (tied to a tool like Pivotal Tracker or an in-house system). These feature branches also spun up temporary instances of the application for testing purposes. When the work in these feature branches was complete, it would get merged into develop.
  • A few days before the end of our sprint, the code in the develop branch was merged into a release-candidate branch, which updated our staging servers to allow QA to do more thorough regression / exploratory testing. If any issues popped up during this phase, it would get fixed in a feature branch and merged with release-candidate.
  • Once everything looked fine on staging and the team got the green light to deploy to production, the code in release-candidate gets pushed to master, which was considered our stable branch. The master branch automatically took care of updating the live site.

At my last job, the team changed this approach to have the master branch the main development branch as we were beginning to improve our automated test coverage, with the idea to have continuous delivery in place. I left that job before the transition completed so I’m unsure if they stuck with it.

1 Like

Darya has shared this blog post on Twitter