Version Control

Introduction

Version control is an integral part of any software development project, especially when working with a team. It allows multiple people to work on a project at the same time, provides a history of changes, and helps in reverting to a previous state in case of mistakes or bugs. In the Alliance Business Suite (ABS), we use Azure DevOps for our version control needs, focusing on a Git-based workflow.

Git Workflow

We primarily use a feature-based Git workflow. Developers work on feature branches, which are then reviewed and merged into the main branch upon completion. The primary branches in our repository are:

  • main: The production-ready version of the application
  • develop: The staging branch that contains features that are under review
  • Personal branches: Every developer can have a personal branch named after themselves (e.g., daniel-lozano), for work that doesn't directly relate to current feature development.

Feature Branches

When starting work on a new feature, it is good practice to create a new branch off develop:

git checkout develop
git pull origin develop
git checkout -b feature/your-feature-name

Commit Messages

Commit messages should be clear and indicate what the commit achieves. Please use the following format:

[Task/Feature ID] Short description

Optional long description.

Pull Requests

All changes are introduced to the develop and main branches through pull requests (PRs). A PR should be reviewed by at least one other team member before being merged.

Creating a Pull Request in Azure DevOps

  1. Go to the 'Repos' section in Azure DevOps.
  2. Choose 'Pull requests' from the sidebar.
  3. Click on 'New Pull Request'.
  4. Choose the source branch (your feature branch) and the target branch (usually develop).
  5. Fill in the necessary details and create the pull request.

Branching Strategy

Given that every developer has a personal branch, you're encouraged to perform initial tests and reviews there before creating a pull request to develop.

  • Feature branches: feature/feature-name
  • Bugfix branches: bugfix/bug-name
  • Hotfix branches: hotfix/issue-name

Azure DevOps Repos

We use Azure DevOps Repos for hosting our code repository. Here are some key features and guidelines:

  1. SSH Authentication: We use SSH for secure access to our repository. If you haven't already set this up, please refer to the Setting Up Development Environment page for a guide on SSH setup.
  2. Code Reviews: Every pull request must go through a code review process in Azure DevOps. Please tag the appropriate people for code reviews.
  3. Policies and Permissions: Access to main and develop is restricted, and merging can only happen through PRs.

For more information, refer to our Azure DevOps Guidelines.