feat(im): format feed group error handling - #1308
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughAdds three IM CLI shortcuts ( ChangesFeed group CLI shortcuts and API integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1308 +/- ##
==========================================
+ Coverage 71.01% 71.14% +0.12%
==========================================
Files 681 685 +4
Lines 65435 65770 +335
==========================================
+ Hits 46470 46793 +323
- Misses 15320 15326 +6
- Partials 3645 3651 +6 ☔ 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@01cd74956d9cc9cc9d1bcd9a014f48c38a902da9🧩 Skill updatenpx skills add zhumiaoxin/cli#feat/feed-group -y -g |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/im/im_feed_group_list_test.go (1)
94-118: 💤 Low valueConsider adding test case for
--end-timevalidation.The test covers
--start-timevalidation but not--end-time(which has the same Unix-milliseconds integer parsing requirement in line 86-89 ofim_feed_group_list.go). Adding a case like{"bad end-time", map[string]string{"end-time": "notnum"}, "--end-time"}would complete the validation coverage.📝 Suggested test case addition
{"page-limit too large", map[string]string{"page-limit": "1001"}, "--page-limit"}, {"bad start-time", map[string]string{"start-time": "notnum"}, "--start-time"}, + {"bad end-time", map[string]string{"end-time": "notnum"}, "--end-time"}, }🤖 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/im/im_feed_group_list_test.go` around lines 94 - 118, Add a test case for end-time validation in TestFeedGroupListValidation: update the cases slice used by TestFeedGroupListValidation to include a {"bad end-time", map[string]string{"end-time": "notnum"}, "--end-time"} entry so that ImFeedGroupList.Validate (invoked via newFGRuntime and ImFeedGroupList.Validate) is exercised for the same Unix-milliseconds integer parsing logic as start-time; ensure the new case follows the same t.Run assertion pattern already present.
🤖 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/im/im_feed_group_list_test.go`:
- Around line 94-118: Add a test case for end-time validation in
TestFeedGroupListValidation: update the cases slice used by
TestFeedGroupListValidation to include a {"bad end-time",
map[string]string{"end-time": "notnum"}, "--end-time"} entry so that
ImFeedGroupList.Validate (invoked via newFGRuntime and ImFeedGroupList.Validate)
is exercised for the same Unix-milliseconds integer parsing logic as start-time;
ensure the new case follows the same t.Run assertion pattern already present.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 994cf024-3b07-47db-8b13-51c4904ce6d6
📒 Files selected for processing (16)
shortcuts/im/helpers_test.goshortcuts/im/im_feed_group_item_test.goshortcuts/im/im_feed_group_items.goshortcuts/im/im_feed_group_list.goshortcuts/im/im_feed_group_list_item.goshortcuts/im/im_feed_group_list_test.goshortcuts/im/im_feed_group_query_item.goshortcuts/im/im_flag_cancel.goshortcuts/im/im_flag_create.goshortcuts/im/shortcuts.goskill-template/domains/im.mdskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-feed-group-list-item.mdskills/lark-im/references/lark-im-feed-group-list.mdskills/lark-im/references/lark-im-feed-group-query-item.mdskills/lark-im/references/lark-im-feed-groups.md
Address the Codecov report on larksuite#1308 (patch coverage 62.7%, 125 lines missing). Adds tests for the previously uncovered paths: - +feed-group-list: DryRun shape, single-page Execute, table render, end-time validation, time-window query params - page_token infinite-loop guard and defensive page-limit clamping for both list and list-item page-all paths - API error propagation across all three shortcuts - enrichment warning on total chat-name resolution failure; nil-data no-op - formatFeedGroupUpdateTime empty/non-numeric passthrough Remaining uncovered lines are nil-map defensive skips and one dead branch (SplitCSV already drops empty tokens); no production code changed.
dc4d272 to
9d62121
Compare
9d62121 to
6aae8ee
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 `@skills/lark-im/references/lark-im-feed-groups.md`:
- Line 8: Remove the stray blank line inside the continued blockquote at the
start of the document (the blockquote around Line 8) so the quote lines are
contiguous; edit the blockquote so there are no empty lines between its lines
(delete the empty line or merge surrounding text) to satisfy markdownlint MD028.
🪄 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: 17cb9246-d845-43c4-b1fb-bf4ec33c8225
📒 Files selected for processing (16)
shortcuts/im/helpers_test.goshortcuts/im/im_feed_group_item_test.goshortcuts/im/im_feed_group_items.goshortcuts/im/im_feed_group_list.goshortcuts/im/im_feed_group_list_item.goshortcuts/im/im_feed_group_list_test.goshortcuts/im/im_feed_group_query_item.goshortcuts/im/im_flag_cancel.goshortcuts/im/im_flag_create.goshortcuts/im/shortcuts.goskill-template/domains/im.mdskills/lark-im/SKILL.mdskills/lark-im/references/lark-im-feed-group-list-item.mdskills/lark-im/references/lark-im-feed-group-list.mdskills/lark-im/references/lark-im-feed-group-query-item.mdskills/lark-im/references/lark-im-feed-groups.md
✅ Files skipped from review due to trivial changes (7)
- skills/lark-im/references/lark-im-feed-group-query-item.md
- skills/lark-im/references/lark-im-feed-group-list.md
- shortcuts/im/im_flag_create.go
- skills/lark-im/references/lark-im-feed-group-list-item.md
- skill-template/domains/im.md
- shortcuts/im/im_flag_cancel.go
- skills/lark-im/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (8)
- shortcuts/im/helpers_test.go
- shortcuts/im/shortcuts.go
- shortcuts/im/im_feed_group_query_item.go
- shortcuts/im/im_feed_group_list.go
- shortcuts/im/im_feed_group_list_item.go
- shortcuts/im/im_feed_group_items.go
- shortcuts/im/im_feed_group_list_test.go
- shortcuts/im/im_feed_group_item_test.go
6aae8ee to
01cd749
Compare
Summary
Improve formatted error output for feed group flows so validation failures return structured, parseable errors with clear parameter attribution.
Changes
--feed-group-id,--feed-id, pagination flags, and time filtersTest Plan
lark-cli im <feed-group command>error output works as expectedRelated Issues