【发布时间】:2018-04-30 13:12:30
【问题描述】:
使用 Microsoft.TeamFoundationServer.Client (15.112.1) 连接到 TFS 2017 Update 2 服务器,我们可以获得有关现有 PR 的详细信息,如下所示:
var connection = new VssConnection(collectionUri, credentials);
var client = connection.GetClient<GitHttpClient>();
var pr = await client.GetPullRequestByIdAsync(pullRequestId);
另外,我们可以像这样创建新的 PR:
var pr = await client.CreatePullRequestAsync(
new GitPullRequest
{
SourceRefName = "master",
TargetRefName = "develop",
Title = "[Automatic Merge]"
},
projectName, repositoryName);
另外,我们可以这样对 PR 进行投票:
var pr = await client.CreatePullRequestReviewerAsync(
reviewer, projectName, repositoryName, pullRequestId, authorizedIdenity.Id.ToString());
有没有办法完成 PR(覆盖或不存在的分支 政策)并继续进行合并操作?
【问题讨论】:
-
也可以使用REST API完成PR:visualstudio.com/en-us/docs/integrate/api/git/pull-requests/…
-
覆盖策略怎么样?
-
在stackoverflow.com/questions/52025417/…987654322@这个帖子上回答了类似的问题
-
@pijei tfs 的版本在这种情况下很重要,这个问题在其他线程之前很重要。我将检查稍后提出的解决方案,检查它是否适用
标签: tfs azure-devops tfs-sdk azure-devops-rest-api