azure-devopspull-requestgit-flow

How can we setup build validation for branches with a naming pattern like wildcard names (release/*) in azure devops?


We are in the process of configuring GitFlow branching where we want to trigger PR validation pipeline when a PR is created on release/* branch after our features in develop branch are ready to move on to next stage. As per Azure DevOps, we need to setup build validation pipelines in branch policies which is per branch. We want to archive our release branch after each release and use new release branch with same pattern i.e release/* in the next release .

  1. As far as i know , we will have to create branch policy and multiple configurations within it every release for the newly create release branch ? Is this correct ? :(
  2. I found that we can override Azure pipelines trigger from the UI and there we can have Branch filters and i was able to add release/* but that will be a CI pipeline and won't act as a validation pipeline on PR to release/* branch ? Is this correct ? :(
  3. Is creating PR & doing PR validations for release/* a wrong approach ? :(

How are you folks doing gitflow in Azure Devops ?


Solution

  • You can create a branch policy for the wildcard release/* and it will be for all future releases branch.

    In Azure DevOps, the /* represents as a folder so go the folder (in the Branches page), click on the ... dots, and "Branch policies".

    enter image description here

    You can see there that the policy of for the wildcard:

    enter image description here