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-address
.
Note: If
PR_NUMBER
is omitted, the command will automatically detect and use the PR associated with the current branch.
用法:
/pr-threads-resolve [PR_NUMBER]
说明: 批量解决未处理的PR评审线程。在手动处理线程或使用/pr-threads-address后非常有用。
注意: 如果省略
PR_NUMBER
,该命令会自动检测并使用当前分支关联的PR。

Workflow

工作流程

  1. Fetch and display all unresolved PR review threads
  2. Show thread details (file, line, comment text)
  3. Ask for confirmation or allow selective resolution
  4. Resolve the confirmed threads
  5. Report back with a summary of resolved threads
  1. 获取并显示所有未处理的PR评审线程
  2. 展示线程详情(文件、行号、评论内容)
  3. 询问确认或允许选择性解决
  4. 解决已确认的线程
  5. 返回已解决线程的汇总报告

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 42
This 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-review

CLI Reference

CLI 参考

List Review Threads

列出评审线程

Enumerate all review threads with filtering:
bash
gh pr-review threads list --pr <number> --repo <owner/repo>
Common filters:
  • --unresolved
    — Show only unresolved threads
  • --resolved
    — Show only resolved threads
枚举所有评审线程并支持过滤:
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:
  • --reviewer <login>
    — Filter by specific reviewer
  • --states <list>
    — Filter by review state (APPROVED, CHANGES_REQUESTED, COMMENTED, DISMISSED)
  • --unresolved
    — Show only unresolved threads
  • --not_outdated
    — Exclude outdated threads
  • --tail <n>
    — Show only the last n replies per thread
  • --include-comment-node-id
    — Include GraphQL node IDs for replies
显示评审内容、行内评论及回复,包含完整上下文:
bash
gh pr-review review view --pr <number> --repo <owner/repo>
常用过滤器:
  • --reviewer <login>
    — 按特定评审者过滤
  • --states <list>
    — 按评审状态过滤(APPROVED、CHANGES_REQUESTED、COMMENTED、DISMISSED)
  • --unresolved
    — 仅显示未处理的线程
  • --not_outdated
    — 排除过时的线程
  • --tail <n>
    — 仅显示每个线程的最后n条回复
  • --include-comment-node-id
    — 包含回复的GraphQL节点ID

Resolve / Unresolve Threads

解决/取消解决线程

Toggle thread resolution status:
bash
undefined
切换线程的处理状态:
bash
undefined

Resolve 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>
undefined
gh pr-review threads unresolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>
undefined

Bulk Resolve Example

批量解决示例

bash
undefined
bash
undefined

Get 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
undefined
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
undefined

Usage Notes

使用注意事项

  1. Repository Context: Always include
    --repo owner/repo
    to ensure correct repository context, or run commands from within a local clone of the repository.
  2. Thread IDs: Thread IDs (format
    PRRT_...
    ) can be obtained from
    review view --include-comment-node-id
    or
    threads list
    commands.
  3. State Filters: When using
    --states
    , provide a comma-separated list:
    --states APPROVED,CHANGES_REQUESTED
  4. Unresolved Focus: Use
    --unresolved --not_outdated
    together to focus on actionable comments that need attention.
  1. 仓库上下文:请始终包含
    --repo owner/repo
    以确保正确的仓库上下文,或在仓库的本地克隆目录中运行命令。
  2. 线程ID:线程ID(格式为
    PRRT_...
    )可通过
    review view --include-comment-node-id
    threads list
    命令获取。
  3. 状态过滤器:使用
    --states
    时,请提供逗号分隔的列表:
    --states APPROVED,CHANGES_REQUESTED
  4. 聚焦未处理项:结合使用
    --unresolved --not_outdated
    可聚焦于需要处理的有效评论。