Skip to content

[Commands API interface consistency #2] Remove generators - #3866

Merged
uglide merged 5 commits into
mainfrom
im/remove-api-generators
Aug 6, 2026
Merged

[Commands API interface consistency #2] Remove generators#3866
uglide merged 5 commits into
mainfrom
im/remove-api-generators

Conversation

@uglide

@uglide uglide commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

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 onto main after #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

  • delete src/test/java/io/lettuce/apigenerator/ (9 classes) and src/main/templates/ (23 templates)
  • drop the javaparser-core test dependency and the templates entry of the formatter plugin
  • remove the api_generator test tag
  • strip the @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)
  • 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

No production code changes beyond the Javadoc marker removal.

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don't submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

🤖 Generated with Claude Code


Note

Low Risk
Documentation and Javadoc-only edits on interfaces; no command dispatch or wire-protocol changes.

Overview
Removes the legacy template + JUnit generator pipeline for sync/async/reactive/Kotlin/cluster command interfaces now that #3865’s consistency tests enforce parity. Deleted pieces include src/test/java/io/lettuce/apigenerator/, src/main/templates/, the api_generator tag, and javaparser-core / formatter coverage for templates; code-generation.md is replaced by api-consistency.md.

Agent and contributor docs (architecture.md, AGENTS.md, adding-a-redis-command, writing-javadoc, integration-testing layout) now describe hand-editing the sync interface first, mirroring to every flavor, and running *ConsistencyUnitTests instead of running generators.

On the public API surface, behavior is unchanged: ~139 command interfaces only lose the @generated by io.lettuce.apigenerator.* Javadoc line so the committed files are clearly the source of truth.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .agents/docs/architecture.md
Comment thread .agents/docs/api-consistency.md Outdated
Comment thread .agents/docs/api-consistency.md Outdated
@uglide uglide changed the title Remove generators [Commands API interface consistency #2] Remove generators Jul 28, 2026
@uglide
uglide force-pushed the im/remove-api-generators branch from b37a5c7 to ab6760c Compare July 28, 2026 16:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .agents/skills/adding-a-redis-command/SKILL.md Outdated
Comment thread .agents/skills/adding-a-redis-command/SKILL.md Outdated
Comment thread .agents/docs/api-consistency.md
@uglide
uglide force-pushed the im/remove-api-generators branch from ab6760c to c8f7d34 Compare July 28, 2026 16:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .agents/docs/api-consistency.md
Comment thread .agents/skills/writing-javadoc/SKILL.md Outdated
@uglide
uglide force-pushed the im/remove-api-generators branch 2 times, most recently from a75d0c8 to f7c122d Compare July 28, 2026 16:57
@uglide
uglide force-pushed the im/remove-api-generators branch from f7c122d to fab040a Compare July 28, 2026 17:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +60 to +62
- 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +106 to +107
**Then add the method + Javadoc to the sync interface**
`src/main/java/io/lettuce/core/api/sync/<Group>Commands.java`. The sync signature is

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI would probably figure it out, though it is still valid comment.

Comment on lines +42 to +43
methods return `Flow<E>` (not suspend); deprecated and streaming-channel
methods are omitted. The suite verifies presence and the suspend/`Flow` shape

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +43 to +45
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@atakavci atakavci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment on lines +106 to +107
**Then add the method + Javadoc to the sync interface**
`src/main/java/io/lettuce/core/api/sync/<Group>Commands.java`. The sync signature is

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI would probably figure it out, though it is still valid comment.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5ad6db7ad

ℹ️ 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".

Comment thread .agents/docs/architecture.md Outdated
Comment thread .agents/skills/adding-a-redis-command/SKILL.md
Comment thread .agents/skills/adding-a-redis-command/SKILL.md
@uglide
uglide force-pushed the im/remove-api-generators branch from c5ad6db to b348dcb Compare July 30, 2026 14:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f43bd8208

ℹ️ 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".

Comment on lines +55 to +58
- **The sync interface is the reference** — the other flavors are derived from it
by mechanical return-type mapping: async wraps in `RedisFuture<…>`; reactive
maps `T → Mono<T>` and `List<T>/Set<T> → Flux<T>`; Kotlin uses
`suspend fun`/`Flow`; node-selection wraps in `Executions`/`AsyncExecutions`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep consistency mechanics in their owner document

These new bullets restate the precise return-type mappings and deviation-registry split even though api-consistency.md is designated as their owner below. Future mapping or registry changes now require edits in both files and can give agents contradictory instructions when one copy drifts; keep only the architectural overview here and link to the owner for these mechanics.

AGENTS.md reference: AGENTS.md:L20-L22

Useful? React with 👍 / 👎.

@uglide
uglide force-pushed the im/remove-api-generators branch from 3f43bd8 to 2d16734 Compare August 3, 2026 12:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d167345b5

ℹ️ 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".

Comment thread pom.xml
<scope>test</scope>
</dependency>

<!-- CDI -->

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore JavaParser for the Javadoc consistency tests

On a clean checkout, removing this test dependency makes test-compile fail because JavadocConsistencyUnitTests still directly imports com.github.javaparser.JavaParser and several related AST/Javadoc classes, and no other dependency declares JavaParser. Retain javaparser-core while that consistency test remains in the regular unit-test suite.

AGENTS.md reference: AGENTS.md:L89-L93

Useful? React with 👍 / 👎.

Comment on lines +122 to +123
- Javadoc is duplicated across flavors by design; the tests do **not** check
Javadoc — keep the flavors in sync by hand, using the sync file as reference.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the Javadoc checks that the suite now performs

This blanket statement is false: JavadocConsistencyUnitTests parses the Java command-interface sources and checks documentation completeness, @param/@return, @since, deprecation tags, parameter names, and selected cross-flavor text parity. Describe those enforced Java checks and limit the manual-review caveat to unverified prose/Kotlin KDoc so this owner document accurately explains test failures.

AGENTS.md reference: AGENTS.md:L24-L29

Useful? React with 👍 / 👎.

@uglide
uglide force-pushed the im/remove-api-generators branch from ec69252 to 5e865f7 Compare August 6, 2026 13:40
Base automatically changed from im/api-consistency-tests to main August 6, 2026 13:52
uglide and others added 3 commits August 6, 2026 15:52
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>
@uglide
uglide force-pushed the im/remove-api-generators branch from 5e865f7 to 071f211 Compare August 6, 2026 13:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 071f211773

ℹ️ 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".

Comment on lines +29 to +32
**The sync interface is the reference.** Async/reactive/coroutine/node-selection
declarations are derived from it by the mapping rules below. (Two methods —
`setAutoFlushCommands`, `flushCommands` — exist on async/reactive/coroutines but
intentionally not on sync.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the nonexistent command-interface exceptions

When an agent uses this owner document to determine command-interface parity, this exception is misleading: repo-wide search finds setAutoFlushCommands and flushCommands only on src/main/java/io/lettuce/core/api/StatefulConnection.java:113-119, not on the async, reactive, or coroutine command interfaces covered by this suite. Remove this parenthetical so maintainers do not preserve or introduce exceptions that are outside the command API catalog.

AGENTS.md reference: AGENTS.md:L24-L29

Useful? React with 👍 / 👎.

Comment on lines +53 to +55
- **builder coverage** — every sync command has a same-named method on its
group's command builder, and every command-producing builder method is
reachable from an interface. Core groups map to `RedisCommandBuilder`; the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Account for registered builder aliases

When a maintainer checks commands whose API and builder names intentionally differ, this same-name rule misdescribes what the suite enforces: KnownApiDeviations.BUILDER_ALIASES maps examples such as waitForReplication to wait, getMasterAddrByName to getMasterAddrByKey, and vClearAttributes to vsetattr. State that a command needs either a same-named builder method or a registered alias so agents do not add duplicate builder entry points merely to satisfy this owner document.

AGENTS.md reference: AGENTS.md:L24-L29

Useful? React with 👍 / 👎.

Comment on lines +92 to +94
```bash
mvn -Dtest='*ConsistencyUnitTests,CommandBuilderCoverageUnitTests' \
-Dsurefire.failIfNoSpecifiedTests=false test

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run the entire advertised consistency suite

When this focused command is used after adding a command group or deviation, it can report success without running CatalogCompletenessUnitTests or DeviationTableStalenessUnitTests, because neither class name matches *ConsistencyUnitTests and only the builder test is added explicitly. Include both tests in the filter so an unregistered interface or stale deviation entry is caught at the workflow's consistency checkpoint rather than only by a later full mvn test.

AGENTS.md reference: AGENTS.md:L97-L102

Useful? React with 👍 / 👎.

@uglide
uglide merged commit 1d78319 into main Aug 6, 2026
10 checks passed
@uglide
uglide deleted the im/remove-api-generators branch August 6, 2026 14:09
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.

2 participants