Azure DevOps Repos
Introduction
Azure DevOps Repos provide a secure, enterprise-grade, and integrated version control for your codebase. In the Alliance Business Suite (ABS) development cycle, we use Azure DevOps Repos to store our code, manage pull requests, and control versioning. This document outlines how to effectively use Azure DevOps Repos for your work within ABS.
Repository Structure
Our main repository is structured as follows:
main: The production-ready version of the application.develop: The staging branch containing features that are under review.- Personal branches: Every developer can have a personal branch named after themselves for work that doesn't directly relate to current feature development.
Setting up SSH Authentication
SSH provides a secure way to access your repositories. To set up SSH authentication:
- Open a command prompt and run
ssh-keygen -t rsa -b 4096 -C "your-email@example.com". - Follow the on-screen instructions to generate the SSH keys.
- Open the SSH public key file (commonly
id_rsa.pub) with a text editor and copy its content. - Go to Azure DevOps, and navigate to
User settings > SSH public keys. - Click
+ New Key, paste your copied SSH public key, and save.
Now you should be able to clone, pull, and push to Azure DevOps Repos without entering your username and password each time.
Pull Requests (PRs)
Pull Requests are the primary mechanism by which code changes are reviewed and added to the main repository. A PR should be reviewed by at least one other team member before being merged.
Creating a Pull Request
- Go to Azure DevOps and navigate to
Repos > Pull Requests. - Click
New Pull Request. - Select the source (your feature branch) and the target branch (
developormain). - Fill in the PR details and create the pull request.
Reviewing a Pull Request
- Go to
Repos > Pull Requestsin Azure DevOps. - Select the pull request you wish to review.
- Review the code changes and either approve or request changes.
Code Reviews
Code reviews are mandatory for every pull request. You can add reviewers under the Reviewers section while creating a pull request. Azure DevOps also supports inline comments and a rich set of annotations to aid in the review process.
Policies and Permissions
-
Branch Policies: We have set up specific branch policies for
mainanddevelopto ensure code quality. This includes a minimum number of reviewers and passing build checks. -
Access Permissions: Permission levels are set according to roles. For example, only certain team members can merge into
main.
Additional Features
- Wikis: Azure DevOps also offers a Wiki feature which we use for documentation.
- Tags: Utilize tags to mark important points in the repository’s history, like software versions or milestones.
Conclusion
Azure DevOps Repos is a robust tool that integrates seamlessly with our development cycle. Adhering to the guidelines outlined in this document ensures a smoother, more secure development process.
For more information on other DevOps practices, please refer to the Development Guidelines.
Feel free to contribute to this document to keep it updated and relevant.