Repository navigation
DOC-7267 Rebuild the ioredis entries from the declared overloads - #4496
Conversation
The ioredis data was scraped from RedisCommander.d.ts by something that ran text together: signatures with stray commas and empty leading parameters, params arrays reduced to a single garbled ...args item, 16 entries that glued one command's overload, a JSDoc comment and other commands' overloads into one string, and an Any return on 416 of 429 entries. Each entry is now matched to the overload it came from and rebuilt from that declaration. The reference is ioredis 5.11.1, the latest 5.x. The harness pins ^5.4.0, and 430 of the 458 existing pieces match a 5.11.1 overload exactly against 333 for 6.0.0, so the data is 5.x. The six himport entries are the exception: himport only exists in 6.0.0, where they were authored, and they were already correct. 154 command lists change. 175 signatures are regenerated verbatim from the declaration, 264 params arrays are rebuilt (one item per tuple element, as in HIMPORT PREPARE), and every return becomes the declared Result<T, Context>. Existing text that already matched stays byte for byte, apart from the return. Collapsed entries split into their real overloads, so the file grows from 429 to 458 entries, and 16 pieces that belonged to other commands (hget inside HEXPIRE, lmove inside LLEN, migrate inside MGET and so on) are dropped. The 154 distinct method names all exist on the 5.11.1 Redis type (checked with tsc), except himport. Learned: the scraper concatenated declarations, so a collapsed entry can hold another command's overloads, match pieces to declarations before trusting an entry Constraint: the reference is ioredis 5.x, 6.0.0 differs on about 100 overload signatures (bitop and geoadd option names, for one) Directive: keep the existing per-command overload selection, do not import all 2,891 declared overloads Gaps: which overloads each command should list was not reviewed, HEXPIRE now lists ten Gaps: the pieces dropped from other commands were not added to those commands' own lists Recheck: when the docs move to ioredis 6.x, rerun the match against its declarations Ticket: DOC-7267 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 2166b40 |
dwdougherty
left a comment
There was a problem hiding this comment.
I'm not seeing ioredis entries in the pulldown menu, but maybe I'm looking for the wrong thing. That said, I'll go ahead an approve to speed you along.
@dwdougherty Yes, Claude seems to have figured that getting the data in place first merited a separate PR, which does make this one seem a bit odd. You should see ioredis appear soon :-) Anyway, thanks for the review! |
The ioredis entries rebuilt in #4496 and the redis_rb entries were never shown: the API Methods tab builds its dropdown from a fixed client order in api-methods-tab.html, and that list named every client with a mappingClientId except these two. ioredis now sits after Node.js and Ruby after PHP, in both the dropdown order and the localStorage tab-sync order. Both also get genericCall="call", which ioredis declares in RedisCommander.d.ts (5.11.1) and redis-rb v6.0.0 documents as Redis::Commands#call, so a command listed generic_only in the status file would say how to send it. Coverage is thin. ioredis has a list for 159 of 527 commands (62 empty, 306 with no key) and Ruby for 217 (310 with no key), against about 470 for redis-py, Jedis and go-redis. The rest show the default "No method signature available for this client." No status entries were added, because most of the gap is typed methods that were never mapped (EVAL and HGET for ioredis), not commands the client cannot call. RedisVL stays out of the dropdown on purpose, because it is handled differently from the other clients. Learned: a client with a mappingClientId in config.toml still does not appear in the tab unless it is in both clientOrder lists in api-methods-tab.html Directive: add a client to the tab in both $clientOrder and $jsClientOrder, and give it a genericCall Directive: do not add RedisVL to the API Methods tab client order, the docs team decided it is handled differently Gaps: most commands have no ioredis or Ruby entry, so the new options show the default message for them Gaps: built with content/develop/clients ignored, checked SET, EVAL and ACL in the output Ticket: DOC-7267 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…re container pages Seven ioredis lists held other subcommands' overloads: XGROUP DESTROY, DELCONSUMER, CREATECONSUMER and SETID, and XINFO STREAM, GROUPS and CONSUMERS. The ioredis cleanup in #4496 kept each command's existing overload selection, and these lists had been built from the whole xgroup or xinfo method, so XGROUP DESTROY listed five CREATE overloads and none of its own. The tab renders the ioredis subcommand as a plain param, so it showed xgroup( subcommand: "CREATE", ...) on the DESTROY page. Each list now holds only the overloads whose subcommand literal is its own, 24 entries dropped, and the four lists left with none take their overloads from the declaration. Every ioredis entry for a space-named container command now names that command's subcommand. The ten remaining empty ioredis pages from #4512 are settled. DEBUG is one method with a free subcommand string, so it takes the three declared debug overloads. MONITOR is a method of the Redis class, declared outside RedisCommander as monitor(callback?: Callback<Redis>): Promise<Redis>, so it gets that entry. The nine bare container pages (ACL, CLIENT, CLUSTER, COMMAND, CONFIG, LATENCY, MEMORY, MODULE, SLOWLOG) have no method that takes the command without a subcommand, so ioredis is generic_only for them. Learned: an ioredis container command is one method, so a subcommand entry has to be filtered by the subcommand literal, and a list that was split from a collapsed entry can hold the wrong ones Constraint: reference ioredis 5.11.1, DEBUG and MONITOR were checked in RedisCommander.d.ts and Redis.d.ts Directive: after building ioredis entries for a container subcommand, check that every signature names that subcommand Gaps: the two descriptions on the MONITOR entry are written by hand, ioredis has none for them Gaps: nine bare container pages say to use call although the bare command is not useful, the status file has no way to say that Ticket: DOC-7267 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The API Methods tab lists ioredis since #4498, but 368 of the 527 commands had an empty or missing ioredis list. Each is now accounted for against the RedisCommander overloads declared in ioredis 5.11.1, the version #4496 settled on. 225 command files get 444 entries and 132 commands are recorded as generic_only in the status file, so the tab says to use call. 114 commands that name a method (DEL, EXPIRE, the AR and V commands and so on) take the declared overloads of that method, and 111 container subcommands (ACL CAT, CLIENT KILL, CLUSTER ADDSLOTS, XGROUP and others) take the overloads of the container method whose subcommand literal is theirs. Each list stops at five overloads, the same reach as the existing SET and ZADD entries. Returns are the declared Result<T, Context> and descriptions are empty. The generic_only set is the 116 module commands, 6 container subcommands with no typed overload and 10 commands with no method. Five CLUSTER commands are declared with the CLUSTER SLOTS reply type, so they keep it and the return description says Redis replies OK. Learned: ioredis container commands are one method each, the subcommand is the first parameter literal, so a subcommand entry is the subset of that method's overloads with its literal Constraint: the reference is ioredis 5.x, a command only 6.x declares would be wrongly generic_only, none of the 368 is one Directive: do not list ioredis methods the declarations lack, such as module commands, send them with call Gaps: five overloads per command is a presentation choice, many methods declare more, plus Buffer variants that are not listed Recheck: when the docs move to ioredis 6.x, regenerate and revisit the generic_only commands that 6.x types Ticket: DOC-7267 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…re container pages Seven ioredis lists held other subcommands' overloads: XGROUP DESTROY, DELCONSUMER, CREATECONSUMER and SETID, and XINFO STREAM, GROUPS and CONSUMERS. The ioredis cleanup in #4496 kept each command's existing overload selection, and these lists had been built from the whole xgroup or xinfo method, so XGROUP DESTROY listed five CREATE overloads and none of its own. The tab renders the ioredis subcommand as a plain param, so it showed xgroup( subcommand: "CREATE", ...) on the DESTROY page. Each list now holds only the overloads whose subcommand literal is its own, 24 entries dropped, and the four lists left with none take their overloads from the declaration. Every ioredis entry for a space-named container command now names that command's subcommand. The ten remaining empty ioredis pages from #4512 are settled. DEBUG is one method with a free subcommand string, so it takes the three declared debug overloads. MONITOR is a method of the Redis class, declared outside RedisCommander as monitor(callback?: Callback<Redis>): Promise<Redis>, so it gets that entry. The nine bare container pages (ACL, CLIENT, CLUSTER, COMMAND, CONFIG, LATENCY, MEMORY, MODULE, SLOWLOG) have no method that takes the command without a subcommand, so ioredis is generic_only for them. Learned: an ioredis container command is one method, so a subcommand entry has to be filtered by the subcommand literal, and a list that was split from a collapsed entry can hold the wrong ones Constraint: reference ioredis 5.11.1, DEBUG and MONITOR were checked in RedisCommander.d.ts and Redis.d.ts Directive: after building ioredis entries for a container subcommand, check that every signature names that subcommand Gaps: the two descriptions on the MONITOR entry are written by hand, ioredis has none for them Gaps: nine bare container pages say to use call although the bare command is not useful, the status file has no way to say that Ticket: DOC-7267 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Summary
DOC-7267 ioredis follow-up (the ticket listed the other clients; this one turned out to be a different defect from redis_py).
The ioredis data was scraped from
RedisCommander.d.tsby something that ran text together. Each entry is now matched to the overload it came from and rebuilt from that declaration:bitcount(, key: RedisKey, ...)). 175 are regenerated verbatim from the declaration. Text that already matched stays byte for byte.paramsarrays were often one garbled item (...argstyped[key). 264 are rebuilt with one item per tuple element, asHIMPORT PREPAREalready does. Existing descriptions are kept.Anyon 416 of 429 entries. Every return is now the declaredResult<T, Context>. No non-Anyreturn changed.The merged
data/command-api-mapping.jsonis regenerated and equals the per-command data. Its only semantic changes are the 154 ioredis lists. No other client changed. ioredis isn't in the API Methods tab's client list, so nothing renders differently.How to review
^5.4.0, and 430 of the 458 existing pieces match a 5.11.1 overload exactly, against 333 for 6.0.0. The sixhimportentries are the exception:himportonly exists in 6.0.0, where they were authored, and they were already correct, so they are untouched.PFCOUNT,PFMERGE, where the old text had a rest parameter beforecallback, which isn't valid TypeScript) are matched by parameter names and rest-ness.tsc --strictcompile oftypeof redis.<name>succeeds on the 5.11.1Redistype for 153 of the 154 distinct method names. The exception ishimport.HEXPIREnow lists ten entries andHPEXPIREten. Those were each already one entry that contained 8 or 9 real overloads (the NX, XX, GT and LT variants), so splitting preserves information. Whether a command should list that many is a separate question.Not fixed
hget,hmget,hrandfield,lmove,migrate,script,sdiffstore,sintercard,subscribe,sunionstore,xpending,zcount,incr,incrby,decr,decrby) were not added to those commands' own lists. They were stray fragments, not a reviewed selection.bitopandgeoaddoption names, for one). When the docs move to 6.x, rerun the match.🤖 Generated with Claude Code
Note
Low Risk
These edits are documentation metadata only; there is no runtime or client-facing behavior change beyond regenerated JSON.
Overview
Refreshes the
data/command-api-mappingJSON shards so ioredis entries mirror the actual TypeScript overloads instead of scraped noise.Signatures drop stray commas/comments and split merged command strings into distinct overloads, while
paramsnow enumerate each positional/rest argument instead of a single...argsblob. Returns that were previously labeledAnynow expose the declaredResult<T, Context>shapes, and follow-on tweaks (e.g.,mget/msetmap vs tuple variants,HEXPIREoption breakdowns) align with current typings.data/command-api-mapping.jsonis regenerated from the per-command files so only the ioredis sections change; other clients remain untouched.Reviewed by Cursor Bugbot for commit 2166b40. Bugbot is set up for automated code reviews on this repo. Configure here.