[Commands API interface consistency #2] Remove generators - #3866
Conversation
b0fa44f to
b37a5c7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b37a5c7fdc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b37a5c7 to
ab6760c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab6760c67c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ab6760c to
c8f7d34
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8f7d34679
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a75d0c8 to
f7c122d
Compare
The command interfaces are now hand-edited source files kept in lockstep by the API consistency test suite; the generators had drifted from the committed files (re-running them produced noisy, API-changing diffs) and were no longer part of any workflow. - delete src/test/java/io/lettuce/apigenerator and src/main/templates - drop the javaparser-core test dependency and the templates entry of the formatter plugin - remove the api_generator test tag - replace .agents/docs/code-generation.md with .agents/docs/api-consistency.md and update architecture.md, AGENTS.md and the adding-a-redis-command/writing-javadoc skills to describe the hand-edit-all-flavors workflow Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The markers referenced the removed io.lettuce.apigenerator classes and instructed readers not to hand-edit files that are now the source of truth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- architecture.md: drop the leftover claim that the sync interface is generated; it is a declaration implemented by the async-backed proxy - api-consistency.md: describe builder coverage against each group's registered builder (module groups have dedicated builders), document that Kotlin scalar return types/nullability are not verified, and mention the parameter-signature and @deprecated parity checks - adding-a-redis-command: keep the return-type mapping in its owner document instead of restating it, and rename the stale "checkpoint before generation" reference to "before mirroring" - writing-javadoc: extend the mirroring checklist to the node-selection and Sentinel interfaces Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f7c122d to
fab040a
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fab040ad66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - across the Java flavors (async, reactive, node-selection, aggregates) the | ||
| suite also verifies **generic parameter signatures** (not just erased types) | ||
| and **`@Deprecated` parity** with the sync method. |
There was a problem hiding this comment.
Check varargs parity across Java flavors
When a hand-edited method uses varargs, the advertised parameter-signature check still accepts an array declaration in another flavor: foo(K... keys) and foo(K[] keys) have the same erased and generic reflection parameter type, while TypeSignatures never compares Method.isVarArgs(). This leaves the suite green even though callers can pass multiple arguments only to one flavor, so include varargs parity in each Java counterpart check.
AGENTS.md reference: AGENTS.md:L89-L93
Useful? React with 👍 / 👎.
|
|
||
| Every command group (STRING, HASH, …) exists in up to six parallel interfaces — | ||
| sync, async, reactive, Kotlin coroutines, and the two cluster node-selection | ||
| flavors. All of them are **ordinary hand-edited source files**; there is no code |
There was a problem hiding this comment.
Remove the remaining generated-shapes claim
Although this new paragraph correctly states that there is no code generation, the earlier sentence at line 40 still calls the flavors “independently generated shapes.” The previously reported bottom-of-file statement has been corrected, but this additional occurrence remains, so an agent reading this owner document still receives contradictory instructions about whether these interfaces are generated or hand-edited.
AGENTS.md reference: AGENTS.md:L89-L93
Useful? React with 👍 / 👎.
| **Then add the method + Javadoc to the sync interface** | ||
| `src/main/java/io/lettuce/core/api/sync/<Group>Commands.java`. The sync signature is |
There was a problem hiding this comment.
Route Sentinel commands to the Sentinel API files
When the command belongs to SENTINEL, this new instruction points to the nonexistent core/api/sync/RedisSentinelCommands.java; that interface actually lives under core/sentinel/api/sync, and the later implementation steps likewise need SentinelCommandBuilder, RedisSentinelAsyncCommandsImpl, RedisSentinelReactiveCommandsImpl, and the Sentinel coroutine implementation rather than the core classes. Add an explicit Sentinel branch to this workflow so following it does not edit or create the wrong files.
AGENTS.md reference: AGENTS.md:L34-L36
Useful? React with 👍 / 👎.
| methods return `Flow<E>` (not suspend); deprecated and streaming-channel | ||
| methods are omitted. The suite verifies presence and the suspend/`Flow` shape |
There was a problem hiding this comment.
Document the deprecated coroutine exceptions
The categorical statement that deprecated methods are omitted is false for flushallAsync, flushdbAsync, slaveof, slaveofNoOne, and slaves: KnownApiDeviations.COROUTINES_KEEP_DEPRECATED explicitly requires those methods to remain in the coroutine API, and they are currently declared there. Mention that registry exception here so maintainers do not remove these supported coroutine methods while applying the owner document's mapping rule.
AGENTS.md reference: AGENTS.md:L24-L29
Useful? React with 👍 / 👎.
| methods are omitted. The suite verifies presence and the suspend/`Flow` shape | ||
| only — scalar return types and nullability are **not** checked; review them by | ||
| hand. |
There was a problem hiding this comment.
Check Kotlin parameter-name parity
For Kotlin coroutine methods, parameter names are part of the callable source API because callers can use named arguments, but commandFunctions matches only the method name and erased parameter classes and verifyShape never compares parameter names. A hand-edited strlen(redisKey: K) therefore passes against sync strlen(key) while breaking existing calls such as strlen(key = value); enforce the source-level names or add this limitation to the explicit manual-review caveat.
AGENTS.md reference: AGENTS.md:L89-L93
Useful? React with 👍 / 👎.
Removes the template-based API interface generators now that consistency between the command interface flavors is enforced by the test suite from #3865 (this PR is stacked on it — its base is
im/api-consistency-tests; rebase ontomainafter #3865 merges).The generators had drifted from the committed interfaces — re-running them produced large, noisy diffs that silently changed the public API — and were no longer part of any workflow. The interfaces are now hand-edited source files; the consistency tests fail the build when a flavor is missed.
Changes
src/test/java/io/lettuce/apigenerator/(9 classes) andsrc/main/templates/(23 templates)javaparser-coretest dependency and the templates entry of the formatter pluginapi_generatortest tag@generated by io.lettuce.apigenerator.*Javadoc markers from all 139 interface files — they referenced deleted classes and instructed readers not to hand-edit files that are now the source of truth (mechanical commit: one Javadoc line per file).agents/docs/code-generation.mdwith.agents/docs/api-consistency.mdand updatearchitecture.md,AGENTS.mdand theadding-a-redis-command/writing-javadocskills to describe the hand-edit-all-flavors workflowNo production code changes beyond the Javadoc marker removal.
Make sure that:
mvn formatter:formattarget. Don't submit any formatting related changes.🤖 Generated with Claude Code
Note
Low Risk
No command signatures or runtime behavior change—only dead generator removal and Javadoc marker cleanup, with contributor workflow fully redirected to the consistency test suite.
Overview
Removes the drift-prone JavaParser API generators and
src/main/templates/, so sync/async/reactive/Kotlin/cluster command interfaces are treated as normal hand-edited sources. Parity across flavors is documented and enforced by the existing API consistency unit tests (from the stacked PR), not by regeneration.Build/tooling: drops the
javaparser-coretest dependency and stops formattingsrc/main/templatesin the formatter plugin; integration-testing docs no longer mentionapigenerator/.Public surface (Javadoc only): strips
@generated by io.lettuce.apigenerator.*from ~139 command interface files so Javadoc no longer points at deleted generators or discourages hand edits.Contributor docs: deletes
.agents/docs/code-generation.md, adds.agents/docs/api-consistency.md, and updatesarchitecture.md,AGENTS.md, and theadding-a-redis-command/writing-javadocskills to the sync-first → mirror all flavors → run consistency tests workflow.Reviewed by Cursor Bugbot for commit fab040a. Bugbot is set up for automated code reviews on this repo. Configure here.