Bot /用户可以投票PR [英] Bot/User that can vote on PRs

查看:94
本文介绍了Bot /用户可以投票PR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在寻找一个机器人/用户,它将从Sonar检索信息,并根据这些信息批准或不通过拉动请求。

I'm looking to make a bot/user that will retrieve information from Sonar and, based on this information, will either approve or fail a pull request.

我的TFS和Sonarqube没有集成在一起;我们使用TFS,但是我们在Jenkins上运行构建,然后转到Sonar进行代码分析。

My TFS and Sonarqube are not integrated together; we use TFS but we run our builds on Jenkins and then it goes to Sonar to get code analysis.

是否有类似的可用示例?我试过看但我没找到任何东西。此外,API中是否有任何内容允许这样做?我找到了一个标题"完整拉取请求"但当我点击它时,我需要
"创建一个拉动请求"相反:  https://www.visualstudio.com/en-us/docs/integrate/api/git/overview。

Is there an example of anything similar to this available? I've tried looking but I haven't found anything. Also, is there anything in the API that allows for this? I found a header "Complete pull request" but when I click on it it takes me to "Create a pull request" instead: https://www.visualstudio.com/en-us/docs/integrate/api/git/overview.

如果有人有任何提示或提示开始这个项目,我们将不胜感激。

If anyone has any tips or hints to get started on this project, it would be greatly appreciated.

谢谢

推荐答案

嗨脚蹬,

有一个REST API来更新评论者的投票:

There is a REST API to Update a reviewer's vote:

PUT https://{instance}/DefaultCollection/{project}/_apis/git/repositories/{repository}/pullRequests/{pullRequest}/reviewers/{reviewer}?api-version=3.0-preview


Content-Type:application / json

Content-Type: application/json

{
" vote":{integer}
}

欲了解更多信息,请参阅以下链接:

For more information, please refer to the link below:

https:// www。 visualstudio.com/en-us/docs/integrate/api/git/pull-requests/reviewers#update-a-reviewers-vote

有相关的API供 使用;更新评论者的投票:

There are related APIs for  Update a reviewer's vote:

1。获取存储库ID:

1. Get Repository id:

https://www.visualstudio.com/en-us/docs/integrate/api/git/repositories#get-a-list-of-repositories

2。获取评论者ID:

2. Get Reviewer id:

https://www.visualstudio.com/en-us/docs/integrate/api/git/pull-requests/reviewers#get-a-list-of-reviewers

最好的问候


这篇关于Bot /用户可以投票PR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆