Feat/task app members#712
Conversation
📝 WalkthroughWalkthroughTask creation and assignment workflows now support distinguishing between user and app members based on ID prefixes ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
shortcuts/task/shortcuts.go (1)
115-120: Consider trimming create-time member IDs before building payloads.
buildMembersBody/buildFollowersBodynormalize whitespace, but create-path IDs currently pass through raw. Trimming here would make behavior consistent and reduce avoidable API failures from accidental spaces.♻️ Suggested refactor
- if assignee := runtime.Str("assignee"); assignee != "" { + if assignee := strings.TrimSpace(runtime.Str("assignee")); assignee != "" { members = append(members, buildTaskMember(assignee, "assignee")) } - if follower := runtime.Str("follower"); follower != "" { + if follower := strings.TrimSpace(runtime.Str("follower")); follower != "" { members = append(members, buildTaskMember(follower, "follower")) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/task/shortcuts.go` around lines 115 - 120, The assignee and follower IDs read via runtime.Str are not trimmed before being passed to buildTaskMember, causing inconsistency with buildMembersBody/buildFollowersBody; update the code around the runtime.Str("assignee") and runtime.Str("follower") usages to call strings.TrimSpace on the returned values (or an equivalent trim helper) and only append when the trimmed value is non-empty, so buildTaskMember always receives normalized IDs; apply the same trimming pattern to any other create-path ID reads to avoid accidental-space API failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@shortcuts/task/task_assign.go`:
- Around line 127-135: Update the user-facing strings that misspell "assignees":
replace the fmt.Fprintf call currently printing "✅ Task assignes updated
successfully!" with "✅ Task assignees updated successfully!" and change the
fmt.Fprintf that prints "Current Assignes: %d\n" to "Current Assignees: %d\n";
locate these calls in task_assign.go (the fmt.Fprintf calls that format
taskId/url and members count) and correct the two string literals to the proper
spelling.
---
Nitpick comments:
In `@shortcuts/task/shortcuts.go`:
- Around line 115-120: The assignee and follower IDs read via runtime.Str are
not trimmed before being passed to buildTaskMember, causing inconsistency with
buildMembersBody/buildFollowersBody; update the code around the
runtime.Str("assignee") and runtime.Str("follower") usages to call
strings.TrimSpace on the returned values (or an equivalent trim helper) and only
append when the trimmed value is non-empty, so buildTaskMember always receives
normalized IDs; apply the same trimming pattern to any other create-path ID
reads to avoid accidental-space API failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e612c2e-b98c-40b3-ac3e-13bf36f1349f
📒 Files selected for processing (5)
shortcuts/task/shortcuts.goshortcuts/task/task_assign.goshortcuts/task/task_assign_test.goshortcuts/task/task_followers.goshortcuts/task/task_followers_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #712 +/- ##
==========================================
+ Coverage 63.80% 64.17% +0.37%
==========================================
Files 500 504 +4
Lines 43531 44287 +756
==========================================
+ Hits 27773 28420 +647
- Misses 13317 13393 +76
- Partials 2441 2474 +33 ☔ 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@f9623177b042f7c11ad7902c6a065e537ea4d0d1🧩 Skill updatenpx skills add zero-my/cli#feat/task-app-members -y -g |
* feat: support app task members by id * docs: clarify task member id formats
* feat: support app task members by id * docs: clarify task member id formats
Summary
Support app task members in task shortcuts by inferring member type from the input ID. This also adds follower support during task creation and keeps member construction consistent across assign/follower shortcuts.
Changes
cli_=>app, otherwiseuser)--followerintask +create+assignand+followersTest Plan
lark xxxcommand works as expectedRelated Issues
Summary by CodeRabbit
Release Notes