0

我一直在将 Azure DevOps 中的构建/发布管道迁移到统一的 YAML 格式。一旦 PR 合并到主分支,除了与 CI 构建相关的工作项之外,一切都按预期工作。这是工作流程:

  1. 开发人员提出 PR 以将功能分支的更改合并到主分支
  2. PR 有一个构建策略,它针对测试环境执行 YAML 管道
  3. PR完成,将feature分支合并到master分支
  4. YAML 管道具有用于部署到更高环境的 CI 触发器

对于第 2 步,触发的构建会显示与 PR 关联的任何工作项:

在此处输入图像描述

但是,对于第 4 步,触发的 CI 构建会列出主分支中的所有工作项,而不仅仅是与 PR 关联的那些:

在此处输入图像描述

有没有办法只将与 PR 关联的工作项关联到 CI 构建,一旦特性分支合并到主分支就会触发?

4

1 回答 1

0

I can reproduce this issue and I found a similar ticket, they have reported it, you could follow this ticket to get the latest news.

If the build status is queue or running, then we create a new build, the new build will contain before build link work item. This is why the step 4 the triggered CI build lists all work items in the master branch rather than just those associated with the PR.

If all builds are completed, then we complete the pull request to trigger the CI build, it will be associated with the expected work items.

When all the builds were completed, I merged the PR to trigger the CI build, it just contain the pull request link work item.

Test result

enter image description here

于 2021-03-12T07:38:33.360 回答