fetch-ci-build
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFetch 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提供商
| Provider | Detection | Tool |
|---|---|---|
| GitHub Actions | | |
| Buildkite | | Python script |
| CircleCI | | Python script |
| 提供商 | 检测方式 | 使用工具 |
|---|---|---|
| GitHub Actions | | |
| Buildkite | | Python 脚本 |
| CircleCI | | Python 脚本 |
Auto-Detection
自动检测
From URL
通过URL检测
If the user provides a CI URL, detect provider:
- → GitHub Actions
github.com/.../actions/runs/... - → Buildkite
buildkite.com/... - or
app.circleci.com/...→ CircleCIcircleci.com/...
如果用户提供CI URL,将自动检测提供商:
- → GitHub Actions
github.com/.../actions/runs/... - → Buildkite
buildkite.com/... - 或
app.circleci.com/...→ CircleCIcircleci.com/...
From Project Files
通过项目文件检测
Check for CI configuration directories:
bash
undefined检查CI配置目录:
bash
undefinedGitHub 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"
undefinedtest -d .circleci && echo "circleci"
undefinedWorkflow
工作流程
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 skill.
systematic-debugging如果故障需要深度调查(例如:根因不明确、测试不稳定、环境问题),推荐使用技能。
systematic-debuggingError Types Detected
可检测的错误类型
| Type | Detection | Common Fixes |
|---|---|---|
| Test failure | Minitest/RSpec/Jest/pytest output | Fix assertion, update expected value, fix test setup |
| Lint error | Rubocop/ESLint/Biome violations | Auto-fix with linter's fix command |
| TypeScript | TSC compilation errors | Add types, fix type mismatches |
| Build error | Compilation failures | Fix syntax, missing dependencies |
| 错误类型 | 检测方式 | 常见修复方案 |
|---|---|---|
| 测试失败 | Minitest/RSpec/Jest/pytest输出 | 修复断言,更新预期值,修复测试设置 |
| 代码检查错误 | Rubocop/ESLint/Biome违规 | 使用代码检查工具的自动修复命令 |
| TypeScript错误 | TSC编译错误 | 添加类型定义,修复类型不匹配 |
| 构建错误 | 编译失败 | 修复语法错误,补充缺失依赖 |
Common Mistakes
常见问题
| Mistake | Solution |
|---|---|
| Can't detect provider | Specify provider explicitly or provide CI URL |
| Missing credentials | Check provider reference for required env vars/auth |
| Build still running | Wait for completion or check partial results |
| Rate limiting | Wait 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:推送修复前先在本地运行测试