如何在Bitbucket的pull请求上添加评论

2024-06-16 12:13:06 发布

您现在位置:Python中文网/ 问答频道 /正文

如何以编程方式对Bitbucket上托管的pull请求进行注释(最好使用Python)?在

我有一个Buildbot服务器,它在Bitbucket上托管的所有分支上持续运行测试,在它为一个分支运行测试之后,我希望它检查任何挂起的请求,并自动创建一个注释,说明测试状态(例如通过/失败)。在

Thisthis表示Bitbucket有一个非常丰富的API,甚至还有列出注释的方法,但是我找不到任何方法来为pull请求创建注释。在


Tags: 方法服务器apibitbucket编程分支方式this
1条回答
网友
1楼 · 发布于 2024-06-16 12:13:06

根据1.0 API documentation

POST a new comment Creates a new comment on an request using the specified content data. The caller must be authenticated and have access to the repository to create an request. POST https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/pullrequests/{pull_request_id}/comments data "content=string"

以上位置提供数据样本。在

另外,根据this SO answer,API 2.0只支持读取请求请求注释,需要使用API 1.0来操作它们。在

相关问题 更多 >