RI-8220: Add Aggregate tab to Array key details#6089
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 525d6d4ce9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ARRAY_RANGE_MAX_SPAN | ||
|
|
||
| const matchValueInvalid = | ||
| operation === ArrayAggregateOperation.Match && value.trim() === '' |
There was a problem hiding this comment.
Allow whitespace-only MATCH values
When the MATCH operation is used to count an array element whose value is only whitespace, this validation treats the input as empty and disables Run even though whitespace is a valid Redis string and the backend only requires a non-empty value before passing it through to AROP. Use an empty-string check rather than trimming so values like ' ' can be matched.
Useful? React with 👍 / 👎.
Code Coverage - Backend unit tests
Test suite run success3597 tests passing in 317 suites. Report generated by 🧪jest coverage report action from 6e7cfa8 |
0bdace6 to
ec07780
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec077801de
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Code Coverage - Integration Tests
|
Code Coverage - Frontend unit tests
Test suite run success7311 tests passing in 828 suites. Report generated by 🧪jest coverage report action from 6e7cfa8 |
What
Adds the Aggregate tab to the Array key details view, exposing the
POST /array/aggregate(AROP) endpoint to the UI. Users can pick a range, an operation, and run aggregations from the key view.Form:
start/endindex inputs (u64-safe strings, client-side validation against the 1 000 000-element span cap)SUM,MIN,MAX,AND,OR,XOR,MATCH,USEDvaluefield is shown and required only whenMATCHis selectedScreenshots
Note
Medium Risk
New browser feature that issues aggregate commands over user-defined ranges; risk is moderate due to scope and shared array slice state, but it follows existing range-query patterns and does not touch auth or refresh replay.
Overview
Replaces the Array key Aggregate tab placeholder with a full AROP flow against
POST array/aggregate.Redux / API: Adds
ARRAY_AGGREGATE, anaggregatesub-state on the array slice (loading,error,result,hasResult), andaggregateArraywith its own abort controller so View-tab range/scan requests are not cancelled. MATCH sends an optionalvaluein the request body.UI:
ArrayAggregateFormmirrors the View tab: start/end indexes (u64 strings + 1M span cap), operation select (SUM…USED), conditional value for MATCH, command preview, Run/Reset.useArrayAggregateQueryholds form state, gates on array key readiness, resets on key change/unmount, and only runs on manual Run.AggregateTabshows loader/errors and a Result field with raw string copy (BigInt-safe) or(nil)when the server returns null, while hiding stale state until the selected key is ready.Tests: Coverage for the tab, hook, and
ArrayDetailstab visibility.Reviewed by Cursor Bugbot for commit 6e7cfa8. Bugbot is set up for automated code reviews on this repo. Configure here.