gpt4 book ai didi

python - 如何创建对 Bitbucket pull 请求的评论

转载 作者:行者123 更新时间:2023-12-01 04:13:23 26 4
gpt4 key购买 nike

如何以编程方式对 Bitbucket 上托管的 pull 请求发表评论(最好使用 Python)?

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

Thisthis表明 Bitbucket 有相当丰富的 API,甚至有列出评论的方法,但我找不到任何在 pull 请求上创建评论的方法。

最佳答案

根据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"

以上位置提供了 --data 示例。

此外,根据 this SO answer API 2.0仅支持读取pull request注释,需要使用API​​ 1.0来操作它们。

关于python - 如何创建对 Bitbucket pull 请求的评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34620529/

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