fix(wiki): correct copy semantics and rename routing - #2238
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe change documents non-recursive Wiki node copying, adds test coverage for that behavior, and directs in-place Wiki node renaming through ChangesWiki shortcut guidance
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/wiki/wiki_node_copy.go (1)
118-118: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the pretty output contract.
The changed renderer emits
copy_scope, but the shown test only checks the structured JSON field. Add or verify a--format prettycase that checkscopy_scope: node_only. This protects the pretty output if this line is removed or renamed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@shortcuts/wiki/wiki_node_copy.go` at line 118, Add coverage for the pretty-rendering path that exercises the output around valueOrDash(out["copy_scope"]) and asserts the rendered text contains “copy_scope: node_only”. Keep the existing structured JSON assertion and verify the pretty output contract through the relevant CLI/test entry point.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@shortcuts/wiki/wiki_node_copy.go`:
- Line 118: Add coverage for the pretty-rendering path that exercises the output
around valueOrDash(out["copy_scope"]) and asserts the rendered text contains
“copy_scope: node_only”. Keep the existing structured JSON assertion and verify
the pretty output contract through the relevant CLI/test entry point.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e9545bfb-e3a9-4d56-b1ae-a03cba0ba5be
📒 Files selected for processing (8)
shortcuts/wiki/wiki_list_copy_test.goshortcuts/wiki/wiki_node_copy.goshortcuts/wiki/wiki_node_create.goshortcuts/wiki/wiki_node_create_test.goskills/lark-wiki/SKILL.mdskills/lark-wiki/references/lark-wiki-node-copy.mdtests/cli_e2e/wiki/coverage.mdtests/cli_e2e/wiki/wiki_shortcut_workflow_test.go
|
Manual live verification completed in an authorized tenant: created a new Wiki docx node, renamed it in place with |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@f3244a14e49a9da141f896c5771efcdd73e0610d🧩 Skill updatenpx skills add larksuite/cli#fix/wiki-copy-rename-bugs -y -g |
|
Live verification completed against a real personal Wiki space using the PR branch:
This verifies the API/CLI behavior is node-only, not recursive. Tokens and internal document links are intentionally omitted. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2238 +/- ##
=======================================
Coverage 76.33% 76.34%
=======================================
Files 993 993
Lines 106633 106691 +58
=======================================
+ Hits 81400 81450 +50
- Misses 19032 19037 +5
- Partials 6201 6204 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bee7cb0 to
f3244a1
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Summary
Fix two deterministic Wiki agent failures:
+node-copywas documented as recursive even though it copies only the requested node, and Wiki rename tasks were not routed to the existingdrive +update-titleshortcut.Changes
+node-copyhelp and the lark-wiki reference that copying is non-recursive.drive +update-titlein the lark-wiki Skill, so agents avoid raw API probing and receive the shortcut's scope recovery hints.wiki +moveshortcut.Test Plan
make unit-test)go test ./shortcuts/wiki)drive +update-titleand confirmed the samenode_tokenreturned the new titlego vet ./...gofmt -l .returns no filesgo mod tidyleavesgo.modandgo.sumunchangedRelated Issues
Summary by CodeRabbit