Skip to content

feat(cmds): add Redis array command builders#1002

Merged
rueian merged 3 commits into
redis:mainfrom
kiranmagic7:kiran/add-array-command-builders-1000
Jun 13, 2026
Merged

feat(cmds): add Redis array command builders#1002
rueian merged 3 commits into
redis:mainfrom
kiranmagic7:kiran/add-array-command-builders-1000

Conversation

@kiranmagic7

@kiranmagic7 kiranmagic7 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Closes #1000.

Summary

  • add hack/cmds/commands_array.json with the 18 Redis 8.8 AR* command specs from Redis unstable/src/commands
  • regenerate the array command builders and generated builder-path tests
  • mark Redis AR read commands in readOnlyCMDs so generated builders keep the readonly command flag

Tests

  • PATH="/Users/kiran/go/bin:$PATH" go generate ./...
  • go test ./internal/cmds -run 'TestCommand_.*_array' -count=1
  • go test ./internal/cmds -count=1
  • go test ./... -run '^$'
  • git diff HEAD^..HEAD --check

Compatibility

Generated command-builder additions only. Existing command builders are unchanged; AR write commands are normal completed commands, and AR read commands get the same readonly flag as other read-only Redis commands.


Note

Low Risk
Additive generated API and generator logic only; existing builders unchanged aside from shared gen.go path/oneof behavior for ARGREP-style commands.

Overview
Adds Redis 8.8 array support to the typed command builder by introducing hack/cmds/commands_array.json (18 AR* commands) and regenerating internal/cmds/gen_array.go plus path tests.

hack/cmds/gen.go is extended so ARGREP builds correctly: variadic oneof handling, AND/OR connectors that chain into further predicates, and path generation that avoids invalid duplicate predicate steps. Read-only AR commands are registered in readOnlyCMDs so generated roots get the readonly flag.

A focused TestArgrepBuildsMultiplePredicates asserts multi-predicate ARGREP wire format and readonly behavior.

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

@jit-ci

jit-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit b8529b2. Configure here.

Comment thread internal/cmds/gen_array.go
@kiranmagic7
kiranmagic7 force-pushed the kiran/add-array-command-builders-1000 branch from b8529b2 to e2b8cad Compare June 8, 2026 05:43
@kiranmagic7

Copy link
Copy Markdown
Contributor Author

CI is now complete on the updated head e2b8caddda0ba7fb27aa7fcccf7b82b57d10ebed: all visible checks are passing, including CircleCI build/setup, Jit Security, Cursor Bugbot, and the GitHub Actions Go matrix.

I did not find a CODEOWNERS file in the repo root, .github/, or docs/, so I have not requested a specific reviewer. From my side, the main review focus is whether the generated ARGREP predicate chaining shape matches the intended Redis AR command API.

@kiranmagic7

Copy link
Copy Markdown
Contributor Author

Friendly follow-up: this still looks ready for maintainer review. Current head e2b8caddda0ba7fb27aa7fcccf7b82b57d10ebed is mergeable from the PR view, all visible checks are passing, and I did not find a CODEOWNERS file to request a more specific reviewer path.

Review focus: the new array command builders are generated consistently with the existing command-builder patterns, and the earlier CI/proof note has the exact passing check summary. Happy to adjust anything maintainers want changed.

@rueian

rueian commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Hi @kiranmagic7, could you help delete acl_categories, key_specs, and reply_schema from specs? Those fields we don't need.

@kiranmagic7
kiranmagic7 force-pushed the kiran/add-array-command-builders-1000 branch from e2b8cad to e013bd1 Compare June 13, 2026 11:47
@kiranmagic7

Copy link
Copy Markdown
Contributor Author

Addressed, thank you.

Changed:

  1. Removed acl_categories, key_specs, and reply_schema from all 18 commands in hack/cmds/commands_array.json.
  2. Rebased the branch on current origin/main after feat: add INCREX command support (#1003).
  3. Pushed updated head e013bd1c834d2ed724b9751e2e39ed63285932be.

Local verification:

  1. jq empty hack/cmds/commands_array.json
  2. jq check confirms remaining_removed_fields=0
  3. PATH="$(go env GOPATH)/bin:$PATH" go run hack/cmds/gen.go internal/cmds hack/cmds/*.json
  4. go test ./hack/cmds ./internal/cmds ./internal/util
  5. git diff --check

I also tried go test ./...; local integration tests require Redis/Sentinel/cluster services on ports such as 6379, 26379, and 7001, so that broad run is blocked in this local environment.

@rueian rueian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@rueian
rueian merged commit bac7d5e into redis:main Jun 13, 2026
30 checks passed
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.

Add support for the new 18 AR* commands

2 participants