Skip to content

MOD-16685 Add RedisJSON API to open from RedisModuleKey (#1619) - #1655

Merged
AvivDavid23 merged 3 commits into
8.8from
8.8-cp-e69a4e6983097e35f98b676266394ab75902764b
Sep 29, 2026
Merged

AvivDavid23 merged 3 commits into
8.8from
8.8-cp-e69a4e6983097e35f98b676266394ab75902764b

Conversation

@AvivDavid23

@AvivDavid23 AvivDavid23 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
  • MOD-16685 Add RedisJSON API to open from RedisModuleKey

Add a RedisJSON shared API V8 entry that opens a JSON root from an already-open RedisModuleKey handle. This lets consumers such as RediSearch reuse an existing key handle instead of manually checking isJSON and calling RedisModule_ModuleTypeGetValue.

Update the RediSearch RedisJSON API header copy and add LLAPI coverage for the new openKeyFromHandle path.

  • use Imanager to get value for json

  • fix clippy

  • rename functions

  • fix compilation


Note

Medium Risk
Adds a versioned C ABI surface and raw pointer access to module key values; misuse (wrong key type or closed handle) can return null or be unsafe, but behavior mirrors existing open-key paths with explicit validation.

Overview
RedisJSON shared API is bumped to V8 with getJsonFromHandle, which returns the JSON document root from an already-open RedisModuleKey without re-opening the key. Callers (e.g. RediSearch) can reuse a handle they already hold instead of duplicating isJSON plus RedisModule_ModuleTypeGetValue.

The Rust side adds json_api_get_value_from_handle_internal / JSONAPI_getJsonFromHandle, wires the function into the exported RedisJSONAPI struct and rejson_api.h, and extends the Manager trait with get_value_from_handle (implemented for the IValue manager). A unit test asserts a null key handle returns null.

The Linux flow workflow drops the always-on Capture test results step; failure uploads of test logs remain unchanged.

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

TalBarYakar and others added 2 commits September 29, 2026 13:40
* MOD-16685 Add RedisJSON API to open from RedisModuleKey

Add a RedisJSON shared API V8 entry that opens a JSON root from an
already-open RedisModuleKey handle. This lets consumers such as RediSearch
reuse an existing key handle instead of manually checking isJSON and calling
RedisModule_ModuleTypeGetValue.

Update the RediSearch RedisJSON API header copy and add LLAPI coverage for the
new openKeyFromHandle path.

* use Imanager to get value for json

* fix clippy

* rename functions

* fix compilation
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.15%. Comparing base (a644c55) to head (b08647d).
⚠️ Report is 1 commits behind head on 8.8.

Files with missing lines Patch % Lines
redis_json/src/c_api.rs 0.00% 20 Missing ⚠️
redis_json/src/ivalue_manager.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              8.8    #1655      +/-   ##
==========================================
- Coverage   75.65%   75.15%   -0.50%     
==========================================
  Files          15       15              
  Lines        4227     4255      +28     
==========================================
  Hits         3198     3198              
- Misses       1029     1057      +28     

☔ 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.

@AvivDavid23
AvivDavid23 merged commit 1064a46 into 8.8 Sep 29, 2026
2 checks passed
@AvivDavid23
AvivDavid23 deleted the 8.8-cp-e69a4e6983097e35f98b676266394ab75902764b branch September 29, 2026 11:10
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.

2 participants