Skip to content

DOC-7267 Show a literal first argument in the API Methods tab signatures - #4514

Merged
andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-api-tab-subcommand
Nov 9, 2026
Merged

andy-stark-redis merged 1 commit into
mainfrom
DOC-7267-api-tab-subcommand

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The API Methods tab printed only the method name from each signature, then the params. A Ruby container entry such as xgroup(:create, key, group, ...) has a first argument that is a literal rather than a param, so the :create was dropped. The code examples call r.xgroup(:create, ...), so the tab now prints a literal first argument as the first line inside the parentheses:

xgroup(
    :create,
    key: String,   // the stream key
    group: String, // the consumer group name
    ...
)

The literal is read from the signature text: a Ruby symbol (:create) or a quoted string. A signature whose first argument is a param, such as ioredis client(subcommand: "KILL", ...), isn't a literal and renders as before.

Review notes

  • Why not the full signature text: about 3,000 Jedis, Lettuce and NRedisStack signatures start with a return type that the tab already shows after the arrow, and 236 ioredis signatures are long tuple forms. Printing the text would also lose the per-param type and description lines.
  • Scope: I built the site with content/develop/clients ignored (the full site only builds in CI), once with this template and once with the unchanged one, and compared the API Methods blocks on 589 command pages. Only the 4 Ruby XGROUP blocks differ, and every other client's block is identical.
  • Pairs with DOC-7267 Fill the missing Ruby entries from the redis-rb 6.0.0 source #4513: that PR adds about 66 more Ruby container entries (client(:kill, *args), slowlog(:get, ...) and xinfo(:stream, ...)) that this change makes readable. The two PRs don't depend on each other.
  • Not changed: a literal that isn't the first argument is still not shown.

🤖 Generated with Claude Code


Note

Low Risk
Documentation template-only change to signature HTML rendering; no runtime API or data pipeline impact.

Overview
The API Methods tab now detects and prints a literal first argument inside method parentheses when it is not part of the structured params list—common for Ruby calls like xgroup(:create, ...).

Rendering parses the signature string after the method name and, when the first token is a Ruby symbol or quoted string, shows it before the typed parameter lines (with a trailing comma when params follow). Signatures whose first argument is already a named param are unchanged.

Scope: docs-only Hugo template change in api-methods-tab.html; behavior is limited to signature display, not mapping data or client selection logic.

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

The tab printed only the method name from each signature, then the params. A Ruby container
entry such as xgroup(:create, key, group, ...) has a first argument that is a literal, not a
param, so the :create was dropped and the XGROUP CREATE, DESTROY, DELCONSUMER and SETID entries
all read xgroup( key, group ...). The code examples call r.xgroup(:create, ...), so the tab now
prints the literal as the first line inside the parentheses.

The literal is read from the signature text: a first argument that is a Ruby symbol (:create) or
a quoted string. A signature whose first argument is a param, such as ioredis
client(subcommand: "KILL", ...), is not a literal and renders as before. Compared with the
unchanged template across 589 command pages, only the 4 Ruby XGROUP blocks differ, and every
other client's block is identical.

Learned: the tab builds each signature from the method name plus the params list, not from the signature text, so a part of the signature that is not a param never shows
Constraint: do not print the whole signature text, about 3,000 Jedis, Lettuce and NRedisStack signatures start with a return type that the tab already shows after the arrow, and 236 ioredis signatures are long tuple forms
Directive: a client whose container commands pass the subcommand as a literal first argument should write it as the first argument of the signature, and the tab will show it
Gaps: a literal that is not the first argument is still not shown
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

DOC-7267

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

Found 5 related items from repository history (5 new this commit):

Memory updated at a69fd4c

andy-stark-redis added a commit that referenced this pull request Nov 9, 2026
The Ruby entries were added to the API Methods tab dropdown in #4498, but 310 of the 527 commands had no redis_rb list. Each is now accounted for against the redis-rb v6.0.0 source. 89 command files get an entry and 203 commands are recorded as generic_only in the status file, so the tab says to use call.

23 commands name a method with complete YARD docs (BITCOUNT, BITOP, GETBIT, GEOSEARCH, INFO, PING, TIME and others) and take its signature, @PARAM types and descriptions, and @return. 66 container subcommands go through the container method that forwards the subcommand to the server, as XGROUP CREATE already does: client(:kill, *args), cluster, script and config with the same shape, slowlog(:get, length = nil), and xinfo for stream, groups and consumers with the return type that belongs to the subcommand. The 203 generic_only commands have no method in redis-rb 6.0.0, among them the array AR* commands, the V* vector commands, the module commands, the HOTKEYS family and the hash field-expiry commands, each searched for by name and by command symbol. The 18 methods without YARD parameter docs are covered by #4516 and the literal subcommand symbol is shown by #4514.

Learned: redis-rb container commands are one method each that passes the subcommand through, so a subcommand entry shows the container call with the symbol in the signature
Constraint: only emit an entry from YARD when every parameter has a @PARAM and the method has a @return, otherwise the type would be invented
Directive: do not list a command redis-rb 6.0.0 lacks, send it with call, and check the source for the method before marking generic_only
Recheck: when redis-rb ships a release after 6.0.0, search the new source for the generic_only commands
Ticket: DOC-7267
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@andy-stark-redis
andy-stark-redis merged commit cb26be3 into main Nov 9, 2026
109 checks passed
@andy-stark-redis
andy-stark-redis deleted the DOC-7267-api-tab-subcommand branch November 9, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants