gh-issue-fix-flow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gh Issue Fix Flow

Gh 问题修复工作流

Overview

概述

Resolve a GitHub issue from intake through fix, validation, and push using gh, local edits, XcodeBuildMCP, and git.
使用gh、本地编辑、XcodeBuildMCP和git完成从接收问题到修复、验证再到推送的全流程GitHub问题处理。

Workflow

工作流

1) Intake and issue context

1) 问题接收与上下文获取

  1. Use
    gh issue view <id> --repo <owner/repo> --comments
    to get the full issue context.
  2. If the repo is unclear, run
    gh repo view --json nameWithOwner
    to confirm.
  3. Capture reproduction steps, expected behavior, and any maintainer notes.
  1. 使用
    gh issue view <id> --repo <owner/repo> --comments
    获取完整的问题上下文。
  2. 如果仓库信息不明确,运行
    gh repo view --json nameWithOwner
    进行确认。
  3. 记录复现步骤、预期行为以及维护人员的任何备注。

2) Locate the code path

2) 定位代码路径

  1. Use
    rg -n
    to locate likely files and entry points.
  2. Read the relevant code paths with
    sed -n
    or
    rg -n
    context.
  3. Follow repo-specific conventions (AGENTS/CLAUDE instructions).
  1. 使用
    rg -n
    定位可能的文件和入口点。
  2. 使用
    sed -n
    或带上下文的
    rg -n
    查看相关代码路径。
  3. 遵循仓库特定的规范(AGENTS/CLAUDE 说明)。

3) Implement the fix

3) 实施修复

  1. Edit the minimal set of files.
  2. Keep changes aligned with existing architecture and style.
  3. Add tests when behavior changes and test coverage is practical.
  1. 仅编辑必要的文件。
  2. 确保修改与现有架构和代码风格保持一致。
  3. 当行为发生变更且测试覆盖可行时,添加测试用例。

4) Build and test

4) 构建与测试

  1. Use XcodeBuildMCP for required builds/tests:
    • Set defaults once:
      mcp__XcodeBuildMCP__session-set-defaults
      .
    • Build:
      mcp__XcodeBuildMCP__build_macos
      or
      mcp__XcodeBuildMCP__build_sim
      .
    • Tests: prefer targeted schemes (e.g.,
      mcp__XcodeBuildMCP__test_sim
      ).
  2. If macOS tests fail due to deployment target mismatches, run the equivalent iOS simulator tests.
  3. Report warnings or failures; do not hide them.
  1. 使用XcodeBuildMCP执行所需的构建/测试:
    • 一次性设置默认值:
      mcp__XcodeBuildMCP__session-set-defaults
    • 构建:
      mcp__XcodeBuildMCP__build_macos
      mcp__XcodeBuildMCP__build_sim
    • 测试:优先使用针对性的方案(例如
      mcp__XcodeBuildMCP__test_sim
      )。
  2. 如果macOS测试因部署目标不匹配而失败,运行对应的iOS模拟器测试。
  3. 报告警告或失败情况;不要隐瞒。

5) Commit and push

5) 提交与推送

  1. Check for unrelated changes with
    git status --short
    .
  2. Stage only the fix (exclude unrelated files).
  3. Commit with a closing message:
    Fix … (closes #<issue>)
    .
  4. Push with
    git push
    .
  1. 使用
    git status --short
    检查是否有无关修改。
  2. 仅暂存修复相关的修改(排除无关文件)。
  3. 附带关闭信息提交:
    Fix … (closes #<issue>)
  4. 使用
    git push
    推送代码。

6) Report back

6) 反馈结果

  1. Summarize what changed and where.
  2. Provide test results (including failures).
  3. Note any follow-ups or blocked items.
  1. 总结修改内容和位置。
  2. 提供测试结果(包括失败情况)。
  3. 记录任何后续工作或阻塞项。