fetch-ci-build

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fetch CI Build

获取CI构建信息

Overview

概述

Fetch CI build results, diagnose failures, extract actionable error information, and suggest fixes. Supports multiple CI providers with automatic detection.
获取CI构建结果,诊断故障,提取可操作的错误信息并提出修复建议。支持自动检测多种CI提供商。

Supported Providers

支持的CI提供商

ProviderDetectionTool
GitHub Actions
.github/workflows/
or
github.com
URL
gh
CLI
Buildkite
.buildkite/
or
buildkite.com
URL
Python script
CircleCI
.circleci/
or
circleci.com
URL
Python script
提供商检测方式使用工具
GitHub Actions
.github/workflows/
github.com
URL
gh
CLI
Buildkite
.buildkite/
buildkite.com
URL
Python 脚本
CircleCI
.circleci/
circleci.com
URL
Python 脚本

Auto-Detection

自动检测

From URL

通过URL检测

If the user provides a CI URL, detect provider:
  • github.com/.../actions/runs/...
    → GitHub Actions
  • buildkite.com/...
    → Buildkite
  • app.circleci.com/...
    or
    circleci.com/...
    → CircleCI
如果用户提供CI URL,将自动检测提供商:
  • github.com/.../actions/runs/...
    → GitHub Actions
  • buildkite.com/...
    → Buildkite
  • app.circleci.com/...
    circleci.com/...
    → CircleCI

From Project Files

通过项目文件检测

Check for CI configuration directories:
bash
undefined
检查CI配置目录:
bash
undefined

GitHub Actions

GitHub Actions

test -d .github/workflows && echo "github"
test -d .github/workflows && echo "github"

Buildkite

Buildkite

test -d .buildkite && echo "buildkite"
test -d .buildkite && echo "buildkite"

CircleCI

CircleCI

test -d .circleci && echo "circleci"
undefined
test -d .circleci && echo "circleci"
undefined

Workflow

工作流程

dot
digraph workflow {
    rankdir=TB;
    node [shape=box];
    
    detect [label="1. Detect CI provider"];
    load [label="2. Load provider reference"];
    fetch [label="3. Fetch build results"];
    check [label="4. Check for failures" shape=diamond];
    passed [label="Report: Build passed!"];
    read [label="5. Read failing source files"];
    present [label="6. Present failures + proposed fixes"];
    ask [label="7. Ask: Apply fix?" shape=diamond];
    apply [label="Apply the fix"];
    complex [label="Complex failure?" shape=diamond];
    debug [label="Use systematic-debugging skill"];
    next [label="Next failure?" shape=diamond];
    done [label="Done"];
    
    detect -> load;
    load -> fetch;
    fetch -> check;
    check -> passed [label="passed"];
    check -> read [label="failed"];
    read -> present;
    present -> ask;
    ask -> apply [label="yes"];
    ask -> complex [label="no"];
    apply -> next;
    complex -> debug [label="yes"];
    complex -> next [label="no"];
    debug -> next;
    next -> read [label="yes"];
    next -> done [label="no"];
}
dot
digraph workflow {
    rankdir=TB;
    node [shape=box];
    
    detect [label="1. Detect CI provider"];
    load [label="2. Load provider reference"];
    fetch [label="3. Fetch build results"];
    check [label="4. Check for failures" shape=diamond];
    passed [label="Report: Build passed!"];
    read [label="5. Read failing source files"];
    present [label="6. Present failures + proposed fixes"];
    ask [label="7. Ask: Apply fix?" shape=diamond];
    apply [label="Apply the fix"];
    complex [label="Complex failure?" shape=diamond];
    debug [label="Use systematic-debugging skill"];
    next [label="Next failure?" shape=diamond];
    done [label="Done"];
    
    detect -> load;
    load -> fetch;
    fetch -> check;
    check -> passed [label="passed"];
    check -> read [label="failed"];
    read -> present;
    present -> ask;
    ask -> apply [label="yes"];
    ask -> complex [label="no"];
    apply -> next;
    complex -> debug [label="yes"];
    complex -> next [label="no"];
    debug -> next;
    next -> read [label="yes"];
    next -> done [label="no"];
}

Step-by-Step Process

分步流程

1. Detect CI Provider

1. 检测CI提供商

First, check if the user provided a URL. If not, detect from project files.
首先,检查用户是否提供了URL。如果没有,则从项目文件中检测。

2. Load Provider Reference

2. 加载提供商参考文档

Read the appropriate reference file for provider-specific commands:
  • GitHub: references/github.md
  • Buildkite: references/buildkite.md
  • CircleCI: references/circleci.md
读取对应提供商的参考文件以获取特定命令:
  • GitHub: references/github.md
  • Buildkite: references/buildkite.md
  • CircleCI: references/circleci.md

3. Fetch Build Results

3. 获取构建结果

Use the provider-specific commands to fetch build information and failures.
使用提供商特定的命令获取构建信息和故障详情。

4. For Each Failure

4. 处理每个故障

Read the relevant source file to understand context:
  • For test failures: read the test file at the indicated line
  • For lint errors: read the source file at the indicated line
  • For TypeScript errors: read the file and understand the type issue
读取相关源文件以了解上下文:
  • 测试故障:读取指定行的测试文件
  • 代码检查错误:读取指定行的源文件
  • TypeScript错误:读取文件并理解类型问题

5. Present Findings and Propose Fix

5. 展示结果并提出修复建议

Show the user:
  • What failed (test name, file, line)
  • Error message
  • Proposed fix based on the error
向用户展示:
  • 故障内容(测试名称、文件、行号)
  • 错误信息
  • 基于错误的修复建议

6. Ask User What To Do

6. 询问用户操作

Ask how to proceed:
  • "Apply the suggested fix"
  • "Investigate further before fixing"
  • "Skip this failure"
  • "Use systematic-debugging for deeper investigation"
询问用户下一步操作:
  • "应用建议的修复方案"
  • "在修复前进一步调查"
  • "跳过此故障"
  • "使用systematic-debugging进行深度调查"

7. Complex Failures

7. 复杂故障处理

If the failure requires deeper investigation (e.g., unclear root cause, flaky test, environmental issue), recommend the
systematic-debugging
skill.
如果故障需要深度调查(例如:根因不明确、测试不稳定、环境问题),推荐使用
systematic-debugging
技能。

Error Types Detected

可检测的错误类型

TypeDetectionCommon Fixes
Test failureMinitest/RSpec/Jest/pytest outputFix assertion, update expected value, fix test setup
Lint errorRubocop/ESLint/Biome violationsAuto-fix with linter's fix command
TypeScriptTSC compilation errorsAdd types, fix type mismatches
Build errorCompilation failuresFix syntax, missing dependencies
错误类型检测方式常见修复方案
测试失败Minitest/RSpec/Jest/pytest输出修复断言,更新预期值,修复测试设置
代码检查错误Rubocop/ESLint/Biome违规使用代码检查工具的自动修复命令
TypeScript错误TSC编译错误添加类型定义,修复类型不匹配
构建错误编译失败修复语法错误,补充缺失依赖

Common Mistakes

常见问题

MistakeSolution
Can't detect providerSpecify provider explicitly or provide CI URL
Missing credentialsCheck provider reference for required env vars/auth
Build still runningWait for completion or check partial results
Rate limitingWait and retry
问题解决方案
无法检测提供商明确指定提供商或提供CI URL
缺少凭证查看提供商参考文档获取所需环境变量/认证信息
构建仍在运行等待构建完成或查看部分结果
请求受限等待后重试

Integration with Other Skills

与其他技能的集成

  • systematic-debugging: Use for complex failures requiring root cause analysis
  • test-driven-development: After fixing, ensure tests follow TDD principles
  • verification-before-completion: Run tests locally before pushing fix
  • systematic-debugging:用于需要根因分析的复杂故障
  • test-driven-development:修复后,确保测试遵循TDD原则
  • verification-before-completion:推送修复前先在本地运行测试