feat: add wiki move-to-drive shortcut#1869
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
🚧 Files skipped from review as they are similar to previous changes (14)
📝 WalkthroughWalkthroughAdds ChangesWiki Move-to-Drive Workflow
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant CLI
participant WikiMoveToDrive
participant WikiAPI
participant DriveTaskResult
CLI->>WikiMoveToDrive: submit move request
WikiMoveToDrive->>WikiAPI: POST move_wiki_to_docs
WikiAPI-->>WikiMoveToDrive: return task_id
WikiMoveToDrive->>WikiAPI: poll task status
WikiAPI-->>WikiMoveToDrive: return status and moved object
WikiMoveToDrive-->>CLI: return ready or timed_out result
CLI->>DriveTaskResult: resume with task_id
DriveTaskResult->>WikiAPI: GET task result with task_type
WikiAPI-->>DriveTaskResult: return normalized task result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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 |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@039d729827584d76e7554aff96c79e15dcf35a5d🧩 Skill updatenpx skills add larksuite/cli#feat/wiki-move-to-docs -y -g |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1869 +/- ##
==========================================
+ Coverage 74.66% 74.71% +0.04%
==========================================
Files 877 878 +1
Lines 91731 92033 +302
==========================================
+ Hits 68494 68761 +267
- Misses 17926 17954 +28
- Partials 5311 5318 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0a091e6 to
520d300
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/drive/drive_task_result.go (1)
505-573: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExtract shared wiki move-to-drive status parsing
queryWikiMoveToDriveTaskduplicates the same status/result-shape parsing already inshortcuts/wiki/wiki_move_to_drive.go::parseWikiMoveToDriveTaskStatus. Pulling that contract into a helper (for example undershortcuts/common) would keep the allowed status set andstatus_msgfallback in sync across both pollers.🤖 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/drive/drive_task_result.go` around lines 505 - 573, Extract the shared status/result parsing logic from queryWikiMoveToDriveTask and wiki move-to-drive’s parseWikiMoveToDriveTaskStatus into a common helper, reusing it from both pollers. Preserve the existing validation of numeric statuses, allowed values (-1, 0, 1), and status_msg fallbacks while keeping each caller’s task-specific resource fields and response shaping unchanged.
🤖 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/drive/drive_task_result.go`:
- Around line 505-573: Extract the shared status/result parsing logic from
queryWikiMoveToDriveTask and wiki move-to-drive’s parseWikiMoveToDriveTaskStatus
into a common helper, reusing it from both pollers. Preserve the existing
validation of numeric statuses, allowed values (-1, 0, 1), and status_msg
fallbacks while keeping each caller’s task-specific resource fields and response
shaping unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ab7dc6cb-ca9e-479c-92a8-c692ce113fec
📒 Files selected for processing (17)
shortcuts/common/extract.goshortcuts/common/extract_test.goshortcuts/drive/drive_task_result.goshortcuts/drive/drive_task_result_test.goshortcuts/wiki/shortcuts.goshortcuts/wiki/wiki_move_to_drive.goshortcuts/wiki/wiki_move_to_drive_test.goskill-template/domains/drive.mdskill-template/domains/wiki.mdskills/lark-drive/SKILL.mdskills/lark-drive/references/lark-drive-move.mdskills/lark-drive/references/lark-drive-task-result.mdskills/lark-wiki/SKILL.mdskills/lark-wiki/references/lark-wiki-move-to-drive.mdskills/lark-wiki/references/lark-wiki-move.mdtests/cli_e2e/wiki/wiki_move_to_drive_dryrun_test.gotests/cli_e2e/wiki/wiki_move_to_drive_workflow_test.go
🚧 Files skipped from review as they are similar to previous changes (4)
- shortcuts/wiki/shortcuts.go
- skill-template/domains/drive.md
- shortcuts/common/extract_test.go
- skill-template/domains/wiki.md
520d300 to
039d729
Compare
Summary
Add wiki +move-to-drive to move an existing Wiki node into a Drive folder or the caller personal-space root. The shortcut submits the asynchronous Wiki API request, polls task status, and returns a resumable command when the bounded polling window expires.
Changes
Test Plan
Related Issues
Summary by CodeRabbit
wiki +move-to-driveto move Wiki nodes into a Drive folder or the personal “我的空间” root via an async task.drive +task_resultwith thewiki_move_to_drivescenario, including polling orchestration, scope enforcement, and enriched result fields.0values from missing or malformed data.