Skip to content

[8.4] MOD-13146, MOD-9573, MOD-8104: FTCursor request policy#7893

Merged
Itzikvaknin merged 3 commits into8.4from
manual-backport-6396-to-8.4_setCommandInfo
Dec 25, 2025
Merged

[8.4] MOD-13146, MOD-9573, MOD-8104: FTCursor request policy#7893
Itzikvaknin merged 3 commits into8.4from
manual-backport-6396-to-8.4_setCommandInfo

Conversation

@Itzikvaknin
Copy link
Copy Markdown
Collaborator

@Itzikvaknin Itzikvaknin commented Dec 25, 2025

Manual backport of #6396 to 8.4.


Note

Introduces build-time generation and embedding of command metadata, and integrates it across command registration with request policy updates.

  • Add srcutil/gen_command_info.py and commands.json; CMake custom target runs Python to emit src/command_info/{command_info.h,c} and compiles them
  • Refactor command registration in module.c: reusable helpers for commands/subcommands, structured definitions, and per‑command Set*Info application; new IsEnterpriseBuild()
  • Set command tips for FT.CURSOR READ/DEL to request_policy:special; add corresponding setters for many commands (SEARCH, AGGREGATE, PROFILE, etc.)
  • Include src/command_info/*.c in build and add target dependency; adjust git working directory in CMake
  • Update mocks/tests: implement SetCommandInfo in redismock; strengthen to_dict; tweak ACL tests and version skips

Written by Cursor Bugbot for commit 7940c4e. This will update automatically on new commits. Configure here.

…tCommandInfo() (rebased) (#6396)

* * initial commit

* * fix compilation

* * fix test

* * support cases where the RedisModule_SetCommandInfo is not provided

* * fix test

* * rebase fixes

* * fix test_acl.py

* * fix proxy filtering

* * fix RegisterAllDebugCommands

* * fix RegisterCoordCursorCommands

* * Raz's comments 15/12/2024

* * try and fix sanitizer compilation issues

* * simplify python script to hopefully run using lower python version in CI

* * simplify python script to hopefully run using lower python version in CI - part 2

* * Raz's comments 17/12

* * use copy instead of deepcopy

* * Get rid of command macros to some degree
* Bring back commands to module.c
* Keep callback mutually exclusive group

* cluster commands name fix

* * add missing newline

* * Omer Comments - 25/12

* * add missing files

* get things to compile

* Add command tips to command info

* Add tests and fix failure with nested arguments requiring a BLOCK

* Code review fixes

* Intermediate work on module.c

* Sync tests_acl and commands.h with master
fix CreateCommandWithAcl implementation

* Register RS_RESTORE_IF_NX

* Fix test_command_info_tips_field

* tests/pytests/test_command_info.py pass

* remove tests/pytests/command_info_expectations.json and the expectations generating part from srcutil/gen_command_info.py

* continuation of expectation json removal

* Skip ft.config in cluster in test_command_info

* Register profile as a cursor subcommand

* small fix

* Fix potential memory leak

* Update test_mod_12493 to correctly assert cursor command stats

* Add RMCK_SetCommandInfo to redismock

Call GetRedisVersion() in RediSearch_InitModuleInternal to properly populate redisVersion

* Refactor command argument types and arity in command_info

Updated command argument types from 'key' to 'string' in commands.json for consistency. Adjusted the arity values in
command_info.c to include the command name as appears in redis docs.

Modified test_acl commands to reflect command structure validation is prior to acl check

* Refactor tests/pytests/test_command_info.py comparison utils

* resolve TODO

* update flags to align with master

* align module.c commands properties  with master

* Completion of merging https://github.com/RediSearch/RediSearch/pull changes

* Align RegisterCoordCursorCommands and RegisterCursorCommands with master implementation

* Fix tests (correct handler in cursor coord)

* CR comments

* Add types to tokens in apply expressions in commands.json

Change all cursor commands to "readonly" category

* Revery 5060000 commands.json

* Remove unused code

* Remove duplicate

* Restore RS_DEBUG admin group

* Replace RS_READ_ONLY_FLAGS_DEFAULT with "readonly" according to master

* Use the RMCreateArbitraryWriteSearchCommand fallback to register drop commands

* set SetFt_ListInfo

* Add SetFtHybridInfo to internal FT.HYBRID

* Remove unnecessary RS_WRITE_FLAGS_DEFAULT

* Fix indentation

* Fix CreateArbitraryWriteSearchCommands

* CR comments: test_command_
info

* CR comments

* Set SetFtDropindexInfo to ft.dropindex command

* Fix indentation

* CR comments

* Remove tests/cpptests/test_cpp_command_info.cpp

* Use IsEnterpriseBuild to condition code on build type

* Align with master (isEnterprise based internal command)

* Add expression property to filter command in commands.json

* Fix commands.json discrepency

* Block the option to register OSS commands on enterprise cluster (by uploading an OSS artifact to enterprise cluster)

* Revert "Block the option to register OSS commands on enterprise cluster (by uploading an OSS artifact to enterprise cluster)"

This reverts commit 00ee365.

---------

Co-authored-by: jonathan keinan <jonathan.keinan@redis.com>
Co-authored-by: itzik.vaknin@redis.com <itzikvaknin6@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 25, 2025

Codecov Report

❌ Patch coverage is 84.61538% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.02%. Comparing base (a0936ea) to head (7940c4e).
⚠️ Report is 2 commits behind head on 8.4.

Files with missing lines Patch % Lines
src/module.c 84.61% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.4    #7893      +/-   ##
==========================================
- Coverage   86.03%   86.02%   -0.02%     
==========================================
  Files         331      332       +1     
  Lines       53380    53683     +303     
  Branches    11998    11998              
==========================================
+ Hits        45925    46180     +255     
- Misses       7288     7336      +48     
  Partials      167      167              
Flag Coverage Δ
flow 84.64% <80.76%> (-0.14%) ⬇️
unit 52.41% <39.01%> (+0.08%) ⬆️

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

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

@Itzikvaknin Itzikvaknin requested a review from oshadmi December 25, 2025 12:11
…rectory (#7884)

Update CMakeLists.txt to use 'root' variable for paths and working directories
kei-nan
kei-nan previously approved these changes Dec 25, 2025
Comment thread tests/pytests/test_acl.py
@@ -1,3 +1,5 @@
import copy
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused import statement left in test file

The import copy statement was added but is never used anywhere in the file. There are no calls to copy.copy(), copy.deepcopy(), or any other copy module functions. This appears to be accidentally committed dead code that was likely part of development or debugging that wasn't cleaned up before the commit.

Fix in Cursor Fix in Web

@Itzikvaknin Itzikvaknin added this pull request to the merge queue Dec 25, 2025
Merged via the queue into 8.4 with commit 45628e4 Dec 25, 2025
32 checks passed
@Itzikvaknin Itzikvaknin deleted the manual-backport-6396-to-8.4_setCommandInfo branch December 25, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants