gitlink-cli/examples/workflows/community-ops-automation/docs/runbook.md

3.1 KiB
Raw Permalink Blame History

运行手册

前置条件

  • 已安装 gitlink-cli
  • 已完成 gitlink-cli auth login
  • 目标仓库有可读权限
  • 自定义 Skill 文件存在:D:\BigData\CCFer\CCF\gitlink-issue-triage-rules\SKILL.md

官方快速开始里要求的验证命令是:

gitlink-cli user +me

运行方式

1. 只生成报告

python .\scripts\gitlink_workflow.py --config .\examples\sample_config.json

该命令默认同时生成 Issue 自动分类与派单 dry-run 计划,但不会写回真实 Issue。

2. 生成报告并发布摘要

python .\scripts\gitlink_workflow.py --config .\examples\sample_config.json --publish-issue-id 123

3. 执行真实 Issue 分类与派单

python .\scripts\gitlink_workflow.py --config .\examples\sample_config.json --apply-triage

真实写回会先通过 issue +list 拉取待处理 Issue并读取自定义 Skill 的 JSON 规则完成分类;再使用 label +listissue +assignersissue +viewissue +update 写入标签、优先级和负责人。配置中 triage.comment=true 时,会通过 issue +comment 写入审计说明。

负责人分配使用 triage.members 中的显式三成员池:Angel123456(153579, 管理员)Hsy15889521073(134328, 开发者)Priziq(134450, 报告者)。派单策略为 type-map-configsecurity/bug/performance 给管理员,feature/refactor/ci 给开发者,question/docs/duplicate 给报告者。issue +assigners 用于校验和解析 login/name若显式成员未出现在该接口返回中dry-run 计划会保留负责人并记录 warning。

如需显式指定 Skill 路径:

python .\scripts\gitlink_workflow.py --config .\examples\sample_config.json --triage-skill D:\BigData\CCFer\CCF\gitlink-issue-triage-rules\SKILL.md

4. 一键复现

.\scripts\run_demo.ps1

写回模式:

.\scripts\run_demo.ps1 -ApplyTriage

输出文件

  • outputs/*_report.md:完整周报
  • outputs/*_release_notes.mdRelease Notes 草稿
  • outputs/*_summary.json:结构化摘要
  • outputs/*_triage_plan.mdIssue 分类与派单计划
  • outputs/*_triage_plan.json:结构化分类与写回结果

验证清单

  • repo +info 能返回仓库信息
  • 自定义 Skill 中存在 TRIAGE_RULES_JSON_START/END 规则块
  • issue +list 能返回待分类 Issue
  • label +list 能解析分类标签 ID
  • issue +assigners 能解析负责人 ID
  • dry-run 模式不会调用 issue +update
  • *_triage_plan.json 能记录 source=skill-json、Skill 路径和命中规则
  • pr +list 能返回 PR 列表
  • release +list 能返回 Release 列表
  • 报告文件能落盘
  • Release Notes 草稿能落盘
  • apply 模式能把分类标签、优先级和负责人写回 Issue
  • 发布模式能把摘要写回指定 Issue

真实项目配置

  • examples/demo_active_config.json 指向 Angel123456/gitlink-cli,用于验证 fork 仓库的数据分析能力。
  • examples/sample_config.json 指向 Angel123456/gitlink-cli,用于验证参赛仓库的采集和 Issue 回写能力。