Build tooling to guarantee correct output from interactive redis-cli commands#3643
Conversation
|
|
|
The command outputs embedded in the Markdown docs are the source of truth, each example records exactly what Redis should return. This script replays those commands against redis.io/cli and checks that the live output still matches the docs, so you can catch stale or broken examples. Some examples won't match right now and that's expected for commands for which the output is random (e.g. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7fb1cec. Configure here.
|
I posted this a while ago but unfortunately, I added it to the wrong PR :-( Anyway, among other mismatches, I'm getting: Looks like this is down to non-deterministic ordering rather than an actual error. |
I've added VSIM to the commands for which the order is not relevant |
|
@paoloredis A few more issues:
Aside from these things, the script catches some genuine, fixable mistake already - really useful! |
Thanks, I've now differentiated between unordered and non deterministic cmds |
andy-stark-redis
left a comment
There was a problem hiding this comment.
The checker gives a clear run now, so LGTM.
|
@dwdougherty what do you think? |
dwdougherty
left a comment
There was a problem hiding this comment.
I haven't had a chance to look at this yet, but if @andy-stark-redis says it's good, then that's good enough for me.

Note
Low Risk
Changes are mostly documentation transcripts and a new optional CI script that calls the public redis.io CLI API; no runtime product or auth paths are modified.
Overview
Adds
build/check_tryit_output.py, a CI-oriented verifier that parsesclients-exampletranscripts, runs each page’s commands in one shared redis.io/cli session (batched to 20 commands), formats API replies likestatic/js/cli.js, and compares them to documented output. ERROR (command fails when docs expect real output) fails the build; MISMATCH is reported but only gates with--strict. It handles unordered commands, skips non-deterministic ones, and can mask volatile values (stream IDs, timestamps).Across command and develop docs, example transcripts are updated so they match live redis-cli text: unquoted
OKfor simple strings, quoted bulk strings, nested array layout (e.g. ARSCAN, ARGREP, CMS.INCRBY), fixed typos/corruption in XADD examples,DELsetup in ZRANGE / ARGREP / SDIFF for isolated runs, fuller JSON wildcard/filter output, expanded TS.INFO blocks,runnable="false"on a heavy TS.MRANGE example, and small numeric/format fixes (t-digest, FT.SEARCH, listsDELreturn values).Reviewed by Cursor Bugbot for commit 9b38047. Bugbot is set up for automated code reviews on this repo. Configure here.