BugPack - Fix Bug
Read bug context from BugPack, locate the relevant code, apply a fix, and mark the bug as fixed.
Instructions
- 1. Get bug context: Call
GET http://localhost:3456/api/bugs/:id to fetch full bug details including description, screenshots, environment, and related files.
- 2. Analyze the bug: Read the description and examine the screenshots to understand what is broken and what the expected behavior should be.
- 3. Locate code: Use the
relatedFiles array from the bug context to find the relevant source files. If relatedFiles is empty, use the pagePath and description to search the codebase.
- 4. Apply fix: Edit the source code to fix the described issue. Follow the project's existing code style and conventions.
- 5. Mark as fixed: After applying the fix, call
PATCH http://localhost:3456/api/bugs/:id with:
CODEBLOCK0
- 6. Add fix note (optional): Call
PATCH http://localhost:3456/api/bugs/:id with a description update to document what was changed.
Example
CODEBLOCK1
Response:
CODEBLOCK2
BugPack - 修复Bug
从BugPack读取Bug上下文,定位相关代码,应用修复,并将Bug标记为已修复。
操作说明
- 1. 获取Bug上下文:调用GET http://localhost:3456/api/bugs/:id获取完整的Bug详情,包括描述、截图、环境和相关文件。
- 2. 分析Bug:阅读描述并查看截图,了解问题所在以及预期的行为。
- 3. 定位代码:使用Bug上下文中的relatedFiles数组查找相关的源文件。如果relatedFiles为空,则使用pagePath和description在代码库中搜索。
- 4. 应用修复:编辑源代码以修复所述问题。遵循项目现有的代码风格和约定。
- 5. 标记为已修复:应用修复后,调用PATCH http://localhost:3456/api/bugs/:id,请求体为:
json
{ status: fixed }
- 6. 添加修复说明(可选):调用PATCH http://localhost:3456/api/bugs/:id并更新描述,记录所做的更改。
示例
bash
步骤1:获取Bug上下文
GET http://localhost:3456/api/bugs/abc-123
步骤5:标记为已修复
PATCH http://localhost:3456/api/bugs/abc-123
Content-Type: application/json
{ status: fixed }
响应:
json
{
ok: true,
data: {
id: abc-123,
status: fixed
}
}