DevOps Toolchain with Atlassian – Part 2: Bitbucket

This article focuses on Bitbucket, a tool from the Atlassian toolchain. It describes how important this tool is for software development and how it is used in a DevOps context.

An essential component of any DevOps toolchain is a code repository for all types of software source code, as well as configuration and automation code. In this article, we’ll explore the features and workflows that enable DevOps principles to be put into practice using Atlassian Bitbucket as the central version control system (VCS).

Key topics covered in this article include: 

  • Collaboration and communication
  • Transparency
  • Knowledge management
  • Continuous development
  • Automation
  • Shift Left
  • Configuration management

Integration between Jira and Bitbucket

Following on from our latest blog post on the DevOps toolchain with Atlassian, we’ll start with Atlassian Jira. Essentially, integrating these tools improves the traceability of requirements and ensures greater transparency throughout the entire development process. This helps to eliminate, for example, any ambiguity regarding requirements. Furthermore, it reduces the number of errors caused by incorrect assignment or missing information.

Each Jira ticket can be linked to the relevant Bitbucket repository, which houses the software’s codebase. Bitbucket is based on the widely used version control system Git. This makes it possible to create a new development branch directly from the ticket for work on a new feature or bug fix. A branch is a fork of the codebase that serves as a separate workspace. Changes can be made in this branch without altering the codebase used for parallel work or the production software. Atlassian integrates the tools particularly well here, so that, for example, as work progresses on the code, our ticket can automatically be changed from ‘Open’ to ‘In Progress’. 

1 Atlassian Jira Developer Panel

The so-called Developer Panel in the Jira ticket displays key information on the development status: from code commits, branches and pull requests right through to builds and deployments from a CI/CD tool, along with their respective statuses. Errors caused by missing information or incorrect assumptions are therefore a thing of the past.

It is also very easy to switch between tools via this feature – for example, to view commits in Bitbucket and back again. All you need to do is mention the relevant ticket number in the commit. Whilst programming, the developer has all the associated requirements to hand, which they are to implement using code. This traceability of requirements is an important feature resulting from the integration of the tools. 

The integration options thus ensure greater transparency on the one hand and foster teamwork on the other.

Image: 1 Atlassian Jira Developer Panel

Knowledge sharing and code quality

Another advantage of Bitbucket is its integrated web interface. All the information and functions are presented very clearly and are easily accessible to users. This means you can view the source code via your browser even without any knowledge of Git command-line commands.

Bitbucket can display and search the complete version history of the code in the browser. This makes it easier, for example, to analyse errors or retrieve old code for a rollback. Furthermore, the code can also be compared (diff) and merged.

A frequently underestimated benefit of a powerful, centralised code management system such as Bitbucket lies in knowledge sharing and code quality. The development history of the software can be traced in Bitbucket. This enables reference solutions to be reused or decisions to be understood. This makes it easier for junior software developers to get started and encourages the exchange ofknow-how amongst colleagues right from the start.

Atlassian Bitbucket Code Review

Bitbucket offers the option of collaborative code reviews via so-called pull requests. Here, the developer submits their implementation to the team for discussion and can subsequently merge or integrate it directly within Bitbucket alongside other parallel developments. Features such as the display of code differences and comments or discussions on individual lines of code make collaborating on code even easier. The collective knowledge of the entire team and beyond can now be utilised and flows in both directions between developers and reviewers. Experienced developers can easily involve subject matter experts. This makes solutions more efficient and less prone to errors (the ‘Shift Left’ principle). Codequality can thus be significantly improved.

Image: Atlassian Bitbucket Code Review

Atlassian Bitbucket Version History

Versioning

In DevOps teams, this integration must take place as frequently as possible and, ideally, with minimal code changes. Any errors are identified early in the development process or very soon after release. Fewer implementations and dependencies will have been created by that stage, meaning less time is required for fault analysis. Issues can be corrected or rolled back more quickly. This is what makes continuous development and the release of new features or bug fixes possible in the first place.

Furthermore, with small commits, each individual change can be documented in a more traceable manner. The process by which they come about is more comprehensible and transparent to others.

Image: Atlassian Bitbucket version history

Configuration as Code

Bitbucket should not only contain the software code. A high degree of automation is always accompanied by numerous scripts or declarative descriptions. Examples include scripts for deploying the software (Bash, PowerShell, Ansible, Puppet, etc.), infrastructure definitions (Terraform, CloudFormation, ARM, HELM, etc.) or container descriptions (Dockerfiles, etc.). The definition of a so-called pipeline – starting from the commit, through build, test, integration, delivery, release and deployment – should also be described declaratively wherever possible. All this information and these files can also be stored in Bitbucket. The benefits described so far – collaboration, transparency, integration, reviews and knowledgesharing – can thus be utilised immediately.

Atlassian Bitbucket Full-Text Search

Enterprise Readiness

For enterprise use, there are numerous features that Bitbucket uses to specifically extend the Git version control system. These include, amongst other things, permission settings for users and groups, a full-text search across repositories and individual files, and various authentication options ranging from SAML to SSH and user tokens. 

Image: Atlassian Bitbucket full-text search

Bitbucket can be easily extended using apps from the Atlassian Marketplace or integrated with other components of the toolchain via webhooks.

In my next blog post, I’ll be looking at the CI/CD tool Atlassian Bamboo and its integration with Bitbucket. I’ll be examining the build and deploy phases, as well as the CI/CD pipeline in the context of DevOps, in more detail.

Maxym Basenko
29. March 2022 

Do you have any questions or would you like some advice from us?

Arrange a personal, no-obligation consultation with our Atlassian Sales Experts

Marlen Kaiser, Team Leader Customer Acquisition bei Communardo Software GmbH

Your contact person

Marlen Kaiser
We're happy to help you

Book an appointment now