feat(minutes): enforce deterministic search ordering#626
feat(minutes): enforce deterministic search ordering#626zhicong666-bytedance wants to merge 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughThe minutes search request now explicitly includes a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
shortcuts/minutes/minutes_search.go (1)
163-165: Consider exposing sorter as an optional flag.For consistency with
im_chat_search(which offers a--sort-byenum flag), you could expose an optional--sort-byflag defaulting tocreate_time_desc. This preserves deterministic pagination while letting users opt into alternative orderings if the API supports them. Not a blocker — the hardcoded value satisfies this PR's stated goal.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@shortcuts/minutes/minutes_search.go` around lines 163 - 165, The code currently hardcodes body["sorter"] = "create_time_desc"; expose this as an optional CLI flag (e.g., --sort-by) defaulting to "create_time_desc" similar to im_chat_search's --sort-by enum; add a flag variable (e.g., sortBy string) registered on the minutes search command initialization, validate/enum-check if needed, and replace the hardcoded assignment with body["sorter"] = sortBy so callers can override the ordering while preserving the default deterministic pagination.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@shortcuts/minutes/minutes_search.go`:
- Around line 163-165: The code currently hardcodes body["sorter"] =
"create_time_desc"; expose this as an optional CLI flag (e.g., --sort-by)
defaulting to "create_time_desc" similar to im_chat_search's --sort-by enum; add
a flag variable (e.g., sortBy string) registered on the minutes search command
initialization, validate/enum-check if needed, and replace the hardcoded
assignment with body["sorter"] = sortBy so callers can override the ordering
while preserving the default deterministic pagination.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 489ac964-e39c-4a72-8f7e-146723cb981b
📒 Files selected for processing (2)
shortcuts/minutes/minutes_search.goshortcuts/minutes/minutes_search_test.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #626 +/- ##
==========================================
+ Coverage 60.05% 60.20% +0.14%
==========================================
Files 406 407 +1
Lines 43089 43342 +253
==========================================
+ Hits 25877 26093 +216
- Misses 15194 15221 +27
- Partials 2018 2028 +10 ☔ 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@6982df62b8dfc50ceed79dcb3c213b8bc630ff4f🧩 Skill updatenpx skills add larksuite/cli#feat/minutes-search-default-sorter -y -g |
Summary
Enforce deterministic ordering for
minutes +searchby always settingsorter=create_time_descin the request body. This makes paginated results more stable and predictable.Changes
sorter: create_time_descinshortcuts/minutes/minutes_search.goshortcuts/minutes/minutes_search_test.goto verify the sorter is present in the built request bodyTest Plan
go test ./shortcuts/minutesRelated Issues
Summary by CodeRabbit