gitlink-cli/skills/gitlink-issue/examples/issue-workflow.md

81 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Issue 全流程工作流
## 场景:创建、更新、评论、关闭 Issue
### 步骤 1创建 Issue
```bash
gitlink-cli issue +create \
--owner wbtiger \
--repo gitlink-cli \
-t "Bug: 登录失败" \
-b "复现步骤:
1. 打开登录页面
2. 输入错误密码
3. 点击登录
预期:显示错误提示
实际:页面崩溃"
```
**返回**:
```json
{
"ok": true,
"data": {
"id": 140801,
"message": "创建成功",
"status": 0
}
}
```
### 步骤 2查看 Issue 详情
```bash
gitlink-cli issue +view --owner wbtiger --repo gitlink-cli -i 140801
```
### 步骤 3添加评论
```bash
gitlink-cli issue +comment \
--owner wbtiger \
--repo gitlink-cli \
-i 140801 \
-b "已在本地复现,正在调查"
```
### 步骤 4更新 Issue
```bash
gitlink-cli issue +update \
--owner wbtiger \
--repo gitlink-cli \
-i 140801 \
-t "Bug: 登录失败 - 已定位到 auth.js 第 42 行"
```
### 步骤 5关闭 Issue
```bash
gitlink-cli issue +close --owner wbtiger --repo gitlink-cli -i 140801
```
## 测试验证
✅ 已验证的工作流2026-04-01:
- issue +create: 成功(需要 done_ratio=0
- issue +view: 成功
- issue +update: 成功
- issue +comment: 成功
- issue +close: 成功(需要 subject 字段)
## 常见错误
| 错误 | 原因 | 解决 |
|------|------|------|
| "标题不能为空" | 关闭 Issue 时缺少 subject | CLI 已自动处理 |
| "Mysql2::Error: done_ratio cannot be null" | 创建 Issue 时缺少 done_ratio | CLI 已自动处理 |
| 401 错误 | Token 过期 | 运行 `gitlink-cli auth login` |