sentry-pr-code-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sentry 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
sentry[bot]
- ignore other bots.
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
    <summary>🔍 <b>Detailed Analysis</b></summary>
    block
  • Suggested Fix: Inside
    <summary>💡 <b>Suggested Fix</b></summary>
    block
  • AI Prompt: Inside
    <summary>🤖 <b>Prompt for AI Agent</b></summary>
    block
从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:
  1. Read the file at the specified line
  2. Confirm issue still exists in current code
  3. Review related code to understand if its an actual issue or not
  4. Implement fix (suggested or your own)
  5. Consider edge cases
针对每个问题:
  1. 读取指定行的文件
  2. 确认问题在当前代码中仍然存在
  3. 查看相关代码以判断是否确实是问题
  4. 实施修复(使用建议的方案或自行编写)
  5. 考虑边缘情况

Phase 4: Summarize and Report Results

阶段4:总结并报告结果

markdown
undefined
markdown
undefined

Sentry Review: PR #[number]

Sentry审查:PR #[编号]

Resolved

已解决

File:LineIssueSeverityFix Applied
path:123descHIGHwhat done
文件:行号问题严重程度已应用的修复
path:123描述HIGH处理内容

Manual Review Required

需要人工审查

File:LineIssueReason
Summary: X resolved, Y need manual review
undefined
文件:行号问题原因
总结: 已解决X个问题,Y个需要人工审查
undefined

Common Issue Types

常见问题类型

CategoryExamples
Type SafetyMissing null checks, unsafe type assertions
Error HandlingSwallowed errors, missing boundaries
ValidationPermissive inputs, missing sanitization
ConfigMissing env vars, incorrect paths
类别示例
类型安全缺失空值检查、不安全的类型断言
错误处理被吞掉的错误、缺失边界处理
验证宽松的输入、缺失数据清理
配置缺失环境变量、路径错误