You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added order parameter to list chains and chain metrics endpoints, enabling control over sort direction (ascending or descending). Defaults to descending order when not specified.
API Updates
Renamed sort_by query parameter to sort in list chains and chain metrics API endpoints for improved naming consistency.
This PR introduces an optional order_direction parameter to the multichain-aggregator's sorting API. A new OrderDirection enum with Asc and Desc variants is added to the types module. The list_chains and list_chain_metrics methods in the cluster service are updated to accept this parameter and apply conditional sort reversal. The proto definitions for ListClusterChainsRequest and ListChainMetricsRequest are modified to rename the sort_by field to sort and add a new order field. Corresponding swagger API definitions and server-side implementations are updated to reflect these changes, including parameter parsing and propagation through the call chain.
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
feat(multi): add list_chain_metrics sort #1618: Modifies the same cluster service sorting APIs (list_chain_metrics and list_chains) by adding sort metric support; this PR extends that work by adding explicit order direction support
🐰 With whiskers twitching, we arrange, Ascending paths and descending range, OrderDirection, shiny new toy, Sorting chains fills this rabbit with joy! ✨
✨ Finishing Touches
📝 Generate docstrings (stacked PR)
📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
Commit unit tests in branch lok52/multi-sort-order
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
Release Notes
New Features
orderparameter to list chains and chain metrics endpoints, enabling control over sort direction (ascending or descending). Defaults to descending order when not specified.API Updates
sort_byquery parameter tosortin list chains and chain metrics API endpoints for improved naming consistency.