forked from Gitlink/gitlink-cli
# feat(feishu): 新增分层飞书协作导出能力 #46
Loading…
Reference in New Issue
No description provided.
Delete Branch "test-import/pr-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat(feishu): 新增分层飞书协作导出能力
概要
本 PR 为 GitLink CLI 新增分层飞书协作导出能力,围绕
workflow +repo-report的仓库健康、Issue、PR、Review Audit 等结果,提供飞书机器人通知、周报摘要、负责人摘要、贡献者摘要、多维表格数据、本地任务预览,以及实验性的 DocX、多维表格、飞书任务 OpenAPI 写入能力。主要内容:
gitlink-feishuSkill、示例、环境说明和 smoke 测试脚本。workflow +repo-report数据准确性问题。已修复问题与正确性改动
本 PR 同时修复前置联调中发现的工作流统计准确性问题:
workflow +repo-report的 open issue 过滤改为使用与 GitLink 原生命令一致的category=opened。workflow +repo-report的 open PR 过滤改为使用 GitLink API 的status=0。--issue-limit和--pr-limit现在表示显式采样上限。稳定命令
稳定命令默认本地 preview,不产生外部副作用。真实飞书机器人发送必须显式传入:
可用性诊断命令
诊断命令默认只检查本地配置。远程只读 OpenAPI 检查必须显式传入:
--remote只做资源可用性检查,不创建或修改飞书/GitLink 资源。实验性命令
这些命令需要飞书自建应用配置,并且必须显式传入:
当前作为实验性能力提交,便于后续根据维护者意见继续收敛命令边界、权限边界和文档说明。
安全边界
--send。--remote。验证结果
本地验证结果如下���
go test -race ./...未在当前 Windows 环境完成,原因是当前 Go 环境CGO_ENABLED=0,-race需要启用 cgo。已知的独立校验失败项
以下 i18n 校验当前在飞书分支上失败:
失败原因是既有 locale JSON 格式/换行校验问题,不属于飞书功能改动范围。
该问题不合入本飞书 PR,已通过独立 PR 处理:
因此本 PR 的验证结论是:
真实 Smoke 验证证据
真实测试企业中已验证:
真实 GitLink 仓库数据 smoke 结果:
完整 review audit 结果:
证据文件
不在本 PR 范围内的内容
需要维护者确认的问题
workflow +repo-report --include-pr-review-audit是否应拆成独立 workflow 命令?gitlink-cli内,还是作为独立服务维护?- Add pr +reviews to list reviews for a pull request (with status filter) - Add pr +review to create a review (comment/approve/reject) - Uses v1 API: /v1/{owner}/{repo}/pulls/{index}/reviews - Includes tests for both list and create operations Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1. shortcuts/pr/pr.go — 核心逻辑 +diff 命令替换: 旧实现:与 +files 完全相同,调用 /pulls/{id}/files(只返回文件列表) 新实现:两步调用 GET /v1/{owner}/{repo}/pulls/{id}/versions → 取最新版本 ID GET /v1/{owner}/{repo}/pulls/{id}/versions/{version_id}/diff → 获取逐行 diff 新增参数: --file / -f — 过滤特定文件的 diff --stat — 仅显示统计摘要 新增函数: getLatestVersionID() — 获取 PR 最新版本 ID formatDiffStat() — 提取增删统计摘要 2. internal/output/formatter.go — Diff 渲染 isDiffData() — 通过检测 files[].sections 区分 diff 数据和普通文件列表 printDiffTable() — 以 git diff 风格渲染:diff --git 头、hunk header、增删行 修改 printTable() 路由,自动检测并走 diff 渲染分支 3. shortcuts/pr/pr_test.go — 新增 5 个测试 测试用例 验证内容 TestPRDiffFetchesVersionThenDiff 两步调用完整流程 TestPRDiffWithFileFilter --file 参数传递 filepath 查询参数 TestPRDiffStatMode --stat 模式只输出统计 TestPRDiffFailsWhenNoVersions 无版本时返回友好错误 TestPRDiffFailsWhenPRNotFound PR 不存在时正确处理 404 4. Skill 文档更新 SKILL.md — 更新 +diff 描述、新增使用示例、更新注意事项 gitlink-pr-files.md — 完整重写,明确 +files 和 +diff 的区别新增功能参数 gitlink-cli search +issues --keyword "登录失败" # 必填:搜索关键词 --category opened # 可选:all/opened/closed --assignee 42 # 可选:按负责人 ID --author 10 # 可选:按创建人 ID --milestone 5 # 可选:按里程碑 ID --tag 1,2 # 可选:按标签 ID --sort-by created_on # 可选:排序字段 --sort-dir asc # 可选:排序方向 API 调用 GET /api/v1/{owner}/{repo}/issues?keyword=xxx&category=opened&assigner_id=42&sort_by=issues.updated_onclose 命令 API URL 误拼为 {repo_path}/{owner}/milestones/{id}/update_status(Owner 重复、Repo 丢失、缺 /v1),修正为 /v1/{owner}/{repo}/milestones/{id}/update_status;新增 TestMilestoneClose 回归测试。 Co-Authored-By: Claude <noreply@anthropic.com>新增 server 子命令启动 HTTP 服务(:8080),提供 /api/scenarios、/api/run、/api/result/{key}、/api/health;前端含仪表盘(index)、独立结果页(result)、热点追踪页(hotspot),6 科研场景一键运行与可视化。在 cmd/root.go 注册子命令。 Co-Authored-By: Claude <noreply@anthropic.com>Rewrite the wiki section of community_ops_sweep.py to match the current gitlink-cli wiki commands (shortcuts/wiki/wiki.go), replacing the obsolete --page-name/--title/--project-id/--gateway flags. New flow in _publish_report_to_wiki: 1. bootstrap _Sidebar on cold-start (empty wiki had no sidebar → mkdir/ create -d 404'd) 2. ensure the report directory exists (idempotent +mkdir) 3. wiki +create -d, letting the CLI maintain the sidebar link Drops the hand-rolled _Sidebar parser (now built into the CLI) and the unreliable create→update fallback (create always returns 201). Handles the .- sub_url suffix: page name uses an ASCII slug; the CLI (after the cleanSidebar fix) auto-cleans the link on delete. Verified end-to-end with --apply on baoerjun/gitlink-cli: report page created, _Sidebar directory structure correct, dry-run path intact.Pull request closed