Generating Release Notes From Commits — An Azure DevOps Pipelines Story
Azure DevOps, as formerly known Visual Studio Team Services is a great tool for keeping every need in one place, especially with its own repos and CI/CD pipelines. I have been experiencing it couple of months now and can say that it saves me lot of time to set up everything in same place and keep my tasks with good connectivity thanks to the Boards feature.
Also both in my personal projects and the tech infrastructure in my company also entirely based on Azure, and it seems Azure DevOps plays nicely together, sounds too good to be true but actually is :)
Azure DevOps Pipelines is responsible CI / CD processes in this tool and we are heavily using it for our builds and deployments, things from lot of various tests integrations to containerization, lot of different tasks going under our pipelines and it is growing day by day.
Our latest need in these pipelines is an addition to our deployment tasks. We do sprint review meetings when the sprint ends (Obviously!) to talk about features we developed through, doing high level reviews for these features and wrap up the sprint in terms of needs of the product. Until now we are creating a document to write down the features in this sprint to talk in the review meeting, completely manually, and it was looking like this :
We wanted to create this table automatically for each sprint, when our release package deployed to the staging environment :
- Get the commit details in this package
- Get titles of the commits
- Get author of the commits
- Get related work items connected to these commits
And so on. Of course, in the automatic approach, it won’t be %100 semantic, but still it is better than to create everything from scratch manually :)
For the first plan, a simple approach as in the diagram below can give us what we want, but still it is a little tricky work that needs to be play with Azure DevOps API all the time to get almost every information we need.
Shorter Approach, Extensions !
Luckily there is an extension for generating release notes, and in this instance this is what we need.
First one is “Generate Release Notes” extension which is using the same Rest API calls to generate data roughly shown in the diagram above, and the second extension is “WIKI Updater” which basically saves this release notes into a wiki file to make it more versioned look like. Both of these extensions are easy to use and compatible with our pipelines, so instead of creating the whole scheme from scratch this made more sense to add a new step to our pipelines rapidly.
Adding these extensions to the pipeline is very straightforward, after installations the configuration can be seen below, which is the almost default except template
Release Notes Generation Step :
The only important area in this step is “Template” field which can be altered to your own needs, a regular one can be seen below :
There are different templates can be found on Extension’s own website and the template field can be altered with different versions with these.
Generating a WIKI Step :
In this step there couple of things to be aware about, which they are :
- Repo : Git URL of Your Wiki Repo in the Azure DevOps (e.g. : dev.azure.com/organizationname/gitreponame /_git/test.wiki)
- Name of the file : This will be output name of your WIKI based file, “Data is a file” option should be checked
- Source file : Name of the file which created in the first step(Release notes generation)
-Authentication : “Run with Build Agent Credentials” should be checked for elevating access in the pipeline
After saving these steps and running the pipeline, an example WIKI file can be seen like this if it all succeeded :
Despite of having its own limitations because of the nature of extensions, it is good to have a generated document like this, alongside with a proper versioning schemes this is a good way to keep the versions in an order and maybe if you have a release pipeline with a short cycles, this can be a good helper to keep your users notified about your products changes, with almost zero manual efforts.