为 reportctl 增加 Lark/飞书同步后端 - #9
Open
BrahmaMantra wants to merge 4 commits into
Open
Conversation
Author
|
有相应测试覆盖吗 |
Author
|
有,当前覆盖分三层:
本轮已重新跑:
另外之前也用临时 |
BrahmaMantra
commented
Jul 22, 2026
| config | ||
| .set_property(section::REPORT, config_key::GIT_REPO, u) | ||
| .unwrap_or_else(|e| error!("保存配置失败: {}", e)); | ||
| config |
Author
There was a problem hiding this comment.
为什么 lark 分支的 pr 要修改 git.rs 呢
Author
There was a problem hiding this comment.
这个点合理,已调整。
现在 git.rs 已恢复为只负责 Git URL / Git sync 自身逻辑,不再写 sync_backend。reportctl set-url 触发“切回 git backend”的行为移到了 report/write.rs 的命令路由层里,因为这是 report backend 选择逻辑,不应该放在 Git 实现内部。
最新 PR diff 相对 origin/main 已经不再包含 src/command/report/git.rs。验证已跑:
cargo fmt --checkcargo check --ignore-rust-version --bin jcargo test --ignore-rust-version command::report::sync::tests
Owner
There was a problem hiding this comment.
可以考虑把 report/README.md 放入assets/help/日报 并入 help.rs 的输出
Author
|
@LingoJack PTAL~ |
Co-authored-by: TRAE CLI <noreply@bytedance.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
为
reportctl push/pull增加 Lark/飞书同步后端,与现有 Git 同步并存。首次同步可选择git或lark,已有 Git 配置继续走 Git。Closes #8
主要改动
reportctl use git|lark,支持显式切换同步后端。lark-cli、用户鉴权、文档 inspect、保存文档元数据。reportctl push/pull按配置路由到 Git 或 Lark。push只 append 本地新增内容到飞书文档。pull只接受远端追加内容写回本地。push -f/pull -f支持强制覆盖,但覆盖前必须创建备份子文档。src/command/report/README.md,说明 Lark 从 0 使用流程。备份行为
push -f:先拉取远端旧内容,在当前周报 wiki 节点下创建备份子文档;备份成功后才覆盖远端。pull -f:先读取本地旧内容,在当前周报 wiki 节点下创建备份子文档;备份成功后才覆盖本地。验证
cargo fmt --checkcargo test --ignore-rust-version command::report::lark::testscargo check --ignore-rust-version --bin jJ_DATA_PATH=/tmp/jcli-lark-force-e2e做过真实 Lark E2E:push -f覆盖前成功创建备份子文档并输出 URL。pull -f覆盖前成功创建备份子文档并输出 URL。备注:本地 Rust 是
1.93.0,仓库rust-version是1.93.1,验证命令使用了--ignore-rust-version。