Skip to content

RI-8220: Add Aggregate tab to Array key details#6089

Open
pawelangelow wants to merge 7 commits into
be/RI-8220/add-aggregatefrom
fe/RI-8220/add-aggregate
Open

RI-8220: Add Aggregate tab to Array key details#6089
pawelangelow wants to merge 7 commits into
be/RI-8220/add-aggregatefrom
fe/RI-8220/add-aggregate

Conversation

@pawelangelow

@pawelangelow pawelangelow commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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 / end index inputs (u64-safe strings, client-side validation against the 1 000 000-element span cap)
  • Operation select: SUM, MIN, MAX, AND, OR, XOR, MATCH, USED
  • value field is shown and required only when MATCH is selected
  • Run / Reset controls; result is copyable

Screenshots

Dark Light
Screenshot 2026-06-18 at 12 54 24 Screenshot 2026-06-18 at 12 53 39
Screenshot 2026-06-18 at 12 54 55 Screenshot 2026-06-18 at 12 54 45

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, an aggregate sub-state on the array slice (loading, error, result, hasResult), and aggregateArray with its own abort controller so View-tab range/scan requests are not cancelled. MATCH sends an optional value in the request body.

UI: ArrayAggregateForm mirrors the View tab: start/end indexes (u64 strings + 1M span cap), operation select (SUMUSED), conditional value for MATCH, command preview, Run/Reset. useArrayAggregateQuery holds form state, gates on array key readiness, resets on key change/unmount, and only runs on manual Run. AggregateTab shows 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 ArrayDetails tab visibility.

Reviewed by Cursor Bugbot for commit 6e7cfa8. Bugbot is set up for automated code reviews on this repo. Configure here.

@pawelangelow pawelangelow requested a review from a team as a code owner June 18, 2026 10:57
@pawelangelow pawelangelow self-assigned this Jun 18, 2026
@jit-ci

jit-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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() === ''

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@pawelangelow pawelangelow changed the title Fe/ri 8220/add aggregate RI-8220: Add Aggregate tab to Array key details Jun 18, 2026
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Backend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 93.01% 16157/17371
🟡 Branches 75.17% 5096/6779
🟢 Functions 87.31% 2497/2860
🟢 Lines 92.84% 15440/16630

Test suite run success

3597 tests passing in 317 suites.

Report generated by 🧪jest coverage report action from 6e7cfa8

@pawelangelow pawelangelow force-pushed the fe/RI-8220/add-aggregate branch from 0bdace6 to ec07780 Compare June 18, 2026 13:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Integration Tests

Status Category Percentage Covered / Total
🟡 Statements 78.47% 17782/22660
🟡 Branches 61.19% 8209/13415
🟡 Functions 66.31% 2420/3649
🟡 Lines 78.03% 16724/21432

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Coverage - Frontend unit tests

St.
Category Percentage Covered / Total
🟢 Statements 83.33% 25849/31021
🟡 Branches 68.73% 10923/15892
🟡 Functions 78.54% 6938/8834
🟢 Lines 83.8% 25221/30096

Test suite run success

7311 tests passing in 828 suites.

Report generated by 🧪jest coverage report action from 6e7cfa8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant