feat(EN-1541)!: make QueryFilter the sole HTTP selector for volume aggregation#1613
Conversation
…gregation
Remove the prefix query parameter from GET /v3/{ledgerName}/volumes and expose
the shared dual-format filter parameter instead, compiled for the Accounts
target and forwarded unchanged to AggregateVolumes. Aggregation options
(useMaxPrecision, groupByPrefixes, collapseColors) are unaffected.
BREAKING CHANGE: prefix is removed with no alias; account selection is now the
canonical filter (e.g. filter=address ^= "users:").
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
✅ Approve — automated reviewThe changes consistently replace the legacy prefix selector with the shared filter parsing path, preserve existing aggregation options, and update the documented API surface. I did not identify a discrete correctness issue introduced by the diff. No findings. |
flemzord
left a comment
There was a problem hiding this comment.
Reviewed current head 8b4c6cc8. The handler now uses the shared dual-format filter parser with the Accounts target and forwards the compiled filter without changing precision, grouping, or color-collapse behavior. The hard removal of the legacy prefix query parameter is documented across OpenAPI and architecture docs; as a pre-stable API compatibility change it is non-blocking here. Main CI, NumaryBot, CodeRabbit, and coverage are green, and I found no correctness/runtime blocker.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v3.0 #1613 +/- ##
================================================
+ Coverage 74.42% 74.67% +0.25%
================================================
Files 445 446 +1
Lines 47398 47447 +49
================================================
+ Hits 35277 35433 +156
+ Misses 8925 8806 -119
- Partials 3196 3208 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Context
EN-1541
GET /v3/{ledgerName}/volumesexposed onlyprefix, while the controller and gRPC request already accept a general Accounts-targetQueryFilter. This exposes that existing capability through the HTTP adapter and removesprefix, aligning volumes with the other filtered endpoints. No new aggregation or QueryFilter semantics are introduced.Rebased on the post-#1438 handler;
collapseColorsbehavior and tests are preserved.Changes
handlers_aggregate_volumes.go— dropprefixand its hand-builtAddressMatch; parse the shared dual-formatfilterviaparseListFilter(w, r, QUERY_TARGET_ACCOUNTS)and forward it unchanged toAggregateVolumes. MirrorshandleListAccounts.useMaxPrecision/groupByPrefixes/collapseColorsare untouched and stay independent of filtering.openapi.yml—prefixreplaced with$ref: ListFilter.api-comparison.md,query-pipeline.md— document the genericfilteras the sole account selector.Client impact (breaking)
?prefix=users:→?filter=address ^= "users:"(or structured{"$match":{"address":"users:"}}, URL-encoded).?prefix=gets no error — the param is ignored and the endpoint aggregates over all accounts.account has asset/ booleanand/or/notselection; invalid-for-target and malformed filters return400.Tests
Extended HTTP handler tests: dual-format equivalence, address + metadata reaching the controller, target-invalid + malformed →
400without invoking the backend, coexistence with precision/grouping/color-collapse, and absence of legacyprefixinterpretation.GOROOT= go build ./...,go vet, andgo test ./internal/adapter/http/all pass.