DOC-6968 Omit a clients-example tab when that client lacks the requested step - #3811
Merged
andy-stark-redis merged 1 commit intoAug 13, 2026
Merged
Conversation
…ted step Splits the shortcode's whole-file fallback three ways, so that a step a client does not have omits its tab instead of dumping the client's entire file into the pane. 63 panes site-wide were doing that, the worst rendering 258 lines of Go — package declaration, imports and several unrelated examples — where the reader expected a snippet for one command. The condition has three clauses and each one is load-bearing: step != "" AND step not in named_steps AND len(named_steps) > 0 Dropping the last would strip every client tab from commands/set.md and commands/get.md, whose files have no STEP markers at all, so the whole file genuinely is the example. Dropping the first would break the deliberate step="" usage on data-store.md. Both are verified as untouched below. It tests membership in named_steps rather than $sliceable on purpose. A step that exists but whose line range is malformed or out of bounds should still fall through to the whole-file path — that is precisely the drift the $sliceable guard was written to absorb, and conflating the two would turn a data problem into a missing tab. The continue fires before any content is built, not merely before the tab is appended. The legacy path mutates .Page.Store and inlines the file once per page, so building it for a tab we then drop would leave orphaned markup and a wasted copy of the file in the output. Each omission emits a warnf naming the page, client, step and set, which is self-extinguishing: it goes to zero as the missing examples get written. CI runs plain `hugo -d output` with no --panicOnWarning, and the build still exits 0, so this surfaces the gaps without turning them into a failure. Verified before and after on identical data: 2711 panes -> 2648 (63 removed), legacy panes 100 -> 37, and the 63 warnings correspond one-to-one with the 63 removed panes. What remains on the legacy path is exactly the two protected classes: 25 cosmetic panes in zero-step files and 12 from step="". All 594 tab groups survive with at least one pane, so nothing renders empty; selector options still match panes exactly on the worst-affected group (scan1, 6 and 6), so no tab button is left without a pane; commands/incr.md is untouched at 12 clients; and vector3/vector4 degrade to a CLI-only tab as agreed, a shape that already exists elsewhere on the site. One measurement trap cost me a false discrepancy first time round. data/examples.json is gitignored build output, so after checking out a branch it still describes the previous tree: my first run reported 65 warnings against 63 known panes, purely because Ruby's newly merged hexpire steps were absent from the stale data. Rebuilding it reconciled both numbers exactly. Learned: data/examples.json is gitignored build output, so it must be regenerated after any branch switch before rendering is measured, or the measurement describes the tree you were on before Constraint: keep all three clauses of the omit condition — dropping the len(named_steps) > 0 test strips every client tab from commands/set.md and commands/get.md, which have no STEP markers at all Constraint: the continue must fire before content is built, because the legacy path mutates .Page.Store and inlines the whole file once per page Rejected: gating omission on $sliceable rather than named_steps membership | a step whose range is malformed should still fall back to the whole file, which is what that guard exists for Directive: do not add a whole-file last resort for groups that lose every client tab — vector3/vector4 intentionally degrade to CLI-only, and a 1-pane group is an existing shape Gaps: scan.md still loses 7 of its 12 client tabs, and the h* pages 2 each, until the cmds_generic and cmds_hash steps are written; the warnf output is the worklist Ticket: DOC-6968 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at 94cb5ab |
dwdougherty
approved these changes
Aug 13, 2026
dwdougherty
left a comment
Collaborator
There was a problem hiding this comment.
GAH! ZOMG! So many new warnings! OCD triggered bigly. 😲
That said, please proceed.
Contributor
Author
Thanks for the review @dwdougherty ! Yeah, I prefer to be clear of warnings too - next PR is all about fixing them :-) |
andy-stark-redis
deleted the
DOC-6968-clients-example-omit-missing-step
branch
August 13, 2026 15:43
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-6968 — omit a
clients-exampletab when the client lacks the requested step29 lines in one partial. It stops 63 panes site-wide from rendering a client's entire example file where a snippet belongs — the worst being 258 lines of Go (
package, imports and several unrelated examples) oncommands/scan.md.This is the fix the rest of DOC-6968 was clearing the way for. The coverage work that had to land first is already on
main(#3809).The condition, and why each clause matters
The shortcode's
elsebranch was conflating three situations. Only the middle one is a defect:step=""— explicitly emptydata-store.md)STEPmarkers; the whole file is still the closest thing to an exampleDropping the
len > 0clause would strip every client tab fromcommands/set.mdandcommands/get.md— 12 each — because those files have noSTEPmarkers. That's a regression, not a fix, so the clause is load-bearing rather than defensive.It deliberately tests membership in
named_stepsrather than$sliceable: a step that exists but whose line range is malformed or out of bounds should still fall through to the whole-file path, which is exactly the drift$sliceablewas written to absorb.The
continuefires before any content is built, not just before the tab is appended — the legacy path mutates.Page.Storeand inlines the file once per page, so building it for a tab we then drop would leave orphaned markup and a wasted copy of the file in the output.Loud, not silent
Each omission emits a
warnfnaming page, client, step and set, so the gaps become a worklist rather than an invisible absence:Self-extinguishing — it drops to zero as the examples get written. CI runs plain
hugo -d outputwith no--panicOnWarning, and the build still exits 0, so this surfaces the gaps without failing anything. Deliberately not warning on the 25 zero-step files, which would produce permanent warnings nobody can action.Verification
Two builds of the identical tree, with and without the change:
The 63 warnings correspond one-to-one with the 63 removed panes, and what remains on the legacy path is exactly the two protected classes (25 cosmetic + 12 by-design).
Structural checks, because a change like this fails quietly:
scan1: 6 and 6, identical sets) — no tab button left without a pane.commands/incr.mduntouched at 12 clients, thanks to the examples added in DOC-6968 Fix two node-redis step names, and add the missing incr step for nine clients #3809.commands/set.md/commands/get.mduntouched, 12 client tabs each.data-store.md(step="") untouched.hashes.mdhexpirekeeps all 11 clients including Ruby;hexpireatkeeps its 10 (Ruby excluded bylang_filter, so it never reaches this check).vector3/vector4degrade to a CLI-only tab as agreed — a 1-pane shape that already exists elsewhere on the site (nredisstack/prob).What this does not fix
The 63 panes stop rendering wrongly; the missing coverage is still missing.
commands/scan.mddrops from 12 client tabs to 5, theh*pages from 14 to 12, anddel/expire/ttlfrom 12 to 7. The fourcmds_genericscansteps are 28 of the 63 and remain the biggest lever — see the DOC-6968 status comment for the full per-page table. Thewarnfoutput is the worklist.🤖 Generated with Claude Code
Note
Low Risk
Docs layout-only change with explicit guards for legacy no-step files; build still succeeds and tab groups retain at least one pane per verification notes.
Overview
Client example tabs in
tabbed-clients-example.htmlnow skip a language tab when the shortcode asks for a namedstepthat client’s example file does not define, but that file does define other steps.That stops the legacy whole-file path from dumping full multi-example sources (imports, unrelated snippets) into a pane meant for one command—63 panes site-wide, per the PR verification.
Unchanged behavior: empty
stepstill uses the whole file; files with noSTEPmarkers at all still get a tab (so pages likeset/getkeep all client tabs). Malformed or out-of-bounds ranges still use the existing whole-file fallback via$sliceable, not this omission rule.Each omission logs a
warnfwith page, client, step, and example set. The loopcontinues before building tab content so legacy.Page.Storeinlining does not run for tabs that are dropped.Reviewed by Cursor Bugbot for commit 94cb5ab. Bugbot is set up for automated code reviews on this repo. Configure here.