Professional Documents
Culture Documents
Version Control
Last updated by | Jhonatan Reyes | Feb 23, 2022 at 10:55 AM GMT-5
Contents
• Introduction
• Scope
• Technologies used
• Branching model concept
• Use case using Azure Repos with Azure Boards
• How to create a branch
• Pull request creation
• Git command line
• Clone the repository from Azure Repos:
• Update a local repository:
• Push changes to the repository:
• Cloning specific branch:
• Pull request approval
• General considerations
• Approvers list
• Versioning control
Introduction
This document is intended to cover all the required explanations to follow a branching model for the ELT
development process.
Branching explanation.
Scope
Applies to ELT development team.
Technologies used
This branching approach was implemented on top of the following technological tools:
Azure Boards: Software designed to help with the tasks in the development process.
Azure Pipelines: Automation service to build and tests code projects to make them available to others in
different environments.
All technologies are in the Azure DevOps portal. The scope of this document is to list these tools for reference,
further investigation is required by the reader.
Optimize productivity.
Enable parallel development.
Allow for a set of planned, structured releases.
Provide a clear promotion path for software changes through production.
Evolve to accommodate changes that are delivered, daily, weekly, or whenever it is needed.
Support multiple versions of released software and patches.
The idea of using this approach is to efficiently manage code changes when requested by the client and make
an organized path from the start of the development process until the end, which is the deployment of the
development itself.
The way the branching model was implemented is oriented to Feature Branching Strategy (Task branching). This
type of work allows the developers to create a branch for a specific feature/issue, which is referred to as service
desk tickets. This branch-per-issue workflow allows developers to work separately
The previous image shows us a common approach for the task branch strategy. Each “feature” or “Task” branch
will be created by the developer using the issue/ticket number and all the changes in the code that may occur
will be committed at first on this branch, and later a Pull Request (PR) will be created to merge all changes to
the Development or Master branch.
Through the Azure DevOps Web interface, we can perform all the necessary steps to create the branch and Pull
Request (PR) for the development in the course. For this, use your assigned Team international account to
access the repository:
To work on a specific repository, select the project that you are going to make an adjustment to, as soon as you
enter it, you will see the following options:
From the left side, you can see all the available options for the project, the most relevant options related to the
branch creation are as follows:
Source: This is the main page of the repository, here you can check all the source code related to the
project.
Commits: Here you can check all the recent commits that were done to the project filtered by branch.
Branches: Here we can see all the branches created by the team, in here we can browse between them and
create new branch.
Pull requests: From this page, we can manage all the open PR (Pull requests) also we can create a new one
after our development is ready for promotion
In general, this is a quick overview of using Azure Repos and the required options to understand how this
works.
The branch name must be the User Story ID from Azure boards. Keep in mind that the branch name or User
Story ID may differ depending on the project, however, each field from that form has a purpose:
Work Items to link: This one is important, depending on the task please select the appropriate value
according to the User story, if it is a task or bug.
Based on: Indicates from which branch the developer will copy the data into the new branch.
Branch name: The developer indicates the name of the new branch using the User Story ID number only.
After branch creation, you can now use this new branch to add or modify the source files as requested in the
Task, all commits must be done inside this branch every time.
Please fill out the form provided by Azure Repos with enough information about the changes that are going to
be merged to the Master branch. The title and description fields must be filled by the developer without
exception. If the PR doesn’t comply with a proper description It will be rejected.
During the PR creation, before merging the changes to production, we need to add the reviewers of the
change, and those are the ones who finally approve the PR and all the changes are committed/merged to the
Master branch. The approvers from the team will be listed in this document in the section “Pull request
approval”.
https://dev.azure.com/TEAM-DOGS/Data Research and Development/_wiki/wikis/Data-Research-and-Development.wiki/678/Version-Control 9/15
3/22/22, 5:21 PM Version Control - Overview
After the PR creation, both reviewers must approve the PR to merge the changes to the Master branch before
promoting everything to production. This is a mandatory step.
On this page we can manage everything related to this process, here we can see when the reviewers have
approved or commented on the development. All the communication threads regarding the technical part of
this process must be done through the comment section:
In the previous image, we can see that all comments/communication in regard to this PR happens here. In this
place, both developer and reviewers manage all communications. Documents can be attached here if needed.
Rejected: Developer must validate the reviewer’s comments and make the necessary changes.
Git - Downloads
The official page contains enough information to get started using this tool, all the commands and usage of this
tool can be learned from here:
To give a better reference about how Git can be used for branching, please check these documents, which
contain some valid examples of how this approach works:
NOTE: Remember to complement all this information use this link Git - Book or this one Git - Referenc here
you can find all the topics and documentation related to Git.
This process is similar to the one described before using the Azure Repos interface, but with the difference that
it is done through commands in the Git command line.
To use Git, you need to have installed Git on your computer as described in the next numeral.
In the Start menu, you must open your favorite interface to use Git, in this case, we will use Git Bash, but you
can use Git CMD which works from the CMD interface, or Git GUI which uses a graphic interface.
First, you must ensure that you have the most recent version of the repository in your local machine. To do this
you can clone the repository from bitbucket or if you already have a local copy of the repository which you
used before you must ensure it is updated. These two processes are described below:
You must paste and execute this command on Git, this will copy the content of the folder from Azure Repos to
your local machine. You can enter this folder with CD command. By doing this you will be working by default on
the master branch which means that this command makes a check out to master by default.
you must be working at the master branch, so if you need to change the branch you must run:
Execute
git fetch origin
to find all the changes that the master branch had and execute
git reset --hard origin/main
After ensuring that you have the most recent version of the branch, you should create a branch by executing
This command creates a new local branch with a given name whose characteristics have been described before
and besides that, it makes a check out to this branch.
After that, you will not be able to see this branch on Azure Repos because it has the same code as the main
branch, but you will be able to start working locally on this branch from your preferred IDE.
General considerations
Pull Request go through an approval process as mentioned before in which other team members validates and
approves the changes uploaded by the developer. The Pull Request approvers have the following
considerations while evaluating the Pull Request if any of the following does not comply the PR can be rejected
until all necessary adjustments are made:
Unit testing evidence: The developer must attach to the ticket evidence of the testing made.
Execution logs: The developer must attach evidence of successful execution in the development
environment.
SQL scripts: If the development requires modifying or the creation of production database objects, the
script must be provided.
Proper code writing: Queries or code developed must be written in accordance with good practices.
Job development good practices: Jobs developed must comply with a minimum of good practices (no
hardcoded queries, connections, email notifications, and such).
All line of communications in regard to this takes place inside Azure Repos as mentioned in the Pull request
creation section.
Approvers list
The following users are the ones authorized to check and approve the Pull Request:
Accept pull request: You can go to Azure Repos, choose the pull request and you can see the changes to be
merged, conflict, documentation, approve or reject the PR, among others:
Versioning control
During the PR process and merging all the changes to the Master branch, we may encounter a situation in
which our changes have conflicts with another development. In such scenarios, we may involve all people
affected by this.
This means that we must reach the Team Leads, developers of the current branch, and the developers or team
members involved in the conflict. In these cases, we must negotiate with the other team or developer on how to
proceed also in this case with the rule of first-come, first-serve.
Versioning conflicts must be addressed as a team to avoid broking the development from another ticket or
team.