Skip to content

feat(EN-1541)!: make QueryFilter the sole HTTP selector for volume aggregation#1613

Merged
Azorlogh merged 1 commit into
release/v3.0from
fix/en-1541-volumes-queryfilter
Jul 22, 2026
Merged

feat(EN-1541)!: make QueryFilter the sole HTTP selector for volume aggregation#1613
Azorlogh merged 1 commit into
release/v3.0from
fix/en-1541-volumes-queryfilter

Conversation

@Azorlogh

@Azorlogh Azorlogh commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Context

EN-1541

GET /v3/{ledgerName}/volumes exposed only prefix, while the controller and gRPC request already accept a general Accounts-target QueryFilter. This exposes that existing capability through the HTTP adapter and removes prefix, aligning volumes with the other filtered endpoints. No new aggregation or QueryFilter semantics are introduced.

Rebased on the post-#1438 handler; collapseColors behavior and tests are preserved.

Changes

  • handlers_aggregate_volumes.go — drop prefix and its hand-built AddressMatch; parse the shared dual-format filter via parseListFilter(w, r, QUERY_TARGET_ACCOUNTS) and forward it unchanged to AggregateVolumes. Mirrors handleListAccounts.
  • useMaxPrecision / groupByPrefixes / collapseColors are untouched and stay independent of filtering.
  • openapi.ymlprefix replaced with $ref: ListFilter.
  • api-comparison.md, query-pipeline.md — document the generic filter as the sole account selector.

Client impact (breaking)

  • ?prefix=users:?filter=address ^= "users:" (or structured {"$match":{"address":"users:"}}, URL-encoded).
  • Hard removal, no alias: a caller still sending ?prefix= gets no error — the param is ignored and the endpoint aggregates over all accounts.
  • New: metadata / account has asset / boolean and/or/not selection; invalid-for-target and malformed filters return 400.

Tests

Extended HTTP handler tests: dual-format equivalence, address + metadata reaching the controller, target-invalid + malformed → 400 without invoking the backend, coexistence with precision/grouping/color-collapse, and absence of legacy prefix interpretation.

GOROOT= go build ./..., go vet, and go test ./internal/adapter/http/ all pass.

…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:").
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73ca8614-c6f2-4749-a85d-2127eb842661

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/en-1541-volumes-queryfilter

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.

@NumaryBot

Copy link
Copy Markdown
Contributor

✅ Approve — automated review

The 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 flemzord left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.67%. Comparing base (832a329) to head (8b4c6cc).
⚠️ Report is 1 commits behind head on release/v3.0.

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     
Flag Coverage Δ
e2e 74.67% <100.00%> (+0.25%) ⬆️
scenario 74.67% <100.00%> (+0.25%) ⬆️
unit 74.67% <100.00%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@Azorlogh
Azorlogh merged commit d9bd018 into release/v3.0 Jul 22, 2026
14 checks passed
@Azorlogh
Azorlogh deleted the fix/en-1541-volumes-queryfilter branch July 22, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants