[ci][issue] Fix external contributor assignment - #11666
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
There was a problem hiding this comment.
Pull request overview
This PR fixes the /claim issue-automation workflow so external contributors can be assigned when GitHub allows assignment at the issue level (even if they are not repository collaborators), by switching the assignability check to the issue-scoped assignee API.
本 PR 修复 Issue 自动化 /claim 流程:当 GitHub 在 Issue 级别允许将外部贡献者设为 Assignee(即使其不是仓库协作者)时,脚本也能正确完成指派;实现方式是将“可指派性”检查切换为 Issue 级 assignee 接口。
Changes:
- Update
GitHubClient.can_assign()to call the issue-scoped endpoint/repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}and threadissue_numberthrough the claim flow. - Add/extend unit tests to verify the new API path and that
issue_numberis passed into the assignability check.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/ci/issue_claim.py | Switches assignability check to issue-scoped API and passes issue_number through handle_claim(). |
| tools/ci/test_issue_claim.py | Adds a unit test asserting the exact request path/expected status, and updates handler tests to assert issue_number is used. |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Issue 认领脚本使用仓库级 assignee 检查接口判断评论者能否被指派。该接口会将不属于仓库协作者的外部贡献者判定为不可指派,即使该用户已经评论了具体 Issue,并且 GitHub 的 Issue 级接口允许将其设为 Assignee。
这会导致外部贡献者评论
/claim后,只能通过机器人评论和in progress标签记录认领状态,Issue 右侧的 Assignees 仍为空。你的解决方案是什么 (what is your solution)
将可指派性检查改为使用包含 Issue 编号的 Issue 级 assignee 接口,并在认领流程中传入当前 Issue 编号。保留原有回退逻辑,确保 GitHub 确实不允许指派的账号仍可通过评论和标签记录认领状态。
新增单元测试验证 Issue 级 API 路径及 Issue 编号透传。
请提供验证的bsp和config (provide the config and bsp)
BSP: 不涉及 BSP。
.config: 不涉及配置变更。
action: Issue Automation Tests;本地执行认领专项 22 项测试及 Issue 自动化完整 48 项测试,全部通过。
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up