feat: 完善工单路由规则和 Gitea API 指南
- gitea-api.md: 补全 5 个仓库地址、工单路由表、URL 前缀映射、remote 名称、关闭 Issue API - issue-workflow.md: 增加工单归属判断、跨仓库提工单流程、列出/关闭工单 API
This commit is contained in:
@@ -2,42 +2,102 @@
|
||||
|
||||
## 标准流程
|
||||
|
||||
### 1. 获取工单详情
|
||||
### 1. 读取工单
|
||||
|
||||
使用 Gitea API 获取 Issue 内容:
|
||||
```bash
|
||||
curl -s -H "Authorization: token $(cat ~/.config/gitea/token)" \
|
||||
TOKEN=$(cat ~/.config/gitea/token)
|
||||
curl -s -H "Authorization: token ${TOKEN}" \
|
||||
"https://git.dev.vifo.cc/api/v1/repos/{owner}/{repo}/issues/{id}"
|
||||
```
|
||||
|
||||
也可以列出当前仓库所有未关闭的工单:
|
||||
```bash
|
||||
TOKEN=$(cat ~/.config/gitea/token)
|
||||
curl -s -H "Authorization: token ${TOKEN}" \
|
||||
"https://git.dev.vifo.cc/api/v1/repos/{owner}/{repo}/issues?state=open"
|
||||
```
|
||||
|
||||
### 2. 分析需求
|
||||
|
||||
- 阅读工单标题和描述
|
||||
- 确认需求范围
|
||||
- 确认需求范围是否属于当前仓库
|
||||
- 检查相关配置文件和代码
|
||||
- 必要时向用户澄清
|
||||
|
||||
### 3. 实施修改
|
||||
### 3. 判断工单归属
|
||||
|
||||
如果工单内容不属于当前仓库,需要路由到正确的仓库:
|
||||
|
||||
| 问题类型 | 正确仓库 |
|
||||
|---------|---------|
|
||||
| 框架能力、公共工具、安全、Feign | rui-framework |
|
||||
| 系统管理、用户管理接口 | rui-framework |
|
||||
| 收银业务逻辑 | rui-cashier |
|
||||
| 支付业务逻辑 | rui-payment |
|
||||
| 前端页面、UI 组件 | rui-frontend |
|
||||
| 文档、规范、技能 | rui-docs |
|
||||
|
||||
**路由方式**:在当前仓库回复工单说明需转交,然后向目标仓库创建新 Issue。
|
||||
|
||||
### 4. 实施修改
|
||||
|
||||
按 Superpowers 工作流处理:
|
||||
- 简单任务:直接实施
|
||||
- 复杂任务:设计 -> 计划 -> 实施
|
||||
|
||||
### 4. 回复工单状态
|
||||
### 5. 回复工单
|
||||
|
||||
完成后必须回复工单:
|
||||
```bash
|
||||
TOKEN=$(cat ~/.config/gitea/token)
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $(cat ~/.config/gitea/token)" \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"body": "✅ 已完成\n\n完成内容..."}' \
|
||||
"https://git.dev.vifo.cc/api/v1/repos/{owner}/{repo}/issues/{id}/comments"
|
||||
```
|
||||
|
||||
### 6. 关闭工单
|
||||
|
||||
```bash
|
||||
TOKEN=$(cat ~/.config/gitea/token)
|
||||
curl -s -X PATCH \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"state": "closed"}' \
|
||||
"https://git.dev.vifo.cc/api/v1/repos/{owner}/{repo}/issues/{id}"
|
||||
```
|
||||
|
||||
## 跨仓库提工单
|
||||
|
||||
当当前仓库开发中需要其他仓库配合时:
|
||||
|
||||
1. 确认问题属于目标仓库
|
||||
2. 通过 Gitea API 向目标仓库创建 Issue
|
||||
3. 在当前仓库的 git commit 中注明关联工单
|
||||
|
||||
```bash
|
||||
# 示例:payment 需要框架新增能力,向 rui-framework 提交
|
||||
cat > /tmp/issue.json << 'EOF'
|
||||
{
|
||||
"title": "[API-REQ] 需要新增支付回调重试工具",
|
||||
"body": "## 来源\n\nrui-payment 模块请求\n\n## 功能描述\n\n...\n\n## 优先级\n\n高"
|
||||
}
|
||||
EOF
|
||||
|
||||
TOKEN=$(cat ~/.config/gitea/token)
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token ${TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @/tmp/issue.json \
|
||||
"https://git.dev.vifo.cc/api/v1/repos/rui/rui-framework/issues"
|
||||
```
|
||||
|
||||
## 提交规范
|
||||
|
||||
- 提交信息需关联工单编号:`对应工单 #2`
|
||||
- 使用语义化提交前缀:`feat:`, `fix:`, `docs:`, `chore:`
|
||||
- 提交信息需关联工单编号:对应工单 #2
|
||||
- 使用语义化提交前缀:feat:, fix:, docs:, chore:
|
||||
|
||||
## 优先级处理
|
||||
|
||||
|
||||
Reference in New Issue
Block a user