sentry-pr-code-review
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSentry Code Review
Sentry 代码审查
Review and fix issues identified by Sentry bot in GitHub PR comments.
审核并修复GitHub PR评论中由Sentry机器人识别的问题。
Invoke This Skill When
何时调用此技能
- User asks to "review Sentry comments" or "fix Sentry issues" on a PR
- User shares a PR URL/number and mentions Sentry feedback
- User asks to "address Sentry review" or "resolve Sentry findings"
- User wants to find PRs with unresolved Sentry comments
- 用户要求“审核Sentry评论”或“修复PR上的Sentry问题”
- 用户分享PR URL/编号并提及Sentry反馈
- 用户要求“处理Sentry审查”或“解决Sentry发现的问题”
- 用户想要查找存在未解决Sentry评论的PR
Workflow
工作流程
Phase 1: Fetch Sentry Comments
阶段1:获取Sentry评论
bash
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments \
--jq '.[] | select(.user.login | startswith("sentry")) | {file: .path, line: .line, body: .body}'Only process comments from - ignore other bots.
sentry[bot]bash
gh api repos/{owner}/{repo}/pulls/{PR_NUMBER}/comments \
--jq '.[] | select(.user.login | startswith("sentry")) | {file: .path, line: .line, body: .body}'仅处理来自的评论 - 忽略其他机器人。
sentry[bot]Phase 2: Parse Each Comment
阶段2:解析每条评论
Extract from the markdown body:
- Bug description: Line starting with
**Bug:** - Severity/Confidence: In
<sub>Severity: X | Confidence: X.XX</sub> - Analysis: Inside block
<summary>🔍 <b>Detailed Analysis</b></summary> - Suggested Fix: Inside block
<summary>💡 <b>Suggested Fix</b></summary> - AI Prompt: Inside block
<summary>🤖 <b>Prompt for AI Agent</b></summary>
从Markdown正文中提取:
- Bug描述:以开头的行
**Bug:** - 严重程度/置信度:位于中
<sub>Severity: X | Confidence: X.XX</sub> - 分析:在块内
<summary>🔍 <b>Detailed Analysis</b></summary> - 建议修复方案:在块内
<summary>💡 <b>Suggested Fix</b></summary> - AI提示词:在块内
<summary>🤖 <b>Prompt for AI Agent</b></summary>
Phase 3: Verify & Fix
阶段3:验证与修复
For each issue:
- Read the file at the specified line
- Confirm issue still exists in current code
- Review related code to understand if its an actual issue or not
- Implement fix (suggested or your own)
- Consider edge cases
针对每个问题:
- 读取指定行的文件
- 确认问题在当前代码中仍然存在
- 查看相关代码以判断是否确实是问题
- 实施修复(使用建议的方案或自行编写)
- 考虑边缘情况
Phase 4: Summarize and Report Results
阶段4:总结并报告结果
markdown
undefinedmarkdown
undefinedSentry Review: PR #[number]
Sentry审查:PR #[编号]
Resolved
已解决
| File:Line | Issue | Severity | Fix Applied |
|---|---|---|---|
| path:123 | desc | HIGH | what done |
| 文件:行号 | 问题 | 严重程度 | 已应用的修复 |
|---|---|---|---|
| path:123 | 描述 | HIGH | 处理内容 |
Manual Review Required
需要人工审查
| File:Line | Issue | Reason |
|---|
Summary: X resolved, Y need manual review
undefined| 文件:行号 | 问题 | 原因 |
|---|
总结: 已解决X个问题,Y个需要人工审查
undefinedCommon Issue Types
常见问题类型
| Category | Examples |
|---|---|
| Type Safety | Missing null checks, unsafe type assertions |
| Error Handling | Swallowed errors, missing boundaries |
| Validation | Permissive inputs, missing sanitization |
| Config | Missing env vars, incorrect paths |
| 类别 | 示例 |
|---|---|
| 类型安全 | 缺失空值检查、不安全的类型断言 |
| 错误处理 | 被吞掉的错误、缺失边界处理 |
| 验证 | 宽松的输入、缺失数据清理 |
| 配置 | 缺失环境变量、路径错误 |