Skip to content

DOC-7293 Add a Jedis set member expiration example to the sets page - #4526

Open
andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7293-set-member-expiration-examples
Open

andy-stark-redis wants to merge 1 commit into
mainfrom
DOC-7293-set-member-expiration-examples

Conversation

@andy-stark-redis

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

Copy link
Copy Markdown
Contributor

Adds a member_expiration step to the sets_tutorial Jedis example (SADDEX with SAddExParams, SADD, STTL) and wraps the matching redis-cli block in the Member expiration section of sets.md in a clients-example shortcode (lang_filter="Java-Sync").

Warning

Do not merge yet. This PR documents client APIs that are on the clients' default branches but in no stable release. Base is feature-oss-8.12 (the 8.12 release branch), not main.

Run-verified on redis:8.12-rc2 (the server reports redis_version:8.11.241, the rc2 version string; upstream tests gate at 8.11.240). The whole SetsExample ran against Jedis master c701a365 with its assertions; the new step printed 1, 1, [900, 900, -1].

Park manifest

Ticket: DOC-7293
Parked at: 2026-11-10
Trigger to pick up: jedis#4828 merge commit e7c37d3d3d5e is an ancestor of a non-prerelease Jedis tag (gh api repos/redis/jedis/compare/e7c37d3d3d5e...<tag>, expecting behind_by: 0), and Redis 8.12 is GA.
Labels: parked, do not merge yet

Pinned sources (state observed at park time, 2026-11-10)

Source State SHA Notes
jedis#4828 merged 2026-11-06, base master head 01c6bebd5e58, merge e7c37d3d3d5e not in v8.0.2 or v8.1.0-beta2 (beta2 was tagged 2026-10-26)
jedis master — c701a365ab46 the example was compiled against this
StackExchange.Redis#3340 merged into its 8.12 branch merge 9597c4be85f8 [Experimental] under SER011; integration PR #3343 open
lettuce#3991 merged 2026-11-09 merge c8c11f7e454b no tag
predis#1749 merged merge 1685693b83ef not in v3.7.1

Re-fetch: gh api repos/redis/jedis/pulls/4828 --jq '{state, merged, merge: .merge_commit_sha}'.

Observed shape the page assumes

Confidence: MEDIUM for semantics (set members get a per-member TTL, STTL returns -1 for no expiry); LOW for identifiers, which are unreleased.
Identifiers the step uses, all on Jedis master (SetCommands.java, params/SAddExParams.java):

  • SAddExParams.sAddExParams().ex(long), inherited ex from BaseSetExParams
  • long saddex(String key, SAddExParams params, String... members)
  • long sadd(String, String...)
  • List<Long> sttl(String key, String... members)
    Expected values: 1, 1, [900, 900, -1].

Re-check checklist

On unpark, then

Run /unpark with this PR's number. /unpark Steps 4–5 own the closing sequence; /finalize is deferred until then.


Note

Low Risk
Documentation and example-test changes only; no production runtime impact beyond pinning a newer Jedis version in the example harness.

Overview
Adds Java (Jedis) coverage for set member expiration on the sets data-type page and wires it into the runnable example harness.

The Member expiration clients-example shortcode in sets.md now includes Java-Sync alongside Node.js and PHP. SetsExample.java gains a member_expiration step that mirrors the redis-cli flow: DEL, SADDEX with SAddExParams.ex(900), SADD, and STTL, plus assertions for expected counts and TTLs [900, 900, -1].

The Jedis test harness POM is bumped from 8.0.2 → 8.1.0 so the new saddex / SAddExParams APIs compile in CI.

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

@andy-stark-redis andy-stark-redis added do not merge yet parked PR speculatively added based on pre-release info. Check validity when release goes ahead. labels Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

DOC-7293

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Redis Memory

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

Memory updated at 3453f0c

Base automatically changed from feature-oss-8.12 to main November 23, 2026 14:19
andy-stark-redis added a commit that referenced this pull request Nov 25, 2026
…4662)

Adds a `member_expiration` step to the PHP `sets_tutorial` example (SADDEX
with a 900-second TTL, SADD, STTL) and adds PHP to the existing step's
`lang_filter` on the sets page. Node.js already had this step and this mirrors it.

Run-verified with the example harness on redis:8.12-rc2 (the server reports
8.11.241) against Predis v3.8.0. The step prints 1, 1, [900,900,-1] and the
whole DtSetsTest passes. The example passes the SADDEX condition and TTL
modifier as the string literals '' and 'ex' instead of SADDEX::COND_NULL and
SADDEX::TTL_EX, so the step needs no `use` import outside the step markers.

Learned: the harness only runs composer require when vendor/predis is missing, so work/php can sit on an old Predis
Directive: if the PHP step fails with "Command SADDEX is not a registered Redis command", run composer update predis/predis in build/example-test-harness/work/php
Gaps: the page was not built with Hugo locally; the other member expiration redis-cli blocks have no PHP steps
Recheck: when parked #4526 (Jedis) merges, its lang_filter edit on the same line needs a one-line merge
Ticket: DOC-7345
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Adds a member_expiration step to the sets_tutorial Jedis example (SADDEX with
SAddExParams, SADD, STTL) and adds Java-Sync to the lang_filter of the matching
redis-cli block in the Member expiration section of sets.md. Bumps the harness
pom-jedis.xml pin from 8.0.2 to 8.1.0, which is the first release with the API.

Unparked after Jedis 8.1.0 shipped. The park snapshot was right about the
identifiers: saddex(String, SAddExParams, String...), SAddExParams.sAddExParams().ex(long),
sadd and sttl(String, String...) all exist unchanged in 8.1.0, and the step printed
1, 1, [900, 900, -1] as predicted. The example was run with the harness
(sets_tutorial jedis) on Jedis 8.1.0 against the local redis:8.12-rc2 server, which
reports 8.11.241. The same commands were then checked in redis-cli on redis:8.12 GA
(8.12.0) and gave the page's output, but the Java example itself was not run on GA.

The PR was built on feature-oss-8.12, which main already contains as a squash, so a
rebase would have replayed those commits. This branch is a fresh one from origin/main
with only the DOC-7293 commit cherry-picked. main had since added lang_filter
"Node.js,PHP" to the same step line, so the conflict was resolved by merging the lists.

Other clients stay out of the allowlist unless their support has shipped. A step that is
missing for a client renders the whole file for it, so add a client to lang_filter only
together with its example. The existing srem step prints res18 after assigning res19 and
was left alone. examples/ is gitignored build output, so only local_examples/ changes.

Learned: A missing step for a client renders the whole example file, so lang_filter must list exactly the clients that have the step.
Constraint: lang_filter on member_expiration must match the clients that have the step in their sets_tutorial file.
Directive: Keep fidelity/pom-jedis.xml and the run.sh comment about 8.0.2 in mind; only pom-jedis.xml was bumped here.
Gaps: The Java example ran on redis:8.12-rc2 (8.11.241), not on the GA image; only the redis-cli commands were checked on GA.
Reversibility: clean
Ticket: DOC-7293
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@andy-stark-redis
andy-stark-redis force-pushed the DOC-7293-set-member-expiration-examples branch from 7f5ec33 to 3453f0c Compare November 25, 2026 15:19
@andy-stark-redis andy-stark-redis removed the parked PR speculatively added based on pre-release info. Check validity when release goes ahead. label Nov 25, 2026
@andy-stark-redis andy-stark-redis changed the title DOC-7293 Add a Jedis set member expiration example to the sets page [PARKED] DOC-7293 Add a Jedis set member expiration example to the sets page Nov 25, 2026
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