Implement a new Redis command (or extend an existing one) in Jedis, following the
conventions Jedis maintainers enforce in review.
-
Ask the user for the HLD. Interactively ask the user for the path to a
markdown file containing the High-Level Design for the command(s) (or confirm
that no HLD exists). If a path is given, read it fully — it is the primary
source for syntax, semantics, reply shape, and edge cases.
-
Find the server-side PR in the redis/redis GitHub repo. First verify
that gh works in the current (sandboxed) environment:
gh auth status
Sandboxes often block access to credential files (~/.netrc, gh config), so
gh may report unauthenticated here even though it works on the user's
machine. If gh auth status fails or reports no authentication, ask the
user for permission to run the gh commands outside the sandbox (e.g. with
the sandbox override for these specific read-only commands), explaining that
gh cannot reach its credentials from inside the sandbox. Only if the user
declines (or gh is genuinely not logged in anywhere) fall back to the
unauthenticated GitHub REST API or fetching
https://github.com/redis/redis/pulls?q=<command>.
Then search for the PR that adds/extends the command on the server:
gh search prs --repo redis/redis "<COMMAND NAME>" --limit 10
gh pr view <num> --repo redis/redis
gh pr diff <num> --repo redis/redis
From the server PR,
extract: exact wire syntax (argument order and optionality), reply type per
RESP2/RESP3, error conditions, time complexity, and — critically — the first
server version carrying the feature (RC builds like 8.7.225 = Redis 8.8 RC
are used for test gating). Note whether the server marks the feature
experimental / in preview.
-
Verify the command exists on the "next" Redis OSS version. Start the
integration environment using the latest .env.vX.XX file under
src/test/resources/env/ (pick the highest version numerically, not
lexicographically — e.g. 8.10 > 8.8):
ls src/test/resources/env/.env.v* | sort -V | tail -1
make start version=8.10
Then probe the standalone0 endpoint. Read its connection details from
src/test/resources/endpoints.json (currently redis://localhost:6379,
password foobared) and check the target command via redis-cli:
redis-cli -u redis://localhost:6379 -a foobared INFO server | grep redis_version
redis-cli -u redis://localhost:6379 -a foobared COMMAND INFO <COMMAND>
redis-cli -u redis://localhost:6379 -a foobared COMMAND DOCS <COMMAND>
For a NEW command, COMMAND INFO must return a non-empty reply. For an
EXTENDED command, additionally invoke it with the new syntax against a
scratch key and confirm the server accepts it (no ERR syntax error /
ERR unknown argument).
If the command/option is missing on the latest env version, the image tag
pinned in the .env.vX.XX file is too old for the target change. Interactively
ask the user for a redislabs/client-libs-test image tag that contains it
(e.g. an RC/edge/milestone build — tags are listed at
https://hub.docker.com/r/redislabs/client-libs-test/tags; you may check them
yourself and suggest candidates). Then restart the environment with that tag
and re-run the probes:
make stop
make start CLIENT_LIBS_TEST_IMAGE_TAG=<tag>
If the user has no tag to offer (or the probe still fails), report it and
proceed anyway: the implementation can continue, but integration tests will
be gated/skipped until a redislabs/client-libs-test image ships the change.
Keep the environment running for later test runs, or make stop if you
won't need it soon.
-
Create redis-cli showcase test cases. Once the command is available on
the running environment, derive a small set of redis-cli scenarios from the
HLD and the server PR and run them against standalone0. These serve two
purposes at once:
- Smoke test: prove the documented behavior actually holds on the target
server — happy path, each new option/keyword, reply shape (run with
redis-cli -3 too if RESP3 replies differ), edge cases and error
conditions called out in the HLD (empty/missing key, out-of-range args,
conflicting options), so the Java implementation is built against observed
replies, not assumptions.
- Showcase: each scenario should read as a mini use-case that explains
WHY the command/option exists — what a user could not do (or could only do
awkwardly) before, and how the new API covers it. Prefer realistic data
over
foo/bar (e.g. rate-limit counters for a bounded INCR, sensor
readings for a time-series aggregator).
Save the scenarios as a commented script in a scratch file (one block per
use-case: a one-line "what this demonstrates" comment, the redis-cli
commands, and the observed reply pasted back as comments). Carry this
material forward: it feeds the Phase 1 plan (as the explanation of the
feature and the source of expected values for tests), the Java test
assertions, and the PR description. If the command could not be made
available on any image (see step 3), still write the scenarios from the
HLD/PR as expected transcripts and mark them unverified.
-
Read docs/integration-testing.md in the Jedis repo — it defines the test
environment, endpoint discovery, *Test vs *IT naming, and how to run tests.
-
Trace one analogous existing command end-to-end in the codebase (same
command group, similar reply shape) so the plan mirrors real code, not
guesswork.
-
Determine the @since version:
mvn help:evaluate -Dexpression=project.version -q -DforceStdout
Strip -SNAPSHOT (e.g. 8.0.0-SNAPSHOT → @since 8.0).