Skip to content

feat(multi): add sort order for chain metrics#1635

Merged
lok52 merged 2 commits into
mainfrom
lok52/multi-sort-order
Feb 23, 2026
Merged

feat(multi): add sort order for chain metrics#1635
lok52 merged 2 commits into
mainfrom
lok52/multi-sort-order

Conversation

@lok52

@lok52 lok52 commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • 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.

@lok52 lok52 added the feat New feature label Feb 23, 2026
@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fd8b26 and 31261c8.

📒 Files selected for processing (6)
  • multichain-aggregator/multichain-aggregator-logic/src/services/cluster.rs
  • multichain-aggregator/multichain-aggregator-logic/src/types/mod.rs
  • multichain-aggregator/multichain-aggregator-logic/src/types/order_direction.rs
  • multichain-aggregator/multichain-aggregator-proto/proto/v1/cluster-explorer.proto
  • multichain-aggregator/multichain-aggregator-proto/swagger/v1/multichain-aggregator.swagger.yaml
  • multichain-aggregator/multichain-aggregator-server/src/services/cluster_explorer.rs

Walkthrough

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

Poem

🐰 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.

❤️ Share

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

@lok52 lok52 merged commit 303b424 into main Feb 23, 2026
10 of 11 checks passed
@lok52 lok52 deleted the lok52/multi-sort-order branch February 23, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant