microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 866 forks source link

Multiple branches pipeline triggers - YAML vs DevOps override YAML #4603

Closed tiagopsantos closed 2 months ago

tiagopsantos commented 9 months ago

What happened?

When using multiple branches to deploy (ProjA/develop, ProjB/develop), with the same final part name (develop), the multiple pipelines run all at once when the "final part branch" (ex ProjA/develop) is updated.

develop
ProjA/develop
ProjB/develop

With yaml pipelines added in devops configured for ProjA Pipeline in the ProjA/develop branch

trigger: 
  branches:
    include:
    - ProjA/develop

With yaml pipelines added in devops configured for ProjB Pipeline in the ProjB/develop branch

trigger: 
  branches:
    include:
    - ProjA/develop

If the ProjA/develop branch is edited both ProjA Pipeline and ProjB Pipeline are executed...

Printing the SourceBranchName its "develop", is there any limitation in sub-branches?

Checked and rechecked in devops the Pipelines in Edit are with the correct Branch.

**ProjA Pipeline** -> ProjA/develop
**ProjB Pipeline** -> ProjB/develop

Now the strangest part is, if used the Pipeline > Triggers (Override the YAML continuous integration trigger from here) With the same Branch > Include Branch specification (ProjA/develop) The behavior is the expected

Versions

Azure DevOps Server 2020 Update 1.1

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

Azure DevOps Server 2020 Update 1.1

Operation system

No response

Version controll system

No response

Relevant log output

No response

ismayilov-ismayil commented 9 months ago

Hi @tiagopsantos, thanks for reporting. Could you please check it by adding prefix refs/heads/ in front of your branch names?

and could you please confirm that this is not the same case with - https://learn.microsoft.com/en-us/azure/devops/pipelines/process/pipeline-triggers?view=azure-devops#combining-trigger-types

tiagopsantos commented 8 months ago

Sorry for the late reply, no with the

trigger: 
- refs/heads/ProjA/develop

When submit to ProjB/develop, the pipeline is triggered...

Only "Override the YAML continuous integration trigger from here" + include branch, we get the expected behaviour

github-actions[bot] commented 2 months ago

This issue has had no activity in 180 days. Please comment if it is not actually stale