2
votes

Currently when I create an PR i have multiple build validation policies running. Is there a way to make sure that the builds run in a specific order and one at a time.

Currently what happens is when the PR is created multiple builds starts at the same time. Which is causing builds to fail because the builds are depended on each other.

I have looked at the docs but it does not seem like there is an option for it.

https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#build-validation

1
Builds that depend on each other are a huge, huge anti-pattern. Builds should not depend on other builds.Daniel Mann
Be that as i may, but the project i am working on unfortunately need builds to depend on each other. It is a real headache but i cant change it, so i have to try and find a work aroundR4nc1d
@R4nc1d Hi, Is my answer helpful? If you have any question,please feel free to ask.Hugh Lin
Hi, sorry for replying yet...i was busy testing some scenarios that you suggested with the Build Completion triggersR4nc1d
It doesn't matter, if you have any confusion in the test, feel free to ask.Hugh Lin

1 Answers

0
votes

make sure that the builds run in a specific order

For your issue , if you want your builds run in a specific order ,I think you can set it in Build completion triggers . You can trigger a build upon the successful completion of another build. You can select any other build in the same project. Refer to this document for details .

But in order to actually run in order, you need to cancel the ci trigger and pr trigger on the related builds, because these triggers are not affected by the Build completion triggers, once these trigger conditions are met, the builds will still be triggered without order.

Run one build at a time

For this issue ,I think if you don't use multiple private agents or support multiple paid hosted agents, there should be no parallel running.