Which azure-pipelines.yml runs in build-validation

Viewed 934

I have 2 questions about build validation in Branch policies in azure devops.

  1. When defining a build validation policy, you have a Build pipeline drop-down list,
    listing all the pipelines you have in your project (also pipelines that are defined for different repos).
    I was wondering what is the point in selecting a build pipeline that's defined in
    repo Foo as build validation pipeline for a branch in repo Bar. Anyhow as far as i tried,
    it's not even possible.

  2. Say i have master and feature branches, and i want to set a build validation policy for
    master. Now say i have a azure-pipelines.yml file both in master and in feature, which one of them
    will run when i issue a pull-request? It'll be great if someone could answer these questions
    with a widder context of how the whole mechanism of build validation works.

Thanks!

1 Answers
  1. You're right, we can't queue a build of one repo to a PR of a second repo, if you choose in the build validation a pipeline of another repo you will get this error:

enter image description here

  1. If the azure-pipelines.yml file is different in the branches, the behavior is like any file. if the YAML in the feature branch can be merged into master without issues so the YAML of the feature will be queued, because before the build is running, Azure DevOps perform a merge behind the scenes. if there are conflicts between the branches (in the YAML file) the build will not be queued until you will solve the conflicts, then the build will take the version after you solved the conflicts.
Related