feat: Add command metadata and update tests
Add #[valkey_command] Metadata & KeySpecs for Bloom Filter Commands
This PR adds the #[valkey_command] macro to all Bloom Filter commands in src/lib.rs, enabling proper SetCommandInfo support through the valkeymodule-rs crate.
The macro now provides Valkey with complete metadata, including:
- Command name
- Flags
- Arity
- KeySpec definitions (key position, read/write semantics, key ranges)
As a result, COMMAND INFO BF.* now correctly reports the KeySpec metadata for each Bloom Filter command.
Changes Included
Added #[valkey_command] to all Bloom Filter commands:
BF.ADDBF.MADDBF.EXISTSBF.MEXISTSBF.CARDBF.RESERVEBF.INFOBF.INSERTBF.LOAD
Implemented complete KeySpecs for each command:
begin_searchfind_keys- Key flags (
rw,insert,update,access)
Updated tests in tests/test_bloom_command.py:
- Adjusted expected arities
- Added KeySpec validation checks
Minor cleanup:
- Improved string formatting in:
src/bloom/data_type.rssrc/bloom/utils.rs
Notes / Limitations
The current version of valkeymodule-rs does not support argument metadata (args:) in SetCommandInfo.
Because of this limitation, this PR implements all supported metadata (KeySpecs), but cannot yet add full CLI argument autocomplete like the built-in SET command.
Once args support is added upstream in valkeymodule-rs, I can follow up with another PR to provide complete argument specifications for full autocomplete.
Verification
Example output of COMMAND INFO BF.ADD, showing that KeySpec metadata is now present: