Skip to content

feat(minutes): enforce deterministic search ordering#626

Open
zhicong666-bytedance wants to merge 1 commit intomainfrom
feat/minutes-search-default-sorter
Open

feat(minutes): enforce deterministic search ordering#626
zhicong666-bytedance wants to merge 1 commit intomainfrom
feat/minutes-search-default-sorter

Conversation

@zhicong666-bytedance
Copy link
Copy Markdown
Collaborator

@zhicong666-bytedance zhicong666-bytedance commented Apr 23, 2026

Summary

Enforce deterministic ordering for minutes +search by always setting sorter=create_time_desc in the request body. This makes paginated results more stable and predictable.

Changes

  • Always include sorter: create_time_desc in shortcuts/minutes/minutes_search.go
  • Update shortcuts/minutes/minutes_search_test.go to verify the sorter is present in the built request body

Test Plan

  • go test ./shortcuts/minutes

Related Issues

  • None

Summary by CodeRabbit

  • feature enhance
    • Minutes search results are now consistently sorted by creation time in descending order, ensuring stable and predictable pagination behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

The minutes search request now explicitly includes a sorter field set to "create_time_desc", enforcing descending chronological ordering of results. The corresponding test is updated to validate this new parameter.

Changes

Cohort / File(s) Summary
Minutes Search Sorting
shortcuts/minutes/minutes_search.go, shortcuts/minutes/minutes_search_test.go
Added explicit sorter: "create_time_desc" field to the minutes search request body to enforce descending creation time ordering. Updated test assertion to validate the sorter parameter is included in generated requests.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A search that once wandered without a clear way,
Now sorts by creation time, newest first to display!
No more guessing the order, it's written in stone,
With create_time_desc, results are precisely honed. ⏰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description includes all required sections: Summary, Changes, Test Plan, and Related Issues, with concrete details about what was changed and how it was tested.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The PR title 'feat(minutes): enforce deterministic search ordering' accurately describes the main change: adding explicit ordering to minutes search results.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/minutes-search-default-sorter

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Apr 23, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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-by enum flag), you could expose an optional --sort-by flag defaulting to create_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

📥 Commits

Reviewing files that changed from the base of the PR and between 81d22c6 and 6982df6.

📒 Files selected for processing (2)
  • shortcuts/minutes/minutes_search.go
  • shortcuts/minutes/minutes_search_test.go

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.20%. Comparing base (6b7263a) to head (6982df6).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@6982df62b8dfc50ceed79dcb3c213b8bc630ff4f

🧩 Skill update

npx skills add larksuite/cli#feat/minutes-search-default-sorter -y -g

@zhicong666-bytedance zhicong666-bytedance changed the title fix(minutes): enforce deterministic search ordering feat(minutes): enforce deterministic search ordering Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant