triage-pr-reviews
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTriage PR Review Comments
分类处理PR评审评论
- Run to get unresolved review comments as JSON. If no argument is given, use the current branch's PR. Note: this command uses Copilot for classification and may take a while depending on the number of comments — use a longer timeout. Each JSON object contains:
gh pr-reviews [arg] --json- (int): REST API comment ID — usable for replying via
comment_idgh api - (string, only for
thread_id): inline review thread IDtype: "thread" - :
type(inline review) or"thread"(PR-level)"comment" - ,
author,body: comment metadataurl - ,
commit_id,path,line(only fordiff_hunk): file location and diff contexttype: "thread" - : one of
category,suggestion,nitpick,issue,question,approvalinformational - (bool),
resolved(string): resolution status and rationalereason
- Check if PR metadata (number, title, url) is already available from conversation context. If not (e.g., when a PR number/URL is explicitly passed as argument), run to get it.
gh pr view [arg] --json number,title,url - For comments, use
type: "thread",path, andlinefrom the JSON response to identify the exact file location. Fordiff_hunk(PR-level), there is no file location.type: "comment" - Check code context for each comment. Leverage any existing conversation context first. Only fetch additional context via or file reads when necessary.
gh pr diff - Evaluate each comment against the code context. Classify as Agree, Partially Agree, or Disagree with a rationale and suggested action.
- Output results in this format:
undefined- 运行 以JSON格式获取未解决的评审评论。如果未传入参数,默认使用当前分支对应的PR。注意:该命令使用Copilot进行分类,耗时取决于评论数量,请设置更长的超时时间。每个JSON对象包含:
gh pr-reviews [arg] --json- (int):REST API评论ID,可用于通过
comment_id回复评论gh api - (字符串,仅
thread_id时存在):行内评审线程IDtype: "thread" - :
type(行内评审)或"thread"(PR层级评论)"comment" - ,
author,body:评论元数据url - ,
commit_id,path,line(仅diff_hunk时存在):文件位置和diff上下文type: "thread" - :取值为
category、suggestion、nitpick、issue、question、approval其中之一informational - (布尔值),
resolved(字符串):解决状态和理由reason
- 检查对话上下文中是否已存在PR元数据(编号、标题、url)。如果不存在(例如用户显式传入PR编号/URL作为参数),运行获取相关数据。
gh pr view [arg] --json number,title,url - 对于类型的评论,使用JSON返回结果中的
type: "thread"、path和line确定精准的文件位置。对于diff_hunk(PR层级)的评论,没有对应的文件位置。type: "comment" - 检查每条评论对应的代码上下文。优先利用已有的对话上下文,仅在必要时通过或读取文件获取额外上下文。
gh pr diff - 结合代码上下文评估每条评论,将其分类为同意、部分同意或不同意,并给出理由和建议操作。
- 按照以下格式输出结果:
undefinedUnresolved Review Comments Analysis
Unresolved Review Comments Analysis
PR: #<number> (<title>)
Unresolved comments: <count>
PR: #<number> (<title>)
Unresolved comments: <count>
Comment 1 — [<category>] by @<author>
Comment 1 — [<category>] by @<author>
<comment body>
File: (line <line>)
Assessment: Agree | Partially Agree | Disagree
Rationale: <1-3 sentences>
Suggested action: <recommended action>
<path><comment body>
File: (line <line>)
Assessment: Agree | Partially Agree | Disagree
Rationale: <1-3 sentences>
Suggested action: <recommended action>
<path>Summary
Summary
- Agree: n — should be addressed
- Partially Agree: n — worth discussing
- Disagree: n — can be explained or dismissed
Do NOT write to GitHub (no commenting, resolving, or any mutations). Do NOT commit or push. If code context is unclear, search the codebase to verify before making a judgment. Prefer `gh` commands for GitHub data.- Agree: n — should be addressed
- Partially Agree: n — worth discussing
- Disagree: n — can be explained or dismissed
请勿向GitHub写入数据(不要发表评论、标记评论已解决或执行任何变更操作)。请勿提交或推送代码。如果代码上下文不明确,请先检索代码库核实后再做出判断。优先使用`gh`命令获取GitHub数据。