简体   繁体   English

Azure DevOps生成管道无法使用标记和路径筛选器进行生成

[英]Azure DevOps Build Pipeline cannot build with Tag and Path Filter

So I am having a strange event not firing when it should be. 所以我有一个奇怪的事件,它应该在什么时候不触发。 I have a master branch and a Azure DevOps Build Pipeline. 我有一个主分支和一个Azure DevOps构建管道。 The branch filter is set to all as * . 分支过滤器全部设置为* It builds. 它建立。 I added a path filter with "/src/SomeFolder1" and it builds with code only checked into that folder. 我使用“ / src / SomeFolder1”添加了路径过滤器,并且仅使用已签入该文件夹的代码进行构建。 Perfect. 完善。

Now I added another branch filter with "refs/tags/v*" like I've always done to other build definitions on other projects with NO path filters and has ALWAYS worked. 现在,我添加了另一个带有“ refs / tags / v *”的分支过滤器,就像我一直在没有路径过滤器的其他项目上对其他构建定义所做的那样,并且一直都能正常工作。

In the git repo associated with the build pipeline I created a git tag as "v1.0.0" but nothing happens. 在与构建管道关联的git repo中,我创建了一个git标签为“ v1.0.0”,但是什么也没有发生。 No automatic build is being triggered. 没有自动构建被触发。 I looked at the Microsoft documentation ( https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#tags ) and I think I am meeting the requirements. 我查看了Microsoft文档( https://docs.microsoft.com/zh-cn/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#tags ),我认为我满足了这些要求。 Am I missing something? 我想念什么吗?

My final CI trigger is: 我最后的CI触发器是:

Branch filter:
  1) '*'
  2) 'refs/tags/v*'

Path filter:
  1) '/src/SomeFolder1'

When I remove the Path Filter, the trigger works perfectly file. 当我删除路径过滤器时,触发器可以正常工作。 It works either/or, but not both. 它要么起作用,要么不起作用,但不能同时起作用。

Based on our discussion in the comments and my testing, the issue is the path filter. 根据我们在评论中的讨论和我的测试,问题是路径过滤器。 It would appear that the path filter takes priority when the rules are applied. 应用规则时,路径过滤器似乎具有优先权。 Without a change to the actual content, the branch or the tag filters never get evaluated. 如果不更改实际内容,则永远不会评估分支或标签过滤器。 With tags, no actual content is changed which explains why the build isn't firing. 使用标签时,实际内容不会更改,这说明了为什么不触发构建。 I verified this by flipping the path filter from include to exclude. 我通过将路径过滤器从包含翻转为排除来验证了这一点。 As long as you have the path filter set, it is going to look for content change. 只要您设置了路径过滤器,它就会查找内容更改。

My suggestion would be to create a feature request for the scenario you've described or setup a separate build (I know, not ideal). 我的建议是为您描述的场景创建功能请求,或者设置一个单独的构建(我知道,这并不理想)。

Azure DevOps Build Pipeline cannot build with Tag and Path Filter Azure DevOps生成管道无法使用标记和路径筛选器进行生成

Sorry for any inconvenience. 任何不便敬请谅解。

I could reproduced this issue on my side. 我可以在自己这边重现此问题。 And this issue has been confirmed as an issue and move to the product team: 此问题已确认为问题,并移至产品团队:

Build triggers from Git Tag are no longer working. 来自Git Tag的构建触发器不再起作用。

Unfortunately, there is no workaround for this issue currently. 不幸的是,目前没有解决此问题的方法。 This issue has been reported to product group for further investigation. 已将此问题报告给产品组以进行进一步调查。 After the product group fixes it, this will return to normal. 产品组修复它后,它将恢复正常。 It may take some time, please be patient to get their feedback later. 可能需要一些时间,请耐心等待稍后获得他们的反馈。

You can vote and add your comments for this feedback. 您可以对此反馈进行投票并添加评论。 When there are enough communities vote and add comments for this feedback, the product team member will take this feedback seriously. 当有足够的社区对此反馈进行投票并添加评论时,产品团队成员将认真对待此反馈。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Azure Devops 和 Cake Build 在构建时自动标记和版本化? - How to tag and version automatically on build using Azure Devops and Cake Build? Azure Devops 构建管道 - 单击一次应用程序发布版本控制策略 - Azure Devops Build Pipeline - Click Once Application Release Versioning Strategy 如何根据提交消息触发 azure devops build pipeline? - How to trigger azure devops build pipeline based on the commit message? Azure devops:在不同存储库的分支上构建管道触发器 CI - Azure devops: Pipeline Trigger CI build on branch in different repositories 在单独的 Azure DevOps 存储库和构建管道中触发 Package 版本更新 - Triggering A Package Version Update In Separate Azure DevOps Repo and Build Pipeline Azure DevOps Releases 跨分支构建管道 - Azure DevOps Releases get pipeline build across branches 从构建管道推送到本地 Azure DevOps Git - Push to local Azure DevOps Git from Build Pipeline Azure DevOps 构建和发布管道与 GitFlow 分支 - Azure DevOps Build and Release-Pipeline with GitFlow Branching Azure DevOps Build Pipeline 有两个仓库,不同的文件夹 - Azure DevOps Build Pipeline with two repos, different folders 使用 Nuke 构建将标签推送到 Azure Devops 存储库 - Using Nuke build to push a tag to an Azure Devops repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM