feat(im): add +chat-members-list shortcut for member listing#1398
Conversation
📝 WalkthroughWalkthroughA new ChangesIM chat members list shortcut
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 #1398 +/- ##
==========================================
+ Coverage 71.58% 72.75% +1.17%
==========================================
Files 689 730 +41
Lines 65521 69034 +3513
==========================================
+ Hits 46901 50228 +3327
- Misses 14972 15034 +62
- Partials 3648 3772 +124 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@ca1b03f66559b96c5247804927929d90420a23b3🧩 Skill updatenpx skills add shifengjuan-dev/lark-cli#feat/im-chat-members -y -g |
ef080c8 to
60cd5b2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@shortcuts/im/im_chat_members_list_test.go`:
- Around line 94-121: The TestNormalizeMemberTypes function uses only basic
error existence checks via wantErr but lacks typed error assertions as required
by coding guidelines. For the error cases in this test (when wantErr is true),
replace the simple nil check with proper typed error validation: use errors.As
to assert the returned error is of type *errs.ValidationError and verify its
Param field contains the appropriate invalid input, use errs.ProblemOf to assert
the error has correct category and subtype metadata, and verify any cause
preservation where applicable to ensure full error contract compliance.
🪄 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: 7f7acaac-1869-41ba-b045-3130e5153a01
📒 Files selected for processing (6)
shortcuts/im/helpers_test.goshortcuts/im/im_chat_members_list.goshortcuts/im/im_chat_members_list_test.goshortcuts/im/shortcuts.goskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-chat-members-list.md
✅ Files skipped from review due to trivial changes (2)
- shortcuts/im/shortcuts.go
- skills/lark-im/references/lark-im-chat-members-list.md
🚧 Files skipped from review as they are similar to previous changes (1)
- skills/lark-im/SKILL.md
1941faa to
5bc3bf2
Compare
888eeb4 to
11e510a
Compare
Add a dedicated +chat-members-list shortcut that lists chat members, returning users and bots in separate users[] / bots[] buckets. It owns its pagination loop (mirroring the paginateLoop conventions: per-page log line, --page-limit cap, non-advancing-token guard) because the list_members response is multi-bucket: the generic --page-all merger is built for single-array responses and would silently drop the bots[] bucket and the final-page truncations[] signal. Highlights: - merges users[] and bots[] across pages; takes truncations[] / has_more / page_token from the last page so a server-side cap is never hidden - surfaces truncations[] with a loud stderr warning when the server caps a bucket due to security config (the list is incomplete) - --member-types filter (user/bot), --member-id-type, and the standard --page-all / --page-limit / --page-token flags - with --page-all and no explicit --page-size, uses the max page size to minimize round-trips - docs: SKILL.md Shortcuts table + references/lark-im-chat-members-list.md
11e510a to
ca1b03f
Compare
Summary
Adds a dedicated
+chat-members-listshortcut that lists chat members, returning users and bots in separateusers[]/bots[]buckets.It owns its pagination loop (mirroring the
paginateLoopconventions: per-page log line,--page-limitcap, non-advancing-token guard) because thelist_membersresponse is multi-bucket — the generic--page-allmerger is built for single-array responses and would silently drop thebots[]bucket and the final-pagetruncations[]signal.What it does
users[]andbots[]across pages; takestruncations[]/has_more/page_tokenfrom the last page so a server-side cap is never hiddentruncations[]with a loud stderr warning when the server caps a bucket due to security config (the list is incomplete)--member-typesfilter (user/bot),--member-id-type, and the standard--page-all/--page-limit/--page-tokenflags--page-alland no explicit--page-size, uses the max page size to minimize round-tripsreferences/lark-im-chat-members-list.mdTest plan
truncations[],has_more/page_tokenfrom last page,--member-typesnormalization,--page-allintegration over mocked pages,--page-limitcutoff, effective page-size selectiontruncations:[{"limit":100,"member_type":"user"}]+ stderr warning) and a 21-user/5-bot group (both buckets merged, no false warning);--member-types botfilter returns bots onlyNew Features
+chat-members-listskill/shortcut to list chat members, with support foruser/botfiltering and cursor-based pagination.Documentation
Bug Fixes / Quality
+chat-members-list.