DOC-6838 add cmds_sorted_set client examples for recently-added clients#3627
Open
andy-stark-redis wants to merge 1 commit into
Open
DOC-6838 add cmds_sorted_set client examples for recently-added clients#3627andy-stark-redis wants to merge 1 commit into
andy-stark-redis wants to merge 1 commit into
Conversation
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>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ZADDandZRANGEcommand pages up to the full supported roster.What changed
zadd.md/zrange.mdclient tabs: 5 → 12. Addedlocal_examples/cmds_sorted_set/sources for ioredis, Ruby (redis-rb), Predis (PHP), Rust sync/async, and Lettuce async/reactive, covering stepszadd,zrange1,zrange2,zrange3. (Go, Jedis, Node.js, Python, C#/SE.Redis were already present upstream.)build/example-test-harness/— wiredcmds_sorted_setintorun.sh, added anioredisrunner (the harness had none), and made the PHP bootstraprequire vendor/autoload.phpso thecmds_*Predis files run without an in-file require. README updated to match.Verification
All 7 new clients pass the
example-test-harnessagainst a live Redis, using each library's real in-file assertions across every step.Notes
del myzsetin aREMOVEblock) so it stands alone — the build strips those cleanup lines from the rendered output.zrange3uses the modernZRANGE … BYSCORE LIMITform on every client that supports it (a Codex review caught Ruby/Predis still on legacyzrangebyscore).ZADD.json/ZRANGE.jsonalready list all relevant clients.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/ZRANGEtabs: ioredis, Ruby, Predis (PHP), Rust sync/async, and Lettuce async/reactive. Each file follows the sharedcmds_sorted_setstep layout (zadd,zrange1,zrange2,zrange3) with in-file assertions and per-stepmyzsetcleanup inREMOVEblocks so the harness can run them independently.Example test harness changes wire in the new
cmds_sorted_setset:src_path()mappings for those clients,ioredisadded to the default client list with a dedicatedrun_ioredisrunner, PHP bootstrap nowrequires 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.