gpt4 book ai didi

azure - 让 Azure DevOps 审查 GitHub 拉取请求

转载 作者:行者123 更新时间:2023-12-01 03:09:39 28 4
gpt4 key购买 nike

https://azurecomcdn.azureedge.net/cvt-15581a490a8fb478b3258ea2c0ebb74bfa82fabce2af64ffc38962598949b138/images/page/services/devops/pipelines/github-integrations.jpg
(来源:azureedge.net)

我的代码存储库位于 GitHub 中,我的管道在 Azure DevOps 中配置。

我需要让 Azure DevOps 检查和过滤提交到我的 GitHub 存储库的每个拉取请求,并限制拉取请求的合并,直到它通过 Azure DevOps 构建。 Azure DevOps 似乎确实支持这一点。但没有关于它的文档或教程。如何实现这一目标?

最佳答案

您需要为您的分支定义构建验证策略(取自Improve code quality with branch policies > Build Validation:

  • Select the build definition from the Build definition drop-down.
  • Choose the type of Trigger - either Automatic (whenever the source branch is updated) or Manual.
  • Configure the Policy requirement. If set to Required, builds must complete successfully in order to complete pull requests. Choose Optional to provide a notification of the build failure but still allow pull requests to complete.
  • Set a build expiration to make sure that updates to your protected branch don't break changes in open pull requests.
    • Immediately when branch name is updated: This option sets the build policy status in a pull request to failed when the protected branch is updated. You must requeue a build to refresh the build status. This setting ensures that the changes in pull requests build successfully even as the protected branch changes. This option is best for teams that have important branches with a lower volume of changes. Teams working in busy development branches may find it disruptive to wait for a build to complete every time the protected branch is updated.
    • After n hours if branch name has been updated: This option expires the current policy status when the protected branch updates if the passing build is older than the threshold entered. This option is a compromise between always requiring a build when the protected branch updates and never requiring one. This choice is excellent for reducing the number of builds when your protected branch has frequent updates.
    • Never: Updates to the protected branch do not change the policy status. This reduces the number of builds for your branch, but can cause problems when closing pull requests that haven't been updated recently.
  • Choose an optional Display name for this build policy which is used to identify the policy on the Branch policies page. If you don't specify a display name, the build definition name is used.

配置完成后,来自 GitHub 的拉取请求应触发 Azure DevOps 中的构建。

希望对你有帮助!

关于azure - 让 Azure DevOps 审查 GitHub 拉取请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53385751/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com