microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 924 forks source link

Multi repository triggers doesn't work with batch mode #571

Open mblaschke-daimlertruck opened 1 year ago

mblaschke-daimlertruck commented 1 year ago

I'm trying to setup a pipeline which should trigger when changes in multiple repositories are detected but with a batched job:

resources:
    repositories:
    - repository: self
      checkoutOptions:
        submodules: true
        clean: true
        fetchDepth: 1
      trigger:
        batch: true
        branches:
          include:
            - main
        paths:
          include:
            - configuration/*

    - repository: repo1
      name: project/repo1
      type: git
      checkoutOptions:
        clean: true
        fetchDepth: 1
      trigger:
        batch: true
        branches:
          include:
            - main

This pipeline triggers when changes in self are detected but not in repo1. If i disable batch: true on repo1 then also the pipeline runs for commits in repo1, but doesn't care if there is already job running.

LiliaSabitova commented 1 year ago

Hi @mblaschke-daimlertruck thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.

keen85 commented 1 year ago

We are also effected by this and would appreciate a fix

mblaschke-daimlertruck commented 1 year ago

@keen85 We've got the response from Azure Support that this feature is not supported and there is no good way to control the concurrency of the Azure DevOps piplines. The only way is to register an "Environment" and switch to jobs.deployment and add an exclusiveLock to the environment. This is a very complicated way and you have to setup one environment per pipeline to get this running. This requires changes either via UI or API, the full setup is not possible via "yaml definition" only.

So far the product group refused to change this behaviour.

GitHub actions are providing this feature with the concurrency setting in yaml.

mblaschke-daimlertruck commented 1 year ago

After some further discussion the product team refused to implement the feature so there will be no proper pipeline lock in future.

Because of this issue and because Azure DevOps is lacking support for the upcoming changes in Azure (eg. no kubelogin support, the lack of support for custom pipeline agents, lack of support of version selections in lots of tasks, ...) we've decided to migrate to another solution instead as we have the feeling that Microsoft is dropping Azure DevOps.

It's funny that Azure DevOps is developed in GitHub so it seems that the major focus from Microsoft is actually GitHub and not Azure DevOps.

KjellTillstrand commented 9 months ago

Any update on this issue? I can see that it is still have status Open! I think it's a quite common case having multiple repositories aggregated into one deployment and test pipeline and a wish to have a stable environment for testing until testing is done.

Are there any good/simple workarounds for this?