Sample from yml file:
pool:
name: Managed
demands:
- agent.name -equals Agent2
# Overrides the value for Build.BuildNumber, which is used to name the artifact (ZIP file) that is produced
name: '$(Date:yyyyMMdd)T$(Hours)$(Minutes)$(Seconds)'
resources:
repositories:
- repository: RepoA
type: git
ref: release/X
name: company/RepoA
trigger:
branches:
include:
- release/X
- repository: RepoB
type: git
ref: release/X
name: company/RepoB
trigger:
branches:
include:
- release/X
... <more repos and other stuff to build the app> ...
Our application is split into multiple repos. Whenever a commit is made to any repo the pipeline should trigger and build the application (using all repos).
The issue occurs when I work on a feature where I have to make changes to both repos here. That results technically results in two commits (one for RepoA and one for RepoB), which means that this pipeline will trigger twice. This in itself it not so bad since we are self-hosting and don’t pay per run, but the issue is that sometimes the first run will fail, because it does not have the updated code from the other repo. This must be some internal limitation of how Azure works.
This means that in a scenario with a commit to both repos (that is done at the same time), two runs will happen. First run fails, then the second run will start directly after and succeed.
Two questions:
- Why is this happening?
- How, if possible, can we fix this?