Skip to content

redis: read the commands at each release tag of redis/redis - #234

Open
adssib wants to merge 1 commit into
pl5-pinsfrom
pl5-redis
Open

adssib wants to merge 1 commit into
pl5-pinsfrom
pl5-redis

Conversation

@adssib

@adssib adssib commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #233

Closes #222

What this changes

redis/commands read commands.json from redis/redis-doc. That repo is archived: the file last changed on 2023-10-24 and lists 370 commands. It now reads the command definitions in the server's own source, src/commands/*.json in redis/redis, at every final release tag (listed from GitHub releases and ordered by version, because Redis patches older lines after newer ones ship).

  • A release is one GitHub listing of src/commands/. A command file missing at the next release is a removed_symbol event, citing the file at the older tag. Only removed files are fetched.
  • A release before 7.0.0 has no src/commands/, so there's nothing to read (skipped).
  • The catalog kind is now one reader type per shape (catalog.Commands here; catalog.UpcomingChanges comes later in this stack). catalog.Catalog / catalog.Plugin are deleted, along with the old fixtures. The scaffold and the docs follow.

Why redis/redis and not redis/docs data/commands.json

The issue named both. I diffed the history of each (2026-11-20):

  • redis/docs data/commands.json (5 commits since 2024-02):

    • commit 2f513f2 drops 126 module commands (BF.*, CF.*, FT.*…) that Redis never removed, and later commits put them back;
    • commit 9740114 deletes the file;
    • its versions are commit dates, not server releases.

    Every one of those would be a false event.

  • redis/redis src/commands/: what the server and redis.io's command reference are generated from, at the release tags a team runs. Across every final release from 7.0.0 to 8.10.3, no command was removed, which is the correct answer for Redis. The one removal anywhere since 7.0 is between pre-release tags: GCRA and GCRASETVALUE, added in the 8.8 milestone builds and gone at 8.8-rc1. The golden pins that pair.

Recorded under Why this source in providers/redis.md.

#222's checklist

  • Point the source at a maintained file, the choice recorded in providers/redis.md (redis/redis src/commands/, see above)
  • List versions from its history (every final release tag)
  • New fixtures and a new golden (testdata/golden/redis-commands.json). There was no golden before, only assertions over the redis-doc excerpts, which are deleted with that source.

Checklist

  • Metadata complete in the registration (I read the words)
  • Signed off
  • Golden over real saved listings and the two real files at 8.8-m03
  • testdata/README.md rows: URL, date, license, quote
  • Pinned drop test: 8.8.0 → 8.10.0 adds 17 command files and removes none, so no event
  • providers/redis.md rewritten, with Why this source
  • make check passes

Related PRs

🤖 Generated with Claude Code

@claude

claude Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Claude finished @adssib's task in 1m 32s —— View job


✅ Ready to merge: the source moves to a maintained, release-tagged file. Metadata, provider page, golden, drop test and source rows are all complete, and every check passes locally.

Rules

Rule Status Evidence
Metadata in the registration (Rule 1) ✅ plugins/catalog/catalog.go:22-30: id, name, category, homepage; source id, layer, Watches, URLs (redis/redis src/commands and the releases page) and Page. They're updated for the new source. Packages is empty, which is fine because the Redis server isn't a published package. No hand-kept list came back.
Provider page ✅ providers/redis.md is rewritten. Why this source has the links, the date it was checked (2026-11-20), why this source is best, three alternatives with reasons (including the redis/docs churn commits) and a quote.
Golden over a real saved source + quote ✅ testdata/golden/redis-commands.json covers 8.8-m03 → 8.8-rc1 (GCRA, GCRASETVALUE), built from real listings and the two real files. Each event carries the raw file URL at the older tag and the compacted entry as its excerpt. It's a new golden, and the PR explains why.
testdata/README.md rows ✅ Every fixture has a URL, date, license and quote. The releases excerpt is clearly marked as hand-written, shape only.
Pinned drop test ✅ TestReleasesThatOnlyAddCommandsHaveNoEvents: 8.8.0 → 8.10.0 has no events and fetches nothing beyond the two listings.
Fetch only via env ✅ Every fetch goes through env.Get (plus versions.GitHubReleases). There's no net/http, filesystem or database access.
Contract fixtures untouched ✅ —
Nothing private (Rule 2) ✅ The leak guard is clean over every tracked file. I found nothing private in the code, docs, commit or PR body (see the one note about the PR body below).

Bugs

None found. A few things I checked:

  • Release ordering. Releases are sorted by version, not by date, so a 7.2.x patch published after 8.0.0 doesn't make a cross-line pair. TestVersionsAreFinalReleasesByVersion pins this.
  • Releases before 7.0.0. A 404 on the listing returns ErrNothingToRead, and so does an empty listing.
  • Unreadable command files. A file with more than one top-level key is an error, not a guess.
  • Pre-releases in the golden. The golden pairs pre-release tags that ListVersions would never return in production. That's fine, because Extract/ReadAt don't depend on the tag's shape, and the PR explains the choice.

Verified

  • go build ./...: OK
  • go vet ./...: OK
  • gofmt -l .: no output
  • go test -race ./...: all packages pass, including plugins/catalog and cmd/new-plugin
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"

Non-blocking

  • Hardcoded "Redis" in the description (redis.go:151, inline comment): Commands is now the generic type the scaffold gives every new provider, but the text always says "Redis". A Product field would fix it before a second provider shows up.
  • Backports across lines: with version ordering, the last 7.4.x is paired with 8.0.0. If a patch on an older line ever gains a command file (a backport) that the next line's .0 release doesn't have yet, that would read as a removal. You checked that this never happened from 7.0 to 8.10, so it's only worth a line under Known gaps in providers/redis.md.
  • File renames: a renamed file that still holds the same command would read as a removal. This is already documented. If it ever happens, a cheap guard is to fetch the added files only when the pair has a removal, and drop any removal whose command name reappears among them.
  • Large directories: GitHub's contents API returns at most 1,000 entries per directory. You're at 460 now, so this is fine; just remember it if the directory grows.
  • PR body: the "Related PRs" section still has placeholders (plugins#…, developer-handbook#…). Please fill them in or remove them, and only link repos that are public.

Comment thread plugins/catalog/redis.go
Type: event.SubjectPackageRelease, Ecosystem: c.Ecosystem, Package: c.Package,
Change: event.PackageRemovedSymbol, Symbols: []string{name},
},
Description: fmt.Sprintf("%s is gone in Redis %s (it was in %s): calling it fails.", name, to.Version.ID, from.Version.ID),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Commands is now the generic reader the scaffold hands to every new catalog provider (cmd/new-plugin/formats.go), but this description says "Redis" for all of them. A second provider would emit "X is gone in Redis 1.2.0". You could add a Product string field ("Redis") or reuse the provider's name, for example:

Description:   fmt.Sprintf("%s is gone in %s %s (it was in %s): calling it fails.", name, c.Product, to.Version.ID, from.Version.ID),

@adssib adssib mentioned this pull request Nov 21, 2026
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant