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

164 lines
4.9 KiB
Markdown
Raw Permalink 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 全流程管理(真实数据)
> 本示例基于 `chroe/gitlink-cli` 项目于 2026-06-13 在 Claude Code 中实际执行。
> 展示完整的 Issue 管理流程:列出 → 查看详情 → 添加评论 → 关闭。
---
## 场景:项目维护者日常 Issue 处理
### Step 1查看全部 Issue
```bash
gitlink-cli issue +list --owner chroe --repo gitlink-cli --state open --format json
```
**真实输出摘要2026-06-13 验证,全部已关闭):**
```json
{
"ok": true,
"data": {
"opened_count": 0,
"closed_count": 6,
"total_count": 6,
"issues": [
{
"project_issues_index": 6,
"subject": "安装模块改进CI版本修复、FreeBSD渠道、Windows凭据路径、去除重复文件",
"author": { "login": "caoweiqiong", "name": "CWQ" },
"status": { "id": 5, "name": "关闭" },
"created_at": "2026-06-03 21:03"
},
{
"project_issues_index": 5,
"subject": "feat: 新增 file/member/watch/star 四大 Shortcut 模块15 个命令)",
"author": { "login": "caoweiqiong", "name": "CWQ" },
"status": { "id": 5, "name": "关闭" },
"created_at": "2026-05-31 08:55"
},
{
"project_issues_index": 4,
"subject": "增加milestone/webhook/label/commit Shortcut模块共20条命令",
"author": { "login": "chroe", "name": "chroe" },
"status": { "id": 5, "name": "关闭" },
"created_at": "2026-05-28 14:36"
},
{
"project_issues_index": 3,
"subject": "table 输出格式优化",
"author": { "login": "yetja", "name": "yetja" },
"status": { "id": 5, "name": "关闭" },
"comment_journals_count": 4,
"created_at": "2026-05-26 15:08"
},
{
"project_issues_index": 2,
"subject": "新增批量 Issue 操作命令batch-assignbatch-labelbatch-milestone",
"author": { "login": "yetja", "name": "yetja" },
"status": { "id": 5, "name": "关闭" },
"comment_journals_count": 4,
"created_at": "2026-05-25 11:01"
},
{
"project_issues_index": 1,
"subject": "test",
"author": { "login": "yetja", "name": "yetja" },
"status": { "id": 5, "name": "关闭" },
"comment_journals_count": 8,
"created_at": "2026-05-22 11:48"
}
]
}
}
```
**分析:** 6 个 Issue 全部已关闭(关闭率 100%)。#1-3 由 yetja 创建,#4 由 chroe 创建,#5-6 由 CWQ 创建。
### Step 2查看已关闭 Issue了解处理模式
```bash
gitlink-cli issue +list --owner chroe --repo gitlink-cli --state closed --format json
```
返回结果与 Step 1 相同(所有 6 个 Issue 均已关闭)。#1-3 有 4-8 条评论互动,#4-6 无评论。
### Step 3查看 Issue 详情(含评论)
```bash
gitlink-cli issue +view --owner chroe --repo gitlink-cli --number 3 --format json
```
**真实输出摘要:**
```json
{
"ok": true,
"data": {
"id": 142892,
"project_issues_index": 3,
"subject": "table 输出格式优化",
"description": "改进已有的 table 输出,让 list 命令用 `--format table` 时显示更美观",
"status": { "id": 5, "name": "关闭" },
"priority": { "id": 2, "name": "正常" },
"author": { "login": "yetja", "name": "yetja" },
"assigners": [{ "login": "yetja", "name": "yetja" }],
"tags": [{ "id": 323830, "name": "功能", "color": "#ee955a" }],
"created_at": "2026-05-26 15:08",
"updated_at": "2026-06-08 12:30",
"due_date": "2026-06-08",
"comment_journals_count": 4,
"participants": [
{ "login": "yetja", "name": "yetja" },
{ "login": "chroe", "name": "chroe" }
]
}
}
```
### Step 4获取 Issue 评论Raw API
```bash
gitlink-cli api GET /v1/chroe/gitlink-cli/issues/3/journals
```
评论列表用于了解 Issue 讨论进展,计算首次响应时间。
### Step 5添加评论并关闭 Issue
```bash
# 对开放 Issue 添加处理评论
gitlink-cli issue +comment --owner chroe --repo gitlink-cli --number 5 --body "已确认收到,将在下一迭代处理"
# 关闭已完成的 Issue
gitlink-cli issue +close --owner chroe --repo gitlink-cli --number 5
```
### Step 6批量操作预览模式
```bash
# 预览批量关闭(不实际执行)
gitlink-cli issue +batch-close --owner chroe --repo gitlink-cli --numbers 4,5,6 --dry-run
# 确认后执行
gitlink-cli issue +batch-close --owner chroe --repo gitlink-cli --numbers 4,5,6
```
---
## 关键发现
| 指标 | 数值 |
|------|------|
| 总 Issue 数 | 6 |
| 开放 / 关闭 | 0 / 6 |
| 关闭率 | 100% |
| 平均评论数(#1-3 | 5.3 条 |
| 平均解决周期(#1-3 | ~10.7 天 |
## 注意事项
1. `--number` 参数是网页 URL 中的序号(`project_issues_index`),不是数据库内部 ID
2. 已关闭 Issue 仍有评论互动,说明团队有 Issue 跟进习惯
3. 开放 Issue 均无评论,建议及时响应以改善 Issue 健康度