Skip to content

DOC-6838 add cmds_sorted_set client examples for recently-added clients#3627

Open
andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-6838-add-command-page-examples-for-recently-added-clients
Open

DOC-6838 add cmds_sorted_set client examples for recently-added clients#3627
andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-6838-add-command-page-examples-for-recently-added-clients

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

DOC-6838 — command-page client examples for recently-added clients

Pilot pass covering the sorted-set command examples. Brings the runnable client tabs on the ZADD and ZRANGE command pages up to the full supported roster.

What changed

  • zadd.md / zrange.md client tabs: 5 → 12. Added local_examples/cmds_sorted_set/ sources for ioredis, Ruby (redis-rb), Predis (PHP), Rust sync/async, and Lettuce async/reactive, covering steps zadd, zrange1, zrange2, zrange3. (Go, Jedis, Node.js, Python, C#/SE.Redis were already present upstream.)
  • build/example-test-harness/ — wired cmds_sorted_set into run.sh, added an ioredis runner (the harness had none), and made the PHP bootstrap require vendor/autoload.php so the cmds_* Predis files run without an in-file require. README updated to match.

Verification

All 7 new clients pass the example-test-harness against a live Redis, using each library's real in-file assertions across every step.

Notes

  • Each step self-resets (del myzset in a REMOVE block) so it stands alone — the build strips those cleanup lines from the rendered output.
  • zrange3 uses the modern ZRANGE … BYSCORE LIMIT form on every client that supports it (a Codex review caught Ruby/Predis still on legacy zrangebyscore).
  • No command→API mapping changes were needed — ZADD.json/ZRANGE.json already list all relevant clients.
  • Scope: sorted set only. The remaining thin sets (cmds_cnxmgmt, cmds_servermgmt, cmds_set, cmds_list, cmds_stream, set_and_get) are follow-up passes.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and local example/harness changes only; no production runtime or security-sensitive logic.

Overview
Adds sorted-set command page runnable examples for seven clients that were missing from the ZADD / ZRANGE tabs: ioredis, Ruby, Predis (PHP), Rust sync/async, and Lettuce async/reactive. Each file follows the shared cmds_sorted_set step layout (zadd, zrange1, zrange2, zrange3) with in-file assertions and per-step myzset cleanup in REMOVE blocks so the harness can run them independently.

Example test harness changes wire in the new cmds_sorted_set set: src_path() mappings for those clients, ioredis added to the default client list with a dedicated run_ioredis runner, PHP bootstrap now requires Composer autoload so Predis examples work without an in-file require, and the README documents the expanded example sets and ioredis client.

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

Pilot for DOC-6838: takes the sorted-set command-page examples (steps
zadd and zrange1-3 on zadd.md and zrange.md) from 5 client tabs to 12,
adding ioredis, Ruby, Predis, Rust sync/async and Lettuce async/reactive
as local_examples overrides. Each step deletes myzset in a REMOVE block
so it stands on its own: the build strips those cleanup lines from the
rendered output, so without them state leaks between steps (e.g. "uno"
from the zadd step bleeding into zrange1). That leak is invisible for Go
- its testable Example funcs carry no Output comment, so go test never
actually runs them - but real for every client the harness executes. All
seven verified green against a live Redis via build/example-test-harness,
which needed a new ioredis runner and a vendor/autoload require in the
PHP bootstrap (the cmds_* predis files omit the in-file require that
ss_tutorial carries). A Codex review caught Ruby and Predis still using
legacy zrangebyscore for zrange3; both now use ZRANGE ... BYSCORE.

Learned: the build strips REMOVE cleanup so each example STEP must self-reset; Go Example funcs without an Output comment are never executed by go test
Constraint: every STEP_START/STEP_END block must delete its own keys in a REMOVE block so it stands alone (the harness runs the whole file top-to-bottom)
Rejected: legacy zrangebyscore for zrange3 | ZRANGE ... BYSCORE LIMIT is the documented form and every mapped client supports it
Directive: keep zrange3 on the modern ZRANGE BYSCORE form; do not revert Ruby/Predis to zrangebyscore
Ticket: DOC-6838
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

DOC-6838

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant