pr-threads-resolve
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/pr-threads-resolve
/pr-threads-resolve
Usage:
/pr-threads-resolve [PR_NUMBER]Description: Bulk resolve unresolved PR review threads. Useful after manually addressing threads or after using .
/pr-threads-addressNote: If is omitted, the command will automatically detect and use the PR associated with the current branch.
PR_NUMBER用法:
/pr-threads-resolve [PR_NUMBER]说明: 批量解决未处理的PR评审线程。在手动处理线程或使用/pr-threads-address后非常有用。
注意: 如果省略,该命令会自动检测并使用当前分支关联的PR。
PR_NUMBERWorkflow
工作流程
- Fetch and display all unresolved PR review threads
- Show thread details (file, line, comment text)
- Ask for confirmation or allow selective resolution
- Resolve the confirmed threads
- Report back with a summary of resolved threads
- 获取并显示所有未处理的PR评审线程
- 展示线程详情(文件、行号、评论内容)
- 询问确认或允许选择性解决
- 解决已确认的线程
- 返回已解决线程的汇总报告
When to use
使用场景
Use this command when you have already addressed PR review threads and want to bulk resolve them, or when you need to clean up threads that are no longer relevant.
当你已经处理完PR评审线程,想要批量解决它们,或者需要清理不再相关的线程时,可以使用此命令。
Example
示例
/pr-threads-resolve 42This will:
- List all unresolved threads on PR #42
- Show what each thread is about
- Ask which threads to resolve (all or specific ones)
- Resolve the selected threads
- Provide a summary of resolved items
/pr-threads-resolve 42这将:
- 列出PR #42上所有未处理的线程
- 展示每个线程的内容
- 询问要解决哪些线程(全部或特定线程)
- 解决选中的线程
- 提供已解决项的汇总
Prerequisites
前置条件
Before using this command, check if the gh pr-review extension is installed:
bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review使用此命令前,请检查gh pr-review扩展是否已安装:
bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-reviewCLI Reference
CLI 参考
List Review Threads
列出评审线程
Enumerate all review threads with filtering:
bash
gh pr-review threads list --pr <number> --repo <owner/repo>Common filters:
- — Show only unresolved threads
--unresolved - — Show only resolved threads
--resolved
枚举所有评审线程并支持过滤:
bash
gh pr-review threads list --pr <number> --repo <owner/repo>常用过滤器:
- — 仅显示未处理的线程
--unresolved - — 仅显示已处理的线程
--resolved
View PR Reviews and Comments
查看PR评审和评论
Display reviews, inline comments, and replies with full context:
bash
gh pr-review review view --pr <number> --repo <owner/repo>Common filters:
- — Filter by specific reviewer
--reviewer <login> - — Filter by review state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)
--states <list> - — Show only unresolved threads
--unresolved - — Exclude outdated threads
--not_outdated - — Show only the last n replies per thread
--tail <n> - — Include GraphQL node IDs for replies
--include-comment-node-id
显示评审内容、行内评论及回复,包含完整上下文:
bash
gh pr-review review view --pr <number> --repo <owner/repo>常用过滤器:
- — 按特定评审者过滤
--reviewer <login> - — 按评审状态过滤(APPROVED、CHANGES_REQUESTED、COMMENTED、DISMISSED)
--states <list> - — 仅显示未处理的线程
--unresolved - — 排除过时的线程
--not_outdated - — 仅显示每个线程的最后n条回复
--tail <n> - — 包含回复的GraphQL节点ID
--include-comment-node-id
Resolve / Unresolve Threads
解决/取消解决线程
Toggle thread resolution status:
bash
undefined切换线程的处理状态:
bash
undefinedResolve a thread
解决一个线程
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
Unresolve a thread
取消解决一个线程
gh pr-review threads unresolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
undefinedgh pr-review threads unresolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
undefinedBulk Resolve Example
批量解决示例
bash
undefinedbash
undefinedGet all unresolved thread IDs and resolve them
获取所有未处理的线程ID并解决它们
gh pr-review threads list --pr 42 --unresolved --repo owner/repo |
jq -r '.threads[].id' |
xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo
jq -r '.threads[].id' |
xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo
undefinedgh pr-review threads list --pr 42 --unresolved --repo owner/repo |
jq -r '.threads[].id' |
xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo
jq -r '.threads[].id' |
xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo
undefinedUsage Notes
使用注意事项
-
Repository Context: Always includeto ensure correct repository context, or run commands from within a local clone of the repository.
--repo owner/repo -
Thread IDs: Thread IDs (format) can be obtained from
PRRT_...orreview view --include-comment-node-idcommands.threads list -
State Filters: When using, provide a comma-separated list:
--states--states APPROVED,CHANGES_REQUESTED -
Unresolved Focus: Usetogether to focus on actionable comments that need attention.
--unresolved --not_outdated
-
仓库上下文:请始终包含以确保正确的仓库上下文,或在仓库的本地克隆目录中运行命令。
--repo owner/repo -
线程ID:线程ID(格式为)可通过
PRRT_...或review view --include-comment-node-id命令获取。threads list -
状态过滤器:使用时,请提供逗号分隔的列表:
--states--states APPROVED,CHANGES_REQUESTED -
聚焦未处理项:结合使用可聚焦于需要处理的有效评论。
--unresolved --not_outdated