docs(im): clarify media path restrictions#956
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 (6)
📝 WalkthroughWalkthroughThis PR documents undocumented path restrictions on IM media flags by introducing shared flag description constants, synchronizing both command implementations to use them, updating skill reference documentation to explicitly describe supported input types (keys, URLs, cwd-relative paths), and adding tests to enforce consistent documentation of path safety rules. ChangesIM Media Path Restrictions Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #956 +/- ##
=======================================
Coverage 66.78% 66.78%
=======================================
Files 564 564
Lines 52441 52441
=======================================
Hits 35024 35024
Misses 14516 14516
Partials 2901 2901 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@759eb622a2838906db14e145da1d025317833d18🧩 Skill updatenpx skills add mtsui-cmyk/cli#docs/im-media-path-help -y -g |
|
Thanks for the PR! This is a point worthy of optimization, a couple of suggestions:
|
|
Thanks for the contribution! |
Summary
Clarify the IM media flag contract for local uploads: existing keys and URLs are accepted, while local paths must be cwd-relative and stay inside the current directory. This addresses the help-text gap reported in #872.
Changes
+messages-sendand+messages-replyso--helpdocuments URL support and the relative-path restriction.lark-imsend/reply skill references with media input rules and absolute-path workarounds.Test Plan
lark xxxcommand works as expectedCommands run:
PATH="$PWD/.tmp/go-toolchain/go/bin:$PATH" go test ./shortcuts/imPATH="$PWD/.tmp/go-toolchain/go/bin:$PATH" go test -race -count=1 ./shortcuts/im.tmp/go-toolchain/go/bin/gofmt -l shortcuts/im/helpers.go shortcuts/im/im_messages_send.go shortcuts/im/im_messages_reply.go shortcuts/im/validate_media_test.gogit diff --checkPATH="$PWD/.tmp/go-toolchain/go/bin:$PATH" go run . im +messages-send --helpPATH="$PWD/.tmp/go-toolchain/go/bin:$PATH" go run . im +messages-reply --helpRelated Issues
--image/--fileflags reject absolute paths but--helpdoesn't document this #872Summary by CodeRabbit
Documentation
..) blockedRefactor